]> code.delx.au - gnu-emacs/commitdiff
Merge from emacs-24; up to 2014-06-26T21:51:25Z!rgm@gnu.org.
authorEli Zaretskii <eliz@gnu.org>
Fri, 1 Aug 2014 13:10:07 +0000 (16:10 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 1 Aug 2014 13:10:07 +0000 (16:10 +0300)
632 files changed:
ChangeLog
GNUmakefile
INSTALL
INSTALL.REPO
Makefile.in
README
admin/CPP-DEFINES
admin/ChangeLog
admin/authors.el [moved from lisp/emacs-lisp/authors.el with 100% similarity]
admin/grammars/Makefile.in
admin/merge-gnulib
admin/merge-pkg-config [new file with mode: 0755]
admin/notes/bzr
admin/notes/changelogs
admin/notes/copyright
admin/notes/unicode
admin/quick-install-emacs
admin/unidata/Makefile.in
admin/unidata/uvs.el
admin/update_autogen
autogen.sh
configure.ac
doc/emacs/ChangeLog
doc/emacs/Makefile.in
doc/emacs/ack.texi
doc/emacs/cal-xtra.texi
doc/emacs/custom.texi
doc/emacs/emacs-xtra.texi
doc/emacs/emacs.texi
doc/emacs/emacsver.texi
doc/emacs/help.texi
doc/emacs/misc.texi
doc/lispintro/ChangeLog
doc/lispintro/Makefile.in
doc/lispintro/emacs-lisp-intro.texi
doc/lispref/ChangeLog
doc/lispref/Makefile.in
doc/lispref/commands.texi
doc/lispref/elisp.texi
doc/lispref/errors.texi
doc/lispref/files.texi
doc/lispref/frames.texi
doc/lispref/functions.texi
doc/lispref/internals.texi
doc/lispref/keymaps.texi
doc/lispref/lists.texi
doc/lispref/minibuf.texi
doc/lispref/os.texi
doc/lispref/positions.texi
doc/lispref/processes.texi
doc/lispref/sequences.texi
doc/lispref/windows.texi
doc/man/emacs.1
doc/misc/ChangeLog
doc/misc/Makefile.in
doc/misc/ada-mode.texi
doc/misc/auth.texi
doc/misc/autotype.texi
doc/misc/bovine.texi
doc/misc/calc.texi
doc/misc/cc-mode.texi
doc/misc/cl.texi
doc/misc/dbus.texi
doc/misc/dired-x.texi
doc/misc/ebrowse.texi
doc/misc/ede.texi
doc/misc/ediff.texi
doc/misc/edt.texi
doc/misc/efaq-w32.texi
doc/misc/efaq.texi
doc/misc/eieio.texi
doc/misc/emacs-gnutls.texi
doc/misc/emacs-mime.texi
doc/misc/epa.texi
doc/misc/erc.texi
doc/misc/ert.texi
doc/misc/eshell.texi
doc/misc/eudc.texi
doc/misc/eww.texi
doc/misc/flymake.texi
doc/misc/forms.texi
doc/misc/gnus-coding.texi
doc/misc/gnus-faq.texi
doc/misc/gnus.texi
doc/misc/htmlfontify.texi
doc/misc/idlwave.texi
doc/misc/ido.texi
doc/misc/mairix-el.texi
doc/misc/message.texi
doc/misc/mh-e.texi
doc/misc/newsticker.texi
doc/misc/nxml-mode.texi
doc/misc/octave-mode.texi
doc/misc/org.texi
doc/misc/pcl-cvs.texi
doc/misc/pgg.texi
doc/misc/rcirc.texi
doc/misc/reftex.texi
doc/misc/remember.texi
doc/misc/sasl.texi
doc/misc/sc.texi
doc/misc/semantic.texi
doc/misc/ses.texi
doc/misc/sieve.texi
doc/misc/smtpmail.texi
doc/misc/speedbar.texi
doc/misc/srecode.texi
doc/misc/texinfo.tex
doc/misc/todo-mode.texi
doc/misc/tramp.texi
doc/misc/trampver.texi
doc/misc/url.texi
doc/misc/vhdl-mode.texi [new file with mode: 0644]
doc/misc/vip.texi
doc/misc/viper.texi
doc/misc/widget.texi
doc/misc/wisent.texi
doc/misc/woman.texi
etc/AUTHORS
etc/CENSORSHIP
etc/ChangeLog
etc/GNU
etc/LINUX-GNU
etc/MACHINES
etc/NEWS
etc/NEWS.19
etc/PROBLEMS
etc/THE-GNU-PROJECT
etc/TODO
etc/WHY-FREE
etc/emacs-buffer.gdb
etc/themes/tsdh-light-theme.el
leim/ChangeLog
leim/Makefile.in
lib-src/ChangeLog
lib-src/Makefile.in
lib-src/ctags.c [new file with mode: 0644]
lib-src/emacsclient.c
lib-src/etags.c
lib-src/hexl.c
lib-src/make-docfile.c
lib-src/movemail.c
lib-src/ntlib.h
lib-src/test-distrib.c [deleted file]
lib-src/testfile [deleted file]
lib-src/update-game-score.c
lib/Makefile.am
lib/acl-internal.h
lib/acl.h
lib/gnulib.mk
lib/mktime.c
lib/openat-proc.c
lib/stdarg.in.h [deleted file]
lib/stdbool.in.h [deleted file]
lisp/ChangeLog
lisp/Makefile.in
lisp/bookmark.el
lisp/bs.el
lisp/calc/calc-alg.el
lisp/calculator.el
lisp/calendar/cal-china.el
lisp/calendar/cal-menu.el
lisp/calendar/calendar.el
lisp/calendar/diary-lib.el
lisp/calendar/icalendar.el
lisp/calendar/parse-time.el
lisp/calendar/time-date.el
lisp/cedet/ChangeLog
lisp/cedet/ede.el
lisp/cedet/ede/dired.el
lisp/cedet/semantic/ia.el
lisp/comint.el
lisp/composite.el
lisp/cus-start.el
lisp/dired-aux.el
lisp/dired-x.el
lisp/dired.el
lisp/doc-view.el
lisp/electric.el
lisp/emacs-lisp/autoload.el
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/byte-run.el
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/cl-extra.el
lisp/emacs-lisp/cl-indent.el
lisp/emacs-lisp/cl-lib.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/cl-seq.el
lisp/emacs-lisp/edebug.el
lisp/emacs-lisp/eldoc.el
lisp/emacs-lisp/ert.el
lisp/emacs-lisp/find-func.el
lisp/emacs-lisp/lisp-mode.el
lisp/emacs-lisp/lisp.el
lisp/emacs-lisp/macroexp.el
lisp/emacs-lisp/nadvice.el
lisp/emacs-lisp/package.el
lisp/emacs-lisp/regexp-opt.el
lisp/emacs-lisp/smie.el
lisp/emacs-lisp/subr-x.el
lisp/emacs-lisp/tabulated-list.el
lisp/emulation/cua-base.el
lisp/emulation/edt.el
lisp/epa-mail.el
lisp/epa.el
lisp/epg.el
lisp/erc/ChangeLog
lisp/erc/erc-backend.el
lisp/erc/erc.el
lisp/eshell/em-smart.el
lisp/eshell/esh-util.el
lisp/eshell/eshell.el
lisp/faces.el
lisp/ffap.el
lisp/files.el
lisp/font-lock.el
lisp/frame.el
lisp/frameset.el
lisp/gnus/ChangeLog
lisp/gnus/auth-source.el
lisp/gnus/gmm-utils.el
lisp/gnus/gnus-art.el
lisp/gnus/gnus-cache.el
lisp/gnus/gnus-cite.el
lisp/gnus/gnus-cloud.el [new file with mode: 0644]
lisp/gnus/gnus-fun.el
lisp/gnus/gnus-group.el
lisp/gnus/gnus-html.el
lisp/gnus/gnus-icalendar.el
lisp/gnus/gnus-mlspl.el
lisp/gnus/gnus-msg.el
lisp/gnus/gnus-notifications.el
lisp/gnus/gnus-picon.el
lisp/gnus/gnus-setup.el [deleted file]
lisp/gnus/gnus-spec.el
lisp/gnus/gnus-srvr.el
lisp/gnus/gnus-start.el
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-util.el
lisp/gnus/gnus.el
lisp/gnus/gravatar.el
lisp/gnus/mail-source.el
lisp/gnus/mailcap.el
lisp/gnus/message.el
lisp/gnus/mm-bodies.el
lisp/gnus/mm-decode.el
lisp/gnus/mm-extern.el
lisp/gnus/mm-url.el
lisp/gnus/mm-util.el
lisp/gnus/mm-uu.el
lisp/gnus/mm-view.el
lisp/gnus/mml-smime.el
lisp/gnus/mml.el
lisp/gnus/mml1991.el
lisp/gnus/mml2015.el
lisp/gnus/nndraft.el
lisp/gnus/nnfolder.el
lisp/gnus/nnheader.el
lisp/gnus/nnimap.el
lisp/gnus/nnir.el
lisp/gnus/nnmail.el
lisp/gnus/nnmaildir.el
lisp/gnus/nnrss.el
lisp/gnus/nntp.el
lisp/gnus/nnweb.el
lisp/gnus/rfc1843.el
lisp/gnus/sieve-manage.el
lisp/gnus/smime.el
lisp/gnus/spam.el
lisp/help-fns.el
lisp/help.el
lisp/hi-lock.el
lisp/hippie-exp.el
lisp/htmlfontify.el
lisp/image-mode.el
lisp/info.el
lisp/international/characters.el
lisp/international/mule-cmds.el
lisp/international/mule-util.el
lisp/jit-lock.el
lisp/ldefs-boot.el
lisp/leim/quail/sisheng.el
lisp/linum.el
lisp/loadup.el
lisp/mail/emacsbug.el
lisp/mail/hashcash.el
lisp/mail/rmail.el
lisp/mail/rmailsum.el
lisp/mail/smtpmail.el
lisp/man.el
lisp/menu-bar.el
lisp/mh-e/ChangeLog
lisp/mh-e/mh-e.el
lisp/minibuffer.el
lisp/mouse.el
lisp/mpc.el
lisp/net/browse-url.el
lisp/net/dbus.el
lisp/net/dns.el
lisp/net/gnutls.el
lisp/net/rcirc.el
lisp/net/tramp-adb.el
lisp/net/tramp-cache.el
lisp/net/tramp-ftp.el
lisp/net/tramp-gvfs.el
lisp/net/tramp-sh.el
lisp/net/tramp-smb.el
lisp/net/tramp.el
lisp/net/trampver.el
lisp/newcomment.el
lisp/nxml/nxml-mode.el
lisp/obsolete/crisp.el [moved from lisp/emulation/crisp.el with 99% similarity]
lisp/obsolete/gulp.el [moved from lisp/emacs-lisp/gulp.el with 99% similarity]
lisp/obsolete/iswitchb.el
lisp/obsolete/mailpost.el
lisp/obsolete/pc-select.el
lisp/obsolete/pgg-pgp.el
lisp/obsolete/pgg-pgp5.el
lisp/obsolete/tpu-edt.el [moved from lisp/emulation/tpu-edt.el with 99% similarity]
lisp/obsolete/tpu-extras.el [moved from lisp/emulation/tpu-extras.el with 99% similarity]
lisp/obsolete/tpu-mapper.el [moved from lisp/emulation/tpu-mapper.el with 99% similarity]
lisp/obsolete/vi.el [moved from lisp/emulation/vi.el with 99% similarity]
lisp/obsolete/vip.el [moved from lisp/emulation/vip.el with 99% similarity]
lisp/obsolete/ws-mode.el [moved from lisp/emulation/ws-mode.el with 99% similarity]
lisp/org/ChangeLog
lisp/org/ob-core.el
lisp/org/org-bibtex.el
lisp/org/org-clock.el
lisp/org/org-compat.el
lisp/org/org-list.el
lisp/org/org-mouse.el
lisp/org/org-src.el
lisp/org/org-table.el
lisp/org/org.el
lisp/org/ox-html.el
lisp/org/ox-odt.el
lisp/org/ox-org.el
lisp/play/bubbles.el
lisp/play/dunnet.el
lisp/play/gametree.el
lisp/play/landmark.el
lisp/printing.el
lisp/progmodes/cap-words.el [deleted file]
lisp/progmodes/cc-defs.el
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-guess.el
lisp/progmodes/cc-langs.el
lisp/progmodes/compile.el
lisp/progmodes/cperl-mode.el
lisp/progmodes/cwarn.el
lisp/progmodes/f90.el
lisp/progmodes/grep.el
lisp/progmodes/hideif.el
lisp/progmodes/hideshow.el
lisp/progmodes/idlw-help.el
lisp/progmodes/idlw-shell.el
lisp/progmodes/inf-lisp.el
lisp/progmodes/perl-mode.el
lisp/progmodes/prog-mode.el
lisp/progmodes/prolog.el
lisp/progmodes/ps-mode.el
lisp/progmodes/python.el
lisp/progmodes/scheme.el
lisp/progmodes/sh-script.el
lisp/progmodes/subword.el
lisp/progmodes/vera-mode.el
lisp/progmodes/verilog-mode.el
lisp/progmodes/vhdl-mode.el
lisp/progmodes/xscheme.el
lisp/ps-samp.el
lisp/rect.el
lisp/register.el
lisp/replace.el
lisp/reveal.el
lisp/ruler-mode.el
lisp/savehist.el
lisp/scroll-all.el
lisp/scroll-bar.el
lisp/server.el
lisp/ses.el
lisp/shell.el
lisp/simple.el
lisp/skeleton.el
lisp/speedbar.el
lisp/startup.el
lisp/subr.el
lisp/term.el
lisp/term/AT386.el
lisp/term/README
lisp/term/apollo.el [deleted file]
lisp/term/news.el
lisp/term/screen.el
lisp/term/tvi970.el
lisp/term/vt100.el
lisp/term/vt102.el [deleted file]
lisp/term/vt125.el [deleted file]
lisp/term/vt201.el [deleted file]
lisp/term/vt220.el [deleted file]
lisp/term/vt240.el [deleted file]
lisp/term/vt300.el [deleted file]
lisp/term/vt320.el [deleted file]
lisp/term/vt400.el [deleted file]
lisp/term/vt420.el [deleted file]
lisp/term/wyse50.el
lisp/term/xterm.el
lisp/textmodes/bibtex.el
lisp/textmodes/conf-mode.el
lisp/textmodes/ispell.el
lisp/textmodes/reftex-auc.el
lisp/textmodes/reftex-cite.el
lisp/textmodes/reftex-dcr.el
lisp/textmodes/reftex-global.el
lisp/textmodes/reftex-index.el
lisp/textmodes/reftex-parse.el
lisp/textmodes/reftex-ref.el
lisp/textmodes/reftex-sel.el
lisp/textmodes/reftex-toc.el
lisp/textmodes/reftex.el
lisp/textmodes/rst.el
lisp/textmodes/tildify.el
lisp/url/ChangeLog
lisp/url/url-dav.el
lisp/url/url-gw.el
lisp/url/url-handlers.el
lisp/url/url-http.el
lisp/url/url-news.el
lisp/url/url-tramp.el [new file with mode: 0644]
lisp/url/url-util.el
lisp/url/url-vars.el
lisp/url/url.el
lisp/vc/diff-mode.el
lisp/vc/ediff-init.el
lisp/vc/ediff-util.el
lisp/vc/emerge.el
lisp/vc/smerge-mode.el
lisp/vc/vc-annotate.el
lisp/vc/vc-bzr.el
lisp/vc/vc-hg.el
lisp/vc/vc-hooks.el
lisp/vc/vc.el
lisp/whitespace.el
lisp/wid-edit.el
lisp/window.el
lisp/woman.el
lisp/xt-mouse.el
lwlib/ChangeLog
lwlib/Makefile.in
lwlib/autodeps.mk [new file with mode: 0644]
lwlib/deps.mk [new file with mode: 0644]
lwlib/lwlib-Xm.c
lwlib/lwlib-int.h
lwlib/lwlib-widget.h [new file with mode: 0644]
lwlib/lwlib.c
lwlib/lwlib.h
lwlib/xlwmenu.c
m4/gnulib-common.m4
m4/gnulib-comp.m4
m4/pkg.m4 [new file with mode: 0644]
m4/pthread_sigmask.m4
m4/stdarg.m4 [deleted file]
m4/stdbool.m4 [deleted file]
m4/timer_time.m4
make-dist
msdos/sed2v2.inp
nextstep/ChangeLog
nextstep/Makefile.in
nt/ChangeLog
nt/INSTALL
nt/Makefile.in
nt/addsection.c [deleted file]
nt/config.nt
nt/emacs.rc
nt/emacsclient.rc
nt/gnulib.mk
nt/inc/ms-w32.h
nt/inc/sys/mman.h [new file with mode: 0644]
nt/makefile.w32-in
oldXMenu/ChangeLog
oldXMenu/Makefile.in
oldXMenu/XMenuInt.h
oldXMenu/autodeps.mk [new file with mode: 0644]
oldXMenu/deps.mk [new file with mode: 0644]
src/.gdbinit
src/ChangeLog
src/Makefile.in
src/alloc.c
src/atimer.c
src/atimer.h
src/buffer.c
src/buffer.h
src/bytecode.c
src/callint.c
src/callproc.c
src/ccl.c
src/character.c
src/character.h
src/charset.c
src/charset.h
src/chartab.c
src/cmds.c
src/coding.c
src/coding.h
src/commands.h
src/composite.c
src/conf_post.h
src/data.c
src/dbusbind.c
src/deps.mk
src/dired.c
src/dispextern.h
src/dispnew.c
src/doc.c
src/dosfns.c
src/dosfns.h
src/editfns.c
src/emacs.c
src/eval.c
src/fileio.c
src/filelock.c
src/fns.c
src/font.c
src/font.h
src/fontset.c
src/frame.c
src/frame.h
src/fringe.c
src/ftfont.c
src/ftfont.h
src/ftxfont.c
src/gmalloc.c
src/gnutls.c
src/gtkutil.c
src/gtkutil.h
src/image.c
src/indent.c
src/insdel.c
src/intervals.h
src/keyboard.c
src/keyboard.h
src/keymap.c
src/keymap.h
src/lisp.h
src/lread.c
src/macfont.m
src/macros.c
src/menu.c
src/menu.h
src/minibuf.c
src/msdos.c
src/nsfns.m
src/nsfont.m
src/nsgui.h
src/nsmenu.m
src/nsterm.h
src/nsterm.m
src/print.c
src/process.c
src/process.h
src/profiler.c
src/puresize.h
src/regex.c
src/search.c
src/sound.c
src/syntax.c
src/sysdep.c
src/sysselect.h
src/syssignal.h
src/systty.h
src/term.c
src/termcap.c
src/termhooks.h
src/terminal.c
src/unexcoff.c
src/unexcw.c
src/unexw32.c
src/vm-limit.c
src/w32.c
src/w32.h
src/w32console.c
src/w32fns.c
src/w32font.c
src/w32gui.h
src/w32heap.c
src/w32heap.h
src/w32inevt.c
src/w32menu.c
src/w32notify.c
src/w32proc.c
src/w32term.c
src/w32term.h
src/w32uniscribe.c
src/widget.c
src/window.c
src/window.h
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xfont.c
src/xftfont.c
src/xgselect.c
src/xmenu.c
src/xrdb.c
src/xselect.c
src/xsmfns.c
src/xterm.c
src/xterm.h
test/ChangeLog
test/automated/Makefile.in
test/automated/advice-tests.el
test/automated/bytecomp-tests.el
test/automated/cl-lib.el
test/automated/core-elisp-tests.el
test/automated/dbus-tests.el
test/automated/eieio-tests.el
test/automated/ert-tests.el
test/automated/flymake-tests.el
test/automated/fns-tests.el [new file with mode: 0644]
test/automated/icalendar-tests.el
test/automated/package-test.el
test/automated/package-x-test.el
test/automated/ruby-mode-tests.el
test/automated/subr-x-tests.el [new file with mode: 0644]
test/automated/subword-tests.el
test/automated/syntax-tests.el [new file with mode: 0644]
test/automated/tildify-tests.el [new file with mode: 0644]
test/automated/timer-tests.el
test/automated/tramp-tests.el
test/automated/undo-tests.el
test/indent/octave.m
test/indent/perl.perl
test/indent/ps-mode.ps [new file with mode: 0644]
test/indent/ruby.rb

index cdf4152bc0ad19e0ed916e35941afa6a7af920fd..2dfef7037fe0714202322b15cbd99d988a207105 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,53 @@
-2014-07-11  Paul Eggert  <eggert@cs.ucla.edu>
+2014-07-31  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Simplify timerfd configuration and fix some minor glitches.
+       * configure.ac (HAVE_TIMERFD): Define only if TFD_CLOEXEC works,
+       since the code leaked file descriptors to children when !TFD_CLOEXEC.
+       (HAVE_TIMERFD_CLOEXEC): Remove; no longer used.
+       * m4/clock_time.m4 (gl_CLOCK_TIME): Don't check for clock_getres.
+       This reverts the previous change to this file, so it matches
+       gnulib again.
+
+2014-07-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * configure.ac (toplevel): Check whether GNU/Linux-specific
+       timerfd functions and macros are available.
+       * m4/clock_time.m4 (gl_CLOCK_TIME): Check for clock_getres as well.
+
+2014-07-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Improve behavior of 'bzr up; cd src; make -k'.
+       * Makefile.in (ACLOCAL_INPUTS): Add all m4/*.m4 files.
+
+2014-07-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Merge from gnulib, incorporating:
+       2014-06-27 mktime: merge #if/#ifdef usage from glibc
+       * lib/mktime.c: Update from gnulib.
 
        * Makefile.in (install-arch-indep): Avoid readdir race (Bug#17971).
 
-2014-06-20  Paul Eggert  <eggert@cs.ucla.edu>
+2014-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * configure.ac: Check whether sys/sysinfo.h provides
+       Linux 'sysinfo' function and 'struct sysinfo' type.
+
+2014-06-28  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac (lwlib_deps_frag, oldxmenu_deps_frag): New output files.
+       * make-dist (lwlib, oldXMenu): Distribute *.mk.
+
+2014-06-27  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (src): No more need to pass BOOTSTRAPEMACS.
+
+       * make-dist: Exclude test/automated/*.log.
+
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (mostlyclean, clean): Maybe clean test/automated.
+
+2014-06-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        * configure.ac: Warn about --enable-link-time-optimization's issues
        in --help message (Bug#17806).
        use -ffat-lto-objects if supported; otherwise Emacs won't
        build with GCC 4.9.0.
 
-2014-06-14  Paul Eggert  <eggert@cs.ucla.edu>
+2014-06-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Diagnose failures due to colons in directory names (Bug#17278).
+       * Makefile.in (epaths-force): Don't allow ':' in directories whose
+       names go into a colon-separated path.
+       * configure.ac: Fail if submake fails.
+
+2014-06-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Omit redundant extern decls.
+       Most of this patch is from Dmitry Antipov, in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00263.html
+       * configure.ac (WERROR_CFLAGS): Add -Wredundant-decls.
+
+       Merge from gnulib, incorporating:
+       2014-06-17 acl: port to gcc -Wredundant-decls
+       2014-06-01 gnulib-common.m4: Fix typo in _GL_UNUSED_LABEL.
+       * lib/acl.h, m4/gnulib-common.m4: Update from gnulib.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in: Use `make -C' rather than `cd && make' throughout.
+
+       * Makefile.in: Parallelize clean rules using GNU make features.
+       (submake_template): New definition.
+       (mostlyclean_dirs, clean_dirs, distclean_dirs, maintainer_clean_dirs):
+       New variables.
+       (mostlyclean, clean, distclean, bootstrap-clean, maintainer-clean)
+       (extraclean): Define using each subdirectory as a prequisite.
+       * lib/Makefile.am (bootstrap-clean): New.
+
+2014-06-15  Paul Eggert  <eggert@cs.ucla.edu>
 
        Port part of the AIX fix to Solaris (Bug#17598).
        * configure.ac (_REENTRANT): Define on Solaris if HAVE_PTHREAD.
        for the same reason that _THREAD_SAFE is needed on AIX, e.g., to
        make sure that each thread has its own 'errno'.
 
+2014-06-13  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (CC, CFLAGS, LDFLAGS, CPPFLAGS, abs_top_srcdir):
+       Remove, no longer used.
+       (lib, lib-src, lisp, nt, src, blessmail, install-arch-dep)
+       (install-nt, install-strip, uninstall, uninstall-nt)
+       (mostlyclean, clean, distclean, bootstrap-clean)
+       (maintainer-clean, extraclean, TAGS, tags, check, $(DOCS)):
+       ($(INSTALL_DOC), $(UNINSTALL_DOC), info, bootstrap, check-declare):
+       GNU make automatically passes command-line arguments to sub-makes.
+
 2014-06-11  Paul Eggert  <eggert@cs.ucla.edu>
 
-       Backport fcntl.h AIX fix from the trunk (Bug#17598).
-       This fixes a bug with the shell freezing.  See:
-       http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17598#185
-       Merge from gnulib, incorporating:
-       2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1
-       * lib/fcntl.in.h, m4/dup2.m4, m4/fcntl.m4:
-       Update from gnulib.
+       Use a shell function in configure.ac to cut down on code duplication.
+       * configure.ac (emacs_check_gnu_make): New shell function.
+       Use it to avoid duplication when checking for GNU Make.
+       It's OK for 'configure' to use shell functions these days,
+       as long as we follow the advice in the 'Shell Functions'
+       section of the Autoconf manual.
+
+2014-06-11  Glenn Morris  <rgm@gnu.org>
 
-2014-06-07  Paul Eggert  <eggert@cs.ucla.edu>
+       * configure.ac: Require at least version 3.81 of GNU make.
+
+2014-06-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Rely on AC_CANONICAL_HOST to detect whether we're using mingw.
+       See the thread containing:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00206.html
+       * configure.ac (AC_CANONICAL_HOST): Invoke this as early as we
+       can, which is just after AM_INIT_AUTOMAKE.  Then check for mingw
+       just after that.
+
+2014-06-10  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (AUTOCONF, AUTOMAKE, AUTOHEADER, ACLOCAL):
+       New, set by configure.  Use throughout where appropriate.
+
+       * Makefile.in (INFO_EXT): Remove and replace by ".info" throughout.
+       * configure.ac (INFO_EXT, INFO_OPTS): Remove output variables.
+
+2014-06-08  Paul Eggert  <eggert@cs.ucla.edu>
 
        Port better to AIX (Bug#17598).
        * configure.ac (with_xpm_set): New shell var.
        (LIBXPM): Append -lXpm if -lXaw is also used, as the latter
        requires the former on AIX.
 
-2014-05-30  Paul Eggert  <eggert@cs.ucla.edu>
+2014-06-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Try harder to find GNU Make when configuring.
+       * configure.ac (AC_PROG_MAKE_SET): Define a dummy.
+       (MAKE): Set it to GNU Make, if one can be found.
+       Search PATH for 'make', 'gmake', 'gnumake'.
+       This works better on platforms like AIX, where GNU Make
+       might be in /opt/freeware/bin/make, and reside
+       behind /usr/bin/make in the PATH.
+
+2014-06-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * configure.ac (POLL_FOR_INPUT): Define with HAVE_WINDOW_SYSTEM.
+       * INSTALL: Mention SVG image support.
+
+2014-06-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * configure.ac: --without-all now implies --without-xft, --disable-acl.
+       * INSTALL: Remove apparently unmaintained documentation about what
+       --without-all exactly means.
+
+2014-06-03  Eli Zaretskii  <eliz@gnu.org>
+
+       * configure.ac (C_HEAP_SWITCH): Remove.
+
+2014-06-02  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix port to 32-bit AIX with xlc (Bug#17598).
        This doesn't fix Bug#17598, but it does fix a regression since Emacs
        2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1
        * lib/ftoastr.c: Update from gnulib.
 
-2014-05-22  Paul Eggert  <eggert@cs.ucla.edu>
+2014-06-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Merge from gnulib, incorporating:
+       2014-06-02 acl: apply pure attribute to two functions
+       2014-06-01 gnulib-common.m4: add _GL_UNUSED_LABEL
+       2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1
+       2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1
+       * lib/acl-internal.h, lib/fcntl.in.h, lib/ftoastr.h:
+       * m4/dup2.m4, m4/fcntl.m4, m4/gnulib-common.m4:
+       Update from gnulib.
+
+2014-06-01  Juanma Barranquero  <lekktu@gmail.com>
+
+       * configure.ac (C_HEAP_SWITCH): Raise HEAPSIZE value for 32-bit
+       builds on Windows.
+
+2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * configure.ac (pthread_sigmask): Look in LIB_PTHREAD too (Bug#17561).
+       Fixes configuration glitch found in <http://bugs.gnu.org/17561#59>.
+
+2014-05-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * configure.ac (ADDSECTION, TEMACS_POST_LINK): Don't compute,
+       unused.
+
+2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't substitute sigprocmask for pthread_sigmask (Bug#17561).
+       sigprocmask isn't portable in a multithreaded process.
+       * configure.ac (gl_THREADLIB): Remove dummy.
+       Merge from gnulib, incorporating:
+       2014-05-28 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
+       * m4/pthread_sigmask.m4, m4/timer_time.m4: Update from gnulib.
+
+2014-05-29  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac: Explicitly drop some ancient Solaris versions.
+
+2014-05-27  Fabrice Popineau  <fabrice.popineau@gmail.com>
+
+       * configure.ac (C_HEAP_SWITCH): Define for different values of
+       dumped heap size depending on 32/64bits arch on Windows.
+       Don't check for pthreads.h on MinGW32/64, it gets in the way.
+       Use mmap(2) for buffers and system malloc for MinGW32/64.
+
+2014-05-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Merge from gnulib, incorporating:
+       2014-05-21 fchdir: port 'open' and 'close' redefinitions to AIX 7.1
+       * lib/openat-proc.c: Update from gnulib.
+
+2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix port to 32-bit AIX (Bug#17540).
        * configure.ac (opsys): On Power Architecture, treat release 7 of
        AIX like releases 5 and 6.
 
+2014-05-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Remove dependencies on getdelim and getline.
+       * configure.ac (getdelim, getline): Remove.
+
 2014-05-18  Glenn Morris  <rgm@gnu.org>
 
-       * configure.ac (INSTALL_INFO):
-       Revert to just checking for "install-info".
+       * configure.ac: Do not bother testing for png in non-graphical builds.
 
-2014-05-17  Glenn Morris  <rgm@gnu.org>
+2014-05-18  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * configure.ac (INSTALL_INFO): Try the identical-but-quieter-on-Debian
-       "ginstall-info" before "install-info".
+       Port ctags+etags build to Sun C 5.12.
+       * .bzrignore: Remove lib-src/ctags.c.
 
-2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+       Port recent libpng changes to hosts with missing png.h.
+       * configure.ac (HAVE_PNG): Port to platforms where libpng-config
+       succeeds but png.h is absent, by testing libpng-config's output
+       rather than trusting it.  I ran into this problem when building
+       Emacs trunk on a Solaris 10 host.
 
-       Revert recent libpng changes (Bug#17339).
-       They fix only bugs that aren't being reported, so it may be better
-       to do them on the trunk.
-       * configure.ac (PNG_CFLAGS): Remove.  All uses removed.
-       (LIBPNG): Don't be consistent about -lpng16 versus -lpng.
-       Ignore libpng-config's exit status.  Always append -lz -lm.
+2014-05-17  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * configure.ac (LIBPNG): Add -lz -lm on platforms where they're needed
-       but libpng-config --libs omits them.  Problem reported by Glenn
-       Morris.
+       Assume C99 or later (Bug#17487).
+       * lib/stdarg.in.h, lib/stdbool.in.h, m4/stdarg.m4, m4/stdbool.m4:
+       Remove.
+       * configure.ac (_AC_PROG_CC_C89): Define a dummy, to keep 'configure'
+       smaller.
+       (gl_PROG_CC_C99): Use this to get C99 or later.
+       * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
 
-2014-05-03  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't require pkg-config when building from repository.
+       * INSTALL: Prefer './configure FOO=BAR' to 'FOO=BAR ./configure'.
+       * INSTALL.REPO: pkg-config is no longer required to build from
+       the repository.
+       * autogen.sh: Don't check for pkg-config.
+       (progs): Remove pkg-config.
+       (pkg_config_min, AUTORECONF_ENV, env_space, ACLOCAL_PATH):
+       Remove.  All uses removed.
+       * m4/pkg.m4: New file, built by admin/merge-pkg-config.
+       * configure.ac: Remove unnecessary m4_pattern_forbid of ^PKG_ and
+       an AC_ARG_VAR of PKG_CONFIG_PATH.  pkg.m4 does that for us.
+       (EMACS_CHECK_MODULES): Remove workaround for old pkg-config bug,
+       as we use pkg.m4 from a newer pkg-config.
+
+2014-05-15  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * configure.ac (LIBPNG): Do not test for libpng if NS_IMPL_COCOA.
+
+2014-05-13  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * configure.ac (HAVE_XFIXES): Define if available.
+       (XFIXES_CFLAGS, XFIXES_LIBS): New AC_SUBSTs.
+       (--enable-link-time-optimization): Add clang support.
+       * INSTALL: Mention it.
+
+2014-05-12  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * configure.ac (EMACS_CHECK_MODULES): Fix typo in previous change.
+
+2014-05-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Work around bug in pkg-config before 0.26 (Bug#17438).
+       * configure.ac (EMACS_CHECK_MODULES): Check for failed exit status
+       of pkg-config, on older pkg-config versions that don't do it
+       properly.
+
+2014-05-07  Glenn Morris  <rgm@gnu.org>
+
+       * autogen.sh: Check for failing aclocal.
+
+2014-05-05  Glenn Morris  <rgm@gnu.org>
+
+       * autogen.sh: Check any pre-existing ACLOCAL_PATH.
+
+2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Consult libpng-config more consistently (Bug#17339).
+       This is mainly for simplicity, but it should also avoid
+       some future problems like the ones we recently had with NetBSD.
+       * configure.ac (LIBPNG): Configure after LIBZ.  Use libpng-config
+       for cflags, too.  Append -lz if we're not already doing that with
+       LIBZ.  Do not bother appending -lm, since we always append that.
+       Coalesce some duplicate code.
+
+       * autogen.sh: Use ‘"’ to quote a message that often contains ‘'’.
 
        Require ImageMagick >= 6.3.5, due to PixelSetMagickColor (Bug#17339).
        * configure.ac (IMAGEMAGICK_MODULE): Bump prereq from 6.2.8 to 6.3.5.
        A more-complicated fix would be to remove uses of PixelSetMagickColor,
        introduced in ImageMagick 6.3.5 (Sept. 2007).
 
-2014-05-02  Paul Eggert  <eggert@cs.ucla.edu>
-
-       Consult libpng-config more consistently (Bug#17339).
-       * configure.ac (edit_cflags): Move this up and to the top level,
-       so that PNG_CFLAGS can use it too.
-       (PNG_CFLAGS): New var.
-       (png_longjmp): Use PNG_CFLAGS when checking.
-       (LIBPNG): Be consistent about -lpng16 etc; e.g., don't use -lpng16
-       in some places and -lpng in others.  Test libpng-config's exit
-       status.  If it succeeds, use its output rather than appending -lz -lm.
-
-2014-05-01  Glenn Morris  <rgm@gnu.org>
+2014-05-04  Glenn Morris  <rgm@gnu.org>
 
        * configure.ac (LIBPNG): Consult libpng-config for the precise
        form of "-lpng" to use.  (Bug#17339)
 
-2014-04-29  Glenn Morris  <rgm@gnu.org>
+2014-05-03  Glenn Morris  <rgm@gnu.org>
+
+       * autogen.sh: If all else fails, try using pkg-config to find pkg.m4.
+
+2014-05-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Get --enable-gcc-warnings to work after touching configure.ac.
+       Preserve ACLOCAL_PATH in later builds, so that by default it has
+       the same value as it did in the first build after initial checkout.
+       * Makefile.in (ACLOCAL_PATH): New macro.
+       ($(srcdir)/aclocal.m4): Use it.
+       * configure.ac (ACLOCAL_PATH): AC_SUBST it.
+       * autogen.sh (env_space): New var.
+       Tell user what variables, if any, to pass to 'configure'.
+
+       Get --enable-gcc-warnings working again.
+       The recent changes to configure.ac removed the transliteration of
+       -I to -isystem in CFLAGS, which is needed for --enable-gcc-warnings.
+       Bring this back while keeping the spirit of the recent changes.
+       * configure.ac (edit_cflags): Restore this shell var, and put it
+       at the top level, where it'll be useful when emacs-24 is next merged.
+       (EMACS_CHECK_MODULES): New macro.  All uses of PKG_CHECK_MODULES
+       changed to use it.
+
+       Make it easier on maintainers who use their own Automake.
+       * autogen.sh (ACLOCAL_PATH, AUTORECONF_ENV): New vars.
+       Set them to avoid problems when maintainers prepend their own
+       Automake installations to their PATH.  Report an error if pkg.m4
+       can't be found.
+
+2014-05-02  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac (PKG_CONFIG_PATH): Declare with AC_ARG_VAR.
+
+       * configure.ac (--with-pkg-config-prog): Remove.
+       Use the PKG_CONFIG environment variable instead if you need it.
+
+       * configure.ac: Use pkg-config's pkg.m4, rather than reinventing it.
+       Add explicit AC_SUBST's where needed.
+       * autogen.sh (progs): Add pkg-config.
+       (pkg_config_min): New variable.
+
+       * configure.ac (AC_CONFIG_MACRO_DIR): Use it.
+
+       * autogen.sh (get_version): Handle no leading whitespace.
+       (check_version, main): Handle program names with hyphens.
+
+2014-04-30  Glenn Morris  <rgm@gnu.org>
 
        * configure.ac: Treat MirBSD as OpenBSD.  (Bug#17339)
 
+2014-04-21  Daniel Colascione  <dancol@dancol.org>
+
+       * .bzrignore: Add a.out to bzr ignore list (a test generates this
+       file).
+
+2014-04-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Link to glib-using libraries when checking for glib (Bug#17289).
+       * configure.ac (XGSELOBJ): Include GTK_LIBS, RSVG_LIBS, etc.
+       when testing whether Glib is linked in.  Similarly for CFLAGS.
+
+2014-04-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * GNUmakefile: Speed up 'make bootstrap' in fresh checkout.
+       (ORDINARY_GOALS): New macro, which excludes 'bootstrap'.
+       (bootstrap, .PHONY): New rules.
+       * INSTALL.REPO: Document current procedure better.
+       Move copyright notice to just before license notice.
+
+       * Makefile.in (FRC, force-info): Remove.
+       All uses removed.  This hack is no longer needed here
+       now that we can assume GNU Make's .PHONY feature works.
+       (bootstrap): No need to make 'info', since 'all' now implies 'info'.
+
 2014-04-16  Eli Zaretskii  <eliz@gnu.org>
 
        * config.bat: Update for Emacs 24.4.
 
-2014-04-13  Paul Eggert  <eggert@cs.ucla.edu>
+2014-04-16  Paul Eggert  <eggert@cs.ucla.edu>
 
        Port to IRIX 6.5 (Bug#9684).
        This port requires IRIX cc, as I did not have time to get
        in an optional library that also contains getdelim, and causes
        a later 'configure' to incorrectly think getdelim is supported.
 
-2014-04-13  Eli Zaretskii  <eliz@gnu.org>
+2014-04-16  Eli Zaretskii  <eliz@gnu.org>
 
        * configure.ac (LN_S_FILEONLY, LN_S): Use "/bin/ln" on MinGW, to
        ensure the MSYS ln.exe is invoked.
 
+2014-04-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Remove DATA_SEG_BITS.
+       * configure.ac (DATA_SEG_BITS): Remove.  All uses removed.
+
+2014-04-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * autogen.sh: Use autoreconf's -f option (Bug#17258).
+
+       Clean up configure-time library handling a bit.
+       This patch was inspired by emacs-24 bzr 116961, which fixed
+       a bug due to sloppy library handling in 'configure'.
+       * configure.ac (LIB_MATH, LIB_PTHREAD, LIBXMU):
+       Use AC_SEARCH_LIBS instead of AC_CHECK_LIB as per Autoconf manual.
+       (LIB_MATH, LIB_PTHREAD, HAVE_X11, IMAGEMAGICK_LIBS, GTK_LIBS)
+       (DBUS_LIBS, LIBXMU, XFT_LIBS, LIBXSM, LIBXML2_LIBS, LIBS_MAIL)
+       (with_kerberos):
+       Don't let the library choice infect $LIBS.
+       (dnet_ntoa, cma_open): Remove obsolete tests.
+       (emacs_pthread_function): Probe for pthread_kill, not pthread_self,
+       as that's a bit more selective on GNU/Linux.
+       (LIBXEXT): Remove.
+       (touchlock): Test for existence when $LIBS_MAIL is in use.
+       (AC_CHECK_FUNCS): Use only $LIB_MATH in addition to $LIBS
+       when testing for typical functions like accept4, lrand48.
+       (random, rint): Remove obsolete HP-UX 9 A.09.05 test.
+
 2014-04-11  Glenn Morris  <rgm@gnu.org>
 
        * make-dist: Do not distribute generated admin/grammars/Makefile.
        Do distribute lib-src/update-game-score.exe.manifest.
 
-2014-04-09  Ken Brown  <kbrown@cornell.edu>
+2014-04-11  Ken Brown  <kbrown@cornell.edu>
 
        * configure.ac (EMACS_MANIFEST): Revert last change (but leave
        UPDATE_MANIFEST empty).
 
-2014-04-03  Ken Brown  <kbrown@cornell.edu>
+2014-04-07  Ken Brown  <kbrown@cornell.edu>
 
        * configure.ac (EMACS_MANIFEST, UPDATE_MANIFEST): Leave these
        variables empty on Cygwin.  (Bug#17176)
 
-2014-03-31  Glenn Morris  <rgm@gnu.org>
+2014-04-03  Glenn Morris  <rgm@gnu.org>
+
+       * make-dist: Further update AC_INIT regexp.
+
+2014-04-02  Glenn Morris  <rgm@gnu.org>
 
        * configure.ac: Make the final "Does Emacs use Gsettings" message
        consistent with src/config.h.
 2014-03-31  Jan Djärv  <jan.h.d@swipnet.se>
 
        * configure.ac: Fix errors from previous checkin (GSettings check).
-       Backport from trunk.
 
-2014-03-30  Daniel Colascione  <dancol@dancol.org>
+2014-03-29  Jan Djärv  <jan.h.d@swipnet.se>
 
-       * configure.ac: Include GFILENOTIFY objects in glib check.  (Bug#17069)
+       * configure.ac: Add check that GSettings is in libgio (Bug#17118).
 
-2014-03-30  Jan Djärv  <jan.h.d@swipnet.se>
+2014-03-28  Glenn Morris  <rgm@gnu.org>
 
-       * configure.ac: Add check that GSettings is in libgio (Bug#17118).
-       Backport from trunk.
+       * configure.ac (AC_INIT): Add "GNU" in package, add bug address.
+       (PACKAGE_BUGREPORT): Use it.
+       (make-dist): Update AC_INIT regexp.
+
+       * configure.ac (ACL_SUMMARY): Rename from acl_summary, for consistency.
+       (EMACS_CONFIG_FEATURES): New define.
+
+2014-03-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * configure.ac: Suggest './configure MAKE=gmake' in diagnostic.
+       This tends to work better than 'MAKE=gmake ./configure' if later
+       builds run config.status etc.
+
+2014-03-27  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac: Require GNU make.
+       (HAVE_GNU_MAKE): Remove.
 
 2014-03-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        2014-03-26 strftime: wrap macros in "do {...} while(0)"
        * lib/strftime.c: Update from gnulib.
 
+2014-03-26  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac (CLASH_DETECTION): Remove option.  Every platform
+       supports it, and the runtime option `create-lockfiles' replaces it.
+
+2014-03-23  Daniel Colascione  <dancol@dancol.org>
+
+       * configure.ac: (Bug#17069) Include GFILENOTIFY objects in glib check.
+
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * make-dist: Do not distribute lib-src/testfile.
+
+2014-03-21  Eli Zaretskii  <eliz@gnu.org>
+
+       * configure.ac: Bump version to 24.4.50.
+
+2014-03-21  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (all): Depend on `info'.  (Bug#16626)
+
 2014-03-07  Paul Eggert  <eggert@cs.ucla.edu>
 
        Merge from gnulib, incorporating:
index 22c57f5cb5b9bad9d38e02b0de8d3dbb83398dba..b4b33f4dbb636d080d1d9b5b45f100a2a65f978c 100644 (file)
@@ -55,7 +55,9 @@ else
 # Once 'configure' exists, run it.
 # Finally, run the actual 'make'.
 
-default $(filter-out configure Makefile,$(MAKECMDGOALS)): Makefile
+ORDINARY_GOALS = $(filter-out configure Makefile bootstrap,$(MAKECMDGOALS))
+
+default $(ORDINARY_GOALS): Makefile
        $(MAKE) -f Makefile $(MAKECMDGOALS)
 # Execute in sequence, so that multiple user goals don't conflict.
 .NOTPARALLEL:
@@ -72,5 +74,11 @@ Makefile: configure
        ./configure
        @echo >&2 'Makefile built.'
 
+# 'make bootstrap' in a fresh checkout needn't run 'configure' twice.
+bootstrap: Makefile
+       $(MAKE) -f Makefile all
+
+.PHONY: bootstrap default $(ORDINARY_GOALS)
+
 endif
 endif
diff --git a/INSTALL b/INSTALL
index ea0331da62fe06e1aee9fda006c5c1442651c31e..94fa6ba653b5305c5e0db22d579edc96b12a87a6 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -24,6 +24,9 @@ find some things, or what options to use.
 `src/config.h' file containing system-dependent definitions.
 Running the `make' utility then builds the package for your system.
 
+Building Emacs requires GNU make, <http://www.gnu.org/software/make/>.
+On most systems that Emacs supports, this is the default `make' program.
+
 Here's the procedure to build Emacs using `configure' on systems which
 are supported by it.  In some cases, if the simplified procedure fails,
 you might need to use various non-default options, and maybe perform
@@ -49,7 +52,6 @@ sections if you need to.
                 SOURCE-DIR/configure
 
       where SOURCE-DIR is the top-level Emacs source directory.
-      This may not work unless you use GNU make.
 
   3. When `configure' finishes, it prints several lines of details
      about the system configuration.  Read those details carefully
@@ -167,6 +169,7 @@ X11 is being used.
   X libjpeg for JPEG: http://www.ijg.org/
   X libtiff for TIFF: http://www.remotesensing.org/libtiff/
   X libgif for GIF:   http://sourceforge.net/projects/giflib/
+    librsvg2 for SVG: http://wiki.gnome.org/action/show/Projects/LibRsvg
 
 If you supply the appropriate --without-LIB option, 'configure' will
 omit the corresponding library from Emacs, even if that makes for a
@@ -260,9 +263,9 @@ with the mouse.  You can get fancy 3D-style scroll bars, even without
 Gtk or Motif, if you have the Xaw3d library installed (see
 "Image support libraries" above for Xaw3d availability).
 
-You can tell configure where to search for GTK by specifying
-`--with-pkg-config-prog=PATH' where PATH is the pathname to
-pkg-config.  Note that GTK version 2.6 or newer is required for Emacs.
+You can tell configure where to search for GTK by giving it the
+argument PKG_CONFIG='/full/name/of/pkg-config'.  GTK version 2.6 or
+newer is required for Emacs.
 
 Emacs will autolaunch a D-Bus session bus, when the environment
 variable DISPLAY is set, but no session bus is running.  This might be
@@ -291,6 +294,7 @@ or more of these options:
   --without-tiff       for TIFF image support
   --without-gif        for GIF image support
   --without-png        for PNG image support
+  --without-rsvg       for SVG image support
 
 Use --without-toolkit-scroll-bars to disable Motif or Xaw3d scroll bars.
 
@@ -302,22 +306,17 @@ systems which support that.
 
 Use --without-sound to disable sound support.
 
-Use --without-all if you want to build a small executable with the minimal
-dependencies on external libraries, at the cost of disabling most of the
-features that are normally enabled by default.  Using --without-all is
-equivalent to --without-sound --without-dbus --without-libotf
---without-selinux --without-xft --without-gsettings --without-gnutls
---without-rsvg --without-xml2 --without-gconf --without-imagemagick
---without-m17n-flt --without-jpeg --without-tiff --without-gif
---without-png --without-gpm --without-file-notification.  Note that
---without-all leaves X support enabled, and using the GTK2 or GTK3
+Use --without-all for a smaller executable with fewer dependencies on
+external libraries, at the cost of disabling many features.  Although
+--without-all disables libraries not needed for ordinary Emacs
+operation, it does enable X support, and using the GTK2 or GTK3
 toolkit creates a lot of library dependencies.  So if you want to
 build a small executable with very basic X support, use --without-all
 --with-x-toolkit=no.  For the smallest possible executable without X,
 use --without-all --without-x.  If you want to build with just a few
 features enabled, you can combine --without-all with --with-FEATURE.
-For example, you can use --without-all --with-dbus to build with DBus
-support and nothing more.
+For example, you can use --without-all --without-x --with-dbus to
+build with DBus support and nothing more.
 
 Use --with-wide-int to implement Emacs values with the type 'long long',
 even on hosts where a narrower type would do.  With this option, on a
@@ -329,12 +328,17 @@ and is useful with GNU-compatible compilers.  On a recent GNU system
 there should be no warnings; on older and on non-GNU systems the
 generated warnings may still be useful.
 
-Use --enable-link-time-optimization to enable link-time optimizer, which
-is available in GNU compiler since version 4.5.0.  If your compiler is not
-GNU or older than version 4.5.0, this option does nothing.  If `configure'
-can determine number of online CPUS on your system, final link-time
-optimization and code generation is executed in parallel using one job
-per each available online CPU.
+Use --enable-link-time-optimization to enable link-time optimizer.  If
+you're using GNU compiler, this feature is supported since version 4.5.0.
+If `configure' can determine number of online CPUS on your system, final
+link-time optimization and code generation is executed in parallel using
+one job per each available online CPU.
+
+This option is also supported for clang.  You should have GNU binutils
+with `gold' linker and plugin support, and clang with LLVMgold.so plugin.
+Read http://llvm.org/docs/GoldPlugin.html for details.  Also note that
+this feature is still experimental, so prepare to build binutils and
+clang from the corresponding source code repositories.
 
 The `--prefix=PREFIXDIR' option specifies where the installation process
 should put emacs and its data files.  This defaults to `/usr/local'.
@@ -401,10 +405,11 @@ compiler.  By default, gcc is used if available.
 Here's an example of a `configure' invocation, assuming a Bourne-like
 shell such as Bash, which uses these variables:
 
- CPPFLAGS='-I/foo/myinclude' LDFLAGS='-L/bar/mylib' \
-  CFLAGS='-O3' LIBS='-lfoo -lbar' ./configure
+  ./configure \
+    CPPFLAGS='-I/foo/myinclude' LDFLAGS='-L/bar/mylib' \
+    CFLAGS='-O3' LIBS='-lfoo -lbar'
 
-(this is all one long line).  This tells `configure' to instruct the
+(this is all one shell command).  This tells `configure' to instruct the
 preprocessor to look in the `/foo/myinclude' directory for header
 files (in addition to the standard directories), instruct the linker
 to look in `/bar/mylib' for libraries, pass the -O3 optimization
@@ -414,12 +419,11 @@ libraries in addition to the standard ones.
 For some libraries, like Gtk+, fontconfig and ALSA, `configure' uses
 pkg-config to find where those libraries are installed.
 If you want pkg-config to look in special directories, you have to set
-the environment variable PKG_CONFIG_PATH to point to the directories
-where the .pc-files for those libraries are.
-For example:
+PKG_CONFIG_PATH to point to the directories where the .pc-files for
+those libraries are.  For example:
 
PKG_CONFIG_PATH='/usr/local/alsa/lib/pkgconfig:/opt/gtk+-2.8/lib/pkgconfig' \
-   ./configure
 ./configure \
+    PKG_CONFIG_PATH='/usr/local/alsa/lib/pkgconfig:/opt/gtk+-2.8/lib/pkgconfig'
 
 The work of `configure' can be done by editing various files in the
 distribution, but using `configure' is easier.  See the section called
@@ -435,12 +439,8 @@ SOURCE-DIR refers to the top-level Emacs source directory which is
 where Emacs's configure script is located.  `configure' looks for the
 Emacs source code in the directory that `configure' is in.
 
-To build in a separate directory, you must use a version of `make'
-that supports the `VPATH' variable, such as GNU `make'.
-
-(Do not try to build in a separate directory by creating many links
-to the real source directory--there is no need, and installation will
-fail.)
+(Do not try to build in a separate directory by creating many links to
+the real source directory--there is no need, and installation will fail.)
 
 4) Put into `./lisp/site-init.el' or `./lisp/site-load.el' any Emacs
 Lisp code you want Emacs to load before it is dumped out.  Use
@@ -726,8 +726,8 @@ Strictly speaking, not all of the executables in `./lib-src' need be copied.
     are used by Emacs; they do need to be copied.
 - The programs `etags', `ctags', and `emacsclient' are intended to be
     run by users; they are handled below.
-- The programs `make-docfile' and `test-distrib' were
-    used in building Emacs, and are not needed any more.
+- The program `make-docfile' was used in building Emacs, and is
+    not needed any more.
 
 2) Copy the files in `./info' to the place specified in
 `./lisp/site-init.el' or `./lisp/info.el'.  Note that if the
index ecf5bc068fe889a74f5dc6a9f834b2ec0b14a2ba..36ab928673d77a3cedfb489d083a31749a7cca4d 100644 (file)
@@ -1,9 +1,10 @@
-Copyright (C) 2002-2014 Free Software Foundation, Inc.
-See the end of the file for license conditions.
-
-
             Building and Installing Emacs from the Repository
 
+Simply run 'make'.  This should work if your files are freshly checked
+out from the repository, and if you have the proper tools installed.
+If it doesn't work, or if you have special build requirements, the
+following information may be helpful.
+
 Building Emacs from the source-code repository requires some tools
 that are not needed when building from a release.  You will need:
 
@@ -14,48 +15,32 @@ automake  - at least the version specified near the start of
 makeinfo  - not strictly necessary, but highly recommended, so that
   you can build the manuals.
 
-The `autogen.sh' script can help you figure out if you have the
-necessary tools.
-
-The first time you build, there are a couple of extra steps.
-First, generate the `configure' script and some related files:
+To use the autotools, run the following shell command to generate the
+'configure' script and some related files:
 
   $ ./autogen.sh
 
-(or you can just run `autoreconf -i -I m4').
-
-You can then configure your build (use `./configure --help' to see
-options you can set):
+You can then configure your build as follows:
 
   $ ./configure
 
-If you want later builds to go faster, at the expense of sometimes
-doing the wrong thing if you update the build procedure, you can
-invoke "./configure -C" instead.
-
-Some of the files that are included in the Emacs tarball, such as
-byte-compiled Lisp files, are not stored in the repository.  Therefore, to
-build from the repository you must run "make bootstrap" instead of
-just "make":
-
-  $ make bootstrap
-
-Normally, it is not necessary to use "make bootstrap" after every
-update from the repository.  "make" should work in 90% of the cases and be
-much quicker.
+The 'configure' script has many options; run './configure --help' to
+see them.  For example, if you want later builds to go faster, albeit
+sometimes doing the wrong thing if you update the build procedure, you
+can invoke './configure -C'.  After configuring, build Emacs as follows:
 
   $ make
 
-(If you want to install the Emacs binary, type "make install" instead
-of "make" in the last command.)
+If you want to install Emacs, type 'make install' instead of 'make' in
+the last command.
 
-Occasionally the file "lisp/loaddefs.el" (and similar automatically
-generated files, such as esh-groups.el, and *-loaddefs.el in some
-subdirectories of lisp/, e.g. mh-e/ and calendar/) will need to be
+Occasionally the file 'lisp/loaddefs.el' (and similar automatically
+generated files, such as 'esh-groups.el', and '*-loaddefs.el' in some
+subdirectories of 'lisp/', e.g., 'mh-e/' and 'calendar/') will need to be
 updated to reflect new autoloaded functions.  If you see errors (rather
 than warnings) about undefined lisp functions during compilation, that
 may be the reason.  Finally, sometimes there can be build failures
-related to *loaddefs.el (e.g. "required feature `esh-groups' was not
+related to '*loaddefs.el' (e.g., "required feature `esh-groups' was not
 provided").  In that case, follow the instructions below.
 
 To update loaddefs.el (and similar files), do:
@@ -63,13 +48,13 @@ To update loaddefs.el (and similar files), do:
   $ cd lisp
   $ make autoloads
 
-If either of the above partial procedures fails, try "make bootstrap".
-If CPU time is not an issue, the most thorough way to rebuild, and
-avoid any spurious problems, is always to use this method.
+If either of the above partial procedures fails, try 'make bootstrap'.
+If CPU time is not an issue, 'make bootstrap' is the most thorough way
+to rebuild, and avoid any spurious problems.
 
-Users of non-Posix systems (MS-Windows etc.) should run the
-platform-specific configuration scripts (nt/configure.bat, config.bat,
-etc.) before "make bootstrap" or "make"; the rest of the procedure is
+Users of non-Posix systems (MS-Windows, etc.) should run the
+platform-specific configuration scripts ('nt/configure.bat',
+'config.bat', etc.) before 'make'; the rest of the procedure is
 applicable to those systems as well.
 
 Because the repository version of Emacs is a work in progress, it will
@@ -82,6 +67,8 @@ never platform-specific.
 
 
 \f
+Copyright (C) 2002-2014 Free Software Foundation, Inc.
+
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
index 103b035a3c9d091329eb040841a2dbacdead167c..a6080e5ce78feed604b28adc02d57ba4a4f2b2c9 100644 (file)
@@ -60,8 +60,8 @@
 
 SHELL = @SHELL@
 
-# This may not work with certain non-GNU make's.  It only matters when
-# inheriting a CDPATH not starting with the current directory.
+# This only matters when inheriting a CDPATH not starting with the
+# current directory.
 CDPATH=
 
 # If Make doesn't predefine MAKE, set it here.
@@ -76,10 +76,11 @@ QUIET_SUBMAKE = MAKELEVEL=0
 cache_file = @cache_file@
 CONFIGURE_FLAGS = --cache-file=$(cache_file)
 
-CC=@CC@
-CFLAGS=@CFLAGS@
-LDFLAGS=@LDFLAGS@
-CPPFLAGS=@CPPFLAGS@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+ACLOCAL = @ACLOCAL@
+
 EXEEXT=@EXEEXT@
 
 ### These help us choose version- and architecture-specific directories
@@ -146,8 +147,7 @@ man1dir=$(mandir)/man1
 # Where to install and expect the info files describing Emacs.
 infodir=@infodir@
 # Info files not in the doc/misc directory (we get those via make echo-info).
-INFO_EXT=@INFO_EXT@
-INFO_NONMISC=emacs$(INFO_EXT) eintr$(INFO_EXT) elisp$(INFO_EXT)
+INFO_NONMISC=emacs.info eintr.info elisp.info
 
 # If no makeinfo was found and configured --without-makeinfo, "no"; else "yes".
 HAVE_MAKEINFO=@HAVE_MAKEINFO@
@@ -166,8 +166,6 @@ bitmapdir=@bitmapdir@
 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
 srcdir=@srcdir@
 abs_srcdir=@abs_srcdir@
-# MinGW CPPFLAGS may use this.
-abs_top_srcdir=@abs_top_srcdir@
 
 # Where the manpage source files are kept.
 mansrcdir=$(srcdir)/doc/man
@@ -288,9 +286,9 @@ SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'`
 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
 COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}"
 
-all: ${SUBDIR}
+all: ${SUBDIR} info
 
-.PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 FRC
+.PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32
 
 removenullpaths=sed -e 's/^:*//' -e 's/:*$$//g' -e 's/::*/:/g'
 
@@ -298,7 +296,15 @@ removenullpaths=sed -e 's/^:*//' -e 's/:*$$//g' -e 's/::*/:/g'
 # See comments in configure.ac for why it is done this way, as opposed
 # to just letting configure generate epaths.h from epaths.in in a
 # similar way to how Makefile is made from Makefile.in.
-epaths-force: FRC
+epaths-force:
+       @for dir in '$(abs_srcdir)' '$(lispdir)' '$(archlibdir)'; do \
+         case $$dir in \
+           *:*) \
+             echo >&2 "Build or installation directory '$$dir'"; \
+             echo >&2 "cannot contain ':'."; \
+             exit 1;; \
+         esac; \
+       done
        @(standardlisppath=`echo "${standardlisppath}" | ${removenullpaths}` ; \
          locallisppath=`echo "${locallisppath}" | ${removenullpaths}` ; \
          buildlisppath=`echo "${buildlisppath}" | ${removenullpaths}` ; \
@@ -335,7 +341,7 @@ msys_sed_sh_escape=sed -e 's/[];$$*.^[]/\\\\&/g'
 # MS-Windows format (e.g. 'c:/foo/bar'), because temacs is a MinGW
 # program that doesn't support MSYS-style paths (e.g. '/c/foo/bar' or
 # '/foo/bar').
-epaths-force-w32: FRC
+epaths-force-w32:
        @(w32srcdir=`${srcdir}/build-aux/msys-to-w32 "${srcdir}"`; \
          w32prefix=`${srcdir}/build-aux/msys-to-w32 "${prefix}" N`; \
          w32prefixpattern=`echo "$${w32prefix}" | ${msys_sed_sh_escape}` ; \
@@ -359,40 +365,21 @@ src: lib-src
 lisp: src
 
 # These targets should be "${SUBDIR} without `src'".
-lib lib-src lisp nt: Makefile FRC
-       cd $@ && $(MAKE) all $(MFLAGS)                         \
-         CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
-         LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
-
-# Pass to src/Makefile.in an additional BOOTSTRAPEMACS variable which
-# is either set to bootstrap-emacs (in case bootstrap-emacs has not been
-# constructed yet) or the empty string (otherwise).
-# src/Makefile.in uses it to implement conditional dependencies, so that
-# files that need bootstrap-emacs to be built do not additionally need
-# to be kept fresher than bootstrap-emacs.  Otherwise changing a single
-# file src/foo.c forces dumping a new bootstrap-emacs, then re-byte-compiling
-# all preloaded elisp files, and only then dump the actual src/emacs, which
-# is not wrong, but is overkill in 99.99% of the cases.
-#
+lib lib-src lisp nt: Makefile
+       $(MAKE) -C $@ all
+
 # Note the use of single quotes in the value of vcswitness.
 # This passes an unexpanded $srcdir to src's Makefile, which then
 # expands it using its own value of srcdir (which points to the
 # source directory of src/).
-src: Makefile FRC
+src: Makefile
        dirstate='.bzr/checkout/dirstate';                              \
        vcswitness='$$(srcdir)/../'$$dirstate;                          \
        [ -r "$(srcdir)/$$dirstate" ] || vcswitness='';                 \
-       cd $@ || exit;                                                  \
-       boot=bootstrap-emacs$(EXEEXT);                                  \
-       [ ! -x "$$boot" ] || boot='';                                   \
-       $(MAKE) all $(MFLAGS)                                           \
-         CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}'          \
-         LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot"   \
-         VCSWITNESS="$$vcswitness"
-
-blessmail: Makefile src FRC
-       cd lib-src && $(MAKE) maybe-blessmail $(MFLAGS) \
-         MAKE='${MAKE}' archlibdir='$(archlibdir)'
+       $(MAKE) -C $@ all VCSWITNESS="$$vcswitness"
+
+blessmail: Makefile src
+       $(MAKE) -C lib-src maybe-blessmail
 
 # We used to have one rule per */Makefile.in, but that leads to race
 # conditions with parallel makes, so let's assume that the time stamp on
@@ -423,16 +410,17 @@ config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
 AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
 
 $(srcdir)/configure: $(AUTOCONF_INPUTS)
-       cd ${srcdir} && autoconf
+       cd ${srcdir} && ${AUTOCONF}
 
-ACLOCAL_INPUTS = $(srcdir)/configure.ac $(srcdir)/m4/gnulib-comp.m4
+ACLOCAL_PATH = @ACLOCAL_PATH@
+ACLOCAL_INPUTS = $(srcdir)/configure.ac $(wildcard $(srcdir)/m4/*.m4)
 $(srcdir)/aclocal.m4: $(ACLOCAL_INPUTS)
-       cd $(srcdir) && aclocal -I m4
+       cd $(srcdir) && ACLOCAL_PATH='$(ACLOCAL_PATH)' $(ACLOCAL) -I m4
 
 AUTOMAKE_INPUTS = $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am \
   $(srcdir)/lib/gnulib.mk
 $(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS)
-       cd $(srcdir) && automake --gnu -a -c lib/Makefile
+       cd $(srcdir) && $(AUTOMAKE) --gnu -a -c lib/Makefile
 
 # Regenerate files that this makefile would have made, if this makefile
 # had been built by Automake.  The name 'am--refresh' is for
@@ -445,9 +433,9 @@ $(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in
        @ # because stamp-h.in has changed (since building stamp-h.in
        @ # refreshes config.in as well), but if config.in is missing
        @ # then we really need to do something more.
-       [ -r "$@" ] || ( cd ${srcdir} && autoheader )
+       [ -r "$@" ] || ( cd ${srcdir} && ${AUTOHEADER} )
 $(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
-       cd ${srcdir} && autoheader
+       cd ${srcdir} && ${AUTOHEADER}
        rm -f $(srcdir)/src/stamp-h.in
        echo timestamp > $(srcdir)/src/stamp-h.in
 
@@ -484,11 +472,7 @@ write_subdir=if [ -f "$${subdir}/subdirs.el" ]; \
 ### Lisp files and DOC file to work properly.
 install-arch-dep: src install-arch-indep install-etcdoc install-$(NTDIR)
        umask 022; ${MKDIR_P} "$(DESTDIR)${bindir}"
-       cd lib-src && \
-         $(MAKE) install $(MFLAGS) prefix="${prefix}" \
-           exec_prefix="${exec_prefix}" bindir="${bindir}" \
-           libexecdir="${libexecdir}" archlibdir="${archlibdir}" \
-           INSTALL_STRIP=${INSTALL_STRIP}
+       $(MAKE) -C lib-src install
        if test "${ns_self_contained}" = "no"; then \
          ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)" || exit 1 ; \
          chmod 1755 "$(DESTDIR)${bindir}/$(EMACSFULL)" || true; \
@@ -506,12 +490,7 @@ install-arch-dep: src install-arch-indep install-etcdoc install-$(NTDIR)
 ### in nt/, and its Posix do-nothing shadow.
 install-:
 install-nt:
-       cd $(NTDIR) && \
-         $(MAKE) install $(MFLAGS) prefix="${prefix}" \
-           exec_prefix="${exec_prefix}" bindir="${bindir}" \
-           libexecdir="${libexecdir}" archlibdir="${archlibdir}" \
-           datadir="${datadir}" \
-           INSTALL_STRIP=${INSTALL_STRIP}
+       $(MAKE) -C $(NTDIR) install
 
 ## In the share directory, we are deleting:
 ## applications (with emacs.desktop, also found in etc/)
@@ -658,7 +637,7 @@ install-info: info
           [ -f "$(DESTDIR)${infodir}/dir" ] || \
              [ ! -f ${srcdir}/info/dir ] || \
              ${INSTALL_DATA} ${srcdir}/info/dir "$(DESTDIR)${infodir}/dir"; \
-          info_misc=`cd doc/misc && $(QUIET_SUBMAKE) $(MAKE) -s echo-info`; \
+          info_misc=`$(QUIET_SUBMAKE) $(MAKE) -s -C doc/misc echo-info`; \
           cd ${srcdir}/info ; \
           for elt in ${INFO_NONMISC} $${info_misc}; do \
              test "$(HAVE_MAKEINFO)" = "no" && test ! -f $$elt && continue; \
@@ -725,19 +704,14 @@ install-etc:
 
 ### Build Emacs and install it, stripping binaries while installing them.
 install-strip:
-       $(MAKE) $(MFLAGS) INSTALL_STRIP=-s install
+       $(MAKE) INSTALL_STRIP=-s install
 
 ### Delete all the installed files that the `install' target would
 ### create (but not the noninstalled files such as `make all' would create).
 ###
 ### Don't delete the lisp and etc directories if they're in the source tree.
 uninstall: uninstall-$(NTDIR) uninstall-doc
-       cd lib-src &&                                   \
-        $(MAKE) $(MFLAGS) uninstall                    \
-           prefix="${prefix}" exec_prefix="${exec_prefix}" \
-           bindir="${bindir}" libexecdir="${libexecdir}" \
-           archlibdir="${archlibdir}"
-
+       $(MAKE) -C lib-src uninstall
        -unset CDPATH; \
        for dir in "$(DESTDIR)${lispdir}" "$(DESTDIR)${etcdir}" ; do    \
          if [ -d "$${dir}" ]; then                     \
@@ -754,7 +728,7 @@ uninstall: uninstall-$(NTDIR) uninstall-doc
        done
        -rm -rf "$(DESTDIR)${libexecdir}/emacs/${version}"
        thisdir=`/bin/pwd`; \
-       (info_misc=`cd doc/misc && $(QUIET_SUBMAKE) $(MAKE) -s echo-info`; \
+       (info_misc=`$(QUIET_SUBMAKE) $(MAKE) -s -C doc/misc echo-info`; \
         if cd "$(DESTDIR)${infodir}"; then \
           for elt in ${INFO_NONMISC} $${info_misc}; do \
             (cd "$${thisdir}"; \
@@ -786,34 +760,35 @@ uninstall: uninstall-$(NTDIR) uninstall-doc
 ### in nt/, and its Posix do-nothing shadow.
 uninstall-:
 uninstall-nt:
-       cd $(NTDIR) &&                                  \
-        $(MAKE) $(MFLAGS) uninstall                    \
-           prefix="${prefix}" exec_prefix="${exec_prefix}" \
-           bindir="${bindir}" libexecdir="${libexecdir}" \
-           archlibdir="${archlibdir}"
-
-FRC:
+       $(MAKE) -C $(NTDIR) uninstall
 
 # ==================== Cleaning up and miscellanea ====================
 
 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean extraclean
 
+## Eg:
+## src_clean:
+##     make -C src clean
+define submake_template
+.PHONY: $(1)_$(2)
+$(1)_$(2):
+       $$(MAKE) -C $(1) $(2)
+endef
+
 ### `mostlyclean'
 ###      Like `clean', but may refrain from deleting a few files that people
 ###      normally don't want to recompile.  For example, the `mostlyclean'
 ###      target for GCC does not delete `libgcc.a', because recompiling it
 ###      is rarely necessary and takes a lot of time.
-mostlyclean: FRC
-       cd src      && $(MAKE) $(MFLAGS) mostlyclean
-       cd oldXMenu && $(MAKE) $(MFLAGS) mostlyclean
-       cd lwlib    && $(MAKE) $(MFLAGS) mostlyclean
-       cd lib      && $(MAKE) $(MFLAGS) mostlyclean
-       cd lib-src  && $(MAKE) $(MFLAGS) mostlyclean
-       cd nt       && $(MAKE) $(MFLAGS) mostlyclean
-       -cd doc/emacs     && $(MAKE) $(MFLAGS) mostlyclean
-       -cd doc/misc      && $(MAKE) $(MFLAGS) mostlyclean
-       -cd doc/lispref   && $(MAKE) $(MFLAGS) mostlyclean
-       -cd doc/lispintro && $(MAKE) $(MFLAGS) mostlyclean
+mostlyclean_dirs = src oldXMenu lwlib lib lib-src nt doc/emacs doc/misc \
+  doc/lispref doc/lispintro
+
+$(foreach dir,$(mostlyclean_dirs),$(eval $(call submake_template,$(dir),mostlyclean)))
+
+mostlyclean: $(mostlyclean_dirs:=_mostlyclean)
+       for dir in test/automated; do \
+         [ ! -d $$dir ] || $(MAKE) -C $$dir mostlyclean; \
+       done
 
 ### `clean'
 ###      Delete all files from the current directory that are normally
@@ -823,24 +798,21 @@ mostlyclean: FRC
 ###      with them.
 ###
 ###      Delete `.dvi' files here if they are not part of the distribution.
-clean: FRC
+clean_dirs = $(mostlyclean_dirs) nextstep
+
+$(foreach dir,$(clean_dirs),$(eval $(call submake_template,$(dir),clean)))
+
+clean: $(clean_dirs:=_clean)
+       for dir in test/automated; do \
+         [ ! -d $$dir ] || $(MAKE) -C $$dir clean; \
+       done
        -rm -f etc/emacs.tmpdesktop
-       cd src      && $(MAKE) $(MFLAGS) clean
-       cd oldXMenu && $(MAKE) $(MFLAGS) clean
-       cd lwlib    && $(MAKE) $(MFLAGS) clean
-       cd lib      && $(MAKE) $(MFLAGS) clean
-       cd lib-src  && $(MAKE) $(MFLAGS) clean
-       cd nt       && $(MAKE) $(MFLAGS) clean
-       -cd doc/emacs     && $(MAKE) $(MFLAGS) clean
-       -cd doc/misc      && $(MAKE) $(MFLAGS) clean
-       -cd doc/lispref   && $(MAKE) $(MFLAGS) clean
-       -cd doc/lispintro && $(MAKE) $(MFLAGS) clean
-       cd nextstep && $(MAKE) $(MFLAGS) clean
 
 ### `bootclean'
 ###      Delete all files that need to be remade for a clean bootstrap.
 top_bootclean=\
        rm -f config.cache config.log
+
 ### `distclean'
 ###      Delete all files from the current directory that are created by
 ###      configuring or building the program.  If you have unpacked the
@@ -850,44 +822,25 @@ top_bootclean=\
 top_distclean=\
        ${top_bootclean}; \
        rm -f config.status config.log~ Makefile stamp-h1 ${SUBDIR_MAKEFILES}
-distclean: FRC
-       cd src      && $(MAKE) $(MFLAGS) distclean
-       cd oldXMenu && $(MAKE) $(MFLAGS) distclean
-       cd lwlib    && $(MAKE) $(MFLAGS) distclean
-       cd lib      && $(MAKE) $(MFLAGS) distclean
-       cd lib-src  && $(MAKE) $(MFLAGS) distclean
-       cd nt       && $(MAKE) $(MFLAGS) distclean
-       cd doc/emacs     && $(MAKE) $(MFLAGS) distclean
-       cd doc/misc      && $(MAKE) $(MFLAGS) distclean
-       cd doc/lispref   && $(MAKE) $(MFLAGS) distclean
-       cd doc/lispintro && $(MAKE) $(MFLAGS) distclean
-       cd leim     && $(MAKE) $(MFLAGS) distclean
-       cd lisp     && $(MAKE) $(MFLAGS) distclean
-       cd nextstep && $(MAKE) $(MFLAGS) distclean
+
+distclean_dirs = $(clean_dirs) leim lisp
+
+$(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),distclean)))
+
+distclean: $(distclean_dirs:=_distclean)
        for dir in test/automated admin/grammars admin/unidata; do \
-         [ ! -d $$dir ] || (cd $$dir && $(MAKE) $(MFLAGS) distclean); \
+         [ ! -d $$dir ] || $(MAKE) -C $$dir distclean; \
        done
        ${top_distclean}
 
 ### `bootstrap-clean'
 ###      Delete everything that can be reconstructed by `make' and that
 ###      needs to be deleted in order to force a bootstrap from a clean state.
-bootstrap-clean: FRC
-       cd src      && $(MAKE) $(MFLAGS) bootstrap-clean
-       cd oldXMenu && $(MAKE) $(MFLAGS) maintainer-clean
-       cd lwlib    && $(MAKE) $(MFLAGS) maintainer-clean
-       cd lib      && $(MAKE) $(MFLAGS) maintainer-clean
-       cd lib-src  && $(MAKE) $(MFLAGS) maintainer-clean
-       cd nt       && $(MAKE) $(MFLAGS) maintainer-clean
-       -cd doc/emacs     && $(MAKE) $(MFLAGS) maintainer-clean
-       -cd doc/misc      && $(MAKE) $(MFLAGS) maintainer-clean
-       -cd doc/lispref   && $(MAKE) $(MFLAGS) maintainer-clean
-       -cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean
-       cd leim     && $(MAKE) $(MFLAGS) bootstrap-clean
-       cd lisp     && $(MAKE) $(MFLAGS) bootstrap-clean
-       cd nextstep && $(MAKE) $(MFLAGS) maintainer-clean
+$(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),bootstrap-clean)))
+
+bootstrap-clean: $(distclean_dirs:=_bootstrap-clean)
        for dir in test/automated admin/grammars admin/unidata; do \
-         [ ! -d $$dir ] || (cd $$dir && $(MAKE) $(MFLAGS) bootstrap-clean); \
+         [ ! -d $$dir ] || $(MAKE) -C $$dir bootstrap-clean; \
        done
        [ ! -f config.log ] || mv -f config.log config.log~
        rm -rf ${srcdir}/info
@@ -907,12 +860,14 @@ bootstrap-clean: FRC
 top_maintainer_clean=\
        ${top_distclean}; \
        rm -fr autom4te.cache
-maintainer-clean: bootstrap-clean FRC
-       cd src  && $(MAKE) $(MFLAGS) maintainer-clean
-       cd leim && $(MAKE) $(MFLAGS) maintainer-clean
-       cd lisp && $(MAKE) $(MFLAGS) maintainer-clean
+
+maintainer_clean_dirs = src leim lisp
+
+$(foreach dir,$(maintainer_clean_dirs),$(eval $(call submake_template,$(dir),maintainer-clean)))
+
+maintainer-clean: bootstrap-clean $(maintainer_clean_dirs:=_maintainer-clean)
        for dir in test/automated admin/grammars admin/unidata; do \
-         [ ! -d $$dir ] || (cd $$dir && $(MAKE) $(MFLAGS) maintainer-clean); \
+         [ ! -d $$dir ] || $(MAKE) -C $$dir maintainer-clean; \
        done
        ${top_maintainer_clean}
 
@@ -920,8 +875,12 @@ maintainer-clean: bootstrap-clean FRC
 ### says GCC supports it, and that's where the configuration part of
 ### the coding standards seem to come from.  It's like distclean, but
 ### it deletes backup and autosave files too.
-extraclean:
-       for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
+### Note that we abuse this in some subdirectories (eg leim),
+### to delete some generated files that are slow to rebuild.
+$(foreach dir,$(SUBDIR),$(eval $(call submake_template,$(dir),extraclean)))
+
+## FIXME this is busted because most of these do not have extraclean rules.
+extraclean: $(SUBDIR:=_extraclean)
        ${top_maintainer_clean}
        -rm -f config-tmp-*
        -rm -f *~ \#*
@@ -930,14 +889,14 @@ extraclean:
 # even when the build directory and source dir are different.
 .PHONY: TAGS tags
 TAGS tags: lib lib-src src
-       cd src; $(MAKE) $(MFLAGS) tags
+       $(MAKE) -C src tags
 
 check: all
        @if test ! -d test/automated; then \
          echo "You do not seem to have the test/ directory."; \
          echo "Maybe you are using a release tarfile, rather than a repository checkout."; \
        else \
-         cd test/automated && $(MAKE) $(MFLAGS) check; \
+         $(MAKE) -C test/automated check; \
        fi
 
 dist:
@@ -951,10 +910,10 @@ PSS   = lispref-ps   lispintro-ps   emacs-ps   misc-ps
 
 DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS)
 $(DOCS):
-       t=$@; IFS=-; set $$t; IFS=; cd doc/$$1 && $(MAKE) $(MFLAGS) $$2
+       t=$@; IFS=-; set $$t; IFS=; $(MAKE) -C doc/$$1 $$2
 
 .PHONY: $(DOCS) docs pdf ps
-.PHONY: info dvi dist check html info-real info-dir force-info check-info
+.PHONY: info dvi dist check html info-real info-dir check-info
 
 ## TODO add etc/refcards.
 docs: $(DOCS)
@@ -1000,7 +959,7 @@ INSTALL_DOC = $(INSTALL_DVI) $(INSTALL_HTML) $(INSTALL_PDF) $(INSTALL_PS)
 ## Install non .info forms of the documentation.
 ## TODO add etc/refcards.
 $(INSTALL_DOC):
-       t=$@; IFS=-; set $$t; IFS=; cd doc/$$2 && $(MAKE) $(MFLAGS) $$1-$$3
+       t=$@; IFS=-; set $$t; IFS=; $(MAKE) -C doc/$$2 $$1-$$3
 
 .PHONY: $(INSTALL_DOC) install-doc
 .PHONY: install-dvi install-html install-pdf install-ps
@@ -1023,7 +982,7 @@ UNINSTALL_PS = uninstall-emacs-ps uninstall-lispref-ps \
 UNINSTALL_DOC = $(UNINSTALL_DVI) $(UNINSTALL_HTML) $(UNINSTALL_PDF) $(UNINSTALL_PS)
 
 $(UNINSTALL_DOC):
-       t=$@; IFS=-; set $$t; IFS=; cd doc/$$2 && $(MAKE) $(MFLAGS) $$1-$$3
+       t=$@; IFS=-; set $$t; IFS=; $(MAKE) -C doc/$$2 $$1-$$3
 
 .PHONY: $(UNINSTALL_DOC) uninstall-doc
 .PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
@@ -1035,7 +994,6 @@ uninstall-pdf: $(UNINSTALL_PDF)
 uninstall-ps: $(UNINSTALL_PS)
 
 
-force-info:
 # Note that man/Makefile knows how to put the info files in $(srcdir),
 # so we can do ok running make in the build dir.
 # This used to have a clause that exited with an error if MAKEINFO = no.
@@ -1047,11 +1005,11 @@ force-info:
 # would require changing every rule in doc/ that builds an info file,
 # and it's not worth it.  This case is only relevant if you download a
 # release, then change the .texi files.
-info: force-info
+info:
        @if test "$(HAVE_MAKEINFO)" = "no"; then \
          echo "Configured --without-makeinfo, not building manuals" ; \
        else \
-         $(MAKE) $(MFLAGS) info-real info-dir; \
+         $(MAKE) info-real info-dir; \
        fi
 
 ## build-aux/make-info-dir expects only certain dircategories.
@@ -1089,10 +1047,10 @@ check-info: info
 #  * Run autogen.sh.
 #  * Rebuild Makefile, to update the build procedure itself.
 #  * Do the actual build.
-bootstrap: bootstrap-clean FRC
+bootstrap: bootstrap-clean
        cd $(srcdir) && ./autogen.sh
-       $(MAKE) $(MFLAGS) MAKEFILE_NAME=force-Makefile force-Makefile
-       $(MAKE) $(MFLAGS) info all
+       $(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile
+       $(MAKE) all
 
 .PHONY: check-declare
 
@@ -1101,4 +1059,4 @@ check-declare:
          echo "You must build Emacs to use this command"; \
          exit 1; \
        fi
-       cd lisp && $(MAKE) $(MFLAGS) $@
+       $(MAKE) -C lisp $@
diff --git a/README b/README
index 2a166ef728afa5f5dcf066a7529b96f1f4b4a073..9f0ff0c5daac11f00dd6b94b088f5029db28f46d 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ Copyright (C) 2001-2014 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 
-This directory tree holds version 24.3.92 of GNU Emacs, the extensible,
+This directory tree holds version 24.4.50 of GNU Emacs, the extensible,
 customizable, self-documenting real-time display editor.
 
 The file INSTALL in this directory says how to build and install GNU
index 27d87dcaa2aaaa920b1e83a887fc9ee71f692643..066347b3826df0182d3597529d7f4d63530a8acf 100644 (file)
@@ -86,8 +86,6 @@ BROKEN_FIONREAD
 BROKEN_GET_CURRENT_DIR_NAME
 BROKEN_NON_BLOCKING_CONNECT
 BROKEN_PTY_READ_AFTER_EAGAIN
-CLASH_DETECTION
-DATA_SEG_BITS
 DEFAULT_SOUND_DEVICE
 DEVICE_SEP
 DIRECTORY_SEP
@@ -201,17 +199,13 @@ HAVE_KRB5_H
 HAVE_KRB_H
 HAVE_LANGINFO_CODESET
 HAVE_LIBDGC
-HAVE_LIBDNET
 HAVE_LIBKSTAT
 HAVE_LIBLOCKFILE
-HAVE_LIBM
 HAVE_LIBMAIL
 HAVE_LIBOTF
 HAVE_LIBPERFSTAT
 HAVE_LIBPNG_PNG_H
-HAVE_LIBPTHREADS
 HAVE_LIBSELINUX
-HAVE_LIBXEXT
 HAVE_LIBXML2
 HAVE_LIBXMU
 HAVE_LOCALTIME_R
index 1abbf36e9dc0b8c40e8cd2ba8d8fe416694dd7f2..90d394ca9bdda339ca9c7db4f9667b49770b1226 100644 (file)
@@ -1,20 +1,64 @@
-2014-06-24  Eli Zaretskii  <eliz@gnu.org>
+2014-07-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use binary-io module, O_BINARY, and "b" flag (Bug#18006).
+       * merge-gnulib (GNULIB_MODULES): Add binary-io.  It was already
+       present implicitly; this just makes the dependence explicit.
+
+2014-06-30  Glenn Morris  <rgm@gnu.org>
+
+       * update_autogen: Find loaddefs targets rather than
+       parsing lisp/Makefile.in
+
+2014-06-29  Glenn Morris  <rgm@gnu.org>
+
+       * update_autogen: Remove need to cd into/out of lisp/.
+
+       * grammars/Makefile.in (bootstrap-clean): Don't delete Makefile,
+       for sake of top-level maintainer-clean rule.
+
+2014-06-26  Eli Zaretskii  <eliz@gnu.org>
 
        * notes/unicode: Some notes about what to do when a new Unicode
        version is imported.
 
-2014-06-24  Glenn Morris  <rgm@gnu.org>
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * authors.el: Move here from ../lisp/emacs-lisp.
+
+2014-06-25  Glenn Morris  <rgm@gnu.org>
+
+       * grammars/Makefile.in (${bovinedir}/c-by.el, ${bovinedir}/make-by.el):
+       (${wisentdir}/js-wy.el, ${wisentdir}/python-wy.el):
+       Replace with pattern rules.
+       (${bovinedir}/scm-by.el, ${wisentdir}/javat-wy.el)
+       (${cedetdir}/srecode/srt-wy.el): Use $<.
+
+       * unidata/Makefile.in (${top_srcdir}/src/macuvs.h): Make and load .elc.
+       (.el.elc): Replace with pattern rule.
+       (%.elc): New.
+       (unidata.txt): Use $<.
+       (compile): Remove.
+       (${DSTDIR}/charprop.el): Use order-only prereqs rather than a sub-make.
+
+       * unidata/uvs.el (uvs-print-table-ivd): Fix free variable typo.
+
+2014-06-21  Glenn Morris  <rgm@gnu.org>
 
        * unidata/BidiMirroring.txt: Update to 7.0.0 (only comment changes).
        * unidata/UnicodeData.txt: Update to 7.0.0.
        * unidata/IVD_Sequences.txt: Update to 2014-05-16 version.
 
-2014-06-16  Stephen Berman  <Stephen.Berman@gmx.net>
+2014-06-21  Stephen Berman  <Stephen.Berman@gmx.net>
 
        * notes/elpa: Use "git" instead of "bzr" in the name of machine to
        clone the repository from.
 
-2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
+2014-06-13  Glenn Morris  <rgm@gnu.org>
+
+       * unidata/Makefile.in (${DSTDIR}/charprop.el):
+       GNU make automatically passes command-line arguments to sub-makes.
+
+2014-06-02  Paul Eggert  <eggert@cs.ucla.edu>
 
        Include sources used to create macuvs.h.
        * unidata/IVD_Sequences.txt: New file.
        (uvs-print-table-ivd): Output a header in the form that
        unidata-gen.el generates.
 
-2014-05-26  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+2014-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
-       * mac/uvs.el: New file.  Generates ../src/macuvs.h.
+       * mac/uvs.el: New file from Mac port.  Generates src/macuvs.h.
 
-2014-05-11  Glenn Morris  <rgm@gnu.org>
+2014-05-17  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * find-gc.el: Move here from ../lisp/emacs-lisp.
+       Assume C99 or later (Bug#17487).
+       * merge-gnulib (GNULIB_MODULES): Remove stdarg, stdbool.
+       (GNULIB_TOOL_FLAGS): Avoid stdarg, stdbool.
+
+2014-05-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't require pkg-config when building from repository.
+       * merge-pkg-config: New script.
+       * notes/copyright: Update for m4/*.m4, in particular m4/pkg.m4.
+
+2014-05-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * merge-gnulib: Defer to autogen.sh for ACLOCAL_PATH computation.
+
+2014-05-12  Glenn Morris  <rgm@gnu.org>
 
-2014-05-10  Glenn Morris  <rgm@gnu.org>
+       * find-gc.el: Move here from ../lisp/emacs-lisp.
 
        * admin.el (set-version-in-file): Don't set identical version.
        (set-version): Provide default version number.
        (set-version, set-copyright): Give start/end messages.
 
-2014-04-17  Paul Eggert  <eggert@cs.ucla.edu>
+2014-04-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        * notes/bzr: Update instructions for merging from gnulib.
        Remove obsolete note about tramp.el and tramp-sh.el.
        Change "emacs-23" to "emacs-24".
 
+2014-04-11  Glenn Morris  <rgm@gnu.org>
+
+       * grammars/Makefile.in (EMACSDATA, EMACSDOC, EMACSPATH): Unexport.
+
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * quick-install-emacs (AVOID): Remove testfile and test-distrib.
+
+2014-03-21  Glenn Morris  <rgm@gnu.org>
+
+       * update_autogen: Auto-detect VCS in use.
+       (vcs): New variable.
+       (status, commit, main): Handle git.
+
 2014-03-07  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix oversight preventing lib/sys/types.h from being generated.
similarity index 100%
rename from lisp/emacs-lisp/authors.el
rename to admin/authors.el
index 827240a8d4ea94864d93b85886999420bf33b41f..c3ee2ef951f9fd446f9fc13a41db3f0b730abbbd 100644 (file)
@@ -28,6 +28,9 @@ srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 top_builddir = @top_builddir@
 
+# Prevent any settings in the user environment causing problems.
+unexport EMACSDATA EMACSDOC EMACSPATH
+
 EMACS = ${top_builddir}/src/emacs
 emacs = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp
 
@@ -63,39 +66,32 @@ bovine: ${BOVINE}
 
 wisent: ${WISENT}
 
-
-${bovinedir}/c-by.el: ${srcdir}/c.by
+## c-by.el, make-by.el.
+${bovinedir}/%-by.el: ${srcdir}/%.by
        [ ! -f "$@" ] || chmod +w "$@"
-       ${make_bovine} -o "$@" ${srcdir}/c.by
-
-${bovinedir}/make-by.el: ${srcdir}/make.by
-       [ ! -f "$@" ] || chmod +w "$@"
-       ${make_bovine} -o "$@" ${srcdir}/make.by
+       ${make_bovine} -o "$@" $<
 
 ${bovinedir}/scm-by.el: ${srcdir}/scheme.by
        [ ! -f "$@" ] || chmod +w "$@"
-       ${make_bovine} -o "$@" ${srcdir}/scheme.by
-
-
-${cedetdir}/semantic/grammar-wy.el: ${srcdir}/grammar.wy
-       [ ! -f "$@" ] || chmod +w "$@"
-       ${make_wisent} -o "$@" ${srcdir}/grammar.wy
+       ${make_bovine} -o "$@" $<
 
-${wisentdir}/javat-wy.el: ${srcdir}/java-tags.wy
+## grammar-wy.el
+${cedetdir}/semantic/%-wy.el: ${srcdir}/%.wy
        [ ! -f "$@" ] || chmod +w "$@"
-       ${make_wisent} -o "$@" ${srcdir}/java-tags.wy
+       ${make_wisent} -o "$@" $<
 
-${wisentdir}/js-wy.el: ${srcdir}/js.wy
+## js-wy.el, python-wy.el
+${wisentdir}/%-wy.el: ${srcdir}/%.wy
        [ ! -f "$@" ] || chmod +w "$@"
-       ${make_wisent} -o "$@" ${srcdir}/js.wy
+       ${make_wisent} -o "$@" $<
 
-${wisentdir}/python-wy.el: ${srcdir}/python.wy
+${wisentdir}/javat-wy.el: ${srcdir}/java-tags.wy
        [ ! -f "$@" ] || chmod +w "$@"
-       ${make_wisent} -o "$@" ${srcdir}/python.wy
+       ${make_wisent} -o "$@" $<
 
 ${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy
        [ ! -f "$@" ] || chmod +w "$@"
-       ${make_wisent} -o "$@" ${srcdir}/srecode-template.wy
+       ${make_wisent} -o "$@" $<
 
 
 .PHONY: distclean bootstrap-clean maintainer-clean extraclean
@@ -103,7 +99,10 @@ ${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy
 distclean:
        rm -f Makefile
 
-bootstrap-clean maintainer-clean: distclean
+## Perhaps this should do what extraclean (qv) does.
+bootstrap-clean:
+
+maintainer-clean: distclean
 
 ## We do not normally delete the generated files, even in bootstrap.
 ## Creating them does not take long, so we could easily change this.
index 6c0dffb6dcee7aff575d6f360dda9885a8114b05..a11b6e06d27fdb0340617c73fb8ac5441f0b851a 100755 (executable)
@@ -26,7 +26,7 @@
 GNULIB_URL=git://git.savannah.gnu.org/gnulib.git
 
 GNULIB_MODULES='
-  alloca-opt byteswap c-ctype c-strcase
+  alloca-opt binary-io byteswap c-ctype c-strcase
   careadlinkat close-stream count-one-bits count-trailing-zeros
   crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
   dtoastr dtotimespec dup2 environ execinfo faccessat
@@ -35,7 +35,7 @@ GNULIB_MODULES='
   intprops largefile lstat
   manywarnings memrchr mkostemp mktime
   pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat
-  sig2str socklen stat-time stdalign stdarg stdbool stdio
+  sig2str socklen stat-time stdalign stdio
   strftime strtoimax strtoumax symlink sys_stat
   sys_time time timer-time timespec-add timespec-sub
   unsetenv update-copyright utimens
@@ -49,6 +49,7 @@ GNULIB_TOOL_FLAGS='
   --avoid=open --avoid=openat-die --avoid=opendir
   --avoid=raise
   --avoid=save-cwd --avoid=select --avoid=sigprocmask
+  --avoid=stdarg --avoid=stdbool
   --avoid=threadlib
   --conditional-dependencies --import --no-changelog --no-vc-files
   --makefile-name=gnulib.mk
@@ -96,4 +97,5 @@ rm -- "$src"lib/gl_openssl.h "$src"m4/fcntl-o.m4 "$src"m4/gl-openssl.m4 \
       "$src"m4/gnulib-cache.m4"$src" m4/warn-on-use.m4 &&
 cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc &&
 cp -- "$gnulib_srcdir"/build-aux/move-if-change "$src"build-aux &&
-autoreconf -i -I m4 -- ${src:+"$src"}
+{ test -z "$src" || cd "$src"; } &&
+./autogen.sh
diff --git a/admin/merge-pkg-config b/admin/merge-pkg-config
new file mode 100755 (executable)
index 0000000..fd03a44
--- /dev/null
@@ -0,0 +1,63 @@
+#! /bin/sh
+# Merge pkg-config macros into Emacs sources.
+# Typical usage:
+#
+#      admin/merge-pkg-config
+
+# Copyright 2014 Free Software Foundation, Inc.
+
+# This file is part of GNU Emacs.
+
+# GNU Emacs is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+# written by Paul Eggert
+
+{
+  # Maybe ACLOCAL_PATH is already set-up.
+  oIFS=$IFS
+  IFS=:
+  for dir in $ACLOCAL_PATH ''; do
+    test -n "$dir" && test -r "$dir/pkg.m4" && break
+  done
+  IFS=$oIFS
+
+  test -n "$dir"
+} || {
+  # Use the pkg.m4 installed where aclocal knows about it.
+  # Maybe we are running our own aclocal, which doesn't know where
+  # the standard pkg.m4 is installed, so try running all the
+  # aclocal programs in our PATH.
+  oIFS=$IFS
+  IFS=:
+  for dir in $PATH ''; do
+    if test -n "$dir" && test -x "$dir/aclocal"; then
+      dir=$("$dir/aclocal" --print-ac-dir) && test -r "$dir/pkg.m4" && break
+    fi
+  done
+  IFS=$oIFS
+
+  test -n "$dir"
+} || {
+  echo >&2 "$0: cannot find pkg.m4"
+  exit 1
+}
+
+test -d m4 || {
+  echo >&2 "$0: please run this command in the main source directory"
+  exit 1
+}
+
+echo >&2 "$0: copying $dir/pkg.m4 to m4/pkg.m4"
+
+cp $dir/pkg.m4 m4
index a1ef8f64133f1b9994d825eafab1904390b861d3..13a3beb4ca832f1d098525f0895b396e93f9cf88 100644 (file)
@@ -388,3 +388,11 @@ and skipping the branch.  See:
  http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg00436.html
 
 which includes a provisional patch to git-remote-bzr to do that.
+
+** remote name
+
+Although Git itself is agnostic about what names you choose for
+the remote repo, it seems git-bzr is more likely to get confused.
+After the clone as described above, the remote name is "origin";
+changing it is Not Recommended.  [Insert 9-hour high-entropy then
+mysterious bug w/ JSON parsing errors anecdote here. --ttn]
index 1025cfc217fbee8a1489399c8d9aefd06286ece8..e8158060e7025ec2abaa2f1f2f549ec0e82a3b57 100644 (file)
@@ -1,3 +1,12 @@
+Emacs generally follows the GNU coding standards when it comes to ChangeLogs:
+http://www.gnu.org/prep/standards/html_node/Change-Logs.html
+
+One exception is that we still sometimes quote `like-this' (as the
+standards used to recommend) rather than 'like-this' (as they do now),
+because `...' is so widely used elsewhere in Emacs.
+http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00514.html
+
+
 If installing changes written by someone else, make the ChangeLog
 entry in their name, not yours.
 
index a54bcb6108bb82dcd5dd69221e79be3c7d705c05..ebef0633032d03a3d229bcd2c7ad808609de5074 100644 (file)
@@ -137,7 +137,10 @@ GNUstep/Emacs.base/Resources/Info-gnustep.plist
 aclocal.m4
 configure
 m4/*.m4
- - copyright FSF, with unlimited permission to copy, distribute and modify
+ - These files are copyright FSF, with unlimited permission to copy,
+   distribute and modify, so long as the copyright notice is preserved.
+   Exception: m4/pkg.m4 is copyright Scott James Remnant; it is
+   distributed under the same terms as for the rest of Emacs.
 
 lib/Makefile.in
  - copyright FSF, with MIT-like license
@@ -161,13 +164,6 @@ etc/letter.pbm,letter.xpm
 etc/FTP, ORDERS
   - trivial (at time of writing), no license needed
 
-etc/GNU, INTERVIEW, LINUX-GNU, MOTIVATION, SERVICE, THE-GNU-PROJECT,
-WHY-FREE
-  rms: "These are statements of opinion or testimony. Their licenses
-  should permit verbatim copying only. Please don't change the
-  licenses that they have. They are distributed with Emacs but they
-  are not part of Emacs."
-
 etc/HELLO
   standard notices. Just a note that although the file itself is not
   really copyrightable, in the wider context of it being part of
index cff619fd8b82d23b3abb6fb942bcf5f476d4ce0b..79e0e1d77e4657a9157a8ba9691adf24aa5d7303 100644 (file)
@@ -214,13 +214,6 @@ nontrivial changes to the build process.
 
        admin/charsets/mapfiles/cns2ucsdkw.txt
 
- * no-conversion
-
-     This file purposely contains arbitrary bytes interspersed within text,
-     to test whether the Emacs distribution is corrupted.
-
-       lib-src/testfile
-
  * iso-2022-7bit
 
      This file switches between CJK charsets, which is not encoded in UTF-8.
index f29d1cb377f330a0e42de86b527bc59067eefd35..5edc8d4d9adf06b677954bdd4bf0c128760bb7e9 100755 (executable)
@@ -30,7 +30,7 @@
 PUBLIC_LIBSRC_BINARIES='emacsclient etags ctags ebrowse'
 PUBLIC_LIBSRC_SCRIPTS='grep-changelog'
 
-AVOID="CVS -DIC README COPYING ChangeLog ~ [.]orig$ [.]rej$ Makefile$ Makefile.in$ makefile$ makefile.w32-in$ stamp-subdir [.]cvsignore [.]arch-ids [{]arch[}] [.][cho]$ make-docfile testfile test-distrib"
+AVOID="CVS -DIC README COPYING ChangeLog ~ [.]orig$ [.]rej$ Makefile$ Makefile.in$ makefile$ makefile.w32-in$ stamp-subdir [.]cvsignore [.]arch-ids [{]arch[}] [.][cho]$ make-docfile"
 
 # Prune old binaries lying around in the source tree
 PRUNE=no
index 3074864bb688fb5483a9371f1874b99ede2557b7..6b253ea565bc7b184cbeaff4b4edb224d0371e39 100644 (file)
@@ -35,24 +35,23 @@ emacs = "${EMACS}" -batch --no-site-file --no-site-lisp
 
 all: ${top_srcdir}/src/macuvs.h ${DSTDIR}/charprop.el
 
-${top_srcdir}/src/macuvs.h: ${srcdir}/uvs.el ${srcdir}/IVD_Sequences.txt
-       ${EMACS} -batch -l "${srcdir}/uvs.el" \
+## Specify .elc as an order-only prereq so as to not needlessly rebuild
+## target just because the .elc is missing.
+## Same with charprop.el below.
+${top_srcdir}/src/macuvs.h: ${srcdir}/uvs.el ${srcdir}/IVD_Sequences.txt | \
+  ${srcdir}/uvs.elc
+       ${emacs} -L ${srcdir} -l uvs \
          --eval '(uvs-print-table-ivd "${srcdir}/IVD_Sequences.txt" "Adobe-Japan1")' \
          > $@
 
-.el.elc:
+%.elc: %.el
        ${emacs} -f batch-byte-compile $<
 
 unidata.txt: ${srcdir}/UnicodeData.txt
-       sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < ${srcdir}/UnicodeData.txt > $@
+       sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < $< > $@
 
-compile: ${srcdir}/unidata-gen.elc
-
-## Depend on .el rather than .elc so as not to needlessly rebuild
-## uni-*.el files just because .elc is missing.
-## Same for UnicodeData.txt v unidata.txt.
-${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt
-       ${MAKE} ${MFLAGS} compile unidata.txt EMACS="${EMACS}"
+${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt | \
+  ${srcdir}/unidata-gen.elc unidata.txt
        -if [ -f "$@" ]; then \
          cd ${DSTDIR} && chmod +w charprop.el `sed -n 's/^;; FILE: //p' < charprop.el`; \
        fi
index 7559a5669744f5ffd1a34febbb572a4077f09780..4a17c7267124bb7b2c7d66c54fb7fab4e73b4395 100644 (file)
@@ -198,8 +198,8 @@ corresponding number."
   (let ((uvs-alist
         (with-temp-buffer
           (insert-file-contents filename)
-          (setq uvs-alist (uvs-alist-from-ivd collection-id
-                                              sequence-id-to-glyph-func)))))
+          (uvs-alist-from-ivd collection-id
+                              sequence-id-to-glyph-func))))
     (princ "/* Automatically generated by uvs.el.  */\n")
     (princ
      (format "static const unsigned char mac_uvs_table_%s_bytes[] =\n  {\n"
index b9511969a1503cf707dd0a3fbadca630071dafb4..ef0edfef50c0f6b6c74488be218ed892e387714d 100755 (executable)
@@ -47,6 +47,14 @@ cd $PD
 cd ../
 [ -d admin ] || die "Could not locate admin directory"
 
+if [ -d .bzr ]; then
+    vcs=bzr
+elif [ -d .git ]; then
+    vcs=git
+else
+    die "Cannot determine vcs"
+fi
+
 
 usage ()
 {
@@ -143,7 +151,10 @@ OPTIND=1
 ## Run status on inputs, list modified files on stdout.
 status ()
 {
-    bzr status -S "$@" >| $tempfile || die "bzr status error for $@"
+    local statflag="-S"
+    [ "$vcs" = "git" ] && statflag="-s"
+
+    $vcs status $statflag "$@" >| $tempfile || die "$vcs status error for $@"
 
     local stat file modified
 
@@ -217,8 +228,11 @@ commit ()
 
     echo "Committing..."
 
-    ## bzr status output is always relative to top-level, not PWD.
-    bzr commit -m "Auto-commit of $type files." "$@" || return $?
+    $vcs commit -m "Auto-commit of $type files." "$@" || return $?
+
+    [ "$vcs" = "git" ] && {
+        $vcs push || return $?
+    }
 
     echo "Committed files: $@"
 }                               # function commit
@@ -257,7 +271,7 @@ EOF
                 *-xtra.texi|*efaq-w32.texi) continue ;;
             esac
 
-            dircat=`sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file`
+            dircat=$(sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file)
 
             ## TODO warn about unknown topics (check-info in top-level
             ## Makefile does this).
@@ -291,7 +305,8 @@ EOF
 
     modified=$(status $basegen) || die
 
-    cd $oldpwd
+    ## bzr status output is always relative to top-level, not PWD.
+    [ "$vcs" = "bzr" ] && cd $oldpwd
 
     commit "generated" $modified || die "commit error"
 
@@ -307,15 +322,20 @@ EOF
 
 echo "Finding loaddef targets..."
 
-sed -n -e '/^AUTOGEN_VCS/,/^$/p' lisp/Makefile.in | \
-    sed -e '/AUTOGEN_VCS/d' -e '/^$/d' -e 's/\\//' \
-    >| $tempfile || die "sed error"
+find lisp -name '*.el' -exec grep '^;.*generated-autoload-file:' {} + | \
+    sed -e '/loaddefs\|esh-groups/d' -e 's|/[^/]*: "|/|' -e 's/"//g' \
+    >| $tempfile || die "Error finding targets"
 
 genfiles=
 
 while read genfile; do
 
-    [ -r lisp/$genfile ] || die "Unable to read $genfile"
+    ## Or we can just use sort -u when making tempfile...
+    case " $genfiles " in
+        *" $genfile "*) continue ;;
+    esac
+
+    [ -r $genfile ] || die "Unable to read $genfile"
 
     genfiles="$genfiles $genfile"
 done < $tempfile
@@ -354,17 +374,12 @@ make -C lisp "$@" autoloads EMACS=../src/bootstrap-emacs || die "make src error"
     cp $ldefs_in $ldefs_out || die "cp ldefs_boot error"
 
 
-cd lisp
-
 echo "Checking status of loaddef files..."
 
 ## It probably would be fine to just check+commit lisp/, since
 ## making autoloads should not effect any other files.  But better
 ## safe than sorry.
-modified=$(status $genfiles ${ldefs_out#lisp/}) || die
-
-
-cd ../
+modified=$(status $genfiles $ldefs_out) || die
 
 
 commit "loaddefs" $modified || die "commit error"
index 6b7c647c4c56ff81aa98c2f0cdb03ddf9e6978de..48e6d19c69d6d6aec6aea0ee1368762c0450f41e 100755 (executable)
@@ -50,7 +50,7 @@ automake_min=`sed -n 's/^ *AM_INIT_AUTOMAKE(\([0-9\.]*\)).*/\1/p' configure.ac`
 get_version ()
 {
     ## Remove eg "./autogen.sh: line 50: autoconf: command not found".
-    $1 --version 2>&1 | sed -e '/not found/d' -n -e '1 s/.* \([1-9][0-9\.]*\).*/\1/p'
+    $1 --version 2>&1 | sed -e '/not found/d' -e 's/.* //' -n -e '1 s/\([0-9][0-9\.]*\).*/\1/p'
 }
 
 ## $1 = version string, eg "2.59"
@@ -76,7 +76,7 @@ minor_version ()
 check_version ()
 {
     ## Respect eg $AUTOMAKE if it is set, like autoreconf does.
-    uprog=`echo $1 | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+    uprog=`echo $1 | sed -e 's/-/_/g' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
 
     eval uprog=\$${uprog}
 
@@ -114,7 +114,9 @@ missing=
 
 for prog in $progs; do
 
-    eval min=\$${prog}_min
+    sprog=`echo "$prog" | sed 's/-/_/g'`
+
+    eval min=\$${sprog}_min
 
     echo "Checking for $prog (need at least version $min)..."
 
@@ -133,7 +135,7 @@ for prog in $progs; do
 
     if [ $retval -ne 0 ]; then
         missing="$missing $prog"
-        eval ${prog}_why=\""$stat"\"
+        eval ${sprog}_why=\""$stat"\"
     fi
 
 done
@@ -147,7 +149,9 @@ Building Emacs from Bzr requires the following specialized programs:
 EOF
 
     for prog in $progs; do
-        eval min=\$${prog}_min
+        sprog=`echo "$prog" | sed 's/-/_/g'`
+
+        eval min=\$${sprog}_min
 
         echo "$prog (minimum version $min)"
     done
@@ -159,7 +163,9 @@ Your system seems to be missing the following tool(s):
 EOF
 
     for prog in $missing; do
-        eval why=\$${prog}_why
+        sprog=`echo "$prog" | sed 's/-/_/g'`
+
+        eval why=\$${sprog}_why
 
         echo "$prog ($why)"
     done
@@ -188,7 +194,7 @@ this script.
 If you know that the required versions are in your PATH, but this
 script has made an error, then you can simply run
 
-autoreconf -i -I m4
+autoreconf -fi -I m4
 
 instead of this script.
 
@@ -198,17 +204,19 @@ EOF
     exit 1
 fi
 
-echo "Your system has the required tools, running autoreconf..."
+echo 'Your system has the required tools.'
+echo "Running 'autoreconf -fi -I m4' ..."
 
 
 ## Let autoreconf figure out what, if anything, needs doing.
-autoreconf -i -I m4 || exit $?
+## Use autoreconf's -f option in case autoreconf itself has changed.
+autoreconf -fi -I m4 || exit $?
 
 ## Create a timestamp, so that './autogen.sh; make' doesn't
 ## cause 'make' to needlessly run 'autoheader'.
 echo timestamp > src/stamp-h.in || exit
 
-echo "You can now run \`./configure'."
+echo "You can now run './configure'."
 
 exit 0
 
index 8e74f799ec92e0f5edae5171bd38617dfde8df98..4f3fde56af282d323613a774123ead76ee7878a1 100644 (file)
@@ -22,23 +22,8 @@ dnl  You should have received a copy of the GNU General Public License
 dnl  along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ(2.65)
-AC_INIT(emacs, 24.3.92)
-
-dnl We get MINGW64 with MSYS2
-if test "x$MSYSTEM" = "xMINGW32" -o "x$MSYSTEM" = "xMINGW64"
-then
-  . $srcdir/nt/mingw-cfg.site
-
-  case $srcdir in
-    /* | ?:*)
-      # srcdir is an absolute path.  In this case, force the format
-      # "/c/foo/bar", to simplify later conversions to native Windows
-      # format ("c:/foo/bar")
-      srcdir=`cd "${srcdir}" && pwd -W`
-      srcdir="/${srcdir:0:1}${srcdir:2}"
-      ;;
-  esac
-fi
+dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el.
+AC_INIT(GNU Emacs, 24.4.50, bug-gnu-emacs@gnu.org)
 
 dnl Set emacs_config_options to the options of 'configure', quoted for the shell,
 dnl and then quoted again for a C string.  Separate options with spaces.
@@ -82,13 +67,16 @@ done
 AC_CONFIG_HEADERS(src/config.h:src/config.in)
 AC_CONFIG_SRCDIR(src/lisp.h)
 AC_CONFIG_AUX_DIR(build-aux)
+dnl automake 1.13 and later understand this, making -I m4 unnecessary.
+dnl With older versions this is a no-op.
+AC_CONFIG_MACRO_DIR(m4)
 
 xcsdkdir=
 AC_CHECK_PROGS(XCRUN, [xcrun])
 if test -n "$XCRUN"; then
   if test -z "$MAKE"; then
     dnl Call the variable MAKE_PROG, not MAKE, to avoid confusion with
-    dnl SET_MAKE and with the usual MAKE variable that 'make' itself uses.
+    dnl the usual MAKE variable that 'make' itself uses.
     AC_CHECK_PROG([MAKE_PROG], [make], [yes])
     if test -z "$MAKE_PROG"; then
       MAKE="$XCRUN MAKE"
@@ -98,9 +86,75 @@ if test -n "$XCRUN"; then
   fi
 fi
 
+dnl GNU Make is required, so don't test for its individual features.
+am_cv_make_support_nested_variables=yes
+AC_DEFUN([AC_PROG_MAKE_SET],
+  [SET_MAKE=
+   AC_SUBST([SET_MAKE])])
+
+dnl Check for GNU Make and possibly set MAKE before running AM_INIT_AUTOMAKE.
+[emacs_check_gnu_make ()
+{
+  emacs_makeout=`($1 --version) 2>/dev/null` &&
+  case $emacs_makeout in
+    'GNU Make '3.8[1-9]* | 'GNU Make '3.9[0-9]* | \
+    'GNU Make '3.[1-9][0-9][0-9]* | 'GNU Make '[4-9]* | 'GNU Make '[1-9][0-9]* )
+       ac_path_MAKE_found=:;;
+  esac
+}]
+AC_CACHE_CHECK([for GNU Make], [ac_cv_path_MAKE],
+  [ac_path_MAKE_found=false
+   if test -n "$MAKE"; then
+     emacs_check_gnu_make "$MAKE"
+     ac_cv_path_MAKE=$MAKE
+   else
+     emacs_tried_make=false
+     emacs_tried_gmake=false
+     emacs_tried_gnumake=false
+     AC_PATH_PROGS_FEATURE_CHECK([MAKE], [make gmake gnumake],
+       [[emacs_check_gnu_make "$ac_path_MAKE"
+        if $ac_path_MAKE_found; then
+          # Use the fully-qualified program name only if the basename
+          # would not resolve to it.
+          if eval \$emacs_tried_$ac_prog; then
+            ac_cv_path_MAKE=$ac_path_MAKE
+          else
+            ac_cv_path_MAKE=$ac_prog
+          fi
+        fi
+        eval emacs_tried_$ac_prog=:]])
+   fi])
+$ac_path_MAKE_found || {
+AC_MSG_ERROR([[Building Emacs requires GNU Make, at least version 3.81.
+If you have it installed under another name, configure with 'MAKE=...'.
+For example, run '$0 MAKE=gnu-make'.]])
+}
+MAKE=$ac_cv_path_MAKE
+
 dnl Fairly arbitrary, older versions might work too.
 AM_INIT_AUTOMAKE(1.11)
 
+dnl Canonicalize the configuration name.
+AC_CANONICAL_HOST
+canonical=$host
+configuration=${host_alias-${build_alias-$host}}
+
+dnl We get MINGW64 with MSYS2.
+case $canonical in
+ *-mingw*)
+  . $srcdir/nt/mingw-cfg.site
+
+  case $srcdir in
+    /* | ?:*)
+      # srcdir is an absolute path.  In this case, force the format
+      # "/c/foo/bar", to simplify later conversions to native Windows
+      # format ("c:/foo/bar").
+      srcdir=`cd "${srcdir}" && pwd -W`
+      srcdir="/${srcdir:0:1}${srcdir:2}"
+      ;;
+  esac;;
+esac
+
 dnl Support for --program-prefix, --program-suffix and
 dnl --program-transform-name options
 AC_ARG_PROGRAM
@@ -293,6 +347,9 @@ otherwise for the first of `gfile' or `inotify' that is usable.])
 dnl http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01844.html
 OPTION_DEFAULT_ON([makeinfo],[don't require makeinfo for building manuals])
 
+## This might be a 'configure' arg.
+AC_SUBST([ACLOCAL_PATH])
+
 ## Makefile.in needs the cache file name.
 AC_SUBST(cache_file)
 
@@ -302,15 +359,6 @@ OPTION_DEFAULT_ON([compress-install],
   [don't compress some files (.el, .info, etc.) when installing.  Equivalent to:
 make GZIP_PROG= install])
 
-AC_ARG_WITH([pkg-config-prog],dnl
-[AS_HELP_STRING([--with-pkg-config-prog=FILENAME],
-                  [file name of pkg-config for finding GTK and librsvg])])
-if test "X${with_pkg_config_prog}" != X; then
-   if test "${with_pkg_config_prog}" != yes; then
-      PKG_CONFIG="${with_pkg_config_prog}"
-   fi
-fi
-
 AC_ARG_WITH(gameuser,dnl
 [AS_HELP_STRING([--with-gameuser=USER],[user for shared game score files])])
 test "X${with_gameuser}" != X && test "${with_gameuser}" != yes \
@@ -442,8 +490,7 @@ AC_SUBST(PROFILING_CFLAGS)
 AC_ARG_ENABLE(autodepend,
 [AS_HELP_STRING([--enable-autodepend],
                [automatically generate dependencies to .h-files.
-                Requires GNU Make and Gcc. Enabled if GNU Make and Gcc is
-                found])],
+                Requires gcc, enabled if found.])],
 [ac_enable_autodepend="${enableval}"],[ac_enable_autodepend=yes])
 
 AC_ARG_ENABLE(gtk-deprecation-warnings,
@@ -451,12 +498,6 @@ AC_ARG_ENABLE(gtk-deprecation-warnings,
                [Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0])],
 [ac_enable_gtk_deprecation_warnings="${enableval}"],[])
 
-### Canonicalize the configuration name.
-
-AC_CANONICAL_HOST
-canonical=$host
-configuration=${host_alias-${build_alias-$host}}
-
 dnl This used to use changequote, but, apart from `changequote is evil'
 dnl per the autoconf manual, we can speed up autoconf somewhat by quoting
 dnl the great gob of text.  Thus it's not processed for possible expansion.
@@ -580,10 +621,13 @@ case "${canonical}" in
                opsys=sol2-10
                emacs_check_sunpro_c=yes
                ;;
+      *-sunos5.[1-5]* | *-solaris2.[1-5]* ) unported=yes ;;
+      ## Note that Emacs 23.1's NEWS said the following would be dropped.
       *-sunos5.6* | *-solaris2.6* )
                opsys=sol2-6
                RANLIB="ar -ts"
                ;;
+      ## 5.7 EOL Aug 2008, 5.8 EOL Mar 2012.
       *-sunos5.[7-9]* | *-solaris2.[7-9]* )
                opsys=sol2-6
                emacs_check_sunpro_c=yes
@@ -655,13 +699,16 @@ dnl quotation ends
 
 if test $unported = yes; then
   AC_MSG_ERROR([Emacs does not support `${canonical}' systems.
-If you think it should, please send a report to bug-gnu-emacs@gnu.org.
+If you think it should, please send a report to ${PACKAGE_BUGREPORT}.
 Check `etc/MACHINES' for recognized configuration names.])
 fi
 
 
 #### Choose a compiler.
 
+dnl Don't bother to test for C89.
+AC_DEFUN([_AC_PROG_CC_C89], [$2])
+
 dnl Sets GCC=yes if using gcc.
 AC_PROG_CC([gcc cc cl clang "$XCRUN gcc" "$XCRUN clang"])
 if test -n "$XCRUN"; then
@@ -669,6 +716,9 @@ if test -n "$XCRUN"; then
   test -n "$AR" && export AR
 fi
 
+dnl Emacs needs C99 or later.
+gl_PROG_CC_C99
+
 AM_PROG_CC_C_O
 
 if test x$GCC = xyes; then
@@ -687,8 +737,6 @@ AC_DEFUN([gl_CRYPTO_CHECK])
 # Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
 # as we don't use them.
 AC_DEFUN([gl_FCNTL_O_FLAGS])
-# Avoid gnulib's threadlib module, as we do threads our own way.
-AC_DEFUN([gl_THREADLIB])
 
 # Initialize gnulib right after choosing the compiler.
 dnl Amongst other things, this sets AR and ARFLAGS.
@@ -754,41 +802,6 @@ AC_ARG_ENABLE([gcc-warnings],
   [gl_gcc_warnings=no]
 )
 
-AC_ARG_ENABLE(link-time-optimization,
-[AS_HELP_STRING([--enable-link-time-optimization],
-                [build emacs with link-time optimization.
-                This requires GCC 4.5.0 or later.
-                It also makes Emacs harder to debug, and when we tried it
-                with GCC 4.9.0 x86-64 it made Emacs slower, so it's not
-                recommended for typical use.])],
-if test "${enableval}" != "no"; then
-   AC_MSG_CHECKING([whether link-time optimization is supported])
-   ac_lto_supported=no
-   if test x$GCC = xyes; then
-      CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
-      if test x$CPUS != x; then
-        LTO="-flto=$CPUS"
-      else
-        LTO="-flto"
-      fi
-      old_CFLAGS=$CFLAGS
-      CFLAGS="$CFLAGS $LTO"
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
-       [ac_lto_supported=yes], [ac_lto_supported=no])
-      CFLAGS="$old_CFLAGS"
-   fi
-   AC_MSG_RESULT([$ac_lto_supported])
-   if test "$ac_lto_supported" = "yes"; then
-      CFLAGS="$CFLAGS $LTO"
-      dnl The following is needed for GCC 4.9.0.  The GCC 4.9.0 release notes
-      dnl suggest that instead of -ffat-lto-objects we should use gcc-ar and
-      dnl gcc-ranlib in place of ar and ranlib, but gcc-ar makes /usr/bin/ar
-      dnl dump core on Fedora 20, so play it safe for now.
-      gl_COMPILER_OPTION_IF([-ffat-lto-objects],
-       [CFLAGS="$CFLAGS -ffat-lto-objects"])
-   fi
-fi)
-
 # clang is unduly picky about some things.
 AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
   [AC_COMPILE_IFELSE(
@@ -869,6 +882,7 @@ else
   for w in $ws; do
     gl_WARN_ADD([$w])
   done
+  gl_WARN_ADD([-Wredundant-decls])     # Prefer this, as we don't use Bison.
   gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
   gl_WARN_ADD([-Wno-sign-compare])     # Too many warnings for now
   gl_WARN_ADD([-Wno-type-limits])      # Too many warnings for now
@@ -914,6 +928,61 @@ edit_cflags="
   s/^ //
 "
 
+AC_ARG_ENABLE(link-time-optimization,
+[AS_HELP_STRING([--enable-link-time-optimization],
+                [build emacs with link-time optimization.
+                This requires GCC 4.5.0 or later, or clang.
+                (Note that clang support is experimental - see INSTALL.)
+                It also makes Emacs harder to debug, and when we tried it
+                with GCC 4.9.0 x86-64 it made Emacs slower, so it's not
+                recommended for typical use.])],
+if test "${enableval}" != "no"; then
+   ac_lto_supported=no
+   if test $emacs_cv_clang = yes; then
+      AC_MSG_CHECKING([whether link-time optimization is supported by clang])
+      GOLD_PLUGIN=`$CC -print-file-name=LLVMgold.so 2>/dev/null`
+      if test -x "$GOLD_PLUGIN"; then
+        LTO="-flto"
+      fi
+   elif test x$GCC = xyes; then
+      AC_MSG_CHECKING([whether link-time optimization is supported by gcc])
+      CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
+      if test x$CPUS != x; then
+        LTO="-flto=$CPUS"
+      else
+        LTO="-flto"
+      fi
+   else
+      AC_MSG_ERROR([Link-time optimization is not supported with your compiler.])
+   fi
+   if test -z "$LTO"; then
+      ac_lto_supported=no
+   else
+      old_CFLAGS=$CFLAGS
+      CFLAGS="$CFLAGS $LTO"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+         [ac_lto_supported=yes], [ac_lto_supported=no])
+         CFLAGS="$old_CFLAGS"
+   fi
+   AC_MSG_RESULT([$ac_lto_supported])
+   if test "$ac_lto_supported" = "yes"; then
+      CFLAGS="$CFLAGS $LTO"
+      if test x$emacs_cv_clang = xyes; then
+        AC_MSG_WARN([Please read INSTALL before using link-time optimization with clang])
+        # WARNING: 'ar --plugin ...' doesn't work without
+        # command, so plugin name is appended to ARFLAGS.
+        ARFLAGS="cru --plugin $GOLD_PLUGIN"
+        RANLIB="$RANLIB --plugin $GOLD_PLUGIN"
+      else
+        dnl The following is needed for GCC 4.9.0.  The GCC 4.9.0 release notes
+        dnl suggest that instead of -ffat-lto-objects we should use gcc-ar and
+        dnl gcc-ranlib in place of ar and ranlib, but gcc-ar makes /usr/bin/ar
+        dnl dump core on Fedora 20, so play it safe for now.
+        gl_COMPILER_OPTION_IF([-ffat-lto-objects],
+          [CFLAGS="$CFLAGS -ffat-lto-objects"])
+      fi
+   fi
+fi)
 
 dnl Some other nice autoconf tests.
 dnl These are commented out, since gl_EARLY and/or Autoconf already does them.
@@ -1058,12 +1127,6 @@ with the `--without-makeinfo' option to build without the manuals.] )
 fi
 AC_SUBST(HAVE_MAKEINFO)
 
-dnl Just so that there is only a single place we need to edit.
-INFO_EXT=.info
-INFO_OPTS=--no-split
-AC_SUBST(INFO_EXT)
-AC_SUBST(INFO_OPTS)
-
 if test $opsys = mingw32; then
    DOCMISC_W32=efaq-w32
 else
@@ -1294,13 +1357,22 @@ else
   CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS"
 fi
 
-# Suppress obsolescent Autoconf test for size_t; Emacs assumes C89 or better.
+# Suppress obsolescent Autoconf test for size_t; Emacs assumes C99 or better.
 AC_DEFUN([AC_TYPE_SIZE_T])
 # Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
 AC_DEFUN([AC_TYPE_UID_T])
 
+# sqrt and other floating-point functions such as fmod and frexp
+# are found in -lm on many systems.
+OLD_LIBS=$LIBS
+AC_SEARCH_LIBS([sqrt], [m])
+if test "X$LIBS" = "X$OLD_LIBS"; then
+  LIB_MATH=
+else
+  LIB_MATH=$ac_cv_search_sqrt
+fi
+LIBS=$OLD_LIBS
 
-LIB_MATH=-lm
 dnl Current possibilities handled by sed (aix4-2 -> aix,
 dnl gnu-linux -> gnu/linux, etc.):
 dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix.
@@ -1345,55 +1417,20 @@ AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE",
 pre_PKG_CONFIG_CFLAGS=$CFLAGS
 pre_PKG_CONFIG_LIBS=$LIBS
 
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-
-dnl This function definition taken from Gnome 2.0
-dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
-dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
-dnl also defines GSTUFF_PKG_ERRORS on error
-AC_DEFUN([PKG_CHECK_MODULES], [
-  succeeded=no
-
-  if test "$PKG_CONFIG" = "no" ; then
-     ifelse([$4], , [AC_MSG_ERROR([
-      *** The pkg-config script could not be found. Make sure it is in your path, or give the full name of pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog.  Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.])], [$4])
-  else
-     PKG_CONFIG_MIN_VERSION=0.9.0
-     if "$PKG_CONFIG" --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        AC_MSG_CHECKING(for $2)
-
-        if "$PKG_CONFIG" --exists "$2" 2>&AS_MESSAGE_LOG_FD &&
-          $1_CFLAGS=`"$PKG_CONFIG" --cflags "$2" 2>&AS_MESSAGE_LOG_FD` &&
-          $1_LIBS=`"$PKG_CONFIG" --libs "$2" 2>&AS_MESSAGE_LOG_FD`; then
-           $1_CFLAGS=`AS_ECHO(["$$1_CFLAGS"]) | sed -e "$edit_cflags"`
-           $1_LIBS=`AS_ECHO(["$$1_LIBS"]) | sed -e 's,///*,/,g'`
-            AC_MSG_RESULT([yes CFLAGS='$$1_CFLAGS' LIBS='$$1_LIBS'])
-            succeeded=yes
-        else
-            AC_MSG_RESULT(no)
-            $1_CFLAGS=""
-            $1_LIBS=""
-            ## If we have a custom action on failure, don't print errors, but
-           ## do set a variable so people can do so.  Do it in a subshell
-           ## to capture any diagnostics in invoking pkg-config.
-           $1_PKG_ERRORS=`("$PKG_CONFIG" --print-errors "$2") 2>&1`
-           ifelse([$4], ,echo "$$1_PKG_ERRORS",)
-        fi
-
-        AC_SUBST($1_CFLAGS)
-        AC_SUBST($1_LIBS)
-     else
-        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
-        echo "*** See http://www.freedesktop.org/software/pkgconfig"
-     fi
-  fi
-
-  if test $succeeded = yes; then
-     ifelse([$3], , :, [$3])
-  else
-     ifelse([$4], , [AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4])
-  fi
-])
+PKG_PROG_PKG_CONFIG(0.9.0)
+
+dnl EMACS_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4)
+dnl acts like PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4,
+dnl HAVE_GSTUFF=yes, HAVE_GSTUFF=no) -- see pkg-config man page --
+dnl except that it postprocesses CFLAGS as needed for --enable-gcc-warnings.
+dnl EMACS_CHECK_MODULES accepts optional 3rd and 4th arguments that
+dnl can take the place of the default HAVE_GSTUFF=yes and HAVE_GSTUFF=no
+dnl actions.
+AC_DEFUN([EMACS_CHECK_MODULES],
+  [PKG_CHECK_MODULES([$1], [$2],
+     [$1_CFLAGS=`AS_ECHO(["$$1_CFLAGS"]) | sed -e "$edit_cflags"`
+      m4_default([$3], [HAVE_$1=yes])],
+     [m4_default([$4], [HAVE_$1=no])])])
 
 HAVE_SOUND=no
 if test "${with_sound}" != "no"; then
@@ -1421,7 +1458,7 @@ if test "${with_sound}" != "no"; then
   if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then
     ALSA_REQUIRED=1.0.0
     ALSA_MODULES="alsa >= $ALSA_REQUIRED"
-    PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
+    EMACS_CHECK_MODULES([ALSA], [$ALSA_MODULES])
     if test $HAVE_ALSA = yes; then
       SAVE_CFLAGS="$CFLAGS"
       SAVE_LIBS="$LIBS"
@@ -1473,6 +1510,7 @@ fi
 dnl checks for header files
 AC_CHECK_HEADERS_ONCE(
   sys/systeminfo.h
+  sys/sysinfo.h
   coff.h pty.h
   sys/resource.h
   sys/utsname.h pwd.h utmp.h util.h)
@@ -1488,6 +1526,21 @@ if test $emacs_cv_personality_linux32 = yes; then
             [Define to 1 if personality LINUX32 can be set.])
 fi
 
+if test "$ac_cv_header_sys_sysinfo_h" = yes; then
+  AC_MSG_CHECKING([if Linux sysinfo may be used])
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]],
+                                     [[struct sysinfo si; sysinfo (&si)]])],
+    emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no)
+  AC_MSG_RESULT($emacs_cv_linux_sysinfo)
+  if test $emacs_cv_linux_sysinfo = yes; then
+    AC_DEFINE([HAVE_LINUX_SYSINFO], 1, [Define to 1 if you have Linux sysinfo function.])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/sysinfo.h>]],
+                                       [[struct sysinfo si; return si.mem_unit]])],
+      AC_DEFINE(LINUX_SYSINFO_UNIT, 1,
+                [Define to 1 if Linux sysinfo sizes are in multiples of mem_unit bytes.]))
+  fi
+fi
+
 dnl On Solaris 8 there's a compilation warning for term.h because
 dnl it doesn't define `bool'.
 AC_CHECK_HEADERS(term.h, , , -)
@@ -1532,32 +1585,20 @@ dnl Check for endianness.
 dnl AC_C_BIGENDIAN is done by gnulib.
 
 dnl check for Make feature
-dnl AC_PROG_MAKE_SET is done by Automake.
 
 DEPFLAGS=
 MKDEPDIR=":"
 deps_frag=deps.mk
-dnl check for GNU Make if we have GCC and autodepend is on.
+dnl check if we have GCC and autodepend is on.
 if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
-   AC_MSG_CHECKING([whether we are using GNU Make])
-   HAVE_GNU_MAKE=no
-   testval=`${MAKE-make} --version 2>/dev/null | grep 'GNU Make'`
-   if test "x$testval" != x; then
-      HAVE_GNU_MAKE=yes
-   else
-      ac_enable_autodepend=no
-   fi
-   AC_MSG_RESULT([$HAVE_GNU_MAKE])
-   if test $HAVE_GNU_MAKE = yes; then
-      AC_MSG_CHECKING([whether gcc understands -MMD -MF])
-      SAVE_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -MMD -MF deps.d -MP"
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no)
-      CFLAGS="$SAVE_CFLAGS"
-      test -f deps.d || ac_enable_autodepend=no
-      rm -rf deps.d
-      AC_MSG_RESULT([$ac_enable_autodepend])
-   fi
+   AC_MSG_CHECKING([whether gcc understands -MMD -MF])
+   SAVE_CFLAGS="$CFLAGS"
+   CFLAGS="$CFLAGS -MMD -MF deps.d -MP"
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no)
+   CFLAGS="$SAVE_CFLAGS"
+   test -f deps.d || ac_enable_autodepend=no
+   rm -rf deps.d
+   AC_MSG_RESULT([$ac_enable_autodepend])
    if test $ac_enable_autodepend = yes; then
       DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d -MP'
       ## MKDIR_P is documented (see AC_PROG_MKDIR_P) to be parallel-safe.
@@ -1565,11 +1606,14 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
       deps_frag=autodeps.mk
    fi
 fi
+lwlib_deps_frag=$srcdir/lwlib/$deps_frag
+oldxmenu_deps_frag=$srcdir/oldXMenu/$deps_frag
 deps_frag=$srcdir/src/$deps_frag
 AC_SUBST(MKDEPDIR)
 AC_SUBST(DEPFLAGS)
 AC_SUBST_FILE(deps_frag)
-
+AC_SUBST_FILE(lwlib_deps_frag)
+AC_SUBST_FILE(oldxmenu_deps_frag)
 
 lisp_frag=$srcdir/src/lisp.mk
 AC_SUBST_FILE(lisp_frag)
@@ -1986,7 +2030,7 @@ doug_lea_malloc=$emacs_cv_var_doug_lea_malloc
 system_malloc=$emacs_cv_sanitize_address
 case "$opsys" in
   ## darwin ld insists on the use of malloc routines in the System framework.
-  darwin|sol2-10) system_malloc=yes ;;
+  darwin|mingw32|sol2-10) system_malloc=yes ;;
 esac
 
 GMALLOC_OBJ=
@@ -2033,7 +2077,7 @@ if test "$doug_lea_malloc" = "yes" ; then
   ## #ifdef DOUG_LEA_MALLOC; #undef REL_ALLOC; #endif
   ## Does the AC_FUNC_MMAP test below make this check unnecessary?
   case "$opsys" in
-    gnu*) REL_ALLOC=no ;;
+    mingw32|gnu*) REL_ALLOC=no ;;
   esac
 fi
 
@@ -2043,7 +2087,7 @@ fi
 
 use_mmap_for_buffers=no
 case "$opsys" in
-  cygwin|freebsd|irix6-5) use_mmap_for_buffers=yes ;;
+  cygwin|mingw32|freebsd|irix6-5) use_mmap_for_buffers=yes ;;
 esac
 
 AC_FUNC_MMAP
@@ -2054,64 +2098,44 @@ fi
 
 LIBS="$LIBS_SYSTEM $LIBS"
 
-dnl If found, this adds -ldnet to LIBS, which Autoconf uses for checks.
-AC_CHECK_LIB(dnet, dnet_ntoa)
-dnl This causes -lresolv to get used in subsequent tests,
-dnl which causes failures on some systems such as HPUX 9.
-dnl AC_CHECK_LIB(resolv, gethostbyname)
-
 dnl FIXME replace main with a function we actually want from this library.
 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
 
-dnl Check if pthreads is available.
+dnl Check for the POSIX thread library.
 LIB_PTHREAD=
+if test "$opsys" != "mingw32"; then
 AC_CHECK_HEADERS_ONCE(pthread.h)
 if test "$ac_cv_header_pthread_h"; then
   dnl gmalloc.c uses pthread_atfork, which is not available on older-style
   dnl hosts such as MirBSD 10, so test for pthread_atfork instead of merely
-  dnl testing for pthread_self if Emacs uses gmalloc.c.
+  dnl testing for pthread_kill if Emacs uses gmalloc.c.
   if test "$GMALLOC_OBJ" = gmalloc.o; then
     emacs_pthread_function=pthread_atfork
   else
-    emacs_pthread_function=pthread_self
+    emacs_pthread_function=pthread_kill
   fi
-  AC_CHECK_LIB(pthread, $emacs_pthread_function, HAVE_PTHREAD=yes)
-fi
-if test "$HAVE_PTHREAD" = yes; then
-  case "${canonical}" in
-    *-hpux*) ;;
-    *) LIB_PTHREAD="-lpthread"
-       LIBS="$LIB_PTHREAD $LIBS" ;;
-  esac
-  AC_DEFINE(HAVE_PTHREAD, 1, [Define to 1 if you have pthread (-lpthread).])
-
-  # Some systems optimize for single-threaded programs by default, and
-  # need special flags to disable these optimizations. For example, the
-  # definition of 'errno' in <errno.h>.
-  case $opsys in
-    sol*)
-      AC_DEFINE([_REENTRANT], 1,
-       [Define to 1 if your system requires this in multithreaded code.]);;
-    aix4-2)
-      AC_DEFINE([_THREAD_SAFE], 1,
-       [Define to 1 if your system requires this in multithreaded code.]);;
-  esac
+  OLD_LIBS=$LIBS
+  AC_SEARCH_LIBS([$emacs_pthread_function], [pthread],
+    [AC_DEFINE([HAVE_PTHREAD], [1],
+       [Define to 1 if you have pthread (-lpthread).])
+     # Some systems optimize for single-threaded programs by default, and
+     # need special flags to disable these optimizations. For example, the
+     # definition of 'errno' in <errno.h>.
+     case $opsys in
+       sol*)
+         AC_DEFINE([_REENTRANT], 1,
+       [Define to 1 if your system requires this in multithreaded code.]);;
+       aix4-2)
+         AC_DEFINE([_THREAD_SAFE], 1,
+       [Define to 1 if your system requires this in multithreaded code.]);;
+     esac])
+ if test "X$LIBS" != "X$OLD_LIBS"; then
+    eval LIB_PTHREAD=\$ac_cv_search_$emacs_pthread_function
+  fi
+  LIBS=$OLD_LIBS
 fi
 AC_SUBST([LIB_PTHREAD])
-
-AC_CHECK_LIB(pthreads, cma_open)
-
-## Note: when using cpp in s/aix4.2.h, this definition depended on
-## HAVE_LIBPTHREADS.  That was not defined earlier in configure when
-## the system file was sourced.  Hence the value of LIBS_SYSTEM
-## added to LIBS in configure would never contain the pthreads part,
-## but the value used in Makefiles might.  FIXME?
-##
-## -lpthreads seems to be necessary for Xlib in X11R6, and should
-## be harmless on older versions of X where it happens to exist.
-test "$opsys" = "aix4-2" && \
-  test $ac_cv_lib_pthreads_cma_open = yes && \
-  LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads"
+fi
 
 dnl Check for need for bigtoc support on IBM AIX
 
@@ -2129,12 +2153,12 @@ aix*)
   ;;
 esac
 
-# Change CFLAGS and CPPFLAGS temporarily so that C_SWITCH_X_SITE gets
-# used for the tests that follow.  We set them back to REAL_CFLAGS and
-# REAL_CPPFLAGS later on.
+# Change CFLAGS, CPPFLAGS, and LIBS temporarily so that C_SWITCH_X_SITE
+# is for the tests that follow.  We set them back later on.
 
 REAL_CFLAGS="$CFLAGS"
 REAL_CPPFLAGS="$CPPFLAGS"
+REAL_LIBS="$LIBS"
 
 if test "${HAVE_X11}" = "yes"; then
   DEFS="$C_SWITCH_X_SITE $DEFS"
@@ -2159,12 +2183,8 @@ if test "${HAVE_X11}" = "yes"; then
      [xgnu_linux_first_failure=no],
      [xgnu_linux_first_failure=yes])
     if test "${xgnu_linux_first_failure}" = "yes"; then
-      OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
-      OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
       OLD_CPPFLAGS="$CPPFLAGS"
       OLD_LIBS="$LIBS"
-      LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
-      C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
       CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
       LIBS="$LIBS -b i486-linuxaout"
       AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
@@ -2173,15 +2193,15 @@ if test "${HAVE_X11}" = "yes"; then
        [xgnu_linux_second_failure=yes])
       if test "${xgnu_linux_second_failure}" = "yes"; then
        # If we get the same failure with -b, there is no use adding -b.
-       # So take it out.  This plays safe.
-       LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
-       C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
-       CPPFLAGS="$OLD_CPPFLAGS"
-       LIBS="$OLD_LIBS"
+       # So leave it out.  This plays safe.
         AC_MSG_RESULT(no)
       else
+       LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
+       C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
         AC_MSG_RESULT(yes)
       fi
+      CPPFLAGS=$OLD_CPPFLAGS
+      LIBS=$OLD_LIBS
     else
       AC_MSG_RESULT(no)
     fi
@@ -2237,7 +2257,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" =
     RSVG_REQUIRED=2.11.0
     RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
 
-    PKG_CHECK_MODULES(RSVG, $RSVG_MODULE, HAVE_RSVG=yes, :)
+    EMACS_CHECK_MODULES([RSVG], [$RSVG_MODULE])
     AC_SUBST(RSVG_CFLAGS)
     AC_SUBST(RSVG_LIBS)
 
@@ -2248,7 +2268,6 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" =
       if test "${opsys}" = "mingw32"; then
                RSVG_LIBS=
       fi
-      LIBS="$RSVG_LIBS $LIBS"
     fi
   fi
 fi
@@ -2259,15 +2278,19 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}"
     ## 6.3.5 is the earliest version known to work; see Bug#17339.
     ## 6.8.2 makes Emacs crash; see Bug#13867.
     IMAGEMAGICK_MODULE="Wand >= 6.3.5 Wand != 6.8.2"
-    PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :)
+    EMACS_CHECK_MODULES([IMAGEMAGICK], [$IMAGEMAGICK_MODULE])
     AC_SUBST(IMAGEMAGICK_CFLAGS)
     AC_SUBST(IMAGEMAGICK_LIBS)
 
     if test $HAVE_IMAGEMAGICK = yes; then
       AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.])
+      OLD_CFLAGS=$CFLAGS
+      OLD_LIBS=$LIBS
       CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
       LIBS="$IMAGEMAGICK_LIBS $LIBS"
       AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers)
+      CFLAGS=$OLD_CFLAGS
+      LIBS=$OLD_LIBS
     fi
   fi
 fi
@@ -2285,7 +2308,8 @@ if test "${opsys}" != "mingw32"; then
     GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
 
     dnl Checks for libraries.
-    PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
+    EMACS_CHECK_MODULES([GTK], [$GTK_MODULES],
+      [pkg_check_gtk=yes], [pkg_check_gtk=no])
     if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then
        AC_MSG_ERROR($GTK_PKG_ERRORS)
     fi
@@ -2312,7 +2336,8 @@ if test "${opsys}" != "mingw32"; then
     GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
 
     dnl Checks for libraries.
-    PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
+    EMACS_CHECK_MODULES([GTK], [$GTK_MODULES],
+      [pkg_check_gtk=yes], [pkg_check_gtk=no])
     if test "$pkg_check_gtk" = "no" &&
        { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
     then
@@ -2322,10 +2347,12 @@ if test "${opsys}" != "mingw32"; then
   fi
 fi
 
+OLD_CFLAGS=$CFLAGS
+OLD_LIBS=$LIBS
+
 if test x"$pkg_check_gtk" = xyes; then
 
   AC_SUBST(GTK_LIBS)
-  C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
   CFLAGS="$CFLAGS $GTK_CFLAGS"
   LIBS="$GTK_LIBS $LIBS"
   dnl Try to compile a simple GTK program.
@@ -2357,6 +2384,7 @@ if test x"$pkg_check_gtk" = xyes; then
       AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?]);
     fi
   else
+    C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
     HAVE_GTK=yes
     AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
     GTK_OBJ="gtkutil.o $GTK_OBJ"
@@ -2425,33 +2453,40 @@ if test "${HAVE_GTK}" = "yes"; then
  term_header=gtkutil.h
 fi
 
+CFLAGS=$OLD_CFLAGS
+LIBS=$OLD_LIBS
+
 dnl D-Bus has been tested under GNU/Linux only.  Must be adapted for
 dnl other platforms.
 HAVE_DBUS=no
 DBUS_OBJ=
 if test "${with_dbus}" = "yes"; then
-   PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
+   EMACS_CHECK_MODULES([DBUS], [dbus-1 >= 1.0])
    if test "$HAVE_DBUS" = yes; then
-     LIBS="$LIBS $DBUS_LIBS"
      AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
      dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1.
      dnl dbus_type_is_valid and dbus_validate_* have been introduced in
      dnl D-Bus 1.5.12.
+     OLD_LIBS=$LIBS
+     LIBS="$LIBS $DBUS_LIBS"
      AC_CHECK_FUNCS(dbus_watch_get_unix_fd \
                    dbus_type_is_valid \
                    dbus_validate_bus_name \
                     dbus_validate_path \
                    dbus_validate_interface \
                    dbus_validate_member)
+     LIBS=$OLD_LIBS
      DBUS_OBJ=dbusbind.o
    fi
 fi
+AC_SUBST(DBUS_CFLAGS)
+AC_SUBST(DBUS_LIBS)
 AC_SUBST(DBUS_OBJ)
 
 dnl GSettings has been tested under GNU/Linux only.
 HAVE_GSETTINGS=no
 if test "${HAVE_X11}" = "yes" && test "${with_gsettings}" = "yes"; then
-   PKG_CHECK_MODULES(GSETTINGS, gio-2.0 >= 2.26, HAVE_GSETTINGS=yes, HAVE_GSETTINGS=no)
+   EMACS_CHECK_MODULES([GSETTINGS], [gio-2.0 >= 2.26])
    if test "$HAVE_GSETTINGS" = "yes"; then
       old_CFLAGS=$CFLAGS
       CFLAGS="$CFLAGS $GSETTINGS_CFLAGS"
@@ -2485,7 +2520,7 @@ dnl GConf has been tested under GNU/Linux only.
 dnl The version is really arbitrary, it is about the same age as Gtk+ 2.6.
 HAVE_GCONF=no
 if test "${HAVE_X11}" = "yes" && test "${with_gconf}" = "yes"; then
-   PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.13, HAVE_GCONF=yes, HAVE_GCONF=no)
+   EMACS_CHECK_MODULES([GCONF], [gconf-2.0 >= 2.13])
    if test "$HAVE_GCONF" = yes; then
       AC_DEFINE(HAVE_GCONF, 1, [Define to 1 if using GConf.])
       dnl Newer GConf doesn't link with g_objects, so this is not defined.
@@ -2495,7 +2530,7 @@ if test "${HAVE_X11}" = "yes" && test "${with_gconf}" = "yes"; then
 fi
 
 if test "$HAVE_GSETTINGS" = "yes" || test "$HAVE_GCONF" = "yes"; then
-    PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= 2.0, HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
+    EMACS_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.0])
     if test "$HAVE_GOBJECT" = "yes"; then
        SETTINGS_CFLAGS="$SETTINGS_CFLAGS $GOBJECT_CFLAGS"
        SETTINGS_LIBS="$SETTINGS_LIBS $GOBJECT_LIBS"
@@ -2526,12 +2561,14 @@ AC_SUBST(LIBSELINUX_LIBS)
 HAVE_GNUTLS=no
 HAVE_GNUTLS3=no
 if test "${with_gnutls}" = "yes" ; then
-  PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.0.0], HAVE_GNUTLS3=yes, HAVE_GNUTLS3=no)
+  EMACS_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.0.0],
+    [HAVE_GNUTLS3=yes], [HAVE_GNUTLS3=no])
   if test "${HAVE_GNUTLS3}" = "yes"; then
     AC_DEFINE(HAVE_GNUTLS3, 1, [Define if using GnuTLS v3.])
     HAVE_GNUTLS="yes"
   else
-    PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.6], HAVE_GNUTLS=yes, HAVE_GNUTLS=no)
+    EMACS_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.6.6],
+      [HAVE_GNUTLS=yes], [HAVE_GNUTLS=no])
   fi
   if test "${HAVE_GNUTLS}" = "yes"; then
     AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.])
@@ -2573,7 +2610,7 @@ dnl only sense when glib has been compiled with inotify support.  How
 dnl to check?
 case $with_file_notification,$NOTIFY_OBJ in
   gfile, | yes,)
-    PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.24, HAVE_GFILENOTIFY=yes, HAVE_GFILENOTIFY=no)
+    EMACS_CHECK_MODULES([GFILENOTIFY], [gio-2.0 >= 2.24])
     if test "$HAVE_GFILENOTIFY" = "yes"; then
        AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
        NOTIFY_OBJ=gfilenotify.o
@@ -2662,6 +2699,7 @@ fi
 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
 
 LIBXTR6=
+LIBXMU=
 if test "${USE_X_TOOLKIT}" != "none"; then
   AC_MSG_CHECKING(X11 toolkit version)
   AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
@@ -2688,37 +2726,20 @@ dnl If using toolkit, check whether libXmu.a exists.
 dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
   OLDLIBS="$LIBS"
   if test x$HAVE_X11XTR6 = xyes; then
-    LIBS="-lXt -lSM -lICE $LIBS"
+    OTHERLIBS='-lXt -lSM -lICE'
   else
-    LIBS="-lXt $LIBS"
+    OTHERLIBS='-lXt'
+  fi
+  AC_SEARCH_LIBS([XmuConvertStandardSelection], [Xmu], [], [], [$OTHERLIBS])
+  if test "X$LIBS" != "X$OLDLIBS"; then
+    LIBXMU=$ac_cv_search_XmuConvertStandardSelection
   fi
-  AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
-  test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
-  dnl ac_cv_lib_Xmu_XmuConvertStandardSelection is also referenced below.
+  LIBS=$OLDLIBS
+  dnl ac_cv_search_XmuConvertStandardSelection is also referenced below.
 fi
 AC_SUBST(LIBXTR6)
-
-dnl FIXME the logic here seems weird, but this is what cpp was doing.
-dnl Why not just test for libxmu in the normal way?
-LIBXMU=-lXmu
-case $opsys in
-  ## These systems don't supply Xmu.
-  hpux* | aix4-2 )
-    test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
-    ;;
-  mingw32 )
-    LIBXMU=
-    ;;
-esac
 AC_SUBST(LIBXMU)
 
-# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
-if test "${HAVE_X11}" = "yes"; then
-  if test "${USE_X_TOOLKIT}" != "none"; then
-    AC_CHECK_LIB(Xext, XShapeQueryExtension)
-  fi
-fi
-
 LIBXP=
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
   # OpenMotif may be installed in such a way on some GNU/Linux systems.
@@ -2863,16 +2884,20 @@ fi
 
 ### Start of font-backend (under X11) section.
 if test "${HAVE_X11}" = "yes"; then
-   PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2.0, HAVE_FC=yes, HAVE_FC=no)
-
-   ## Use -lXft if available, unless `--with-xft=no'.
-   HAVE_XFT=maybe
-    if test "${HAVE_FC}" = "no" || test "x${with_x}" = "xno"; then
+    ## Use -lXft if available, unless `--with-xft=no'.
+    HAVE_XFT=maybe
+    if test "x${with_x}" = "xno"; then
       with_xft="no";
     fi
+
+    if test "$with_xft" != no; then
+      EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
+      with_xft=$HAVE_FONTCONFIG
+    fi
+
     if test "x${with_xft}" != "xno"; then
 
-      PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
+      EMACS_CHECK_MODULES([XFT], [xft >= 0.13.0], [], [HAVE_XFT=no])
       ## Because xftfont.c uses XRenderQueryExtension, we also
       ## need to link to -lXrender.
       HAVE_XRENDER=no
@@ -2893,11 +2918,10 @@ if test "${HAVE_X11}" = "yes"; then
          AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
            AC_SUBST(XFT_LIBS)
          C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
-       else
-         CPPFLAGS="$OLD_CPPFLAGS"
-         CFLAGS="$OLD_CFLAGS"
-         LIBS="$OLD_LIBS"
        fi                        # "${HAVE_XFT}" = "yes"
+       CPPFLAGS=$OLD_CPPFLAGS
+       CFLAGS=$OLD_CFLAGS
+       LIBS=$OLD_LIBS
       fi                          # "$HAVE_XFT" != no
     fi                            # "x${with_xft}" != "xno"
 
@@ -2912,8 +2936,7 @@ if test "${HAVE_X11}" = "yes"; then
        dnl ftfont.o: undefined reference to symbol 'FT_New_Face'
        dnl if -lfreetype is not specified.
        dnl The following is needed to set FREETYPE_LIBS.
-       PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes,
-                        HAVE_FREETYPE=no)
+       EMACS_CHECK_MODULES([FREETYPE], [freetype2])
 
        test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype)
     fi
@@ -2923,8 +2946,7 @@ if test "${HAVE_X11}" = "yes"; then
       AC_DEFINE(HAVE_FREETYPE, 1,
                [Define to 1 if using the freetype and fontconfig libraries.])
       if test "${with_libotf}" != "no"; then
-       PKG_CHECK_MODULES(LIBOTF, libotf, HAVE_LIBOTF=yes,
-                         HAVE_LIBOTF=no)
+       EMACS_CHECK_MODULES([LIBOTF], [libotf])
        if test "$HAVE_LIBOTF" = "yes"; then
          AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.])
          AC_CHECK_LIB(otf, OTF_get_variation_glyphs,
@@ -2943,7 +2965,7 @@ if test "${HAVE_X11}" = "yes"; then
     HAVE_M17N_FLT=no
     if test "${HAVE_LIBOTF}" = yes; then
       if test "${with_m17n_flt}" != "no"; then
-       PKG_CHECK_MODULES(M17N_FLT, m17n-flt, HAVE_M17N_FLT=yes, HAVE_M17N_FLT=no)
+       EMACS_CHECK_MODULES([M17N_FLT], [m17n-flt])
        if test "$HAVE_M17N_FLT" = "yes"; then
          AC_DEFINE(HAVE_M17N_FLT, 1, [Define to 1 if using libm17n-flt.])
        fi
@@ -3101,67 +3123,6 @@ elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
 fi
 AC_SUBST(LIBJPEG)
 
-### Use -lpng if available, unless `--with-png=no'.
-### mingw32 doesn't use -lpng, since it loads the library dynamically.
-HAVE_PNG=no
-LIBPNG=
-if test "${opsys}" = "mingw32"; then
-  if test "${with_png}" != "no"; then
-    AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no)
-  fi
-  if test "${HAVE_PNG}" = "yes"; then
-    AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
-
-    AC_CHECK_DECL(png_longjmp,
-      [],
-      [AC_DEFINE(PNG_DEPSTRUCT, [],
-        [Define to empty to suppress deprecation warnings when building
-         with --enable-gcc-warnings and with libpng versions before 1.5,
-         which lack png_longjmp.])],
-      [[#ifdef HAVE_LIBPNG_PNG_H
-       # include <libpng/png.h>
-       #else
-       # include <png.h>
-       #endif
-      ]])
-  fi
-elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
-  if test "${with_png}" != "no"; then
-    # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
-    # in /usr/include/libpng.
-    AC_CHECK_HEADERS(png.h libpng/png.h, break)
-    if test "$ac_cv_header_png_h" = yes || test "$ac_cv_header_libpng_png_h" = yes ; then
-      AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm)
-    fi
-  fi
-
-  if test "${HAVE_PNG}" = "yes"; then
-    AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library.])
-
-    dnl Some systems, eg NetBSD 6, only provide eg "libpng16", not "libpng".
-    lpng=`libpng-config --libs 2> /dev/null`
-    case $lpng in
-      -l*) : ;;
-      *) lpng="-lpng" ;;
-    esac
-    LIBPNG="$lpng -lz -lm"
-
-    AC_CHECK_DECL(png_longjmp,
-      [],
-      [AC_DEFINE(PNG_DEPSTRUCT, [],
-        [Define to empty to suppress deprecation warnings when building
-         with --enable-gcc-warnings and with libpng versions before 1.5,
-         which lack png_longjmp.])],
-      [[#ifdef HAVE_LIBPNG_PNG_H
-       # include <libpng/png.h>
-       #else
-       # include <png.h>
-       #endif
-      ]])
-  fi
-fi
-AC_SUBST(LIBPNG)
-
 HAVE_ZLIB=no
 LIBZ=
 if test "${with_zlib}" != "no"; then
@@ -3181,6 +3142,69 @@ if test "${HAVE_ZLIB}" = "yes"; then
 fi
 AC_SUBST(LIBZ)
 
+### Use -lpng if available, unless `--with-png=no'.
+HAVE_PNG=no
+LIBPNG=
+PNG_CFLAGS=
+if test "${NS_IMPL_COCOA}" = yes; then
+  : # Nothing to do
+elif test "${with_png}" != no; then
+  # mingw32 loads the library dynamically.
+  if test "$opsys" = mingw32; then
+    AC_CHECK_HEADER([png.h], [HAVE_PNG=yes])
+  elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+    AC_MSG_CHECKING([for png])
+    png_cflags=`(libpng-config --cflags) 2>&AS_MESSAGE_LOG_FD` &&
+    png_libs=`(libpng-config --libs) 2>&AS_MESSAGE_LOG_FD` || {
+      # libpng-config does not work; configure by hand.
+      # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
+      # in /usr/include/libpng.
+      if test -r /usr/include/libpng/png.h &&
+        test ! -r /usr/include/png.h; then
+       png_cflags=-I/usr/include/libpng
+      else
+       png_cflags=
+      fi
+      png_libs='-lpng'
+    }
+    SAVE_CFLAGS=$CFLAGS
+    SAVE_LIBS=$LIBS
+    CFLAGS="$CFLAGS $png_cflags"
+    LIBS="$png_libs -lz -lm $LIBS"
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([[#include <png.h>]],
+        [[return !png_get_channels (0, 0);]])],
+      [HAVE_PNG=yes
+       PNG_CFLAGS=`AS_ECHO(["$png_cflags"]) | sed -e "$edit_cflags"`
+       LIBPNG=$png_libs
+       # $LIBPNG requires explicit -lz in some cases.
+       # We don't know what those cases are, exactly, so play it safe and
+       # append -lz to any nonempty $LIBPNG, unless we're already using LIBZ.
+       if test -n "$LIBPNG" && test -z "$LIBZ"; then
+        LIBPNG="$LIBPNG -lz"
+       fi])
+    CFLAGS=$SAVE_CFLAGS
+    LIBS=$SAVE_LIBS
+    AC_MSG_RESULT([$HAVE_PNG])
+  fi
+fi
+if test $HAVE_PNG = yes; then
+  AC_DEFINE([HAVE_PNG], [1], [Define to 1 if you have the png library.])
+
+  SAVE_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS $PNG_CFLAGS"
+  AC_CHECK_DECL([png_longjmp],
+    [],
+    [AC_DEFINE([PNG_DEPSTRUCT], [],
+       [Define to empty to suppress deprecation warnings when building
+       with --enable-gcc-warnings and with libpng versions before 1.5,
+       which lack png_longjmp.])],
+    [[#include <png.h>
+    ]])
+  CFLAGS=$SAVE_CFLAGS
+fi
+AC_SUBST(LIBPNG)
+AC_SUBST(PNG_CFLAGS)
 
 ### Use -ltiff if available, unless `--with-tiff=no'.
 ### mingw32 doesn't use -ltiff, since it loads the library dynamically.
@@ -3313,10 +3337,6 @@ if test "${HAVE_X11}" = "yes"; then
   if test "${HAVE_X_SM}" = "yes"; then
     AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
     LIBXSM="-lSM -lICE"
-    case "$LIBS" in
-      *-lSM*) ;;
-      *)      LIBS="$LIBXSM $LIBS" ;;
-    esac
   fi
 fi
 AC_SUBST(LIBXSM)
@@ -3326,14 +3346,13 @@ HAVE_XRANDR=no
 if test "${HAVE_X11}" = "yes"; then
   XRANDR_REQUIRED=1.2.2
   XRANDR_MODULES="xrandr >= $XRANDR_REQUIRED"
-  PKG_CHECK_MODULES(XRANDR, $XRANDR_MODULES, HAVE_XRANDR=yes, HAVE_XRANDR=no)
+  EMACS_CHECK_MODULES([XRANDR], [$XRANDR_MODULES])
   if test $HAVE_XRANDR = no; then
     # Test old way in case pkg-config doesn't have it (older machines).
     AC_CHECK_HEADER(X11/extensions/Xrandr.h,
       [AC_CHECK_LIB(Xrandr, XRRGetScreenResources, HAVE_XRANDR=yes)])
     if test $HAVE_XRANDR = yes; then
       XRANDR_LIBS=-lXrandr
-      AC_SUBST(XRANDR_LIBS)
     fi
   fi
   if test $HAVE_XRANDR = yes; then
@@ -3348,35 +3367,57 @@ if test "${HAVE_X11}" = "yes"; then
     AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have the XRandr extension.])
   fi
 fi
+AC_SUBST(XRANDR_CFLAGS)
+AC_SUBST(XRANDR_LIBS)
 
 ### Use Xinerama (-lXinerama) if available
 HAVE_XINERAMA=no
 if test "${HAVE_X11}" = "yes"; then
   XINERAMA_REQUIRED=1.0.2
   XINERAMA_MODULES="xinerama >= $XINERAMA_REQUIRED"
-  PKG_CHECK_MODULES(XINERAMA, $XINERAMA_MODULES, HAVE_XINERAMA=yes,
-                    HAVE_XINERAMA=no)
+  EMACS_CHECK_MODULES([XINERAMA], [$XINERAMA_MODULES])
   if test $HAVE_XINERAMA = no; then
     # Test old way in case pkg-config doesn't have it (older machines).
     AC_CHECK_HEADER(X11/extensions/Xinerama.h,
       [AC_CHECK_LIB(Xinerama, XineramaQueryExtension, HAVE_XINERAMA=yes)])
     if test $HAVE_XINERAMA = yes; then
       XINERAMA_LIBS=-lXinerama
-      AC_SUBST(XINERAMA_LIBS)
     fi
   fi
   if test $HAVE_XINERAMA = yes; then
     AC_DEFINE(HAVE_XINERAMA, 1, [Define to 1 if you have the Xinerama extension.])
   fi
 fi
+AC_SUBST(XINERAMA_CFLAGS)
+AC_SUBST(XINERAMA_LIBS)
 
+### Use Xfixes (-lXfixes) if available
+HAVE_XFIXES=no
+if test "${HAVE_X11}" = "yes"; then
+  XFIXES_REQUIRED=4.0.0
+  XFIXES_MODULES="xfixes >= $XFIXES_REQUIRED"
+  EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES])
+  if test $HAVE_XFIXES = no; then
+    # Test old way in case pkg-config doesn't have it (older machines).
+    AC_CHECK_HEADER(X11/extensions/Xfixes.h,
+      [AC_CHECK_LIB(Xfixes, XFixesHideCursor, HAVE_XFIXES=yes)])
+    if test $HAVE_XFIXES = yes; then
+      XFIXES_LIBS=-lXfixes
+    fi
+  fi
+  if test $HAVE_XFIXES = yes; then
+    AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have the Xfixes extension.])
+  fi
+fi
+AC_SUBST(XFIXES_CFLAGS)
+AC_SUBST(XFIXES_LIBS)
 
 ### Use libxml (-lxml2) if available
 ### mingw32 doesn't use -lxml2, since it loads the library dynamically.
 HAVE_LIBXML2=no
 if test "${with_xml2}" != "no"; then
   ### I'm not sure what the version number should be, so I just guessed.
-  PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+  EMACS_CHECK_MODULES([LIBXML2], [libxml-2.0 > 2.6.17])
   # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc.
   if test "${HAVE_LIBXML2}" != "yes" -a "$opsys" = "darwin"; then
     SAVE_CPPFLAGS="$CPPFLAGS"
@@ -3392,8 +3433,8 @@ if test "${with_xml2}" != "no"; then
   fi
   if test "${HAVE_LIBXML2}" = "yes"; then
     if test "${opsys}" != "mingw32"; then
-      LIBS="$LIBXML2_LIBS $LIBS"
-      AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+      AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no
+        [$LIBXML2_LIBS])
     else
       LIBXML2_LIBS=""
     fi
@@ -3422,19 +3463,17 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then
   AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
 fi
 
-# sqrt and other floating-point functions such as fmod and frexp
-# are found in -lm on most systems, but mingw32 doesn't use -lm.
-if test "${opsys}" != "mingw32"; then
-  AC_CHECK_LIB(m, sqrt)
-fi
-
 # Check for mail-locking functions in a "mail" library.  Probably this should
 # have the same check as for liblockfile below.
 AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no)
 if test $have_mail = yes; then
   LIBS_MAIL=-lmail
-  LIBS="$LIBS_MAIL $LIBS"
   AC_DEFINE(HAVE_LIBMAIL, 1, [Define to 1 if you have the `mail' library (-lmail).])
+
+  OLD_LIBS=$LIBS
+  LIBS="$LIBS_MAIL $LIBS"
+  AC_CHECK_FUNCS(touchlock)
+  LIBS=$OLD_LIBS
 else
   LIBS_MAIL=
 fi
@@ -3442,7 +3481,6 @@ dnl Debian, at least:
 AC_CHECK_LIB(lockfile, maillock, have_lockfile=yes, have_lockfile=no)
 if test $have_lockfile = yes; then
    LIBS_MAIL=-llockfile
-   LIBS="$LIBS_MAIL $LIBS"
    AC_DEFINE(HAVE_LIBLOCKFILE, 1, [Define to 1 if you have the `lockfile' library (-llockfile).])
 else
 # If we have the shared liblockfile, assume we must use it for mail
@@ -3507,18 +3545,19 @@ case "$mail_lock" in
 esac
 AC_SUBST(BLESSMAIL_TARGET)
 
-
+OLD_LIBS=$LIBS
+LIBS="$LIB_PTHREAD $LIB_MATH $LIBS"
 AC_CHECK_FUNCS(accept4 gethostname \
 getrusage get_current_dir_name \
-lrand48 \
+lrand48 random rint \
 select getpagesize setlocale \
 getrlimit setrlimit shutdown getaddrinfo \
-strsignal setitimer \
+pthread_sigmask strsignal setitimer \
 sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
-gai_strerror getline getdelim sync \
+gai_strerror sync \
 getpwent endpwent getgrent endgrent \
-touchlock \
 cfmakeraw cfsetspeed copysign __executable_start log2)
+LIBS=$OLD_LIBS
 
 dnl No need to check for aligned_alloc and posix_memalign if using
 dnl gmalloc.o, as it supplies them.  Don't use these functions on
@@ -3527,17 +3566,6 @@ if test -z "$GMALLOC_OBJ" && test "$opsys" != darwin; then
   AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
 fi
 
-## Eric Backus <ericb@lsid.hp.com> says, HP-UX 9.x on HP 700 machines
-## has a broken `rint' in some library versions including math library
-## version number A.09.05.
-## You can fix the math library by installing patch number PHSS_4630.
-## But we can fix it more reliably for Emacs by just not using rint.
-## We also skip HAVE_RANDOM - see comments in src/conf_post.h.
-case $opsys in
-   hpux*) : ;;
-   *) AC_CHECK_FUNCS(random rint) ;;
-esac
-
 dnl Cannot use AC_CHECK_FUNCS
 AC_CACHE_CHECK([for __builtin_unwind_init],
               emacs_cv_func___builtin_unwind_init,
@@ -3682,6 +3710,19 @@ fi
 AC_SUBST(LIBS_TERMCAP)
 AC_SUBST(TERMCAP_OBJ)
 
+# GNU/Linux-specific timer functions.
+AC_CACHE_CHECK([for timerfd interface], [emacs_cv_have_timerfd],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM([[#include <sys/timerfd.h>
+                     ]],
+                     [[timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC);
+                       timerfd_settime (0, TFD_TIMER_ABSTIME, 0, 0);]])],
+     [emacs_cv_have_timerfd=yes],
+     [emacs_cv_have_timerfd=no])])
+if test "$emacs_cv_have_timerfd" = yes; then
+  AC_DEFINE([HAVE_TIMERFD], 1,
+    [Define to 1 if timerfd functions are supported as in GNU/Linux.])
+fi
 
 # Do we have res_init, for detecting changes in /etc/resolv.conf?
 # On Darwin, res_init appears not to be useful: see bug#562 and
@@ -3754,6 +3795,7 @@ DESLIB=
 KRB4LIB=
 
 if test "${with_kerberos}" != no; then
+  OLD_LIBS=$LIBS
   AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no)
   if test $have_com_err = yes; then
     COM_ERRLIB=-lcom_err
@@ -3810,6 +3852,7 @@ if test "${with_kerberos}" != no; then
                                       [AC_CHECK_HEADERS(kerberos/krb.h)])])
   fi
   AC_CHECK_HEADERS(com_err.h)
+  LIBS=$OLD_LIBS
 fi
 
 AC_SUBST(COM_ERRLIB)
@@ -3872,23 +3915,23 @@ dnl Fixme: Not used.  Should this be HAVE_SOCKETS?
            [Define to 1 if you have inet sockets.])
 fi
 
-dnl Check for a Solaris 2.4 vfork bug that Autoconf misses (through 2.69).
-dnl This can be removed once we assume Autoconf 2.70.
-case $canonical in
-  *-solaris2.4 | *-solaris2.4.*)
-    dnl Disable the Autoconf-generated vfork test.
-    : ${ac_cv_func_vfork_works=no};;
-esac
-
 AC_FUNC_FORK
 
 AC_CHECK_FUNCS(snprintf)
 
-dnl Check this late.  It depends on what other libraries (lrsvg, Gtk+ etc)
-dnl Emacs uses.
+dnl Check for glib.  This differs from other library checks in that
+dnl Emacs need not link to glib unless some other library is already
+dnl linking to glib.  Although glib provides no facilities that Emacs
+dnl needs for its own purposes, when glib is present Emacs needs to
+dnl use primitives like g_main_context_query to avoid clashing with
+dnl glib at a low level.
+dnl
+dnl Check this late, since it depends on $GTK_CFLAGS etc.
 XGSELOBJ=
 OLDCFLAGS="$CFLAGS"
 OLDLIBS="$LIBS"
+CFLAGS="$CFLAGS $GTK_CFLAGS $RSVG_CFLAGS $DBUS_CFLAGS $SETTINGS_CFLAGS"
+LIBS="$LIBS $GTK_LIBS $RSVG_LIBS $DBUS_LIBS $SETTINGS_LIBS"
 CFLAGS="$CFLAGS $GFILENOTIFY_CFLAGS"
 LIBS="$LIBS $GFILENOTIFY_LIBS"
 AC_MSG_CHECKING([whether GLib is linked in])
@@ -3950,14 +3993,6 @@ if test "${opsys}" != "mingw32"; then
      in the full name stands for the login id.])
 fi
 
-dnl Every platform that uses configure supports this.
-dnl There is a create-lockfiles option you can
-dnl customize if you do not want the lock files to be written.
-dnl So it is not clear that this #define still needs to exist.
-AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
-  so that Emacs can tell instantly when you try to modify a file that
-  someone else has modified in his/her Emacs.])
-
 dnl Everybody supports this, except MS.
 dnl Seems like the kind of thing we should be testing for, though.
 ## Note: PTYs are broken on darwin <6.  Use at your own risk.
@@ -4032,7 +4067,7 @@ AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
 case $opsys in
   aix4-2)
     dnl Unfortunately without libXmu we cannot support EditRes.
-    if test x$ac_cv_lib_Xmu_XmuConvertStandardSelection != xyes; then
+    if test "x$ac_cv_search_XmuConvertStandardSelection" = xno; then
       AC_DEFINE(NO_EDITRES, 1)
     fi
     ;;
@@ -4327,28 +4362,6 @@ case $opsys in
 esac
 
 
-dnl Used in lisp.h, emacs.c, vm-limit.c
-dnl NEWS.18 describes this as "a number which contains
-dnl the high bits to be inclusive or'ed with pointers that are unpacked."
-AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers
-stored in a Lisp_Object.])
-dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT.
-
-case $opsys in
-  aix*)
-    dnl This works with 32-bit executables; Emacs doesn't support 64-bit.
-    AC_DEFINE(DATA_SEG_BITS, [0x20000000])
-    ;;
-  hpux*)
-    dnl The data segment on this machine always starts at address 0x40000000.
-    AC_DEFINE(DATA_SEG_BITS, [0x40000000])
-    ;;
-  irix6-5)
-    AC_DEFINE(DATA_SEG_BITS, [0x10000000])
-    ;;
-esac
-
-
 AH_TEMPLATE(TAB3, [Undocumented.])
 
 case $opsys in
@@ -4612,6 +4625,7 @@ esac
 # Set up the CFLAGS for real compilation, so we can substitute it.
 CFLAGS="$REAL_CFLAGS"
 CPPFLAGS="$REAL_CPPFLAGS"
+LIBS="$REAL_LIBS"
 
 ## Hack to detect a buggy GCC version.
 if test "x$GCC" = xyes \
@@ -4826,6 +4840,12 @@ AH_VERBATIM([FORTIFY_SOUR],
 #endif
 ])
 
+# If user asks to omit features, disable optional features that gnulib
+# might otherwise enable.
+if test "$with_features" = no && test "$enable_acl" != yes; then
+  enable_acl=no
+fi
+
 # Configure gnulib.  Although this does not affect CFLAGS or LIBS permanently.
 # it temporarily reverts them to their pre-pkg-config values,
 # because gnulib needs to work with both src (which uses the
@@ -4887,11 +4907,9 @@ case "$opsys" in
   gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;;
 
   mingw32)
-   ## MinGW64 does not prepend an underscore to symbols, so we must
-   ## pass a different -entry switch to linker.  FIXME: It is better
-   ## to make the entry points the same by changing unexw32.c.
+   ## Is it any better under MinGW64 to relocate emacs into higher addresses?
    case "$canonical" in
-     x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;;
+     x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x400000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;;
      *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;;
    esac
    ;;
@@ -4912,27 +4930,10 @@ LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS"
 
 AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
 
-## MinGW-specific post-link processing of temacs.
-TEMACS_POST_LINK=":"
-ADDSECTION=
-EMACS_HEAPSIZE=
-if test "${opsys}" = "mingw32"; then
-  TEMACS_POST_LINK="\$(MINGW_TEMACS_POST_LINK)"
-  ADDSECTION="../nt/addsection\$(EXEEXT)"
-  ## Preload heap size of temacs.exe in MB.
-  case "$canonical" in
-    x86_64-*-*) EMACS_HEAPSIZE=42 ;;
-    *) EMACS_HEAPSIZE=27 ;;
-  esac
-fi
-
-AC_SUBST(ADDSECTION)
-AC_SUBST(TEMACS_POST_LINK)
-AC_SUBST(EMACS_HEAPSIZE)
-
 ## Common for all window systems
 if test "$window_system" != "none"; then
   AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
+  AC_DEFINE(POLL_FOR_INPUT, 1, [Define if you poll periodically to detect C-g.])
   WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o"
 fi
 
@@ -4986,9 +4987,9 @@ if test "${HAVE_GTK}" = "yes"; then
 fi
 
 if test $USE_ACL -ne 0; then
-  acl_summary="yes $LIB_ACL"
+  ACL_SUMMARY="yes $LIB_ACL"
 else
-  acl_summary=no
+  ACL_SUMMARY=no
 fi
 
 echo "
@@ -5013,6 +5014,23 @@ else
 echo "  Where do we find X Windows libraries?                   Standard dirs"
 fi
 
+optsep=
+emacs_config_features=
+for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS \
+  GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \
+  LIBOTF XFT ZLIB; do
+
+    case $opt in
+      NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;;
+      *) eval val=\${HAVE_$opt} ;;
+    esac
+    test x"$val" = xno && continue
+    AS_VAR_APPEND([emacs_config_features], ["$optsep$opt"])
+    optsep=' '
+done
+AC_DEFINE_UNQUOTED(EMACS_CONFIG_FEATURES, "${emacs_config_features}",
+  [Summary of some of the main features enabled by configure.])
+
 echo "  Does Emacs use -lXaw3d?                                 ${HAVE_XAW3D}"
 echo "  Does Emacs use -lXpm?                                   ${HAVE_XPM}"
 echo "  Does Emacs use -ljpeg?                                  ${HAVE_JPEG}"
@@ -5029,7 +5047,7 @@ echo "  Does Emacs use -ldbus?                                  ${HAVE_DBUS}"
 echo "  Does Emacs use -lgconf?                                 ${HAVE_GCONF}"
 echo "  Does Emacs use GSettings?                               ${HAVE_GSETTINGS}"
 echo "  Does Emacs use a file notification library?             ${NOTIFY_SUMMARY}"
-echo "  Does Emacs use access control lists?                    ${acl_summary}"
+echo "  Does Emacs use access control lists?                    ${ACL_SUMMARY}"
 echo "  Does Emacs use -lselinux?                               ${HAVE_LIBSELINUX}"
 echo "  Does Emacs use -lgnutls?                                ${HAVE_GNUTLS}"
 echo "  Does Emacs use -lxml2?                                  ${HAVE_LIBXML2}"
@@ -5145,7 +5163,7 @@ if test "${opsys}" = "mingw32"; then
   ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force-w32
 else
   ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
-fi
+fi || AC_MSG_ERROR(['src/epaths.h' could not be made.])
 ], [GCC="$GCC" CPPFLAGS="$CPPFLAGS" opsys="$opsys"])
 
 dnl NB we have to cheat and use the ac_... version because abs_top_srcdir
@@ -5158,3 +5176,5 @@ fi
 ])
 
 AC_OUTPUT
+
+test "$MAKE" = make || AC_MSG_NOTICE([Now you can run '$MAKE'.])
index 3a4f67bf4b268156b34a874fc1fe52b2a813977e..a1d2688470d7666d71c2bf555f33153095ddadd2 100644 (file)
@@ -2,17 +2,38 @@
 
        * emacs.texi (Intro): Workaround makeinfo 4 @acronym bug.  (Bug#18040)
 
-2014-07-03  Juri Linkov  <juri@jurta.org>
+2014-07-09  Juri Linkov  <juri@jurta.org>
 
        * search.texi (Regexp Search): Update lax space matching that is
        not active in regexp search by default now.  (Bug#17901)
 
-2014-06-29  Glenn Morris  <rgm@gnu.org>
+2014-07-03  Glenn Morris  <rgm@gnu.org>
 
        * help.texi (Misc Help):
        * trouble.texi (Checklist): "Online" help doesn't mean what it
        used to any more.
 
+2014-06-23  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (%.texi): Disable implicit rules.
+       (mkinfodir): Remove.
+       (.dvi.ps): Replace with pattern rule.
+       (${buildinfodir}): New rule.
+       ($(buildinfodir)/emacs.info): Use order-only prereq for output dir.
+       Use $<.
+       (emacs.dvi, emacs.pdf, emacs.html, emacs-xtra.dvi, emacs-xtra.pdf):
+       Use $<.
+       (%.ps): New rule.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (bootstrap-clean): New.
+
+2014-06-10  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (INFO_EXT): Remove and replace by ".info" throughout.
+       (INFO_OPTS): Set directly rather than with configure.
+
 2014-06-08  Glenn Morris  <rgm@gnu.org>
 
        * entering.texi (Entering Emacs): Small fix re initial-buffer-choice.
        * ack.texi (Acknowledgments):
        * emacs.texi (Acknowledgments): Updates.
 
-2014-06-07  Glenn Morris  <rgm@gnu.org>
+2014-06-08  Glenn Morris  <rgm@gnu.org>
+
+       * ack.texi (Acknowledgments):
+       * emacs.texi (Acknowledgments): Updates.
 
        * programs.texi (Prettifying Symbols): Remove node.
        (Misc for Programs): Mention more briefly here.
        * emacs.texi (Top): Update menu.
 
-2014-06-05  Glenn Morris  <rgm@gnu.org>
-
        * package.texi (Package Menu, Package Installation):
        Mention signed packages.
-
-2014-06-03  Glenn Morris  <rgm@gnu.org>
-
-       * package.texi (Package Installation): Mention package-pinned-packages.
+       (Package Installation): Mention package-pinned-packages.
 
 2014-06-02  Glenn Morris  <rgm@gnu.org>
 
+       * ack.texi (Acknowledgments): Remove some obsolete items.
        * misc.texi [iftex]: Update chapter summary.
-       (Emulation): Remove ludicrously outdated claim.
-
-2014-05-29  Glenn Morris  <rgm@gnu.org>
+       (Emulation): Remove section.
 
        * macos.texi (Mac / GNUstep Customization): Mention ns custom group.
        (Customization options specific to Mac OS / GNUstep): Remove section.
 
-2014-05-28  Glenn Morris  <rgm@gnu.org>
-
-       * macos.texi (Mac / GNUstep Customization): Mention some new features.
-
-2014-05-27  Glenn Morris  <rgm@gnu.org>
-
        * abbrevs.texi (Expanding Abbrevs): Update re abbrev-expand-function.
 
-2014-05-21  Eli Zaretskii  <eliz@gnu.org>
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        * frames.texi (Fonts): Clarify which frames are affected by
        setting font from the menu and in default-frame-alist.
        (Bug#17532)
 
-2014-05-12  Eli Zaretskii  <eliz@gnu.org>
+2014-05-14  Eli Zaretskii  <eliz@gnu.org>
 
-       * mule.texi (Language Environments): Remove unused @anchor.
-       (Bug#17479)
+       * mule.texi (Language Environments): Remove unused @anchor.  (Bug#17479)
 
-2014-05-02  Eli Zaretskii  <eliz@gnu.org>
+2014-05-04  Eli Zaretskii  <eliz@gnu.org>
 
        * trouble.texi (Lossage, DEL Does Not Delete, Stuck Recursive)
        (Screen Garbled, Text Garbled, After a Crash, Emergency Escape)
        (Bug Criteria, Understanding Bug Reporting, Checklist, Service):
        Improve indexing.
 
-2014-04-29  Eli Zaretskii  <eliz@gnu.org>
+2014-05-04  Leo Liu  <sdl.web@gmail.com>
+
+       * cal-xtra.texi (Non-Gregorian Diary): Document new features for
+       Chinese calendar and diary.
+
+2014-04-30  Eli Zaretskii  <eliz@gnu.org>
 
        * trouble.texi (Quitting, DEL Does Not Delete, Emergency Escape)
        (Bug Criteria): Fix usage of @kbd and @key.  (Bug#17362)
 
        * anti.texi (Antinews): Fix usage of @kbd and @key.
 
-2014-04-26  Eli Zaretskii  <eliz@gnu.org>
-
        * sending.texi (Mail Signature): Document signature variables used
        by Message mode.  (Bug#17308)
 
-2014-04-21  Eli Zaretskii  <eliz@gnu.org>
+2014-04-22  Eli Zaretskii  <eliz@gnu.org>
 
        * buffers.texi (Uniquify): Clarify the default uniquification.
 
        EMACSLOADPATH.  Index all the environment variables.
        (Misc Variables): Index all the environment variables.
 
-2014-04-13  Eli Zaretskii  <eliz@gnu.org>
+2014-04-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.in (infoclean): Be consistent about reporting failures.
+       Do not fail merely because the info directory does not exist,
+       but do fail if it exists and can't be cleaned.
+
+2014-04-16  Eli Zaretskii  <eliz@gnu.org>
 
        * display.texi (Cursor Display): Explain better how to customize
        'blink-cursor-blinks'.
 
-2014-04-05  Glenn Morris  <rgm@gnu.org>
+2014-04-07  Glenn Morris  <rgm@gnu.org>
 
        * trouble.texi (Checklist): Dribble files may contain passwords.
 
-2014-04-04  Glenn Morris  <rgm@gnu.org>
-
        * files.texi (Backup Names):
        * arevert-xtra.texi (Supporting additional buffers):
        Update for default values of some -function vars no longer being nil.
        (Supporting additional buffers):
        Update for buffer-stale-function also applying to file-buffers.
 
+2014-03-28  Glenn Morris  <rgm@gnu.org>
+
+       * custom.texi (Terminal Init): Mention term-file-aliases.
+
+2014-03-26  Glenn Morris  <rgm@gnu.org>
+
+       * ack.texi (Acknowledgments): Remove reference to obsolete file.
+
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * help.texi (Help Files): Update C-h g description.
+
 2014-03-16  Dmitry Gutov  <dgutov@yandex.ru>
 
        * programs.texi (Matching): Update the missed spot.  (Bug#17008)
index 4a59ebed52181df27abffcf1d3754f88d49a8571..98ff81791ace85c1ccdd2bb66ec3d0898d3bdfec 100644 (file)
@@ -54,12 +54,11 @@ GZIP_PROG = @GZIP_PROG@
 
 HTML_OPTS = --no-split --html
 
-INFO_EXT=@INFO_EXT@
 # Options used only when making info output.
 # --no-split is only needed because of MS-DOS.
 # For a possible alternative, see
 # http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01182.html
-INFO_OPTS=@INFO_OPTS@
+INFO_OPTS= --no-split
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -143,46 +142,46 @@ EMACSSOURCES= \
        ${srcdir}/kmacro.texi \
        $(EMACS_XTRA)
 
-## The info/ directory exists in release tarfiles but not the repository.
-mkinfodir = @${MKDIR_P} ${buildinfodir}
+## Disable implicit rules.
+%.texi: ;
 
 .PHONY: info dvi html pdf ps
 
-.SUFFIXES: .ps .dvi
-
-.dvi.ps:
-       $(DVIPS) -o $@ $<
-
-info: $(buildinfodir)/emacs$(INFO_EXT)
+info: $(buildinfodir)/emacs.info
 dvi: $(DVI_TARGETS)
 html: $(HTML_TARGETS)
 pdf: $(PDF_TARGETS)
 ps: $(PS_TARGETS)
 
+## The info/ directory exists in release tarfiles but not the repository.
+${buildinfodir}:
+       ${MKDIR_P} $@
+
 # Note that all the Info targets build the Info files in srcdir.
 # There is no provision for Info files to exist in the build directory.
 # In a distribution of Emacs, the Info files should be up to date.
-# Note: "<" is not portable in ordinary make rules.
-$(buildinfodir)/emacs$(INFO_EXT): ${EMACSSOURCES}
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/emacs.texi
+$(buildinfodir)/emacs.info: ${EMACSSOURCES} | ${buildinfodir}
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
 
 emacs.dvi: ${EMACSSOURCES}
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs.texi
+       $(ENVADD) $(TEXI2DVI) $<
 
 emacs.pdf: ${EMACSSOURCES}
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs.texi
+       $(ENVADD) $(TEXI2PDF) $<
 
 emacs.html: ${EMACSSOURCES}
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/emacs.texi
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<
 
 emacs-xtra.dvi: $(EMACS_XTRA)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
+       $(ENVADD) $(TEXI2DVI) $<
 
 emacs-xtra.pdf: $(EMACS_XTRA)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-xtra.texi
+       $(ENVADD) $(TEXI2PDF) $<
+
+%.ps: %.dvi
+       $(DVIPS) -o $@ $<
 
-.PHONY: mostlyclean clean distclean maintainer-clean infoclean
+.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean infoclean
 
 ## Temp files.
 mostlyclean:
@@ -199,9 +198,12 @@ distclean: clean
 
 ## In the standalone tarfile, the clean rule runs this.
 infoclean:
-       -cd $(buildinfodir) && rm -f emacs$(INFO_EXT) emacs$(INFO_EXT)-[1-9] emacs$(INFO_EXT)-[1-9][0-9]
+       rm -f \
+         $(buildinfodir)/emacs.info \
+         $(buildinfodir)/emacs.info-[1-9] \
+         $(buildinfodir)/emacs.info-[1-9][0-9]
 
-maintainer-clean: distclean infoclean
+bootstrap-clean maintainer-clean: distclean infoclean
 
 .PHONY: dist
 
@@ -217,7 +219,6 @@ dist:
          -e 's/^\(clean:.*\)/\1 infoclean/' \
          -e "s/@ver[s]ion@/${version}/" \
          -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
-         -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
          ${srcdir}/Makefile.in > emacs-manual-${version}/Makefile
        @if grep '@[a-zA-Z_]*@' emacs-manual-${version}/Makefile; then \
          echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
index ccd58b7aece1ede1d176dfd7920f744e5aa8a678..9f2496da26300ee8ca49920a6c029555fa4d5df8 100644 (file)
@@ -349,8 +349,7 @@ mail messages; and @file{saveplace.el}, for preserving point's
 location in files between editing sessions.
 
 @item
-Gary Foster wrote @file{crisp.el}, the emulation for CRiSP and Brief
-editors; and @file{scroll-all.el}, a mode for scrolling several buffers
+Gary Foster wrote @file{scroll-all.el}, a mode for scrolling several buffers
 together.
 
 @item
@@ -601,7 +600,7 @@ buffers.
 @item
 Michael Kifer wrote @code{ediff}, an interactive interface to the
 @command{diff}, @command{patch}, and @command{merge} programs; and
-Viper, another emulator of the VI editor.
+Viper, an emulator of the VI editor.
 
 @item
 Richard King wrote the first version of @file{userlock.el} and
@@ -883,9 +882,6 @@ a mode for editing makefiles.
 Thien-Thi Nguyen and Dan Nicolaescu wrote @file{hideshow.el}, a minor
 mode for selectively displaying blocks of text.
 
-@item
-Jurgen Nickelsen wrote @file{ws-mode.el}, providing WordStar emulation.
-
 @item
 Dan Nicolaescu added support for running Emacs as a daemon.  He also
 wrote @file{romanian.el}, support for editing Romanian text;
@@ -1037,10 +1033,8 @@ Alex Rezinsky wrote @file{which-func.el}, a mode that shows the name
 of the current function in the mode line.
 
 @item
-Rob Riepel wrote @file{tpu-edt.el} and its associated files, providing
-an emulation of the VMS TPU text editor emulating the VMS EDT editor,
-and @file{vt-control.el}, providing some control functions for the DEC
-VT line of terminals.
+Rob Riepel wrote @file{vt-control.el}, providing some control
+functions for the DEC VT line of terminals.
 
 @item
 Nick Roberts wrote @file{t-mouse.el}, for mouse support in text
@@ -1083,9 +1077,6 @@ references in Info files.
 James B. Salem and Brewster Kahle wrote @file{completion.el}, providing
 dynamic word completion.
 
-@item
-Masahiko Sato wrote @file{vip.el}, an emulation of the VI editor.
-
 @item
 Holger Schauer wrote @file{fortune.el}, a package for using fortune in
 message signatures.
@@ -1194,9 +1185,8 @@ written @file{easymenu.el}, a facility for defining Emacs menus;
 color; and also co-authored portions of CC mode.
 
 @item
-Sam Steingold wrote @file{gulp.el}, a facility for asking package
-maintainers for updated versions of their packages via e-mail, and
-@file{midnight.el}, a package for running a command every midnight.
+Sam Steingold wrote @file{midnight.el}, a package for running a
+command every midnight.
 
 @item
 Ake Stenhoff and Lars Lindberg wrote @file{imenu.el}, a framework for
index 82864859473cdd810bbeb8ca224ff3be04c5136b..cf1eba17dec03645b789fcbd259e219e33532bcd 100644 (file)
@@ -517,7 +517,7 @@ the fourth pattern.
 @subsection Diary Entries Using non-Gregorian Calendars
 
   As well as entries based on the standard Gregorian calendar, your
-diary can have entries based on Bahá'í, Hebrew, or Islamic dates.
+diary can have entries based on Bahá'í, Chinese, Hebrew, or Islamic dates.
 Recognition of such entries can be time-consuming, however, and since
 most people don't use them, you must explicitly enable their use.  If
 you want the diary to recognize Hebrew-date diary entries, for example,
@@ -531,22 +531,27 @@ you must do this:
 @findex diary-islamic-mark-entries
 @findex diary-bahai-list-entries
 @findex diary-bahai-mark-entries
+@findex diary-chinese-list-entries
+@findex diary-chinese-mark-entries
 @smallexample
 (add-hook 'diary-nongregorian-listing-hook 'diary-hebrew-list-entries)
 (add-hook 'diary-nongregorian-marking-hook 'diary-hebrew-mark-entries)
 @end smallexample
 
 @noindent
-Similarly, for Islamic and Bahá'í entries, add
-@code{diary-islamic-list-entries} and @code{diary-islamic-mark-entries}, or
-@code{diary-bahai-list-entries} and @code{diary-bahai-mark-entries}.
+Similarly, for Islamic, Bahá'í and Chinese entries, add
+@code{diary-islamic-list-entries} and @code{diary-islamic-mark-entries},
+@code{diary-bahai-list-entries} and @code{diary-bahai-mark-entries},
+or @code{diary-chinese-list-entries} and @code{diary-chinese-mark-entries}.
 
 @vindex diary-bahai-entry-symbol
+@vindex diary-chinese-entry-symbol
 @vindex diary-hebrew-entry-symbol
 @vindex diary-islamic-entry-symbol
   These diary entries have the same formats as Gregorian-date diary
 entries; except that @code{diary-bahai-entry-symbol} (default @samp{B})
-must precede a Bahá'í date, @code{diary-hebrew-entry-symbol} (default
+must precede a Bahá'í date, @code{diary-chinese-entry-symbol} (default
+@samp{C}) a Chinese date, @code{diary-hebrew-entry-symbol} (default
 @samp{H}) a Hebrew date, and @code{diary-islamic-entry-symbol} (default
 @samp{I}) an Islamic date.  Moreover, non-Gregorian month names may not
 be abbreviated (because the first three letters are often not unique).
@@ -573,7 +578,7 @@ nonmarking if preceded by @code{diary-nonmarking-symbol} (default
 
   Here is a table of commands used in the calendar to create diary
 entries that match the selected date and other dates that are similar in
-the Bahá'í, Hebrew, or Islamic calendars:
+the Bahá'í, Chinese, Hebrew, or Islamic calendars:
 
 @table @kbd
 @item i h d
@@ -594,6 +599,14 @@ the Bahá'í, Hebrew, or Islamic calendars:
 @code{diary-bahai-insert-monthly-entry}
 @item i B y
 @code{diary-bahai-insert-yearly-entry}
+@item i C d
+@code{diary-chinese-insert-entry}
+@item i C m
+@code{diary-chinese-insert-monthly-entry}
+@item i C y
+@code{diary-chinese-insert-yearly-entry}
+@item i C a
+@code{diary-chinese-insert-anniversary-entry}
 @end table
 
 @findex diary-hebrew-insert-entry
@@ -605,6 +618,11 @@ the Bahá'í, Hebrew, or Islamic calendars:
 @findex diary-bahai-insert-entry
 @findex diary-bahai-insert-monthly-entry
 @findex diary-bahai-insert-yearly-entry
+@findex diary-chinese-insert-entry
+@findex diary-chinese-insert-monthly-entry
+@findex diary-chinese-insert-yearly-entry
+@findex diary-chinese-insert-anniversary-entry
+
   These commands work much like the corresponding commands for ordinary
 diary entries: they apply to the date that point is on in the calendar
 window, and what they do is insert just the date portion of a diary
index 9b78128d3231615fb852f280ffcce1369a3ddef4..0d0013f5ace10ba9a241eeaa26a6259328574519 100644 (file)
@@ -2445,9 +2445,13 @@ harmless, so those do not need a conditional.
 @node Terminal Init
 @subsection Terminal-specific Initialization
 
+@vindex term-file-aliases
   Each terminal type can have a Lisp library to be loaded into Emacs when
 it is run on that type of terminal.  For a terminal type named
-@var{termtype}, the library is called @file{term/@var{termtype}} and it is
+@var{termtype}, the library is called @file{term/@var{termtype}}.
+(If there is an entry of the form @code{(@var{termtype} . @var{alias})}
+in the @code{term-file-aliases} association list, Emacs uses
+@var{alias} in place of @var{termtype}.)  The library is
 found by searching the directories @code{load-path} as usual and trying the
 suffixes @samp{.elc} and @samp{.el}.  Normally it appears in the
 subdirectory @file{term} of the directory where most Emacs libraries are
index 817d1c6fd056dde5720d3e44324b46f98b771fa5..dc1ab423db270e32171ed9d49536da9abae7a096 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo    @c -*-texinfo-*-
 @comment %**start of header
-@setfilename ../../info/emacs-xtra
+@setfilename ../../info/emacs-xtra.info
 @settitle Specialized Emacs Features
 @c Merge all functions, variables, and keys into the concept index.
 @syncodeindex fn cp
index 81a7580751159b38160e9e4b22a644777a29af68..b1cb196c3c2b97ab3997a6483cc7318d25fce834 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*- coding: utf-8 -*-
 
-@setfilename ../../info/emacs
+@setfilename ../../info/emacs.info
 @settitle GNU Emacs Manual
 
 @c The edition number appears in more than one place in this file
@@ -201,7 +201,6 @@ Advanced Features
 * Editing Binary Files::  Editing binary files with Hexl mode.
 * Saving Emacs Sessions:: Saving Emacs state from one session to the next.
 * Recursive Edit::      Performing edits while "within another command".
-* Emulation::           Emulating some other editors with Emacs.
 * Hyperlinking::        Following links in buffers.
 * Amusements::          Various games and hacks.
 * Packages::            Installing additional features.
index 700cb266ffa5a25d10f06f75f179ceb8d0ad07db..6329f8aa0e659be3dcfb56c4e9538930079b6610 100644 (file)
@@ -1,4 +1,4 @@
 @c It would be nicer to generate this using configure and @version@.
 @c However, that would mean emacsver.texi would always be newer
 @c then the info files in release tarfiles.
-@set EMACSVER 24.3.92
+@set EMACSVER 24.4.50
index da831d7612423787d42fd6890e7c39b631380f9b..10b5fcfb09583281be1fb6bfb175e83120ef8ac5 100644 (file)
@@ -604,7 +604,8 @@ Display information about where to get external packages
 @item C-h C-f
 Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}).
 @item C-h g
-Display information about the GNU Project (@code{describe-gnu-project}).
+Visit a @uref{http://www.gnu.org} page with information about the GNU
+Project (@code{describe-gnu-project}).
 @item C-h C-m
 Display information about ordering printed copies of Emacs manuals
 (@code{view-order-manuals}).
index f09f23e6a4bd840a4babb715820f0ed4615ad2cb..ae1aefcee7671d97a003e5c7caaa1f07550ac41b 100644 (file)
@@ -1,17 +1,17 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2014 Free Software
-@c Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2014
+@c   Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @iftex
 @chapter Miscellaneous Commands
 
   This chapter contains several brief topics that do not fit anywhere
-else: viewing ``document files'', reading Usenet news, running shell
-commands and shell subprocesses, using a single shared Emacs for
-utilities that expect to run an editor as a subprocess, printing
-hardcopy, sorting text, editing binary files, saving an Emacs session
-for later resumption, following hyperlinks, emulating other editors,
-and various diversions and amusements.
+else: reading Usenet news, viewing PDFs and other such documents, web
+browsing, running shell commands and shell subprocesses, using a
+single shared Emacs for utilities that expect to run an editor as a
+subprocess, printing, sorting text, editing binary files, saving an
+Emacs session for later resumption, recursive editing level, following
+hyperlinks, and various diversions and amusements.
 
 @end iftex
 
@@ -2268,20 +2268,20 @@ new major mode which provides a command to switch back.  These
 approaches give you more flexibility to go back to unfinished tasks in
 the order you choose.
 
+@ignore
+@c Apart from edt and viper, this is all obsolete.
+@c (Can't believe we were saying ``most other editors'' into 2014!)
+@c There seems no point having a node just for those, which both have
+@c their own manuals.
 @node Emulation
 @section Emulation
 @cindex emulating other editors
 @cindex other editors
 @cindex EDT
 @cindex vi
-@cindex PC key bindings
-@cindex scrolling all windows
-@cindex PC selection
-@cindex Motif key bindings
-@cindex Macintosh key bindings
 @cindex WordStar
 
-  GNU Emacs can be programmed to emulate (more or less) some other
+  GNU Emacs can be programmed to emulate (more or less) most other
 editors.  Standard facilities can emulate these:
 
 @table @asis
@@ -2318,7 +2318,7 @@ buffers or major modes while in EDT emulation.
 
 @item vi (Berkeley editor)
 @findex viper-mode
-Viper is the newest emulator for vi.  It implements several levels of
+Viper is an emulator for vi.  It implements several levels of
 emulation; level 1 is closest to vi itself, while level 5 departs
 somewhat from strict emulation to take advantage of the capabilities of
 Emacs.  To invoke Viper, type @kbd{M-x viper-mode}; it will guide you
@@ -2359,6 +2359,8 @@ not use it.
 @kbd{M-x wordstar-mode} provides a major mode with WordStar-like
 key bindings.
 @end table
+@end ignore
+
 
 @node Hyperlinking
 @section Hyperlinking and Navigation Features
index c1607487b6f41b155b2d7e06e75baf8628e34245..70d7767635fe1d2d4626b73f7b41020920957399 100644 (file)
@@ -1,13 +1,42 @@
-2014-07-15  Álvar Jesús Ibeas Martín  <alvar.ibeas@unican.es>  (tiny change)
+2014-07-16  Álvar Jesús Ibeas Martín  <alvar.ibeas@unican.es>  (tiny change)
 
        * emacs-lisp-intro.texi (Variables, Buffer Names, if & or)
        (Symbols as Chest, fwd-para while): Fix typos.
 
-2014-06-29  Glenn Morris  <rgm@gnu.org>
+2014-07-03  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp-intro.texi (Note for Novices, Finding More, Conclusion):
        "Online" help doesn't mean what it used to any more.
 
+2014-06-23  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (%.texi): Disable implicit rules.
+       (mkinfodir): Remove.
+       (.dvi.ps): Replace with explicit rule.
+       (${buildinfodir}): New rule.
+       (${buildinfodir}/eintr.info): Use order-only prereq for output dir.
+       Use $<.
+       (emacs-lisp-intro.dvi, emacs-lisp-intro.pdf, emacs-lisp-intro.html):
+       Use $<.
+       (emacs-lisp-intro.ps): New rule.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (bootstrap-clean): New.
+
+2014-06-10  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (INFO_EXT): Remove and replace by ".info" throughout.
+       (INFO_OPTS): Set directly rather than with configure.
+
+2014-06-02  Glenn Morris  <rgm@gnu.org>
+
+       * emacs-lisp-intro.texi (Autoload): Update loaddefs.el details.
+
+2014-04-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.in (infoclean): Be consistent about reporting failures.
+
 2014-02-25  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp-intro.texi (X11 Colors): Don't use setq with hooks.
index c041cd17e029fa76e86f106daf43cf6388ae933b..b40c26767cc0b3331fbd4b2144608844db0aa56e 100644 (file)
@@ -46,9 +46,8 @@ GZIP_PROG = @GZIP_PROG@
 
 HTML_OPTS = --no-split --html
 
-INFO_EXT=@INFO_EXT@
 # Options used only when making info output.
-INFO_OPTS=@INFO_OPTS@
+INFO_OPTS= --no-split
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -67,42 +66,41 @@ HTML_TARGETS = emacs-lisp-intro.html
 PDF_TARGETS = emacs-lisp-intro.pdf
 PS_TARGETS = emacs-lisp-intro.ps
 
-mkinfodir = @${MKDIR_P} ${buildinfodir}
-
 srcs = ${srcdir}/emacs-lisp-intro.texi ${srcdir}/doclicense.texi \
   ${emacsdir}/emacsver.texi
 
-.PHONY: info dvi html pdf ps
-
-.SUFFIXES: .ps .dvi
-
-.dvi.ps:
-       $(DVIPS) -o $@ $<
+## Disable implicit rules.
+%.texi: ;
 
-info: ${buildinfodir}/eintr$(INFO_EXT)
+.PHONY: info dvi html pdf ps
 
+info: ${buildinfodir}/eintr.info
 dvi: $(DVI_TARGETS)
 html: $(HTML_TARGETS)
 pdf: $(PDF_TARGETS)
 ps: $(PS_TARGETS)
 
+${buildinfodir}:
+       ${MKDIR_P} $@
+
 # The file name eintr must fit within 5 characters, to allow for
 # -NN extensions to fit into DOS 8+3 limits without clashing.
-# Note: "<" is not portable in ordinary make rules.
-${buildinfodir}/eintr$(INFO_EXT): ${srcs}
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/emacs-lisp-intro.texi
+${buildinfodir}/eintr.info: ${srcs} | ${buildinfodir}
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
 
 emacs-lisp-intro.dvi: ${srcs}
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-lisp-intro.texi
+       $(ENVADD) $(TEXI2DVI) $<
 
 emacs-lisp-intro.pdf: ${srcs}
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-lisp-intro.texi
+       $(ENVADD) $(TEXI2PDF) $<
 
 emacs-lisp-intro.html: ${srcs}
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/emacs-lisp-intro.texi
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<
+
+emacs-lisp-intro.ps: emacs-lisp-intro.dvi
+       $(DVIPS) -o $@ $<
 
-.PHONY: mostlyclean clean distclean maintainer-clean infoclean
+.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean infoclean
 
 mostlyclean:
        rm -f *.aux *.log *.toc *.cp *.cps *.fn *.fns *.ky *.kys \
@@ -116,9 +114,11 @@ distclean: clean
        rm -f Makefile
 
 infoclean:
-       -cd $(buildinfodir) && rm -f eintr$(INFO_EXT) eintr$(INFO_EXT)-[1-9]
+       rm -f \
+         $(buildinfodir)/eintr.info \
+         $(buildinfodir)/eintr.info-[1-9]
 
-maintainer-clean: distclean infoclean
+bootstrap-clean maintainer-clean: distclean infoclean
 
 .PHONY: dist
 
@@ -134,7 +134,6 @@ dist:
          -e 's/^\(clean:.*\)/\1 infoclean/' \
          -e "s/@ver[s]ion@/${version}/" \
          -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
-         -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
          ${srcdir}/Makefile.in > emacs-lispintro-${version}/Makefile
        @if grep '@[a-zA-Z_]*@' emacs-lispintro-${version}/Makefile; then \
          echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
index 8ff57619c04b5da7485c3f3f5ab7e67069e59599..f915d0da8abb703e33601566cf225ed276d33c1c 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo                                      @c -*-texinfo-*-
 @comment %**start of header
-@setfilename ../../info/eintr
+@setfilename ../../info/eintr.info
 @c setfilename emacs-lisp-intro.info
 @c sethtmlfilename emacs-lisp-intro.html
 @settitle Programming in Emacs Lisp
@@ -17548,8 +17548,8 @@ are not loaded right away; but you need to wait a moment when you
 first use such a function, while its containing file is evaluated.
 
 Rarely used functions are frequently autoloaded.  The
-@file{loaddefs.el} library contains hundreds of autoloaded functions,
-from @code{bookmark-set} to @code{wordstar-mode}.  Of course, you may
+@file{loaddefs.el} library contains thousands of autoloaded functions,
+from @code{5x5} to @code{zone}.  Of course, you may
 come to use a `rare' function frequently.  When you do, you should
 load that function's file with a @code{load} expression in your
 @file{.emacs} file.
index a3353c66f712ed405bde88de345ad7498015edee..58548077d3d64505b684fce2f2b9b7994542ad6f 100644 (file)
@@ -1,28 +1,74 @@
-2014-07-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-11  Eli Zaretskii  <eliz@gnu.org>
+
+       * internals.texi (Garbage Collection): Fix last change.
+
+2014-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * internals.texi (Garbage Collection): Mention memory-info.
+
+2014-07-11  Michael Albinus  <michael.albinus@gmx.de>
+
+       * minibuf.texi (Intro to Minibuffers, Reading a Password):
+       Password hiding is available in batch mode, do not mention it in
+       the exclusion list.  Mention `read-hide-char'.  (Bug#17839)
+
+2014-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * debugging.texi (Function Debugging, Debugger Commands):
        Update debug-on-entry w.r.t behavior after redefinitions (bug#17902).
 
-2014-06-29  Glenn Morris  <rgm@gnu.org>
+2014-07-03  Glenn Morris  <rgm@gnu.org>
 
        * help.texi (Help Functions): "Online" help doesn't mean what it
        used to any more.
 
-2014-06-26  Glenn Morris  <rgm@gnu.org>
+2014-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * keymaps.texi (Key Lookup): Remove mention of indirect entries.
+       (Scanning Keymaps): Reword the `noindirect' argument.
+
+2014-06-28  Glenn Morris  <rgm@gnu.org>
 
        * minibuf.texi (Intro to Minibuffers): Batch mode is basic.
        (Reading a Password): Mention batch mode.  (Bug#17839)
 
+2014-06-23  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (%.texi): Disable implicit rules.
+       (mkinfodir): Remove.
+       (.dvi.ps): Replace with explicit rule.
+       (html): Declare as PHONY.
+       (${buildinfodir}): New rule.
+       ($(buildinfodir)/elisp.info): Use order-only prereq for output dir.
+       Use $<.
+       (elisp.dvi, elisp.html, elisp.pdf): Use $<.
+       (elisp.ps): New rule.
+
 2014-06-21  Eli Zaretskii  <eliz@gnu.org>
 
        * positions.texi (Screen Lines): Clarify how columns are counted
        by vertical-motion.
 
-2014-06-14  Eli Zaretskii  <eliz@gnu.org>
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (bootstrap-clean): New.
+
+2014-06-15  Eli Zaretskii  <eliz@gnu.org>
 
        * commands.texi (Accessing Mouse): Improve the wording of the
        posn-col-row documentation.  (Bug#17768)
 
+2014-06-10  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (INFO_EXT): Remove and replace by ".info" throughout.
+       (INFO_OPTS): Set directly rather than with configure.
+
+2014-06-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Say (accept-process-output P)'s result pertains to P if P is non-nil.
+       * processes.texi (Accepting Output): Mention that if PROCESS is non-nil,
+       the return value is about PROCESS, not about other processes.
+
 2014-06-08  Glenn Morris  <rgm@gnu.org>
 
        * os.texi (Startup Summary): Small fix for initial-buffer-choice.
@@ -31,7 +77,7 @@
 
        * numbers.texi (Comparison of Numbers): Copyedits.
 
-2014-06-06  Glenn Morris  <rgm@gnu.org>
+2014-06-08  Glenn Morris  <rgm@gnu.org>
 
        * display.texi (Window Systems): Remove window-setup-hook.
        * os.texi (Startup Summary, Init File):
 
        * display.texi (Overlay Properties): Update re priority.  (Bug#17234)
 
-2014-06-05  Glenn Morris  <rgm@gnu.org>
-
        * package.texi (Package Archives): Mention signing packages.
 
-2014-05-27  Glenn Morris  <rgm@gnu.org>
+2014-06-07  Eli Zaretskii  <eliz@gnu.org>
+
+       * commands.texi (Click Events): Update contents of click event's
+       position list due to last changes in make_lispy_position.
+
+2014-06-02  Glenn Morris  <rgm@gnu.org>
 
        * text.texi (Buffer Contents):
        Update for filter-buffer-substring changes.
        * abbrevs.texi (Abbrev Expansion): Update for expand-abbrev changes.
        * functions.texi (Advising Functions): Standardize menu case.
 
-2014-05-17  Eli Zaretskii  <eliz@gnu.org>
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        * display.texi (Invisible Text): Clarify the description of
        line-move-ignore-invisible.  (Bug#17511)
 
-2014-05-07  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-22  Leo Liu  <sdl.web@gmail.com>
+
+       * sequences.texi (Sequence Functions): Don't mention when and how
+       SEQ to nreverse is mutated.
+
+2014-05-21  Leo Liu  <sdl.web@gmail.com>
+
+       * sequences.texi (Sequence Functions): Update nreverse.
+
+2014-05-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Allow any non-nil value to count as true in bool-vector.
+       * sequences.texi (Bool-Vectors): Coalesce discussion of how to
+       print them.  bool-vector's args need not be t or nil.
+
+2014-05-19  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * sequences.texi (Bool-vectors): Mention bool-vector.
+
+2014-05-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Assume C99 or later (Bug#17487).
+       * internals.texi (C Dialect): Document this.
+
+2014-05-15  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lists.texi (Building Cons Cells and Lists): Remove
+       description of `reverse' and `'nreverse' to generalize them...
+       * sequences.texi (Sequences): ...for sequences here.
+
+2014-05-14  Glenn Morris  <rgm@gnu.org>
+
+       * files.texi (Changing Files): Mention with-file-modes.
+
+2014-05-08  Paul Eggert  <eggert@cs.ucla.edu>
 
        * internals.texi (C Dialect): New section.
        (C Integer Types): Mention bool_bf.
 
-2014-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * processes.texi (Filter Functions, Sentinels): Advertise add-function.
 
-2014-04-24  Eli Zaretskii  <eliz@gnu.org>
+2014-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * windows.texi (Window Configurations, Window Configurations):
+       Window configs don't store marks any more.
+
+2014-04-25  Eli Zaretskii  <eliz@gnu.org>
 
        * strings.texi (Text Comparison): Mention equal-including-properties
        for when text properties of the strings matter for comparison.
 
-2014-04-21  Eli Zaretskii  <eliz@gnu.org>
+2014-04-22  Eli Zaretskii  <eliz@gnu.org>
 
        * text.texi (Registers): Document register-read-with-preview.
 
        * internals.texi (Building Emacs): Improve indexing.
 
-2014-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-17  Daniel Colascione  <dancol@dancol.org>
 
-       * display.texi (Overlay Properties): Reword the doc of `priority'.
-       (Finding Overlays): Document new arg of `overlays-at'.
+       * frames.texi (Terminal Parameters): Document new
+       tty-mode-set-strings and tty-mode-reset-strings terminal
+       parameters.
 
-2014-04-05  Glenn Morris  <rgm@gnu.org>
+2014-04-17  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * os.texi (Recording Input): Dribble files may contain passwords.
+       * Makefile.in (infoclean): Be consistent about reporting failures.
+
+2014-04-09  Daniel Colascione  <dancol@dancol.org>
+
+       * errors.texi (Standard Errors): Document required error
+       parameters for `scan-error'.
 
-2014-04-04  Glenn Morris  <rgm@gnu.org>
+       * positions.texi (List Motion): Explain new `up-list' arguments.
+       Mention `backward-up-list'.
+
+2014-04-08  Daniel Colascione  <dancol@dancol.org>
+
+       * minibuf.texi (Programmed Completion): Improve phrasing, remove
+       incorrect bullet count.
+
+2014-04-07  Glenn Morris  <rgm@gnu.org>
+
+       * os.texi (Recording Input): Dribble files may contain passwords.
 
        * backups.texi (Making Backups, Reverting):
        Update for default values of some -function vars no longer being nil.
        (Reverting): Update for buffer-stale-function
        also applying to file-buffers.
 
-2014-03-25  Eli Zaretskii  <eliz@gnu.org>
+2014-03-31  Daniel Colascione  <dancol@dancol.org>
+
+       * minibuf.texi (Completion in Buffers): Discuss using lazy
+       completion tables for inline completion.
+
+2014-03-28  Glenn Morris  <rgm@gnu.org>
+
+       * os.texi (Terminal-Specific): Mention term-file-aliases.
+
+2014-03-26  Eli Zaretskii  <eliz@gnu.org>
 
        * files.texi (Kinds of Files): Improve documentation of
        file-symlink-p.  (Bug#17073)  Add cross-references.
 
-2014-03-24  Barry O'Reilly  <gundaetiapo@gmail.com>
+2014-03-26  Barry O'Reilly  <gundaetiapo@gmail.com>
 
        * markers.texi (Moving Marker Positions): The 2014-03-02 doc
        change mentioning undo's inability to handle relocated markers no
        * text.texi (Undo): Expand documentation of (TEXT . POS) and
        (MARKER . ADJUSTMENT) undo elements.
 
+2014-03-26  Glenn Morris  <rgm@gnu.org>
+
+       * files.texi (File Locks): All systems support locking.
+
 2014-03-22  Glenn Morris  <rgm@gnu.org>
 
+       * commands.texi (Defining Commands):
+       Mention that interactive-only also affects describe-function.
+
+       * functions.texi (Declare Form): Add interactive-only.
+       * commands.texi (Defining Commands) Mention declare.
+
        * commands.texi (Defining Commands): List interactive-only values.
 
 2014-03-22  Eli Zaretskii  <eliz@gnu.org>
        * functions.texi (Core Advising Primitives): Fix cross-reference
        in last change.
 
-2014-03-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-03-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * functions.texi (Advising Functions): Explain a bit more how
        arguments work.
index bb8d4f82884aa35fd6cf3ec507b5a0dcc25622de..2919d97b3a32fa1df97be089a11ccdad2586906c 100644 (file)
@@ -49,9 +49,8 @@ GZIP_PROG = @GZIP_PROG@
 
 HTML_OPTS = --no-split --html
 
-INFO_EXT=@INFO_EXT@
 # Options used only when making info output.
-INFO_OPTS=@INFO_OPTS@
+INFO_OPTS= --no-split
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -125,36 +124,36 @@ srcs = \
   $(srcdir)/gpl.texi \
   $(srcdir)/doclicense.texi
 
-mkinfodir = @${MKDIR_P} ${buildinfodir}
+## Disable implicit rules.
+%.texi: ;
 
-.PHONY: info dvi pdf ps
+.PHONY: info dvi html pdf ps
 
-.SUFFIXES: .ps .dvi
-
-.dvi.ps:
-       $(DVIPS) -o $@ $<
-
-info: $(buildinfodir)/elisp$(INFO_EXT)
+info: $(buildinfodir)/elisp.info
 dvi: $(DVI_TARGETS)
 html: $(HTML_TARGETS)
 pdf: $(PDF_TARGETS)
 ps: $(PS_TARGETS)
 
-## Note: "<" is not portable in ordinary make rules.
-$(buildinfodir)/elisp$(INFO_EXT): $(srcs)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $(srcdir)/elisp.texi
+${buildinfodir}:
+       ${MKDIR_P} $@
+
+$(buildinfodir)/elisp.info: $(srcs) | ${buildinfodir}
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
 
 elisp.dvi: $(srcs)
-       $(ENVADD) $(TEXI2DVI) $(srcdir)/elisp.texi
+       $(ENVADD) $(TEXI2DVI) $<
 
 elisp.html: $(srcs)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $(srcdir)/elisp.texi
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<
 
 elisp.pdf: $(srcs)
-       $(ENVADD) $(TEXI2PDF) $(srcdir)/elisp.texi
+       $(ENVADD) $(TEXI2PDF) $<
+
+elisp.ps: elisp.dvi
+       $(DVIPS) -o $@ $<
 
-.PHONY: mostlyclean clean distclean maintainer-clean infoclean
+.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean infoclean
 
 ## [12] stuff is from two-volume.make.
 mostlyclean:
@@ -171,9 +170,12 @@ distclean: clean
        rm -f Makefile
 
 infoclean:
-       -cd $(buildinfodir) && rm -f elisp$(INFO_EXT) elisp$(INFO_EXT)-[1-9] elisp$(INFO_EXT)-[1-9][0-9]
+       rm -f \
+         $(buildinfodir)/elisp.info \
+         $(buildinfodir)/elisp.info-[1-9] \
+         $(buildinfodir)/elisp.info-[1-9][0-9]
 
-maintainer-clean: distclean infoclean
+bootstrap-clean maintainer-clean: distclean infoclean
 
 .PHONY: dist
 
@@ -190,7 +192,6 @@ dist:
          -e 's/^\(clean:.*\)/\1 infoclean/' \
          -e "s/@ver[s]ion@/${version}/" \
          -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
-         -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
          ${srcdir}/Makefile.in > emacs-lispref-${version}/Makefile
        @if grep '@[a-zA-Z_]*@' emacs-lispref-${version}/Makefile; then \
          echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
index c478b7847d25244bc9ce99dd05e6ee66b2399b2b..58e903918bf275c00fc7dd53bc8f9fee644c3734 100644 (file)
@@ -122,16 +122,19 @@ function symbol's @code{interactive-form} property.  A non-@code{nil}
 value for this property takes precedence over any @code{interactive}
 form in the function body itself.  This feature is seldom used.
 
+@anchor{The interactive-only property}
 @cindex @code{interactive-only} property
   Sometimes, a function is only intended to be called interactively,
 never directly from Lisp.  In that case, give the function a
-non-@code{nil} @code{interactive-only} property.  This causes the
-byte compiler to warn if the command is called from Lisp.  The value
-of the property can be: a string, which the byte-compiler will
-use directly in its warning (it should end with a period,
-and not start with a capital, e.g. ``use @dots{} instead.''); @code{t};
-any other symbol, which should be an alternative function to use in
-Lisp code.
+non-@code{nil} @code{interactive-only} property, either directly
+or via @code{declare} (@pxref{Declare Form}).  This causes the
+byte compiler to warn if the command is called from Lisp.  The output
+of @code{describe-function} will include similar information.
+The value of the property can be: a string, which the byte-compiler
+will use directly in its warning (it should end with a period, and not
+start with a capital, e.g. ``use @dots{} instead.''); @code{t}; any
+other symbol, which should be an alternative function to use in Lisp
+code.
 
 @menu
 * Using Interactive::     General rules for @code{interactive}.
@@ -1393,8 +1396,9 @@ The position in the string where the click occurred.
 @item @var{text-pos}
 For clicks on a marginal area or on a fringe, this is the buffer
 position of the first visible character in the corresponding line in
-the window.  For other events, it is the current buffer position in
-the window.
+the window.  For clicks on the mode line or the header line, this is
+@code{nil}.  For other events, it is the buffer position closest to
+the click.
 
 @item @var{col}, @var{row}
 These are the actual column and row coordinate numbers of the glyph
index 22df02113f07e7f56360923d1bc6204302b2e0b3..bb2e46383961a7d1d2f700cfdade25532ece5dac 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename elisp
+@setfilename ../../info/elisp.info
 
 @ifset VOL1
 @set volflag
index e00496e34784adb07db4a9c514111fb8c1045999..dba8d219774c70a1baf5c2f2eca3b7852a53ca22 100644 (file)
@@ -157,7 +157,10 @@ The message is @samp{Attempt to modify a protected file}.
 @item scan-error
 The message is @samp{Scan error}.  This happens when certain
 syntax-parsing functions find invalid syntax or mismatched
-parentheses.  @xref{List Motion}, and @xref{Parsing Expressions}.
+parentheses.  Conventionally raised with three argument: a
+human-readable error message, the start of the obstacle that cannot be
+moved over, and the end of the obstacle.  @xref{List Motion}, and
+@xref{Parsing Expressions}.
 
 @item search-failed
 The message is @samp{Search failed}.  @xref{Searching and Matching}.
index b071c6a8f35492a6e5ccce32c4d7e1907a6ddc00..ac77b94d8f6b7ef0f149e6920641b69761b56627 100644 (file)
@@ -714,15 +714,15 @@ some other job.
 This function locks the file @var{filename}, if the current buffer is
 modified.  The argument @var{filename} defaults to the current buffer's
 visited file.  Nothing is done if the current buffer is not visiting a
-file, or is not modified, or if the system does not support locking.
+file, or is not modified, or if the option @code{create-lockfiles} is
+@code{nil}.
 @end defun
 
 @defun unlock-buffer
 This function unlocks the file being visited in the current buffer,
 if the buffer is modified.  If the buffer is not modified, then
 the file should not be locked, so this function does nothing.  It also
-does nothing if the current buffer is not visiting a file, or if the
-system does not support locking.
+does nothing if the current buffer is not visiting a file, or is not locked.
 @end defun
 
 @defopt create-lockfiles
@@ -1693,6 +1693,16 @@ version of an existing file; saving a file preserves its existing
 permissions.
 @end defun
 
+@defmac with-file-modes mode body@dots{}
+This macro evaluates the @var{body} forms with the default
+permissions for new files temporarily set to @var{modes} (whose value
+is as for @code{set-file-modes} above).  When finished, it restores
+the original default file permissions, and returns the value of the
+last form in @var{body}.
+
+This is useful for creating private files, for example.
+@end defmac
+
 @defun default-file-modes
 This function returns the default file permissions, as an integer.
 @end defun
index b65134269099ababb461d357283dbcdf99cc5eb7..b95a5ccdb92e1464a3ed07daafd16502f31ec3f3 100644 (file)
@@ -1334,6 +1334,18 @@ terminal.  @xref{DEL Does Not Delete,,, emacs, The Emacs Manual}.
 @item terminal-initted
 After the terminal is initialized, this is set to the
 terminal-specific initialization function.
+@item tty-mode-set-strings
+When present, a list of strings containing escape sequences that Emacs
+will output while configuring a tty for rendering.  Emacs emits these
+strings only when configuring a terminal: if you want to enable a mode
+on a terminal that is already active (for example, while in
+@code{tty-setup-hook}), explicitly output the necessary escape
+sequence using @code{send-string-to-terminal} in addition to adding
+the sequence to @code{tty-mode-set-strings}.
+@item tty-mode-reset-strings
+When present, a list of strings that undo the effects of the strings
+in @code{tty-mode-set-strings}.  Emacs emits these strings when
+exiting, deleting a terminal, or suspending itself.
 @end table
 
 @node Frame Titles
index 019c75ba021a5629d58242f17246c3aa129c0ee1..91fdcc63cbe6318ad06cc998881edbf9ba03c730 100644 (file)
@@ -1209,7 +1209,7 @@ ways to do it.  The added function is also called an @emph{advice}.
 @menu
 * Core Advising Primitives::    Primitives to manipulate advice.
 * Advising Named Functions::    Advising named functions.
-* Advice combinators::          Ways to compose advices.
+* Advice combinators::          Ways to compose advice.
 * Porting old advices::         Adapting code using the old defadvice.
 @end menu
 
@@ -1743,6 +1743,10 @@ Indent calls to this function or macro according to @var{indent-spec}.
 This is typically used for macros, though it works for functions too.
 @xref{Indenting Macros}.
 
+@item (interactive-only @var{value})
+Set the function's @code{interactive-only} property to @var{value}.
+@xref{The interactive-only property}.
+
 @item (obsolete @var{current-name} @var{when})
 Mark the function or macro as obsolete, similar to a call to
 @code{make-obsolete} (@pxref{Obsolete Functions}).  @var{current-name}
index bfc9d491c5e8cd1f36dd82ae9e938eeb07390b67..3d85b474d4b749b369b6a8c0a532305642f8a132 100644 (file)
@@ -513,6 +513,11 @@ created in this Emacs session.  Each of these counters increments for
 a certain kind of object.  See the documentation string for details.
 @end defun
 
+@defun memory-info
+This functions returns an amount of total system memory and how much
+of it is free.  On an unsupported system, the value may be @code{nil}.
+@end defun
+
 @defvar gcs-done
 This variable contains the total number of garbage collections
 done so far in this Emacs session.
@@ -580,15 +585,14 @@ Emacs session.
 @section C Dialect
 @cindex C programming language
 
-The C part of Emacs is portable to C89: C99-specific features such as
-@samp{<stdbool.h>} and @samp{inline} are not used without a check,
+The C part of Emacs is portable to C99 or later: C11-specific features such
+as @samp{<stdalign.h>} and @samp{_Noreturn} are not used without a check,
 typically at configuration time, and the Emacs build procedure
-provides a substitute implementation if necessary.  Some C99 features,
-such as declarations after statements, are too difficult to provide
-substitutes for, so they are avoided entirely.
+provides a substitute implementation if necessary.  Some C11 features,
+such as anonymous structures and unions, are too difficult to emulate,
+so they are avoided entirely.
 
-At some point in the not-too-distant future the base C dialect will
-change from C89 to C99, and eventually it will no doubt change to C11.
+At some point in the future the base C dialect will no doubt change to C11.
 
 @node Writing Emacs Primitives
 @section Writing Emacs Primitives
index 7cc2b39345693e4ba5166c9ddc28ada98e7e09db..e652da033857963a7806c4e471f31d8c09af6d2e 100644 (file)
@@ -1043,22 +1043,6 @@ lambda expression.  This is presumed to be a function, and is treated
 as such (see above).  In order to execute properly as a key binding,
 this function must be a command---it must have an @code{interactive}
 specification.  @xref{Defining Commands}.
-
-@item
-If the @sc{car} of @var{list} is a keymap and the @sc{cdr} is an event
-type, then this is an @dfn{indirect entry}:
-
-@example
-(@var{othermap} . @var{othertype})
-@end example
-
-When key lookup encounters an indirect entry, it looks up instead the
-binding of @var{othertype} in @var{othermap} and uses that.
-
-This feature permits you to define one key as an alias for another key.
-For example, an entry whose @sc{car} is the keymap called @code{esc-map}
-and whose @sc{cdr} is 32 (the code for @key{SPC}) means, ``Use the global
-binding of @kbd{Meta-@key{SPC}}, whatever that may be''.
 @end itemize
 
 @item @var{symbol}
@@ -1066,9 +1050,7 @@ binding of @kbd{Meta-@key{SPC}}, whatever that may be''.
 The function definition of @var{symbol} is used in place of
 @var{symbol}.  If that too is a symbol, then this process is repeated,
 any number of times.  Ultimately this should lead to an object that is
-a keymap, a command, or a keyboard macro.  A list is allowed if it is a
-keymap or a command, but indirect entries are not understood when found
-via symbols.
+a keymap, a command, or a keyboard macro.
 
 Note that keymaps and keyboard macros (strings and vectors) are not
 valid functions, so a symbol with a keymap, string, or vector as its
@@ -1097,8 +1079,7 @@ binding is not executable as a command.
 @end table
 
   In short, a keymap entry may be a keymap, a command, a keyboard
-macro, a symbol that leads to one of them, or an indirection or
-@code{nil}.
+macro, a symbol that leads to one of them, or @code{nil}.
 
 @node Functions for Key Lookup
 @section Functions for Key Lookup
@@ -1945,9 +1926,9 @@ entirely of @acronym{ASCII} characters (or meta variants of @acronym{ASCII}
 characters) are preferred to all other key sequences and that the
 return value can never be a menu binding.
 
-If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't
-follow indirect keymap bindings.  This makes it possible to search for
-an indirect definition itself.
+If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't look
+inside menu-items to find their commands.  This makes it possible to search for
+a menu-item itself.
 
 The fifth argument, @var{no-remap}, determines how this function
 treats command remappings (@pxref{Remapping Commands}).  There are two
index cde7d9ce44ce2f53055b50927ba1e590f68e6c27..f724d5bd902576978dc0f3964f68266c4800ec02 100644 (file)
@@ -601,25 +601,6 @@ not a list, the sequence's elements do not become elements of the
 resulting list.  Instead, the sequence becomes the final @sc{cdr}, like
 any other non-list final argument.
 
-@defun reverse list
-This function creates a new list whose elements are the elements of
-@var{list}, but in reverse order.  The original argument @var{list} is
-@emph{not} altered.
-
-@example
-@group
-(setq x '(1 2 3 4))
-     @result{} (1 2 3 4)
-@end group
-@group
-(reverse x)
-     @result{} (4 3 2 1)
-x
-     @result{} (1 2 3 4)
-@end group
-@end example
-@end defun
-
 @defun copy-tree tree &optional vecp
 This function returns a copy of the tree @code{tree}.  If @var{tree} is a
 cons cell, this makes a new cons cell with the same @sc{car} and
@@ -1143,58 +1124,6 @@ each time you run it!  Here is what happens:
 @end smallexample
 @end defun
 
-@defun nreverse list
-@cindex reversing a list
-  This function reverses the order of the elements of @var{list}.
-Unlike @code{reverse}, @code{nreverse} alters its argument by reversing
-the @sc{cdr}s in the cons cells forming the list.  The cons cell that
-used to be the last one in @var{list} becomes the first cons cell of the
-value.
-
-  For example:
-
-@example
-@group
-(setq x '(a b c))
-     @result{} (a b c)
-@end group
-@group
-x
-     @result{} (a b c)
-(nreverse x)
-     @result{} (c b a)
-@end group
-@group
-;; @r{The cons cell that was first is now last.}
-x
-     @result{} (a)
-@end group
-@end example
-
-  To avoid confusion, we usually store the result of @code{nreverse}
-back in the same variable which held the original list:
-
-@example
-(setq x (nreverse x))
-@end example
-
-  Here is the @code{nreverse} of our favorite example, @code{(a b c)},
-presented graphically:
-
-@smallexample
-@group
-@r{Original list head:}                       @r{Reversed list:}
- -------------        -------------        ------------
-| car  | cdr  |      | car  | cdr  |      | car | cdr  |
-|   a  |  nil |<--   |   b  |   o  |<--   |   c |   o  |
-|      |      |   |  |      |   |  |   |  |     |   |  |
- -------------    |   --------- | -    |   -------- | -
-                  |             |      |            |
-                   -------------        ------------
-@end group
-@end smallexample
-@end defun
-
 @defun sort list predicate
 @cindex stable sort
 @cindex sorting lists
index 4a94f41d73275fcf5c4435da02b47c49699d896e..1c6a74a89fddb8c9806d3a9d3a561e3913460907 100644 (file)
@@ -102,8 +102,8 @@ the minibuffer is in a separate frame.  @xref{Minibuffers and Frames}.
   When Emacs is running in batch mode, any request to read from the
 minibuffer actually reads a line from the standard input descriptor that
 was supplied when Emacs was started.  This supports only basic input:
-none of the special minibuffer features (history, completion,
-password hiding, etc.) are available in batch mode.
+none of the special minibuffer features (history, completion, etc.)
+are available in batch mode.
 
 @node Text from Minibuffer
 @section Reading Text Strings with the Minibuffer
@@ -1736,7 +1736,7 @@ possible match, and ignore the match if the predicate returns
 
 @item
 A flag specifying the type of completion operation to perform.  This
-is one of the following four values:
+flag may be one of the following values.
 
 @table @code
 @item nil
@@ -1875,11 +1875,34 @@ next function in @code{completion-at-point-functions} instead of
 reporting a completion failure.
 @end table
 
+Supplying a function for @var{collection} is strongly recommended if
+generating the list of completions is an expensive operation.  Emacs
+may internally call functions in @code{completion-at-point-functions}
+many times, but care about the value of @var{collection} for only some
+of these calls.  By supplying a function for @var{collection}, Emacs
+can defer generating completions until necessary.  You can use
+@var{completion-table-dynamic} to create a wrapper function:
+
+@smallexample
+;; Avoid this pattern.
+(let ((beg ...) (end ...) (my-completions (my-make-completions)))
+  (list beg end my-completions))
+
+;; Use this instead.
+(let ((beg ...) (end ...))
+  (list beg
+        end
+        (completion-table-dynamic
+          (lambda (_)
+            (my-make-completions)))))
+@end smallexample
+
 A function in @code{completion-at-point-functions} may also return a
-function.  In that case, that returned function is called, with no
-argument, and it is entirely responsible for performing the
-completion.  We discourage this usage; it is intended to help convert
-old code to using @code{completion-at-point}.
+function instead of a list as described above.  In that case, that
+returned function is called, with no argument, and it is entirely
+responsible for performing the completion.  We discourage this usage;
+it is intended to help convert old code to using
+@code{completion-at-point}.
 
 The first function in @code{completion-at-point-functions} to return a
 non-@code{nil} value is used by @code{completion-at-point}.  The
@@ -2124,9 +2147,10 @@ function @code{read-passwd}.
 
 @defun read-passwd prompt &optional confirm default
 This function reads a password, prompting with @var{prompt}.  It does
-not echo the password as the user types it; instead, it echoes @samp{.}
-for each character in the password.  (Note that in batch mode, the
-input is not hidden.)
+not echo the password as the user types it; instead, it echoes
+@samp{.}  for each character in the password.  If you want to apply
+another character to hide the password, let-bind the variable
+@code{read-hide-char} with that character.
 
 The optional argument @var{confirm}, if non-@code{nil}, says to read the
 password twice and insist it must be the same both times.  If it isn't
index 3b63e08676cf06f1e28046ea767dc7ec9971e7ae..5cfbb9ff2ef40a02c2bb1a7995af6e00b0c71db6 100644 (file)
@@ -443,10 +443,13 @@ This variable holds the name of the @file{.emacs.d} directory.  It is
 run on that type of terminal.  The library's name is constructed by
 concatenating the value of the variable @code{term-file-prefix} and the
 terminal type (specified by the environment variable @env{TERM}).
-Normally, @code{term-file-prefix} has the value
-@code{"term/"}; changing this is not recommended.  Emacs finds the file
-in the normal manner, by searching the @code{load-path} directories, and
-trying the @samp{.elc} and @samp{.el} suffixes.
+Normally, @code{term-file-prefix} has the value @code{"term/"};
+changing this is not recommended.  If there is an entry matching
+@env{TERM} in the @code{term-file-aliases} association list,
+Emacs uses the associated value in place of @env{TERM}.
+Emacs finds the file in the normal manner, by searching the
+@code{load-path} directories, and trying the @samp{.elc} and
+@samp{.el} suffixes.
 
 @cindex Termcap
   The usual role of a terminal-specific library is to enable special
@@ -475,7 +478,7 @@ a normal hook that Emacs runs after initializing a new text terminal.
 You could use this hook to define initializations for terminals that do not
 have their own libraries.  @xref{Hooks}.
 
-@defvar term-file-prefix
+@defopt term-file-prefix
 @cindex @env{TERM} environment variable
 If the value of this variable is non-@code{nil}, Emacs loads a
 terminal-specific initialization file as follows:
@@ -490,7 +493,14 @@ init file if you do not wish to load the
 terminal-initialization file.
 
 On MS-DOS, Emacs sets the @env{TERM} environment variable to @samp{internal}.
-@end defvar
+@end defopt
+
+@defopt term-file-aliases
+This variable is an an association list mapping terminal types to
+their aliases.  For example, an element of the form @code{("vt102"
+. "vt100")} means to treat a terminal of type @samp{vt102} like one of
+type @samp{vt100}.
+@end defopt
 
 @defvar tty-setup-hook
 This variable is a normal hook that Emacs runs after initializing a
index fee36fa833db7f2ccf808418bf73caf333f60db2..e32f0ef0b34986a3f9f27f3cf03f582ee5df8865 100644 (file)
@@ -651,9 +651,19 @@ parentheses.  (Other syntactic entities such as words or paired string
 quotes are ignored.)
 @end deffn
 
-@deffn Command up-list &optional arg
-This function moves forward out of @var{arg} (default 1) levels of parentheses.
-A negative argument means move backward but still to a less deep spot.
+@deffn Command up-list &optional arg escape-strings no-syntax-crossing
+This function moves forward out of @var{arg} (default 1) levels of
+parentheses.  A negative argument means move backward but still to a
+less deep spot.  If @var{escape-strings} is non-nil (as it is
+interactively), move out of enclosing strings as well. If
+@var{no-syntax-crossing} is non-nil (as it is interactively), prefer
+to break out of any enclosing string instead of moving to the start of
+a list broken across multiple strings.  On error, location of point is
+unspecified.
+@end deffn
+
+@deffn Command backward-up-list &optional arg escape-strings no-syntax-crossing
+This function is just like @code{up-list}, but with a negated argument.
 @end deffn
 
 @deffn Command down-list &optional arg
index c91afdffdebd1085d266d69d719f9440771c3ece..db80f0537e09d09618b5d2849141c7b8b5b450cd 100644 (file)
@@ -1484,7 +1484,7 @@ The arguments @var{seconds} and @var{millisec} let you specify timeout
 periods.  The former specifies a period measured in seconds and the
 latter specifies one measured in milliseconds.  The two time periods
 thus specified are added together, and @code{accept-process-output}
-returns after that much time, whether or not there has been any
+returns after that much time, even if there is no
 subprocess output.
 
 The argument @var{millisec} is obsolete (and should not be used),
@@ -1502,7 +1502,8 @@ recommended, but may be necessary for specific applications, such as
 speech synthesis.
 
 The function @code{accept-process-output} returns non-@code{nil} if it
-did get some output, or @code{nil} if the timeout expired before output
+got output from @var{process}, or from any process if @var{process} is
+@code{nil}.  It returns @code{nil} if the timeout expired before output
 arrived.
 @end defun
 
index b518bfc6b73408f66088986558dca230f3ef51ca..8f17862d4277d88e642bd811f9e5e6e48a155ac0 100644 (file)
@@ -217,6 +217,116 @@ y @result{} [foo (69 2)]
 @end example
 @end defun
 
+@defun reverse seq
+@cindex string reverse
+@cindex list reverse
+@cindex vector reverse
+@cindex sequence reverse
+This function creates a new sequence whose elements are the elements
+of @var{seq}, but in reverse order.  The original argument @var{seq}
+is @emph{not} altered.   Note that char-table cannot be reversed.
+
+@example
+@group
+(setq x '(1 2 3 4))
+     @result{} (1 2 3 4)
+@end group
+@group
+(reverse x)
+     @result{} (4 3 2 1)
+x
+     @result{} (1 2 3 4)
+@end group
+@group
+(setq x [1 2 3 4])
+     @result{} [1 2 3 4]
+@end group
+@group
+(reverse x)
+     @result{} [4 3 2 1]
+x
+     @result{} [1 2 3 4]
+@end group
+@group
+(setq x "xyzzy")
+     @result{} "xyzzy"
+@end group
+@group
+(reverse x)
+     @result{} "yzzyx"
+x
+     @result{} "xyzzy"
+@end group
+@end example
+@end defun
+
+@defun nreverse seq
+@cindex reversing a string
+@cindex reversing a list
+@cindex reversing a vector
+  This function reverses the order of the elements of @var{seq}.
+Unlike @code{reverse} the original @var{seq} may be modified.
+
+  For example:
+
+@example
+@group
+(setq x '(a b c))
+     @result{} (a b c)
+@end group
+@group
+x
+     @result{} (a b c)
+(nreverse x)
+     @result{} (c b a)
+@end group
+@group
+;; @r{The cons cell that was first is now last.}
+x
+     @result{} (a)
+@end group
+@end example
+
+  To avoid confusion, we usually store the result of @code{nreverse}
+back in the same variable which held the original list:
+
+@example
+(setq x (nreverse x))
+@end example
+
+  Here is the @code{nreverse} of our favorite example, @code{(a b c)},
+presented graphically:
+
+@smallexample
+@group
+@r{Original list head:}                       @r{Reversed list:}
+ -------------        -------------        ------------
+| car  | cdr  |      | car  | cdr  |      | car | cdr  |
+|   a  |  nil |<--   |   b  |   o  |<--   |   c |   o  |
+|      |      |   |  |      |   |  |   |  |     |   |  |
+ -------------    |   --------- | -    |   -------- | -
+                  |             |      |            |
+                   -------------        ------------
+@end group
+@end smallexample
+
+  For the vector, it is even simpler because you don't need setq:
+
+@example
+(setq x [1 2 3 4])
+     @result{} [1 2 3 4]
+(nreverse x)
+     @result{} [4 3 2 1]
+x
+     @result{} [4 3 2 1]
+@end example
+
+Note that unlike @code{reverse}, this function doesn't work with strings.
+Although you can alter string data by using @code{aset}, it is strongly
+encouraged to treat strings as immutable.
+
+@end defun
+
 @node Arrays
 @section Arrays
 @cindex array
@@ -699,7 +809,7 @@ value into an element of the bool-vector, the effect is to store
 and the length cannot be changed once the bool-vector is created.
 Bool-vectors are constants when evaluated.
 
-  There are two special functions for working with bool-vectors; aside
+  Several functions work specifically with bool-vectors; aside
 from that, you manipulate them with same functions used for other kinds
 of arrays.
 
@@ -708,6 +818,11 @@ Return a new bool-vector of @var{length} elements,
 each one initialized to @var{initial}.
 @end defun
 
+@defun bool-vector &rest objects
+This function creates and returns a bool-vector whose elements are the
+arguments, @var{objects}.
+@end defun
+
 @defun bool-vector-p object
 This returns @code{t} if @var{object} is a bool-vector,
 and @code{nil} otherwise.
@@ -761,9 +876,29 @@ or @code{nil}, and @var{i} is an index into @code{a}.
 Return the number of elements that are @code{t} in bool vector @var{a}.
 @end defun
 
-  Here is an example of creating, examining, and updating a
-bool-vector.  Note that the printed form represents up to 8 boolean
-values as a single character.
+  The printed form represents up to 8 boolean values as a single
+character:
+
+@example
+@group
+(bool-vector t nil t nil)
+     @result{} #&4"^E"
+(bool-vector)
+     @result{} #&0""
+@end group
+@end example
+
+You can use @code{vconcat} to print a bool-vector like other vectors:
+
+@example
+@group
+(vconcat (bool-vector nil t nil t))
+     @result{} [nil t nil t]
+@end group
+@end example
+
+  Here is another example of creating, examining, and updating a
+bool-vector:
 
 @example
 (setq bv (make-bool-vector 5 t))
index e4177836fa882f1e9ee587c50f3a0db31ab0dd1e..f2fe5c85a937a902981112825da37fa6774bc322 100644 (file)
@@ -3655,7 +3655,7 @@ This function returns the top pixel edge of window @var{window}.
 
 A @dfn{window configuration} records the entire layout of one
 frame---all windows, their sizes, which buffers they contain, how those
-buffers are scrolled, and their values of point and the mark; also their
+buffers are scrolled, and their value of point; also their
 fringes, margins, and scroll bar settings.  It also includes the value
 of @code{minibuffer-scroll-window}.  As a special exception, the window
 configuration does not record the value of point in the selected window
@@ -3731,13 +3731,13 @@ This function returns @code{t} if @var{object} is a window configuration.
 
 @defun compare-window-configurations config1 config2
 This function compares two window configurations as regards the
-structure of windows, but ignores the values of point and mark and the
+structure of windows, but ignores the values of point and the
 saved scrolling positions---it can return @code{t} even if those
 aspects differ.
 
 The function @code{equal} can also compare two window configurations; it
 regards configurations as unequal if they differ in any respect, even a
-saved point or mark.
+saved point.
 @end defun
 
 @defun window-configuration-frame config
index 30fe5bfd3e989ad54b7519bbe9372c8606700ce9..45bdb64d8b000cbfee6ae399338f2f1b7606241c 100644 (file)
@@ -1,5 +1,5 @@
 .\" See section COPYING for copyright and redistribution information.
-.TH EMACS 1 "2007 April 13" "GNU Emacs 24.3.92"
+.TH EMACS 1 "2007 April 13" "GNU Emacs 24.4.50"
 .
 .
 .SH NAME
index 0ad35d3803a7a748d2fa11b8aa7201e869112626..934b35c8840c0088ef85eed1253fea8cd318401b 100644 (file)
-2014-07-25  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-31  Tassilo Horn  <tsdh@gnu.org>
+
+       * gnus.texi (Group Parameters): Document that `gcc-self' may also be a
+       list.
+
+2014-07-28  Stephen Berman  <stephen.berman@gmx.net>
 
        * todo-mode.texi (Marked Items): Correct omission of item deletion
        from commands applying to both todo and done items.
 
-2014-07-04  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-18  Albert Krewinkel  <albert+gnus@zeitkraut.de>
+
+       * gnus.texi (Posting Styles): Document the possibility to perform
+       string replacements when matching against headers.
+
+2014-07-09  Stephen Berman  <stephen.berman@gmx.net>
 
        * todo-mode.texi (Levels of Organization): Comment out statement
        that Emacs recognizes todo files by their extension, since this
        feature has been removed due to bug#17482.
 
-2014-06-29  Glenn Morris  <rgm@gnu.org>
+2014-07-03  Michael Albinus  <michael.albinus@gmx.de>
+
+       * trampver.texi: Update release number.
+
+2014-07-03  Glenn Morris  <rgm@gnu.org>
 
        * info.texi, mh-e.texi: "Online help" doesn't mean what it
        used to any more.
 
        * idlwave.texi (Introduction): Comment out dead http screenshot links.
 
-2014-06-23  Leo Liu  <sdl.web@gmail.com>
+2014-06-24  Leo Liu  <sdl.web@gmail.com>
+
+       * dired-x.texi (Omitting Files in Dired, Omitting Variables):
+       Fix key binding to dired-omit-mode.  (Bug#16354)
+
+2014-06-24  Eli Zaretskii  <eliz@gnu.org>
 
-       * dired-x.texi (Omitting Files in Dired, Omitting Variables): Fix
-       key binding to dired-omit-mode.  (Bug#16354)
+       * autotype.texi (Skeleton Language): Document the \n feature better.
 
-2014-06-22  Eli Zaretskii  <eliz@gnu.org>
+2014-06-23  Glenn Morris  <rgm@gnu.org>
 
-       * autotype.texi (Skeleton Language): Document the \n feature
-       better.
+       * Makefile.in (%.texi): Disable implicit rules.
+
+2014-06-22  Mario Lang  <mlang@delysid.org>
+
+       * srecode.texi (Base Arguments): The the -> to the.
+
+       * org.texi (Images in ODT export): The the -> the.
 
 2014-06-21  Eli Zaretskii  <eliz@gnu.org>
 
        * autotype.texi (Skeleton Language): Document the feature of \n
        when at eol.
 
-2014-06-15  Michael Albinus  <michael.albinus@gmx.de>
+2014-06-21  Michael Albinus  <michael.albinus@gmx.de>
 
        * dbus.texi (Type Conversion): Formatting edits in example.
 
-2014-06-10  Glenn Morris  <rgm@gnu.org>
+2014-06-15  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.2.10.
+
+       * tramp.texi (Inline methods): Remove restriction on "telnet".
+       Recommend sharing ssh connections for "plink".
+       (External methods): Remove "sftp".  Merge "pscp" and "psftp"
+       descriptions.  Recommend sharing ssh connections.  Add "nc" method.
+       (GVFS based methods): Add "sftp".
+       (Customizing Completion, External packages, Issues):
+       Use @dots{}.
+
+       * trampver.texi: Update release number.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (bootstrap-clean): New.
+
+2014-06-12  Vincent Belaïche  <vincentb1@users.sourceforge.net>
+
+       * ses.texi: Adding documentation for SES local printer functions.
+
+2014-06-12  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in: Use GNU Make features to reduce duplication.
+       (mkinfodir): Remove.
+       (${buildinfodir}): Generate using an order-only prerequisite.
+       (.dvi.ps): Replace with pattern rule.
+       ($INFO_TARGETS): Mark as PHONY.
+       (${buildinfodir}): New rule.
+       (EXTRA_OPTS, need_emacsver, need_emacsver_prefix): New variables.
+       (${buildinfodir}/%.info, %.dvi, %.pdf, %.html, %.ps):
+       New pattern rules, replacing numerous previous explicit rules.
+       (info_template): New definition.
+       (gnus.dvi, gnus.pdf): Use distinct intermediate files.
+       (mostlyclean): Adjust for above gnus change.
+
+2014-06-11  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in (INFO_INSTALL): Update for 2013-08-28 DOCMISC_W32 change.
 
+2014-06-10  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (INFO_EXT): Remove and replace by ".info" throughout.
+       (INFO_OPTS): Set directly rather than with configure.
+
 2014-06-08  Karl Berry  <karl@gnu.org>
 
        * doc/info.texi (Help-^L): "mode line", "screenful",
        * todo-mode.texi (Moving and Deleting Items):
        * woman.texi (Navigation): Markup fixes re SPC, RET.
 
-2014-05-24  Paul Eggert  <eggert@cs.ucla.edu>
+2014-06-02  Glenn Morris  <rgm@gnu.org>
+
+       * efaq.texi (Finding a package with particular functionality):
+       Update example.
+       * vip.texi: Mention this is obsolete.
+
+2014-05-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * texinfo.tex: Update from gnulib.
+
+2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        Specify coding if Latin-1 Emacs would misinterpret (Bug#17575).
        * htmlfontify.texi, org.texi: Add "coding: utf-8".
 
-2014-05-23  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-26  Stephen Berman  <stephen.berman@gmx.net>
 
        * todo-mode.texi: Update in light of changes due to bug#17482.
        Replace numerous mistaken uses of literal quotes with proper
        (Todo Mode Entry Points): Comment out reference to using find-file
        or Dired to visit Todo files, since this has been disabled (bug#17482).
 
-2014-05-06  Michael Albinus  <michael.albinus@gmx.de>
+2014-05-20  Leo Liu  <sdl.web@gmail.com>
+
+       * cl.texi (List Functions, Efficiency Concerns): Update cl-endp.
+
+2014-05-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * texinfo.tex: Update from gnulib.
+
+2014-05-08  Michael Albinus  <michael.albinus@gmx.de>
 
        * tramp.texi (Frequently Asked Questions): Mention HISTFILE
        setting in ~/.ssh/environment.
 
-2014-05-02  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-04  Stephen Berman  <stephen.berman@gmx.net>
 
        * todo-mode.texi: Update, improve exposition, add cross
        references, fix typos.
        (Inserting New Items, Editing Item Headers and Text): Rewrite to
        document new user interface.
 
-2014-05-01  Glenn Morris  <rgm@gnu.org>
+2014-05-04  Glenn Morris  <rgm@gnu.org>
 
        * autotype.texi (Skeleton Language):
        * message.texi (Header Commands): Replace `iff'.
 
+2014-05-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * vhdl-mode.texi: Add "@documentencoding UTF-8",
+       since this is a toplevel .texi file.
+
 2014-04-22  Bastien Guerry  <bzg@gnu.org>
 
        * org.texi (Installation): Be more clear on why installing Org
        * org.texi (Top, Exporting): Org has its own documentation and
        should therefore be removed from "Other build-in back-ends".
 
+2014-04-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * cl.texi (Structures): Remove cl-struct-set-slot-value.
+
+2014-04-20  Daniel Colascione  <dancol@dancol.org>
+
+       * cl.texi (Declarations): Document changes to `cl-the' and defstruct functions.
+
+2014-04-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.in (infoclean): Be consistent about reporting failures.
+
+2014-03-27  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (INFO_COMMON): Add vhdl-mode.
+       (vhdl_mode_deps, vhdl-mode, $(buildinfodir)/vhdl-mode$(INFO_EXT))
+       (vhdl-mode.dvi, vhdl-mode.pdf, vhdl-mode.html): New rules/variables.
+
+       * vhdl-mode.texi: General clean-up.  Set copyright to FSF, add license.
+       Remove hand-written node pointers.  Remove info re old Emacs versions.
+       Markup fixes.
+       (Getting Connected): Remove irrelevant info.
+       (Indentation Commands, Requirements): Remove empty/irrelevant nodes.
+       (Frequently Asked Questions): Electric indent is now enabled.
+
+2014-03-27  Reto Zimmermann  <reto@gnu.org>
+           Rod Whitby  <software.vhdl-mode@rwhitby.net>
+
+       * vhdl-mode.texi: New file, imported from upstream vhdl-mode.
+
 2014-03-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        * texinfo.tex: Update from gnulib.
 
-2014-03-24  Michael Albinus  <michael.albinus@gmx.de>
+2014-03-26  Michael Albinus  <michael.albinus@gmx.de>
 
        * tramp.texi (Frequently Asked Questions): Add fish shell settings.
 
+2014-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.texi (Ma Gnus): Mention header attachment buttons.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * emacs-mime.texi (MML Definition): Document recipient-filename.
+
+2014-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.texi (MIME Commands): Mention
+       gnus-mime-buttonize-attachments-in-header and
+       gnus-mime-display-attachment-buttons-in-header.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * message.texi (Forwarding): Mention
+       `message-forward-included-headers'.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus.texi: w3 is no longer supported by Gnus.
+
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * efaq.texi (Informational files for Emacs): Do not mention etc/GNU.
+
 2014-03-21  Glenn Morris  <rgm@gnu.org>
 
        * ede.texi (ede-linux):
index d75628926150295fcf43fcc50bd9ae4505e65f88..53537122cef8d4a6ef30d7305171785c29f281a0 100644 (file)
 
 SHELL = @SHELL@
 
-# Where to find the source code.  $(srcdir) will be the man-aux
-# subdirectory of the source tree.  This is
-# set by the configure script's `--srcdir' option.
+# Where to find the source code.  $(srcdir) will be the doc/misc subdirectory
+# of the source tree.  This is set by configure's `--srcdir' option.
 srcdir=@srcdir@
 
 version=@version@
 
 ## Where the output files go.
+## Note that all the Info targets build the Info files in srcdir.
+## There is no provision for Info files to exist in the build directory.
+## In a tarfile of Emacs, the Info files should be up to date.
 buildinfodir = $(srcdir)/../../info
+
 ## Directory with emacsver.texi.
 emacsdir = $(srcdir)/../emacs
 
@@ -47,15 +50,16 @@ GZIP_PROG = @GZIP_PROG@
 
 HTML_OPTS = --no-split --html
 
-INFO_EXT=@INFO_EXT@
 # Options used only when making info output.
-INFO_OPTS=@INFO_OPTS@
+# (Note that idlwave, info used --nosplit even without the .info extension.)
+INFO_OPTS= --no-split
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
 # The makeinfo program is part of the Texinfo distribution.
 # Use --force so that it generates output even if there are errors.
+# (TODO?  Why is this appropriate?)
 MAKEINFO = @MAKEINFO@
 MAKEINFO_OPTS = --force -I$(emacsdir)
 
@@ -70,7 +74,7 @@ INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl \
        mairix-el message mh-e newsticker nxml-mode octave-mode \
        org pcl-cvs pgg rcirc remember reftex sasl \
        sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \
-       url vip viper widget wisent woman
+       url vhdl-mode vip viper widget wisent woman
 
 ## Info files to install on current platform.
 INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_W32)
@@ -97,18 +101,14 @@ DVIPS = dvips
 ENVADD = TEXINPUTS="$(srcdir):$(emacsdir):$(TEXINPUTS)" \
          MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)"
 
-mkinfodir = @${MKDIR_P} ${buildinfodir}
-
 gfdl = ${srcdir}/doclicense.texi
 
-.PHONY: info dvi html pdf ps echo-info
+.PHONY: info dvi html pdf ps echo-info $(INFO_TARGETS)
 ## Prevent implicit rule triggering for foo.info.
 .SUFFIXES:
 
-.SUFFIXES: .ps .dvi
-
-.dvi.ps:
-       $(DVIPS) -o $@ $<
+## Disable implicit rules.
+%.texi: ;
 
 # Default.
 info: $(INFO_TARGETS)
@@ -117,7 +117,7 @@ info: $(INFO_TARGETS)
 ## Base file names of output info files.
 echo-info:
        @echo "$(INFO_INSTALL) " | \
-         sed -e 's|[^ ]*/||g' -e 's/\.info//g' -e "s/  */$(INFO_EXT) /g"
+         sed -e 's|[^ ]*/||g' -e 's/\.info//g' -e "s/  */.info /g"
 
 dvi: $(DVI_TARGETS)
 
@@ -127,738 +127,98 @@ pdf: $(PDF_TARGETS)
 
 ps: $(PS_TARGETS)
 
-# Note that all the Info targets build the Info files in srcdir.
-# There is no provision for Info files to exist in the build directory.
-# In a distribution of Emacs, the Info files should be up to date.
-
-# Note: "<" is not portable in ordinary make rules.
-
-ada_mode_deps = ${srcdir}/ada-mode.texi ${gfdl}
-ada-mode : $(buildinfodir)/ada-mode$(INFO_EXT)
-$(buildinfodir)/ada-mode$(INFO_EXT): $(ada_mode_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/ada-mode.texi
-ada-mode.dvi: $(ada_mode_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/ada-mode.texi
-ada-mode.pdf: $(ada_mode_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/ada-mode.texi
-ada-mode.html: $(ada_mode_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/ada-mode.texi
-
-auth_deps = ${srcdir}/auth.texi ${gfdl}
-auth : $(buildinfodir)/auth$(INFO_EXT)
-$(buildinfodir)/auth$(INFO_EXT): $(auth_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/auth.texi
-auth.dvi: $(auth_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/auth.texi
-auth.pdf: $(auth_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/auth.texi
-auth.html: $(auth_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/auth.texi
-
-autotype_deps = ${srcdir}/autotype.texi ${gfdl}
-autotype : $(buildinfodir)/autotype$(INFO_EXT)
-$(buildinfodir)/autotype$(INFO_EXT): $(autotype_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/autotype.texi
-autotype.dvi: $(autotype_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/autotype.texi
-autotype.pdf: $(autotype_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/autotype.texi
-autotype.html: $(autotype_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/autotype.texi
-
-bovine_deps = ${srcdir}/bovine.texi ${gfdl}
-bovine : $(buildinfodir)/bovine$(INFO_EXT)
-$(buildinfodir)/bovine$(INFO_EXT): $(bovine_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/bovine.texi
-bovine.dvi: $(bovine_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/bovine.texi
-bovine.pdf: $(bovine_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/bovine.texi
-bovine.html: $(bovine_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/bovine.texi
-
-calc_deps = ${srcdir}/calc.texi $(emacsdir)/emacsver.texi ${gfdl}
-calc : $(buildinfodir)/calc$(INFO_EXT)
-$(buildinfodir)/calc$(INFO_EXT): $(calc_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/calc.texi
-calc.dvi: $(calc_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/calc.texi
-calc.pdf: $(calc_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/calc.texi
-calc.html: $(calc_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/calc.texi
-
-cc_mode_deps = ${srcdir}/cc-mode.texi ${gfdl}
-ccmode : $(buildinfodir)/ccmode$(INFO_EXT)
-$(buildinfodir)/ccmode$(INFO_EXT): $(cc_mode_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/cc-mode.texi
-cc-mode.dvi: $(cc_mode_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/cc-mode.texi
-cc-mode.pdf: $(cc_mode_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/cc-mode.texi
-cc-mode.html: $(cc_mode_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/cc-mode.texi
-
-cl_deps = ${srcdir}/cl.texi $(emacsdir)/emacsver.texi ${gfdl}
-cl : $(buildinfodir)/cl$(INFO_EXT)
-$(buildinfodir)/cl$(INFO_EXT): $(cl_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/cl.texi
-cl.dvi: $(cl_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi
-cl.pdf: $(cl_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/cl.texi
-cl.html: $(cl_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/cl.texi
-
-dbus_deps = ${srcdir}/dbus.texi ${gfdl}
-dbus : $(buildinfodir)/dbus$(INFO_EXT)
-$(buildinfodir)/dbus$(INFO_EXT): $(dbus_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/dbus.texi
-dbus.dvi: $(dbus_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/dbus.texi
-dbus.pdf: $(dbus_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/dbus.texi
-dbus.html: $(dbus_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/dbus.texi
-
-dired_x_deps = ${srcdir}/dired-x.texi $(emacsdir)/emacsver.texi ${gfdl}
-dired-x : $(buildinfodir)/dired-x$(INFO_EXT)
-$(buildinfodir)/dired-x$(INFO_EXT): $(dired_x_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/dired-x.texi
-dired-x.dvi: $(dired_x_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/dired-x.texi
-dired-x.pdf: $(dired_x_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/dired-x.texi
-dired-x.html: $(dired_x_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/dired-x.texi
-
-ebrowse_deps = ${srcdir}/ebrowse.texi ${gfdl}
-ebrowse : $(buildinfodir)/ebrowse$(INFO_EXT)
-$(buildinfodir)/ebrowse$(INFO_EXT): $(ebrowse_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/ebrowse.texi
-ebrowse.dvi: $(ebrowse_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/ebrowse.texi
-ebrowse.pdf: $(ebrowse_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/ebrowse.texi
-ebrowse.html: $(ebrowse_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/ebrowse.texi
-
-ede_deps = ${srcdir}/ede.texi ${gfdl}
-ede : $(buildinfodir)/ede$(INFO_EXT)
-$(buildinfodir)/ede$(INFO_EXT): $(ede_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/ede.texi
-ede.dvi: $(ede_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/ede.texi
-ede.pdf: $(ede_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/ede.texi
-ede.html: $(ede_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/ede.texi
-
-ediff_deps = ${srcdir}/ediff.texi ${gfdl}
-ediff : $(buildinfodir)/ediff$(INFO_EXT)
-$(buildinfodir)/ediff$(INFO_EXT): $(ediff_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/ediff.texi
-ediff.dvi: $(ediff_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi
-ediff.pdf: $(ediff_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/ediff.texi
-ediff.html: $(ediff_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/ediff.texi
-
-edt_deps = ${srcdir}/edt.texi ${gfdl}
-edt : $(buildinfodir)/edt$(INFO_EXT)
-$(buildinfodir)/edt$(INFO_EXT): $(edt_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/edt.texi
-edt.dvi: $(edt_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/edt.texi
-edt.pdf: $(edt_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/edt.texi
-edt.html: $(edt_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/edt.texi
-
-## No gfdl dependency.
-efaq_deps = ${srcdir}/efaq.texi $(emacsdir)/emacsver.texi
-efaq : $(buildinfodir)/efaq$(INFO_EXT)
-$(buildinfodir)/efaq$(INFO_EXT): $(efaq_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/efaq.texi
-efaq.dvi: $(efaq_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/efaq.texi
-efaq.pdf: $(efaq_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/efaq.texi
-efaq.html: $(efaq_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/efaq.texi
-
-efaq_w32_deps = ${srcdir}/efaq-w32.texi $(emacsdir)/emacsver.texi
-efaq-w32 : $(buildinfodir)/efaq-w32$(INFO_EXT)
-$(buildinfodir)/efaq-w32$(INFO_EXT): $(efaq_w32_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/efaq-w32.texi
-efaq-w32.dvi: $(efaq_w32_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/efaq-w32.texi
-efaq-w32.pdf: $(efaq_w32_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/efaq-w32.texi
-efaq-w32.html: $(efaq_w32_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/efaq-w32.texi
-
-eieio_deps = ${srcdir}/eieio.texi ${gfdl}
-eieio : $(buildinfodir)/eieio$(INFO_EXT)
-$(buildinfodir)/eieio$(INFO_EXT): $(eieio_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/eieio.texi
-eieio.dvi: $(eieio_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/eieio.texi
-eieio.pdf: $(eieio_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/eieio.texi
-eieio.html: $(eieio_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/eieio.texi
-
-emacs_gnutls_deps = ${srcdir}/emacs-gnutls.texi ${gfdl}
-emacs-gnutls : $(buildinfodir)/emacs-gnutls$(INFO_EXT)
-$(buildinfodir)/emacs-gnutls$(INFO_EXT): $(emacs_gnutls_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/emacs-gnutls.texi
-emacs-gnutls.dvi: $(emacs_gnutls_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-gnutls.texi
-emacs-gnutls.pdf: $(emacs_gnutls_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-gnutls.texi
-emacs-gnutls.html: $(emacs_gnutls_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/emacs-gnutls.texi
-
-emacs_mime_deps = ${srcdir}/emacs-mime.texi ${gfdl}
-emacs-mime : $(buildinfodir)/emacs-mime$(INFO_EXT)
-$(buildinfodir)/emacs-mime$(INFO_EXT): $(emacs_mime_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) --enable-encoding -o $@ ${srcdir}/emacs-mime.texi
-emacs-mime.dvi: $(emacs_mime_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-mime.texi
-emacs-mime.pdf: $(emacs_mime_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/emacs-mime.texi
-emacs-mime.html: $(emacs_mime_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) --enable-encoding -o $@ ${srcdir}/emacs-mime.texi
-
-epa_deps = ${srcdir}/epa.texi ${gfdl}
-epa : $(buildinfodir)/epa$(INFO_EXT)
-$(buildinfodir)/epa$(INFO_EXT): $(epa_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/epa.texi
-epa.dvi: $(epa_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/epa.texi
-epa.pdf: $(epa_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/epa.texi
-epa.html: $(epa_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/epa.texi
-
-erc_deps = ${srcdir}/erc.texi $(emacsdir)/emacsver.texi ${gfdl}
-erc : $(buildinfodir)/erc$(INFO_EXT)
-$(buildinfodir)/erc$(INFO_EXT): $(erc_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/erc.texi
-erc.dvi: $(erc_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/erc.texi
-erc.pdf: $(erc_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/erc.texi
-erc.html: $(erc_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/erc.texi
-
-ert_deps = ${srcdir}/ert.texi ${gfdl}
-ert : $(buildinfodir)/ert$(INFO_EXT)
-$(buildinfodir)/ert$(INFO_EXT): $(ert_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/ert.texi
-ert.dvi: $(ert_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/ert.texi
-ert.pdf: $(ert_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/ert.texi
-ert.html: $(ert_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/ert.texi
-
-eshell_deps = ${srcdir}/eshell.texi ${gfdl}
-eshell : $(buildinfodir)/eshell$(INFO_EXT)
-$(buildinfodir)/eshell$(INFO_EXT): $(eshell_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/eshell.texi
-eshell.dvi: $(eshell_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/eshell.texi
-eshell.pdf: $(eshell_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/eshell.texi
-eshell.html: $(eshell_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/eshell.texi
-
-eudc_deps = ${srcdir}/eudc.texi ${gfdl}
-eudc : $(buildinfodir)/eudc$(INFO_EXT)
-$(buildinfodir)/eudc$(INFO_EXT): $(eudc_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/eudc.texi
-eudc.dvi: $(eudc_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/eudc.texi
-eudc.pdf: $(eudc_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/eudc.texi
-eudc.html: $(eudc_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/eudc.texi
-
-eww_deps = ${srcdir}/eww.texi ${gfdl}
-eww : $(buildinfodir)/eww$(INFO_EXT)
-$(buildinfodir)/eww$(INFO_EXT): $(eww_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/eww.texi
-eww.dvi: $(eww_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/eww.texi
-eww.pdf: $(eww_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/eww.texi
-eww.html: $(eww_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/eww.texi
-
-flymake_deps = ${srcdir}/flymake.texi ${gfdl}
-flymake : $(buildinfodir)/flymake$(INFO_EXT)
-$(buildinfodir)/flymake$(INFO_EXT): $(flymake_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/flymake.texi
-flymake.dvi: $(flymake_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/flymake.texi
-flymake.pdf: $(flymake_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/flymake.texi
-flymake.html: $(flymake_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/flymake.texi
-
-forms_deps = ${srcdir}/forms.texi ${gfdl}
-forms : $(buildinfodir)/forms$(INFO_EXT)
-$(buildinfodir)/forms$(INFO_EXT): $(forms_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/forms.texi
-forms.dvi: $(forms_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/forms.texi
-forms.pdf: $(forms_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/forms.texi
-forms.html: $(forms_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/forms.texi
-
-## gnus/message/emacs-mime/sieve/pgg are part of Gnus.
+${buildinfodir}:
+       ${MKDIR_P} $@
+
+### The general case.
+
+EXTRA_OPTS =
+
+${buildinfodir}/%.info: ${srcdir}/%.texi ${gfdl} | ${buildinfodir}
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) $(EXTRA_OPTS) -o $@ $<
+
+## The short aliases, eg efaq = $(buildinfodir)/efaq.info.
+define info_template
+ $(1): $$(buildinfodir)/$(1).info
+endef
+
+## "info" is already taken.
+info.info: $(buildinfodir)/info.info
+
+$(foreach ifile,$(filter-out info.info,$(INFO_TARGETS)),$(eval $(call info_template,$(ifile))))
+
+
+%.dvi: ${srcdir}/%.texi ${gfdl}
+       $(ENVADD) $(TEXI2DVI) $<
+
+%.pdf: ${srcdir}/%.texi ${gfdl}
+       $(ENVADD) $(TEXI2PDF) $<
+
+%.html: ${srcdir}/%.texi ${gfdl}
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) $(EXTRA_OPTS) -o $@ $<
+
+%.ps: %.dvi
+       $(DVIPS) -o $@ $<
+
+
+### The exceptions.
+
+## Extra dependencies.
+
+need_emacsver = calc cl dired-x efaq efaq-w32 erc ido reftex woman
+need_emacsver_prefix = $(addprefix ${buildinfodir}/,${need_emacsver})
+
+$(need_emacsver_prefix:=.info) $(need_emacsver:=.dvi) $(need_emacsver:=.pdf) $(need_emacsver:=.html) : ${emacsdir}/emacsver.texi
+
+$(buildinfodir)/gnus.info gnus.html: ${srcdir}/gnus-faq.texi
+
+$(buildinfodir)/semantic.info semantic.dvi semantic.pdf semantic.html: ${srcdir}/sem-user.texi
+
+
+## Please can we just rename cc-mode.texi to ccmode.texi...
+${buildinfodir}/ccmode.info: ${srcdir}/cc-mode.texi ${gfdl}
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
+
+## efaq, efaq_w32 do not depend on gfdl.
+## Maybe we can use .SECONDEXPANSION for this.
+${buildinfodir}/efaq%.info: ${srcdir}/efaq%.texi
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<
+
+efaq%.dvi: ${srcdir}/efaq%.texi
+       $(ENVADD) $(TEXI2DVI) $<
+
+efaq%.pdf: ${srcdir}/efaq%.texi
+       $(ENVADD) $(TEXI2PDF) $<
+
+efaq%.html: ${srcdir}/efaq%.texi
+       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<
+
+${buildinfodir}/emacs-mime.info emacs-mime.html: EXTRA_OPTS = --enable-encoding
+
 gnus_deps = ${srcdir}/gnus.texi ${srcdir}/gnus-faq.texi ${gfdl}
-gnus : $(buildinfodir)/gnus$(INFO_EXT)
-$(buildinfodir)/gnus$(INFO_EXT): $(gnus_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/gnus.texi
 gnus.dvi: $(gnus_deps)
-       sed -e '/@iflatex/,/@end iflatex/d' ${srcdir}/gnus.texi > gnustmp.texi
-       $(ENVADD) $(TEXI2DVI) gnustmp.texi
-       cp gnustmp.dvi $@
-       rm gnustmp.*
+       sed -e '/@iflatex/,/@end iflatex/d' $< > gnustmpdvi.texi
+       $(ENVADD) $(TEXI2DVI) gnustmpdvi.texi
+       cp gnustmpdvi.dvi $@
+       rm gnustmpdvi.*
+
 gnus.pdf: $(gnus_deps)
-       sed -e '/@iflatex/,/@end iflatex/d' ${srcdir}/gnus.texi > gnustmp.texi
-       $(ENVADD) $(TEXI2PDF) gnustmp.texi
-       cp gnustmp.pdf $@
-       rm gnustmp.*
-gnus.html: $(gnus_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/gnus.texi
-
-htmlfontify_deps = ${srcdir}/htmlfontify.texi ${gfdl}
-htmlfontify : $(buildinfodir)/htmlfontify$(INFO_EXT)
-$(buildinfodir)/htmlfontify$(INFO_EXT): $(htmlfontify_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/htmlfontify.texi
-htmlfontify.dvi: $(htmlfontify_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/htmlfontify.texi
-htmlfontify.pdf: $(htmlfontify_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/htmlfontify.texi
-htmlfontify.html: $(htmlfontify_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/htmlfontify.texi
-
-idlwave_deps = ${srcdir}/idlwave.texi ${gfdl}
-idlwave : $(buildinfodir)/idlwave$(INFO_EXT)
-# NB this one needs --no-split even without a .info extension.
-$(buildinfodir)/idlwave$(INFO_EXT): $(idlwave_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/idlwave.texi
-idlwave.dvi: $(idlwave_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/idlwave.texi
-idlwave.pdf: $(idlwave_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/idlwave.texi
-idlwave.html: $(idlwave_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/idlwave.texi
-
-ido_deps = ${srcdir}/ido.texi $(emacsdir)/emacsver.texi ${gfdl}
-ido : $(buildinfodir)/ido$(INFO_EXT)
-$(buildinfodir)/ido$(INFO_EXT): $(ido_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/ido.texi
-ido.dvi: $(ido_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/ido.texi
-ido.pdf: $(ido_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/ido.texi
-ido.html: $(ido_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/ido.texi
-
-info_deps = ${srcdir}/info.texi ${gfdl}
-# Avoid name clash with overall "info" target.
-info.info : $(buildinfodir)/info$(INFO_EXT)
-# NB this one needs --no-split even without a .info extension.
-$(buildinfodir)/info$(INFO_EXT): $(info_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/info.texi
-info.dvi: $(info_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/info.texi
-info.pdf: $(info_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/info.texi
-info.html: $(info_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/info.texi
-
-mairix_el_deps = ${srcdir}/mairix-el.texi ${gfdl}
-mairix-el : $(buildinfodir)/mairix-el$(INFO_EXT)
-$(buildinfodir)/mairix-el$(INFO_EXT): $(mairix_el_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/mairix-el.texi
-mairix-el.dvi: $(mairix_el_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/mairix-el.texi
-mairix-el.pdf: $(mairix_el_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/mairix-el.texi
-mairix-el.html: $(mairix_el_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/mairix-el.texi
-
-message_deps = ${srcdir}/message.texi ${gfdl}
-message : $(buildinfodir)/message$(INFO_EXT)
-$(buildinfodir)/message$(INFO_EXT): $(message_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/message.texi
-message.dvi: $(message_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/message.texi
-message.pdf: $(message_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/message.texi
-message.html: $(message_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/message.texi
-
-mh_e_deps = ${srcdir}/mh-e.texi ${gfdl}
-mh-e : $(buildinfodir)/mh-e$(INFO_EXT)
-$(buildinfodir)/mh-e$(INFO_EXT): $(mh_e_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/mh-e.texi
-mh-e.dvi: $(mh_e_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/mh-e.texi
-mh-e.pdf: $(mh_e_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/mh-e.texi
-mh-e.html: $(mh_e_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/mh-e.texi
-
-newsticker_deps = ${srcdir}/newsticker.texi ${gfdl}
-newsticker : $(buildinfodir)/newsticker$(INFO_EXT)
-$(buildinfodir)/newsticker$(INFO_EXT): $(newsticker_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/newsticker.texi
-newsticker.dvi: $(newsticker_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/newsticker.texi
-newsticker.pdf: $(newsticker_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/newsticker.texi
-newsticker.html: $(newsticker_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/newsticker.texi
-
-nxml_mode_deps = ${srcdir}/nxml-mode.texi ${gfdl}
-nxml-mode : $(buildinfodir)/nxml-mode$(INFO_EXT)
-$(buildinfodir)/nxml-mode$(INFO_EXT): $(nxml_mode_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/nxml-mode.texi
-nxml-mode.dvi: $(nxml_mode_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/nxml-mode.texi
-nxml-mode.pdf: $(nxml_mode_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/nxml-mode.texi
-nxml-mode.html: $(nxml_mode_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/nxml-mode.texi
-
-octave_mode_deps = ${srcdir}/octave-mode.texi ${gfdl}
-octave-mode : $(buildinfodir)/octave-mode$(INFO_EXT)
-$(buildinfodir)/octave-mode$(INFO_EXT): $(octave_mode_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/octave-mode.texi
-octave-mode.dvi: $(octave_mode_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/octave-mode.texi
-octave-mode.pdf: $(octave_mode_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/octave-mode.texi
-octave-mode.html: $(octave_mode_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/octave-mode.texi
-
-org_deps = ${srcdir}/org.texi ${gfdl}
-org : $(buildinfodir)/org$(INFO_EXT)
-$(buildinfodir)/org$(INFO_EXT): $(org_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/org.texi
-org.dvi: $(org_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/org.texi
-org.pdf: $(org_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/org.texi
-org.html: $(org_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/org.texi
-
-pcl_cvs_deps = ${srcdir}/pcl-cvs.texi ${gfdl}
-pcl-cvs : $(buildinfodir)/pcl-cvs$(INFO_EXT)
-$(buildinfodir)/pcl-cvs$(INFO_EXT): $(pcl_cvs_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/pcl-cvs.texi
-pcl-cvs.dvi: $(pcl_cvs_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/pcl-cvs.texi
-pcl-cvs.pdf: $(pcl_cvs_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/pcl-cvs.texi
-pcl-cvs.html: $(pcl_cvs_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/pcl-cvs.texi
-
-pgg_deps = ${srcdir}/pgg.texi ${gfdl}
-pgg : $(buildinfodir)/pgg$(INFO_EXT)
-$(buildinfodir)/pgg$(INFO_EXT): $(pgg_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/pgg.texi
-pgg.dvi: $(pgg_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/pgg.texi
-pgg.pdf: $(pgg_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/pgg.texi
-pgg.html: $(pgg_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/pgg.texi
-
-rcirc_deps = ${srcdir}/rcirc.texi ${gfdl}
-rcirc : $(buildinfodir)/rcirc$(INFO_EXT)
-$(buildinfodir)/rcirc$(INFO_EXT): $(rcirc_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/rcirc.texi
-rcirc.dvi: $(rcirc_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/rcirc.texi
-rcirc.pdf: $(rcirc_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/rcirc.texi
-rcirc.html: $(rcirc_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/rcirc.texi
-
-reftex_deps = ${srcdir}/reftex.texi $(emacsdir)/emacsver.texi ${gfdl}
-reftex : $(buildinfodir)/reftex$(INFO_EXT)
-$(buildinfodir)/reftex$(INFO_EXT): $(reftex_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/reftex.texi
-reftex.dvi: $(reftex_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/reftex.texi
-reftex.pdf: $(reftex_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/reftex.texi
-reftex.html: $(reftex_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/reftex.texi
-
-remember_deps = ${srcdir}/remember.texi ${gfdl}
-remember : $(buildinfodir)/remember$(INFO_EXT)
-$(buildinfodir)/remember$(INFO_EXT): $(remember_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/remember.texi
-remember.dvi: $(remember_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/remember.texi
-remember.pdf: $(remember_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/remember.texi
-remember.html: $(remember_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/remember.texi
-
-sasl_deps = ${srcdir}/sasl.texi ${gfdl}
-sasl : $(buildinfodir)/sasl$(INFO_EXT)
-$(buildinfodir)/sasl$(INFO_EXT): $(sasl_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/sasl.texi
-sasl.dvi: $(sasl_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/sasl.texi
-sasl.pdf: $(sasl_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/sasl.texi
-sasl.html: $(sasl_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/sasl.texi
-
-sc_deps = ${srcdir}/sc.texi ${gfdl}
-sc : $(buildinfodir)/sc$(INFO_EXT)
-$(buildinfodir)/sc$(INFO_EXT): $(sc_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/sc.texi
-sc.dvi: $(sc_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/sc.texi
-sc.pdf: $(sc_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/sc.texi
-sc.html: $(sc_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/sc.texi
-
-semantic_deps = ${srcdir}/semantic.texi ${srcdir}/sem-user.texi ${gfdl}
-semantic : $(buildinfodir)/semantic$(INFO_EXT)
-$(buildinfodir)/semantic$(INFO_EXT): $(semantic_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/semantic.texi
-semantic.dvi: $(semantic_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/semantic.texi
-semantic.pdf: $(semantic_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/semantic.texi
-semantic.html: $(semantic_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/semantic.texi
-
-ses_deps = ${srcdir}/ses.texi ${gfdl}
-ses : $(buildinfodir)/ses$(INFO_EXT)
-$(buildinfodir)/ses$(INFO_EXT): $(ses_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/ses.texi
-ses.dvi: $(ses_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/ses.texi
-ses.pdf: $(ses_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/ses.texi
-ses.html: $(ses_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/ses.texi
-
-sieve_deps = ${srcdir}/sieve.texi ${gfdl}
-sieve : $(buildinfodir)/sieve$(INFO_EXT)
-$(buildinfodir)/sieve$(INFO_EXT): $(sieve_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/sieve.texi
-sieve.dvi: $(sieve_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/sieve.texi
-sieve.pdf: $(sieve_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/sieve.texi
-sieve.html: $(sieve_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/sieve.texi
-
-smtpmail_deps = ${srcdir}/smtpmail.texi ${gfdl}
-smtpmail : $(buildinfodir)/smtpmail$(INFO_EXT)
-$(buildinfodir)/smtpmail$(INFO_EXT): $(smtpmail_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/smtpmail.texi
-smtpmail.dvi: $(smtpmail_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/smtpmail.texi
-smtpmail.pdf: $(smtpmail_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/smtpmail.texi
-smtpmail.html: $(smtpmail_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/smtpmail.texi
-
-speedbar_deps = ${srcdir}/speedbar.texi ${gfdl}
-speedbar : $(buildinfodir)/speedbar$(INFO_EXT)
-$(buildinfodir)/speedbar$(INFO_EXT): $(speedbar_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/speedbar.texi
-speedbar.dvi: $(speedbar_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/speedbar.texi
-speedbar.pdf: $(speedbar_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/speedbar.texi
-speedbar.html: $(speedbar_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/speedbar.texi
-
-srecode_deps = ${srcdir}/srecode.texi ${gfdl}
-srecode : $(buildinfodir)/srecode$(INFO_EXT)
-$(buildinfodir)/srecode$(INFO_EXT): $(srecode_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/srecode.texi
-srecode.dvi: $(srecode_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/srecode.texi
-srecode.pdf: $(srecode_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/srecode.texi
-srecode.html: $(srecode_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/srecode.texi
-
-todo_mode_deps = ${srcdir}/todo-mode.texi ${gfdl}
-todo-mode : $(buildinfodir)/todo-mode$(INFO_EXT)
-$(buildinfodir)/todo-mode$(INFO_EXT): $(todo_mode_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/todo-mode.texi
-todo-mode.dvi: $(todo_mode_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/todo-mode.texi
-todo-mode.pdf: $(todo_mode_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/todo-mode.texi
-todo-mode.html: $(todo_mode_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/todo-mode.texi
-
-tramp_deps = ${srcdir}/tramp.texi ${srcdir}/trampver.texi ${gfdl}
-tramp : $(buildinfodir)/tramp$(INFO_EXT)
-$(buildinfodir)/tramp$(INFO_EXT): $(tramp_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ -D emacs ${srcdir}/tramp.texi
-tramp.dvi: $(tramp_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/tramp.texi
-tramp.pdf: $(tramp_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/tramp.texi
-tramp.html: $(tramp_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ -D emacs ${srcdir}/tramp.texi
-
-url_deps = ${srcdir}/url.texi ${gfdl}
-url : $(buildinfodir)/url$(INFO_EXT)
-$(buildinfodir)/url$(INFO_EXT): $(url_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/url.texi
-url.dvi: $(url_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/url.texi
-url.pdf: $(url_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/url.texi
-url.html: $(url_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/url.texi
-
-vip_deps = ${srcdir}/vip.texi ${gfdl}
-vip : $(buildinfodir)/vip$(INFO_EXT)
-$(buildinfodir)/vip$(INFO_EXT): $(vip_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/vip.texi
-vip.dvi: $(vip_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/vip.texi
-vip.pdf: $(vip_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/vip.texi
-vip.html: $(vip_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/vip.texi
-
-viper_deps = ${srcdir}/viper.texi ${gfdl}
-viper : $(buildinfodir)/viper$(INFO_EXT)
-$(buildinfodir)/viper$(INFO_EXT): $(viper_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/viper.texi
-viper.dvi: $(viper_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/viper.texi
-viper.pdf: $(viper_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/viper.texi
-viper.html: $(viper_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/viper.texi
-
-widget_deps = ${srcdir}/wisent.texi ${gfdl}
-widget : $(buildinfodir)/widget$(INFO_EXT)
-$(buildinfodir)/widget$(INFO_EXT): $(widget_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/widget.texi
-widget.dvi: $(widget_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/widget.texi
-widget.pdf: $(widget_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/widget.texi
-widget.html: $(widget_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/widget.texi
-
-wisent_deps = ${srcdir}/wisent.texi ${gfdl}
-wisent : $(buildinfodir)/wisent$(INFO_EXT)
-$(buildinfodir)/wisent$(INFO_EXT): $(wisent_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/wisent.texi
-wisent.dvi: $(wisent_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/wisent.texi
-wisent.pdf: $(wisent_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/wisent.texi
-wisent.html: $(wisent_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/wisent.texi
-
-woman_deps = ${srcdir}/woman.texi $(emacsdir)/emacsver.texi ${gfdl}
-woman : $(buildinfodir)/woman$(INFO_EXT)
-$(buildinfodir)/woman$(INFO_EXT): $(woman_deps)
-       $(mkinfodir)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/woman.texi
-woman.dvi: $(woman_deps)
-       $(ENVADD) $(TEXI2DVI) ${srcdir}/woman.texi
-woman.pdf: $(woman_deps)
-       $(ENVADD) $(TEXI2PDF) ${srcdir}/woman.texi
-woman.html: $(woman_deps)
-       $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/woman.texi
-
-.PHONY: mostlyclean clean distclean maintainer-clean
+       sed -e '/@iflatex/,/@end iflatex/d' $< > gnustmppdf.texi
+       $(ENVADD) $(TEXI2PDF) gnustmppdf.texi
+       cp gnustmppdf.pdf $@
+       rm gnustmppdf.*
+
+${buildinfodir}/tramp.info tramp.html: EXTRA_OPTS = -D emacs
+${buildinfodir}/tramp.info tramp.html: ${srcdir}/trampver.texi
+
+
+.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
 
 mostlyclean:
        rm -f *.aux *.log *.toc *.c[mp] *.c[mp]s *.fn *.fns \
          *.ky *.kys *.op *.ops *.p[gj] *.p[gj]s *.sc *.scs *.ss \
          *.t[gp] *.t[gp]s *.vr *.vrs
-       rm -f gnustmp.*
+       rm -f gnustmp*
 
 clean: mostlyclean
        rm -f $(DVI_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(PS_TARGETS)
@@ -870,12 +230,15 @@ distclean: clean
 
 ## buildinfodir is relative to srcdir.
 infoclean:
-       cd $(buildinfodir); for file in $(INFO_TARGETS); do \
-         file=`echo $${file} | sed 's/\.info$$//'`${INFO_EXT}; \
-         rm -f $${file} $${file}-[1-9] $${file}-[1-9][0-9]; \
+       for file in $(INFO_TARGETS); do \
+         file=`echo $${file} | sed 's/\.info$$//'`.info; \
+         rm -f \
+           $(buildinfodir)/$${file} \
+           $(buildinfodir)/$${file}-[1-9] \
+           $(buildinfodir)/$${file}-[1-9][0-9]; \
        done
 
-maintainer-clean: distclean infoclean
+bootstrap-clean maintainer-clean: distclean infoclean
 
 dist:
        rm -rf emacs-misc-${version}
@@ -889,7 +252,6 @@ dist:
          -e 's/^\(clean:.*\)/\1 infoclean/' \
          -e "s/@ver[s]ion@/${version}/" \
          -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
-         -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
          ${srcdir}/Makefile.in > emacs-misc-${version}/Makefile
        @if grep '@[a-zA-Z_]*@' emacs-misc-${version}/Makefile; then \
          echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
index e68bf055f35ff2cae46429492688fcaf783f67e7..ac39c7cab9f54f4a7a78b88e3cb68496bd61208d 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo  @c -*-texinfo-*-
-@setfilename ../../info/ada-mode
+@setfilename ../../info/ada-mode.info
 @settitle Ada Mode
 @documentencoding UTF-8
 
index 2de4cfdab7fb67c10ceff5aa0591002eaba48643..207ffc6d79b41962510d2100f7a0dd406491ef90 100644 (file)
@@ -4,7 +4,7 @@
 
 @set VERSION 0.3
 
-@setfilename ../../info/auth
+@setfilename ../../info/auth.info
 @settitle Emacs auth-source Library @value{VERSION}
 @documentencoding UTF-8
 
index 3ddeb08a306eb8a6d6c4518bd8c8d448e6949529..a2988795fc58ee9dde9c5e2390d9caf1349256d9 100644 (file)
@@ -1,7 +1,7 @@
 \input texinfo
 @c This is an annex of the Emacs manual.
 @c Author: Daniel Pfeiffer <Daniel.Pfeiffer@Informatik.START.dbp.de>
-@setfilename ../../info/autotype
+@setfilename ../../info/autotype.info
 @c @node Autotypist, Picture, Abbrevs, Top
 @c @chapter Features for Automatic Typing
 @settitle Features for Automatic Typing
index 2ac355f805f4770e1e2c8dd3c7d3f60120e38abf..28c75f8a58a74ca3ab1c1d97a9aeab50b1ea38f1 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/bovine
+@setfilename ../../info/bovine.info
 @set TITLE  Bovine parser development
 @set AUTHOR Eric M. Ludlam, David Ponce, and Richard Y. Kim
 @settitle @value{TITLE}
index 56aa2d04a1a07e9995b65df92511f539a20161f0..2e9d71acd4f522cfdbdeffe3712d12c7a2b1bb23 100644 (file)
@@ -1,7 +1,7 @@
 \input texinfo                  @c -*-texinfo-*-
 @comment %**start of header (This is for running Texinfo on a region.)
 @c smallbook
-@setfilename ../../info/calc
+@setfilename ../../info/calc.info
 @c [title]
 @settitle GNU Emacs Calc Manual
 @documentencoding UTF-8
index cbb49e00efaa433b05ad3a4fea9dae5b56f6b735..74e34854417870a31fc480603b99c7c9bf8e725f 100644 (file)
@@ -81,7 +81,7 @@ the second with them pointing to the XEmacs manuals.
 @comment No overfull hbox marks in the dvi file.
 @finalout
 
-@setfilename  ../../info/ccmode
+@setfilename  ../../info/ccmode.info
 @settitle     CC Mode Manual
 @documentencoding UTF-8
 @footnotestyle end
index 4eb8508fd3c907df300a1e679f1b7ba4700f9177..b2914adc062cc24a3c4eb010cf3f230138ba9e46 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo    @c -*-texinfo-*-
-@setfilename ../../info/cl
+@setfilename ../../info/cl.info
 @settitle Common Lisp Extensions
 @documentencoding UTF-8
 @include emacsver.texi
@@ -2627,10 +2627,10 @@ In this package, @code{cl-locally} is no different from @code{progn}.
 @end defmac
 
 @defmac cl-the type form
-Type information provided by @code{cl-the} is ignored in this package;
-in other words, @code{(cl-the @var{type} @var{form})} is equivalent to
-@var{form}.  Future byte-compiler optimizations may make use of this
-information.
+@code{cl-the} returns the value of @code{form}, first checking (if
+optimization settings permit) that it is of type @code{type}.  Future
+byte-compiler optimizations may also make use of this information to
+improve runtime efficiency.
 
 For example, @code{mapcar} can map over both lists and arrays.  It is
 hard for the compiler to expand @code{mapcar} into an in-line loop
@@ -3679,10 +3679,8 @@ This function is a synonym for @code{(cdr @var{x})}.
 @end defun
 
 @defun cl-endp x
-Common Lisp defines this function to act like @code{null}, but
-signaling an error if @code{x} is neither a @code{nil} nor a
-cons cell.  This package simply defines @code{cl-endp} as a synonym
-for @code{null}.
+This function acts like @code{null}, but signals an error if @code{x}
+is neither a @code{nil} nor a cons cell.
 @end defun
 
 @defun cl-list-length x
@@ -4247,6 +4245,40 @@ of the included type and the first new slot.
 Except as noted, the @code{cl-defstruct} facility of this package is
 entirely compatible with that of Common Lisp.
 
+The @code{cl-defstruct} package also provides a few structure
+introspection functions.
+
+@defun cl-struct-sequence-type struct-type
+This function returns the underlying data structure for
+@code{struct-type}, which is a symbol.  It returns @code{vector} or
+@code{list}, or @code{nil} if @code{struct-type} is not actually a
+structure.
+@end defun
+
+@defun cl-struct-slot-info struct-type
+This function returns a list of slot descriptors for structure
+@code{struct-type}.  Each entry in the list is @code{(name . opts)},
+where @code{name} is the name of the slot and @code{opts} is the list
+of slot options given to @code{defstruct}.  Dummy entries represent
+the slots used for the struct name and that are skipped to implement
+@code{:initial-offset}.
+@end defun
+
+@defun cl-struct-slot-offset struct-type slot-name
+Return the offset of slot @code{slot-name} in @code{struct-type}.  The
+returned zero-based slot index is relative to the start of the
+structure data type and is adjusted for any structure name and
+:initial-offset slots.  Signal error if struct @code{struct-type} does
+not contain @code{slot-name}.
+@end defun
+
+@defun cl-struct-slot-value struct-type slot-name inst
+Return the value of slot @code{slot-name} in @code{inst} of
+@code{struct-type}.  @code{struct} and @code{slot-name} are symbols.
+@code{inst} is a structure instance.  This routine is also a
+@code{setf} place.  Can signal the same errors as @code{cl-struct-slot-offset}.
+@end defun
+
 @node Assertions
 @chapter Assertions and Errors
 
@@ -4415,12 +4447,11 @@ supposed to arise in complying programs; implementations are strongly
 encouraged but not required to signal an error in these situations.
 This package sometimes omits such error checking in the interest of
 compactness and efficiency.  For example, @code{cl-do} variable
-specifiers are supposed to be lists of one, two, or three forms;
-extra forms are ignored by this package rather than signaling a
-syntax error.  The @code{cl-endp} function is simply a synonym for
-@code{null} in this package.  Functions taking keyword arguments
-will accept an odd number of arguments, treating the trailing
-keyword as if it were followed by the value @code{nil}.
+specifiers are supposed to be lists of one, two, or three forms; extra
+forms are ignored by this package rather than signaling a syntax
+error.  Functions taking keyword arguments will accept an odd number
+of arguments, treating the trailing keyword as if it were followed by
+the value @code{nil}.
 
 Argument lists (as processed by @code{cl-defun} and friends)
 @emph{are} checked rigorously except for the minor point just
index 4c63ecddb7d63741ed5c453a7804429665b73b8b..0c19cb963e700ffb0998a5a098c402f2d6955c1f 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo   @c -*-texinfo-*-
-@setfilename ../../info/dbus
+@setfilename ../../info/dbus.info
 @c %**start of header
 @settitle Using of D-Bus
 @documentencoding UTF-8
index fe40c5e300fb9f3b6d9fea5be8ca2b9023540b0b..1eb512b7372743d4422e5af071467409739cd9c9 100644 (file)
@@ -7,7 +7,7 @@
 @c [Dodd's address no longer valid.]
 
 @comment %**start of header (This is for running Texinfo on a region.)
-@setfilename ../../info/dired-x
+@setfilename ../../info/dired-x.info
 @settitle Dired Extra User's Manual
 @documentencoding UTF-8
 
index 9ff3e28e99df0b3427291f2bc876230244a4819d..bbb94fe465680a32d6b819c3db48c28af2a93c07 100644 (file)
@@ -1,7 +1,7 @@
 \input texinfo   @c -*-texinfo-*-
 
 @comment %**start of header
-@setfilename ../../info/ebrowse
+@setfilename ../../info/ebrowse.info
 @settitle A Class Browser for C++
 @documentencoding UTF-8
 @setchapternewpage odd
index 89e576b8c25024fa6376afb52d2e70ac6799f56e..c61a32c4f0a7e4a26be30397e3add8d585604312 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo
-@setfilename ../../info/ede
+@setfilename ../../info/ede.info
 @settitle Emacs Development Environment
 @documentencoding UTF-8
 
index ea4bcc8f5b92d62ff3c744cc23d512ae97262fc0..9d373982fa896985d64d9066892ed60249bb7e46 100644 (file)
@@ -7,7 +7,7 @@
 @comment Using ediff.info instead of ediff in setfilename breaks DOS.
 @comment @setfilename ediff
 @comment @setfilename ediff.info
-@setfilename ../../info/ediff
+@setfilename ../../info/ediff.info
 
 @settitle Ediff User's Manual
 @documentencoding UTF-8
index 6e066220020c30de0973cd23a89f6e2a55e7abe2..17057526d2e854a92c1cefcc396ab0037a7bdbb7 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo
-@setfilename ../../info/edt
+@setfilename ../../info/edt.info
 @settitle EDT Emulation for Emacs
 @documentencoding UTF-8
 
index c59f7547d8d63bfeee5905afedf8c476495c1a11..f7086b6d3a9cb132b3b2b62876b853ef8272db55 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo    @c -*-coding:utf-8 -*-
-@setfilename efaq-w32
+@setfilename ../../info/efaq-w32.info
 @settitle GNU Emacs FAQ For MS Windows
 @setchapternewpage odd
 @syncodeindex pg cp
index c320b8b6c080a50506a75677be9e223724272a50..f048f75372c650bf30f6682e1c73cf9542cf1ac5 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo   @c -*- mode: texinfo; -*-
 @c %**start of header
-@setfilename ../../info/efaq
+@setfilename ../../info/efaq.info
 @settitle GNU Emacs FAQ
 @documentencoding UTF-8
 @c %**end of header
@@ -861,7 +861,6 @@ You can get Tkinfo at
 @cindex Files included with Emacs
 @cindex @file{COPYING}, description of file
 @cindex @file{DISTRIB}, description of file
-@cindex @file{GNU}, description of file
 @cindex @file{MACHINES}, description of file
 @cindex @file{NEWS}, description of file
 
@@ -883,9 +882,6 @@ GNU General Public License
 @item DISTRIB
 Emacs Availability Information
 
-@item GNU
-The GNU Manifesto
-
 @item MACHINES
 Status of Emacs on Various Machines and Systems
 
@@ -3268,8 +3264,8 @@ archive sites that make GNU software available.
 
 First of all, you should check to make sure that the package isn't
 already available.  For example, typing @kbd{M-x apropos @key{RET}
-wordstar @key{RET}} lists all functions and variables containing the
-string @samp{wordstar}.
+python @key{RET}} lists all functions and variables containing the
+string @samp{python}.
 
 It is also possible that the package is on your system, but has not been
 loaded.  To see which packages are available for loading, look through
index 937fae26907482345c3c38744a91bfe51f1d422d..8f93300e24a8100c73f3e87a109bf411c171b2ca 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo
-@setfilename ../../info/eieio
+@setfilename ../../info/eieio.info
 @set TITLE Enhanced Implementation of Emacs Interpreted Objects
 @set AUTHOR Eric M. Ludlam
 @settitle @value{TITLE}
index bc054ac76b0dc4ab0d0cadfba47598c53796a6b9..8eb5298010f3b3fa60b296b600f8ca6c8da8c33e 100644 (file)
@@ -2,7 +2,7 @@
 
 @set VERSION 0.3
 
-@setfilename ../../info/emacs-gnutls
+@setfilename ../../info/emacs-gnutls.info
 @settitle Emacs GnuTLS Integration @value{VERSION}
 @documentencoding UTF-8
 
index 19cdd43882e74a68563e1d8ebb87fe85bbe64b87..36ea0b2cac62ab84d80ae7c692bcf6305f5da3cd 100644 (file)
@@ -2,7 +2,7 @@
 
 @include gnus-overrides.texi
 
-@setfilename ../../info/emacs-mime
+@setfilename ../../info/emacs-mime.info
 @settitle Emacs MIME Manual
 @synindex fn cp
 @synindex vr cp
@@ -405,7 +405,7 @@ variable will cause @samp{text/html} parts to be treated as attachments.
 @item mm-text-html-renderer
 @vindex mm-text-html-renderer
 This selects the function used to render @acronym{HTML}.  The predefined
-renderers are selected by the symbols @code{gnus-article-html}, @code{w3},
+renderers are selected by the symbols @code{gnus-article-html},
 @code{w3m}@footnote{See @uref{http://emacs-w3m.namazu.org/} for more
 information about emacs-w3m}, @code{links}, @code{lynx},
 @code{w3m-standalone} or @code{html2text}.  If @code{nil} use an
@@ -418,11 +418,11 @@ Some @acronym{HTML} mails might have the trick of spammers using
 @samp{<img>} tags.  It is likely to be intended to verify whether you
 have read the mail.  You can prevent your personal information from
 leaking by setting this option to @code{nil} (which is the default).
-It is currently ignored by Emacs/w3.  For emacs-w3m, you may use the
-command @kbd{t} on the image anchor to show an image even if it is
-@code{nil}.@footnote{The command @kbd{T} will load all images.  If you
-have set the option @code{w3m-key-binding} to @code{info}, use @kbd{i}
-or @kbd{I} instead.}
+For emacs-w3m, you may use the command @kbd{t} on the image anchor to
+show an image even if it is @code{nil}.@footnote{The command @kbd{T}
+will load all images.  If you have set the option
+@code{w3m-key-binding} to @code{info}, use @kbd{i} or @kbd{I}
+instead.}
 
 @item mm-w3m-safe-url-regexp
 @vindex mm-w3m-safe-url-regexp
@@ -648,6 +648,12 @@ The @acronym{MIME} type of the part (@code{Content-Type}).
 Use the contents of the file in the body of the part
 (@code{Content-Disposition}).
 
+@item recipient-filename
+Use this as the file name in the generated @acronym{MIME} message for
+the recipient.  That is, even if the file is called @file{foo.txt}
+locally, use this name instead in the @code{Content-Disposition} in
+the sent message.
+
 @item charset
 The contents of the body of the part are to be encoded in the character
 set specified (@code{Content-Type}). @xref{Charset Translation}.
index 0632e735df02f8778b75b58f68ac9bd2ff863651..8ee683e09517da56689efbe71849c32ec29b8ced 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo                  @c -*- mode: texinfo -*-
 @c %**start of header
-@setfilename ../../info/epa
+@setfilename ../../info/epa.info
 @settitle EasyPG Assistant User's Manual
 @documentencoding UTF-8
 @c %**end of header
index 4cb5eaed60459e55065024350521d929f4696821..96bfc1e79daa88898bd66930985d6cedf94e914e 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 @c %**start of header
-@setfilename ../../info/erc
+@setfilename ../../info/erc.info
 @settitle ERC Manual
 @syncodeindex fn cp
 @include emacsver.texi
index ec1614c714096179fda638f0acfeb9724e5474c1..9f29c2529c6708589c9611be10ad21512a37f78a 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 @c %**start of header
-@setfilename ../../info/ert
+@setfilename ../../info/ert.info
 @settitle Emacs Lisp Regression Testing
 @documentencoding UTF-8
 @c %**end of header
index e7c3c71afd886adbd88eb39666f7abbd586b8174..e77e6906b06fc2f3c7054a72100005b140c4287e 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/eshell
+@setfilename ../../info/eshell.info
 @settitle Eshell: The Emacs Shell
 @defindex cm
 @synindex vr fn
index a54a37a72e68ab5d3a83e48f6f767f06f3e165c3..086e7416a24aad1f18751d45feeab18c5888d725 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo.tex
 @c %**start of header
-@setfilename ../../info/eudc
+@setfilename ../../info/eudc.info
 @settitle Emacs Unified Directory Client (EUDC) Manual
 @afourpaper
 @documentencoding UTF-8
index 827c35f02ef4bdfeb22ff59105ef14e1d394e7c1..c22a41e451c638463e30971e8867479f2e10e873 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/eww
+@setfilename ../../info/eww.info
 @settitle Emacs Web Wowser
 @documentencoding UTF-8
 @c %**end of header
index 761056a69a50f503edca563f58fc424e2c902aea..7bd8fd1338d928a3cbcf5de68ce9a81e84172c40 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo   @c -*-texinfo-*-
 @comment %**start of header
-@setfilename ../../info/flymake
+@setfilename ../../info/flymake.info
 @set VERSION 0.3
 @set UPDATED April 2004
 @settitle GNU Flymake @value{VERSION}
index 8ea470d2da8f018ec3eba69ed45dc263dd2702ec..ea7999a023f6ae2889addca9596280900bbdd635 100644 (file)
@@ -3,7 +3,7 @@
 @c Written by Johan Vromans, and edited by Richard Stallman
 
 @comment %**start of header (This is for running Texinfo on a region.)
-@setfilename ../../info/forms
+@setfilename ../../info/forms.info
 @settitle Forms Mode User's Manual
 @syncodeindex vr cp
 @syncodeindex fn cp
index 44cc29b9c3938bb4e79b5061dc52ea8780378995..0b2b063275da993bd7902a22a598c903f8142178 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 
-@setfilename gnus-coding
+@setfilename gnus-coding.info
 @settitle Gnus Coding Style and Maintenance Guide
 @documentencoding UTF-8
 @syncodeindex fn cp
index 7bb89fdf0294720e3647ac3d7fd7b2391a2c1f14..fd4f427431df16614fa150fcc421bf6a04f042c0 100644 (file)
@@ -723,7 +723,7 @@ POP3 mail source.  See @pxref{Mail Source Specifiers} for VALUE.
                 the top of the article buffer?
 * FAQ 4-6::     I'd like Gnus NOT to render HTML-mails but show me the
                 text part if it's available. How to do it?
-* FAQ 4-7::     Can I use some other browser than w3 to render my
+* FAQ 4-7::     Can I use some other browser than shr to render my
                 HTML-mails?
 * FAQ 4-8::     Is there anything I can do to make poorly formatted
                 mails more readable?
@@ -868,12 +868,12 @@ too.
 @node FAQ 4-7
 @subsubheading Question 4.7
 
-Can I use some other browser than w3 to render my HTML-mails?
+Can I use some other browser than w3m to render my HTML-mails?
 
 @subsubheading Answer
 
 Only if you use Gnus 5.10 or younger. In this case you've got the
-choice between w3, w3m, links, lynx and html2text, which
+choice between shr, w3m, links, lynx and html2text, which
 one is used can be specified in the variable
 mm-text-html-renderer, so if you want links to render your
 mail say
index 8f1550942e968846a7469fafdde1dbaf33c9b16a..a25d7c540f3dfa590d9a52a67a7ea489ea34fdfb 100644 (file)
@@ -2,7 +2,7 @@
 
 @include gnus-overrides.texi
 
-@setfilename ../../info/gnus
+@setfilename ../../info/gnus.info
 @settitle Gnus Manual
 @syncodeindex fn cp
 @syncodeindex vr cp
@@ -704,7 +704,6 @@ Browsing the Web
 * Archiving Mail::
 * Web Searches::                Creating groups from articles that match a string.
 * RSS::                         Reading RDF site summary.
-* Customizing W3::              Doing stuff to Emacs/W3 from Gnus.
 
 Other Sources
 
@@ -2881,12 +2880,17 @@ news group.
 @item gcc-self
 @cindex gcc-self
 If @code{(gcc-self . t)} is present in the group parameter list, newly
-composed messages will be @code{Gcc}'d to the current group.  If
+composed messages will be @code{gcc}d to the current group.  If
 @code{(gcc-self . none)} is present, no @code{Gcc:} header will be
-generated, if @code{(gcc-self . "string")} is present, this string will
-be inserted literally as a @code{gcc} header.  This parameter takes
-precedence over any default @code{Gcc} rules as described later
-(@pxref{Archived Messages}), with the exception for messages to resend.
+generated, if @code{(gcc-self . "group")} is present, this string will
+be inserted literally as a @code{Gcc:} header.  It should be a group
+name.  The @code{gcc-self} value may also be a list of strings and
+@code{t}, e.g., @code{(gcc-self "group1" "group2" t)} means to
+@code{gcc} the newly composed message into the groups @code{"group1"}
+and @code{"group2"}, and into the current group.  The @code{gcc-self}
+parameter takes precedence over any default @code{Gcc} rules as
+described later (@pxref{Archived Messages}), with the exception for
+messages to resend.
 
 @strong{Caveat}: Adding @code{(gcc-self . t)} to the parameter list of
 @code{nntp} groups (or the like) isn't valid.  An @code{nntp} server
@@ -9140,9 +9144,6 @@ Use Gnus simple html renderer.
 @item gnus-w3m
 Use Gnus rendered based on w3m.
 
-@item w3
-Use Emacs/W3.
-
 @item w3m
 Use @uref{http://emacs-w3m.namazu.org/, emacs-w3m}.
 
@@ -9805,6 +9806,19 @@ Make all the @acronym{MIME} parts have buttons in front of them.  This is
 mostly useful if you wish to save (or perform other actions) on inlined
 parts.
 
+@item W M h
+@kindex W M h (Summary)
+@findex gnus-mime-buttonize-attachments-in-header
+@vindex gnus-mime-display-attachment-buttons-in-header
+Display @acronym{MIME} part buttons in the end of the header of an
+article (@code{gnus-mime-buttonize-attachments-in-header}).  This
+command toggles the display.  Note that buttons to be added to the
+header are only the ones that aren't inlined in the body.  If you want
+those buttons always to be displayed, set
+@code{gnus-mime-display-attachment-buttons-in-header} to non-@code{nil}.
+The default is @code{t}.  To change the appearance of buttons, customize
+@code{gnus-header-face-alist}.
+
 @item K m
 @kindex K m (Summary)
 @findex gnus-summary-repair-multipart
@@ -12804,10 +12818,12 @@ variable, which is a vector of the following headers: number subject
 from date id references chars lines xref extra.
 
 In the case of a string value, if the @code{match} is a regular
-expression, a @samp{gnus-match-substitute-replacement} is proceed on
-the value to replace the positional parameters @samp{\@var{n}} by the
-corresponding parenthetical matches (see @xref{Replacing Match,,
-Replacing the Text that Matched, elisp, The Emacs Lisp Reference Manual}.)
+expression, or if it takes the form @code{(header @var{match}
+@var{regexp})}, a @samp{gnus-match-substitute-replacement} is proceed
+on the value to replace the positional parameters @samp{\@var{n}} by
+the corresponding parenthetical matches (see @xref{Replacing Match,,
+Replacing the Text that Matched, elisp, The Emacs Lisp Reference
+Manual}.)
 
 @vindex message-reply-headers
 
@@ -12839,6 +12855,10 @@ So here's a new example:
         ;; @r{If I'm replying to Larsi, set the Organization header.}
         ((header "from" "larsi.*org")
          (Organization "Somewhere, Inc."))
+        ;; @r{Reply to a message from the same subaddress the message}
+        ;; @r{was sent to.}
+        ((header "x-original-to" "me\\(\\+.+\\)@@example.org")
+         (address "me\\1@@example.org"))
         ((posting-from-work-p) ;; @r{A user defined function}
          (signature-file "~/.work-signature")
          (address "user@@bar.foo")
@@ -16841,12 +16861,8 @@ interfaces to these sources.
 * Archiving Mail::
 * Web Searches::                Creating groups from articles that match a string.
 * RSS::                         Reading RDF site summary.
-* Customizing W3::              Doing stuff to Emacs/W3 from Gnus.
 @end menu
 
-All the web sources require Emacs/W3 and the url library or those
-alternatives to work.
-
 The main caveat with all these web sources is that they probably won't
 work for a very long time.  Gleaning information from the @acronym{HTML} data
 is guesswork at best, and when the layout is altered, the Gnus back end
@@ -16922,10 +16938,6 @@ make money off of advertisements, not to provide services to the
 community.  Since @code{nnweb} washes the ads off all the articles, one
 might think that the providers might be somewhat miffed.  We'll see.
 
-You must have the @code{url} and @code{W3} package or those alternatives
-(try @code{customize-group} on the @samp{mm-url} variable group)
-installed to be able to use @code{nnweb}.
-
 Virtual server variables:
 
 @table @code
@@ -17123,38 +17135,6 @@ Parameters}) in order to display @samp{text/html} parts only in
 @end lisp
 
 
-@node Customizing W3
-@subsection Customizing W3
-@cindex W3
-@cindex html
-@cindex url
-@cindex Netscape
-
-Gnus uses the url library to fetch web pages and Emacs/W3 (or those
-alternatives) to display web pages.  Emacs/W3 is documented in its own
-manual, but there are some things that may be more relevant for Gnus
-users.
-
-For instance, a common question is how to make Emacs/W3 follow links
-using the @code{browse-url} functions (which will call some external web
-browser like Netscape).  Here's one way:
-
-@lisp
-(eval-after-load "w3"
-  '(progn
-    (fset 'w3-fetch-orig (symbol-function 'w3-fetch))
-    (defun w3-fetch (&optional url target)
-      (interactive (list (w3-read-url-with-default)))
-      (if (eq major-mode 'gnus-article-mode)
-          (browse-url url)
-        (w3-fetch-orig url target)))))
-@end lisp
-
-Put that in your @file{.emacs} file, and hitting links in W3-rendered
-@acronym{HTML} in the Gnus article buffers will use @code{browse-url} to
-follow the link.
-
-
 @node Other Sources
 @section Other Sources
 
@@ -26339,7 +26319,7 @@ XEmacs is distributed as a collection of packages.  You should install
 whatever packages the Gnus XEmacs package requires.  The current
 requirements are @samp{gnus}, @samp{mail-lib}, @samp{xemacs-base},
 @samp{eterm}, @samp{sh-script}, @samp{net-utils}, @samp{os-utils},
-@samp{dired}, @samp{mh-e}, @samp{sieve}, @samp{ps-print}, @samp{W3},
+@samp{dired}, @samp{mh-e}, @samp{sieve}, @samp{ps-print},
 @samp{pgg}, @samp{mailcrypt}, @samp{ecrypto}, and @samp{sasl}.
 
 
@@ -28416,6 +28396,19 @@ New features in Ma Gnus:
 
 @itemize @bullet
 
+@item Changes in summary and article mode
+@c **************************************
+
+@itemize @bullet
+
+@item
+By default, @acronym{MIME} part buttons for attachments (if any) will
+appear in the end of the article header in addition to the bottom of the
+article body, so you can easily find them without scrolling the article
+again and again.  @xref{MIME Commands}.
+
+@end itemize
+
 @item Changes in Message mode and related Gnus features
 @c ****************************************************
 
index d31a087be2a912bfb7824ad7e0e28be20409d00b..5bf0449504bbc9c52f0c028c986e519f919c9bbd 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 @comment %**start of header
-@setfilename ../../info/htmlfontify
+@setfilename ../../info/htmlfontify.info
 @settitle Htmlfontify User Manual
 @exampleindent 2
 @documentencoding UTF-8
index b1ed47ed7b74b92b31303dc7db951ca75558eb4e..5c1c8ba350fbe4f1b7201045d42a6d18ec0bcaae 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/idlwave
+@setfilename ../../info/idlwave.info
 @settitle IDLWAVE User Manual
 @synindex ky cp
 @syncodeindex vr cp
index 0a94a19df84ded4a3c3f88559737bd82853111ec..82acadae2e19d0addaeeee97702f5ed6c9b92ded 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo    @c -*-texinfo-*-
-@setfilename ../../info/ido
+@setfilename ../../info/ido.info
 @settitle Interactive Do
 @documentencoding UTF-8
 @include emacsver.texi
index f20582659ba87e3b654ee03a87cbf08fdc30207b..42e7c2bb934856a6d461f4c1a295f59c800e4b9c 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo.tex
 
-@setfilename ../../info/mairix-el
+@setfilename ../../info/mairix-el.info
 @settitle Emacs Interface for Mairix
 
 @documentencoding UTF-8
index 7421360211ca3f476a638e44c506a3c8c9ce45af..792aa4e9ea9e088bfc6f9f53c672801735c8aaa5 100644 (file)
@@ -2,7 +2,7 @@
 
 @include gnus-overrides.texi
 
-@setfilename ../../info/message
+@setfilename ../../info/message.info
 @settitle Message Manual
 @documentencoding UTF-8
 @synindex fn cp
@@ -310,7 +310,13 @@ news.
 @table @code
 @item message-forward-ignored-headers
 @vindex message-forward-ignored-headers
-All headers that match this regexp will be deleted when forwarding a message.
+In non-@code{nil}, all headers that match this regexp will be deleted
+when forwarding a message.
+
+@item message-forward-included-headers
+@vindex message-forward-included-headers
+In non-@code{nil}, only headers that match this regexp will be kept
+when forwarding a message.
 
 @item message-make-forward-subject-function
 @vindex message-make-forward-subject-function
index b4538f89db59f11a0b3f582b2f642b869f9859f4..6b64a108af5101af12d203a53cb3c5d5758e8e6c 100644 (file)
@@ -3,7 +3,7 @@
 @c Note: This document requires makeinfo version 4.6 or greater to build.
 @c
 @c %**start of header
-@setfilename ../../info/mh-e
+@setfilename ../../info/mh-e.info
 @settitle The MH-E Manual
 @documentencoding UTF-8
 @c %**end of header
index f51d954948f19c3360c6b979bd458a708145bed7..ec1236d531b445a017d2381a056cb69347e21b0e 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo   @c -*-texinfo-*-
 @comment %**start of header
-@setfilename ../../info/newsticker
+@setfilename ../../info/newsticker.info
 @set VERSION 1.99
 @set UPDATED June 2008
 @settitle Newsticker @value{VERSION}
index 53030305bfb980b036244b75821dab3a743da646..93a8d9a9f77e8ddf65fb05be689db4602e4fd776 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo @c -*- texinfo -*-
 @c %**start of header
-@setfilename ../../info/nxml-mode
+@setfilename ../../info/nxml-mode.info
 @settitle nXML Mode
 @documentencoding UTF-8
 @c %**end of header
index 31c2112845af04d9c42266b62d32a2b516194155..6fefab3c4439673479df29647d4c2f04893bef3e 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo                  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/octave-mode
+@setfilename ../../info/octave-mode.info
 @settitle Octave Mode
 @documentencoding UTF-8
 @c %**end of header
index 3800a41d2394239be3379bef62a0302e53681651..6466a001f0dbae9d0157378eb42cae598dba26e7 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 @c %**start of header
-@setfilename ../../info/org
+@setfilename ../../info/org.info
 @settitle The Org Manual
 @set VERSION 8.2.6
 
@@ -12228,7 +12228,7 @@ height:width ratio, do the following
 @cindex #+ATTR_ODT
 You can control the manner in which an image is anchored by setting the
 @code{:anchor} property of it's @code{#+ATTR_ODT} line.  You can specify one
-of the the following three values for the @code{:anchor} property:
+of the following three values for the @code{:anchor} property:
 @samp{"as-char"}, @samp{"paragraph"} and @samp{"page"}.
 
 To create an image that is anchored to a page, do the following:
index 6b56bc03223bd56aa4aa1b186d75150e3650be90..099c4be2c1d155ba644306f5d6e3a237eea4fca1 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/pcl-cvs
+@setfilename ../../info/pcl-cvs.info
 @settitle PCL-CVS---Emacs Front-End to CVS
 @syncodeindex vr fn
 @documentencoding UTF-8
index 53c66c8fb34d010b73ccedbd68f204b3fd06a5ea..193f7f7830469160b1057834157a510d1f23be6a 100644 (file)
@@ -2,7 +2,7 @@
 
 @include gnus-overrides.texi
 
-@setfilename ../../info/pgg
+@setfilename ../../info/pgg.info
 
 @set VERSION 0.1
 @settitle PGG @value{VERSION}
index 2a7c52c33d92c4d314a39ed4f27dc0c991165d86..e37db1997569d45db33bb163db47f56adb2b4111 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 @c %**start of header
-@setfilename ../../info/rcirc
+@setfilename ../../info/rcirc.info
 @settitle rcirc Manual
 @documentencoding UTF-8
 @c %**end of header
index 6d79d352e40f47ced6f686fc36b01ab15a518649..7a1b224fee69c21bb6abfc3c4456334f1dafb47b 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/reftex
+@setfilename ../../info/reftex.info
 @settitle RefTeX User Manual
 @documentencoding UTF-8
 @synindex ky cp
index 5e2c1e2b0f6ec28ad40a55466dbe9e880c62bf8b..28c0ef5d8b3f83d109ac9c0fe889037db4933385 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/remember
+@setfilename ../../info/remember.info
 @settitle Remember Manual
 @syncodeindex fn cp
 @documentencoding UTF-8
index ce3300dcc5be2fee67248fd8d45771a789f4973b..41afd9bdc1484937f09d88be3dc94c0322510982 100644 (file)
@@ -2,7 +2,7 @@
 
 @include gnus-overrides.texi
 
-@setfilename ../../info/sasl
+@setfilename ../../info/sasl.info
 
 @set VERSION 0.2
 @settitle Emacs SASL Library @value{VERSION}
index 83429a8e8e2f6530552b6c461f78198bcc3434a7..8a997cd4907ca07b22d3b13379ea3386b2a803bd 100644 (file)
@@ -1,7 +1,7 @@
 \input texinfo  @comment -*-texinfo-*-
 @comment 3.48
 @comment %**start of header (This is for running Texinfo on a region.)
-@setfilename ../../info/sc
+@setfilename ../../info/sc.info
 @settitle Supercite User's Manual
 @documentencoding UTF-8
 @iftex
index 0b0d7a364d6f556bf73cc88ddfec78005bc521fd..9b9f29f1f191eb809e13add65e9ed2e4c14dc4ca 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo
-@setfilename ../../info/semantic
+@setfilename ../../info/semantic.info
 @set TITLE  Semantic Manual
 @set AUTHOR Eric M. Ludlam, David Ponce, and Richard Y. Kim
 @settitle @value{TITLE}
index 2e1159a98fe9bd4a3d67ba288d552b6e57b3f72c..48511221442f3b8d82cd6fa710af23d90a67ef63 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo   @c -*- mode: texinfo; coding: utf-8; -*-
 @c %**start of header
-@setfilename ../../info/ses
+@setfilename ../../info/ses.info
 @settitle @acronym{SES}: Simple Emacs Spreadsheet
 @setchapternewpage off
 @syncodeindex fn cp
@@ -435,6 +435,13 @@ Centering with dashes and spill-over.
 Centering with tildes (~) and spill-over.
 @end table
 
+You can define printer function local to a sheet with command
+@code{ses-define-local-printer}. For instance define printer
+@samp{foo} to @code{"%.2f"} and then use symbol @samp{foo} as a
+printer function. Then, if you call again
+@code{ses-define-local-printer} on @samp{foo} to redefine it as
+@code{"%.3f"} all the cells using printer @samp{foo} will be reprinted
+accordingly.
 
 @node Clearing cells
 @section Clearing cells
index 422468c22103928c96aafd45cf9f11864ab3acdb..98177e0c91ea6277caa6ff1deb80a99da1b4b31b 100644 (file)
@@ -2,7 +2,7 @@
 
 @include gnus-overrides.texi
 
-@setfilename ../../info/sieve
+@setfilename ../../info/sieve.info
 @settitle Emacs Sieve Manual
 @documentencoding UTF-8
 @synindex fn cp
index cb22dc87d2a2e589020576f37628e5fc0cdd4ffd..f539cd0e2247ecabeb86da10a01c1e92ec717c78 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo  @c -*-texinfo-*-
-@setfilename ../../info/smtpmail
+@setfilename ../../info/smtpmail.info
 @settitle Emacs SMTP Library
 @documentencoding UTF-8
 @syncodeindex vr fn
index f5acc254c53cf55b7bc476e19b668f8527e0a03b..c57c4b65ded1717e7ed6e40d39446106a9646689 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo   @c -*-texinfo-*-
-@setfilename ../../info/speedbar
+@setfilename ../../info/speedbar.info
 @settitle Speedbar: File/Tag summarizing utility
 @documentencoding UTF-8
 @syncodeindex fn cp
index cd72656c91bf31b1ee2d34cce4f019ca21e5ea96..749bdf09fba8812417a57b991d5fac03316947ce 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 @c %**start of header
-@setfilename ../../info/srecode
+@setfilename ../../info/srecode.info
 @set TITLE SRecoder Manual
 @set AUTHOR Eric M. Ludlam
 @settitle @value{TITLE}
@@ -1191,7 +1191,7 @@ If there is an active region via @code{transient-mark-mode}, or
 @code{mouse-drag-region}, then the @code{REGION} section will be
 enabled.
 
-In addition, @code{REGIONTEXT} will be set the the text in the region,
+In addition, @code{REGIONTEXT} will be set to the text in the region,
 and that region of text will be ``killed'' from the current buffer.
 
 If standard-output is NOT the current buffer, then the region will not
index 0f2673c849e25850ca3d3d5533fefb29c6f5c13d..6312dadbce044dda55f728598b21705a1007ca3c 100644 (file)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2014-03-17.07}
+\def\texinfoversion{2014-05-20.16}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -2146,7 +2146,7 @@ end
   \let\tenttsl=\secttsl
   \def\curfontsize{sec}%
   \def\lsize{subsec}\def\lllsize{reduced}%
-  \resetmathfonts \setleading{16pt}}
+  \resetmathfonts \setleading{17pt}}
 \def\subsecfonts{%
   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
@@ -8856,20 +8856,20 @@ end
 {
   \catcode`\_ = \active
   \globaldefs=1
-\parseargdef\documentlanguage{\begingroup
-  \let_=\normalunderscore  % normal _ character for filenames
+\parseargdef\documentlanguage{%
   \tex % read txi-??.tex file in plain TeX.
     % Read the file by the name they passed if it exists.
+    \let_ = \normalunderscore  % normal _ character for filename test
     \openin 1 txi-#1.tex
     \ifeof 1
-      \documentlanguagetrywithoutunderscore{#1_\finish}%
+      \documentlanguagetrywithoutunderscore #1_\finish
     \else
       \globaldefs = 1  % everything in the txi-LL files needs to persist
       \input txi-#1.tex
     \fi
     \closein 1
   \endgroup % end raw TeX
-\endgroup}
+}
 %
 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
 % try txi-de.tex.
index 9b0ec6e85a33b16ad47cfebadaa43c92c938b133..8b9903419abbd58c3f573a022548772dba2befb1 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo.tex   @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/todo-mode
+@setfilename ../../info/todo-mode.info
 @settitle Todo Mode User Manual
 @syncodeindex fn cp
 @syncodeindex vr cp
@@ -158,7 +158,7 @@ you want.
 All todo files reside in a single directory, whose location is specified
 by the user option @code{todo-directory}.  This directory may also
 contain other types of Todo files, which are discussed later
-(@pxref{Todo Archive Mode} and @ref{Todo Filtered Items Mode}).  
+(@pxref{Todo Archive Mode} and @ref{Todo Filtered Items Mode}).
 @c Emacs recognizes Todo files by their extension, so when you visit
 @c the files the buffer is in the appropriate mode and the current
 @c category is correctly displayed.
index 1f6eaef6880a21baaab0e80bf18ddc466c957230..06b302b6d4dc6a0b9eec9a2d98fdf18e51f79768 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo   @c -*-texinfo-*-
-@setfilename ../../info/tramp
+@setfilename ../../info/tramp.info
 @c %**start of header
 @settitle TRAMP User Manual
 @documentencoding UTF-8
@@ -605,11 +605,10 @@ action.
 @cindex methods, inline
 
 The inline methods in @value{tramp} are quite powerful and can work in
-situations where you cannot use an external transfer program to connect.
-Inline methods are the only methods that work when connecting to the
-remote host via telnet.  (There are also strange inline methods which
-allow you to transfer files between @emph{user identities} rather than
-hosts, see below.)
+situations where you cannot use an external transfer program to
+connect.  There are also strange inline methods which allow you to
+transfer files between @emph{user identities} rather than hosts, see
+below.
 
 These methods depend on the existence of a suitable encoding and
 decoding command on remote host.  Locally, @value{tramp} may be able to
@@ -748,7 +747,10 @@ This method is mostly interesting for Windows users using the PuTTY
 implementation of SSH@.  It uses @samp{plink -ssh} to log in to the
 remote host.
 
-This supports the @samp{-P} argument.
+With a recent PuTTY, it is recommended to check the @samp{Share SSH
+connections if possible} control for that session.
+
+This method supports the @samp{-P} argument.
 
 
 @item @option{plinkx}
@@ -757,9 +759,10 @@ This supports the @samp{-P} argument.
 
 Another method using PuTTY on Windows.  Instead of host names, it
 expects PuTTY session names, calling @samp{plink -load @var{session}
--t"}.  User names are relevant only in case the corresponding session
-hasn't defined a user name.  Different port numbers must be defined in
-the session.
+-t}.  User names and port numbers must be defined in the session.
+
+With a recent PuTTY, it is recommended to check the @samp{Share SSH
+connections if possible} control for that session.
 
 @end table
 
@@ -820,22 +823,6 @@ specify @samp{-p 42} in the argument list for @command{ssh}, and to
 specify @samp{-P 42} in the argument list for @command{scp}.
 
 
-@item @option{sftp}---@command{ssh} and @command{sftp}
-@cindex method sftp
-@cindex sftp method
-@cindex sftp (with sftp method)
-@cindex ssh (with sftp method)
-
-That is mostly the same method as @option{scp}, but using
-@command{sftp} as transfer command.  So the same remarks are valid.
-
-This command does not work like @value{ftppackagename}, where
-@command{ftp} is called interactively, and all commands are send from
-within this session.  Instead of, @command{ssh} is used for login.
-
-This method supports the @samp{-p} argument.
-
-
 @item @option{rsync}---@command{ssh} and @command{rsync}
 @cindex method rsync
 @cindex rsync method
@@ -881,33 +868,27 @@ This method supports the @samp{-p} argument.
 
 
 @item @option{pscp}---@command{plink} and @command{pscp}
+@item @option{psftp}---@command{plink} and @command{psftp}
 @cindex method pscp
 @cindex pscp method
 @cindex pscp (with pscp method)
 @cindex plink (with pscp method)
 @cindex PuTTY (with pscp method)
-
-This method is similar to @option{scp}, but it uses the
-@command{plink} command to connect to the remote host, and it uses
-@command{pscp} for transferring the files.  These programs are part
-of PuTTY, an SSH implementation for Windows.
-
-This method supports the @samp{-P} argument.
-
-
-@item @option{psftp}---@command{plink} and @command{psftp}
 @cindex method psftp
 @cindex psftp method
-@cindex psftp (with psftp method)
+@cindex pscp (with psftp method)
 @cindex plink (with psftp method)
 @cindex PuTTY (with psftp method)
 
-As you would expect, this method is similar to @option{sftp}, but it
-uses the @command{plink} command to connect to the remote host, and it
-uses @command{psftp} for transferring the files.  These programs are
-part of PuTTY, an SSH implementation for Windows.
+These methods are similar to @option{scp} or @option{sftp}, but they
+use the @command{plink} command to connect to the remote host, and
+they use @command{pscp} or @command{psftp} for transferring the files.
+These programs are part of PuTTY, an SSH implementation for Windows.
 
-This method supports the @samp{-P} argument.
+With a recent PuTTY, it is recommended to configure the @samp{Share
+SSH connections if possible} control for that session.
+
+These methods support the @samp{-P} argument.
 
 
 @item @option{fcp}---@command{fsh} and @command{fcp}
@@ -938,6 +919,19 @@ opens just one connection to the remote host and then keeps it open,
 anyway.
 
 
+@item @option{nc}---@command{telnet} and @command{nc}
+@cindex method nc
+@cindex nc method
+@cindex nc (with nc method)
+@cindex telnet (with nc method)
+
+Using @command{telnet} to connect to the remote host and @command{nc}
+for file transfer is often the only possibility to access dumb
+devices, like routers or NAS hosts.  Those hosts have just a
+restricted @command{busybox} as local shell, and there is no program
+to encode and decode files for transfer.
+
+
 @item @option{ftp}
 @cindex method ftp
 @cindex ftp method
@@ -1066,6 +1060,17 @@ OBEX is an FTP-like access protocol for simple devices, like cell
 phones.  For the time being, @value{tramp} only supports OBEX over Bluetooth.
 
 
+@item @option{sftp}
+@cindex method sftp
+@cindex sftp method
+
+As you might expect, this method uses @command{sftp} in order to
+access the remote host.  Contrary to the @option{ssh} and @option{scp}
+methods, it doesn't open an @command{ssh} session for login.
+Therefore, it could be used to access to remote hosts which refuse
+@command{ssh} for security reasons.
+
+
 @item @option{synce}
 @cindex method synce
 @cindex synce method
@@ -1077,10 +1082,10 @@ FUSE, it also needs the SYNCE-GVFS plugin.
 @end table
 
 @defopt tramp-gvfs-methods
-This customer option, a list, defines the external methods which
-shall be used with GVFS@.  Per default, these are @option{dav},
-@option{davs}, @option{obex} and @option{synce}.  Other possible
-values are @option{ftp}, @option{sftp} and @option{smb}.
+This customer option, a list, defines the external methods which shall
+be used with GVFS@.  Per default, these are @option{dav},
+@option{davs}, @option{obex}, @option{sftp} and @option{synce}.  Other
+possible values are @option{ftp} and @option{smb}.
 @end defopt
 @end ifset
 
@@ -1503,7 +1508,7 @@ customize which files are taken into account for user and host name
 completion (@pxref{File name completion}).  For every method, it keeps
 a set of configuration files, accompanied by a Lisp function able to
 parse that file.  Entries in @code{tramp-completion-function-alist}
-have the form (@var{method} @var{pair1} @var{pair2} ...).
+have the form (@var{method} @var{pair1} @var{pair2} @dots{}).
 
 Each @var{pair} is composed of (@var{function} @var{file}).
 @var{function} is responsible to extract user names and host names
@@ -3774,7 +3779,7 @@ a non-@code{nil} value.
 
 @lisp
 (let ((non-essential t))
-  ...)
+  @dots{})
 @end lisp
 
 
@@ -3793,7 +3798,7 @@ should let-bind the variable @code{process-file-side-effects} to
 
 @lisp
 (let (process-file-side-effects)
-  ...)
+  @dots{})
 @end lisp
 
 For asynchronous processes, @value{tramp} flushes the file attributes
@@ -3934,7 +3939,7 @@ file:
 
 The autoload of the @value{emacsname} @value{tramp} package must be
 disabled.  This can be achieved by setting file permissions @code{000}
-to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}.
+to the files @file{@dots{}/xemacs-packages/lisp/tramp/auto-autoloads.el*}.
 
 In case of unified file names, all @value{emacsname} download sites are
 added to @code{tramp-default-method-alist} with default method
index 3b66239f284c4fd10d8139ac0351395956b523dd..cfcb66401830c10ff3954af710734bf680e8698b 100644 (file)
@@ -5,10 +5,10 @@
 @c Copyright (C) 2003-2014 Free Software Foundation, Inc.
 @c See file doclicense.texi for copying conditions.
 
-@c In the Tramp CVS, the version number is auto-frobbed from
+@c In the Tramp GIT, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.2.9-24.4
+@set trampver 2.2.11-pre
 
 @c Other flags from configuration
 @set instprefix /usr/local
index 765d97d598070d77604395d9e1f414283fb64267..48e18391f29a90dc07504ce43b47edbfbd775c6b 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo
-@setfilename ../../info/url
+@setfilename ../../info/url.info
 @settitle URL Programmer's Manual
 
 @documentencoding UTF-8
diff --git a/doc/misc/vhdl-mode.texi b/doc/misc/vhdl-mode.texi
new file mode 100644 (file)
index 0000000..35c6e0b
--- /dev/null
@@ -0,0 +1,1022 @@
+\input texinfo   @c -*- texinfo -*-
+
+@setfilename ../../info/vhdl-mode.info
+@settitle VHDL Mode, an Emacs mode for editing VHDL code
+@documentencoding UTF-8
+
+@c Adapted from the VHDL Mode texinfo manual version 2 by Rodney J. Whitby.
+@c Adapted from the CC Mode texinfo manual by Barry A. Warsaw.
+
+@copying
+This file documents VHDL Mode, an Emacs mode for editing VHDL code.
+
+Copyright @copyright{} 1995--2008, 2010, 2012, 2014 Free Software
+Foundation, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
+and with the Back-Cover Texts as in (a) below.  A copy of the license
+is included in the section entitled ``GNU Free Documentation License.''
+
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual.''
+@end quotation
+@end copying
+
+@dircategory Emacs editing modes
+@direntry
+* VHDL Mode: (vhdl-mode).       Emacs mode for editing VHDL code.
+@end direntry
+
+@finalout
+
+@titlepage
+@title VHDL Mode
+@sp 2
+@subtitle A GNU Emacs mode for editing VHDL code.
+@sp 2
+@author Reto Zimmermann
+@author @email{reto@@gnu.org}
+@author Rod Whitby
+@author @email{software.vhdl-mode@@rwhitby.net}
+
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@contents
+
+@ifnottex
+@node Top
+@top VHDL Mode, an Emacs mode for editing VHDL code
+
+@insertcopying
+@end ifnottex
+
+@menu
+* Introduction::
+* Getting Connected::
+* New Indentation Engine::
+* Customizing Indentation::
+* Syntactic Symbols::
+* Frequently Asked Questions::
+* Getting the latest VHDL Mode release::
+* Sample .emacs File::
+* Limitations and Known Bugs::
+* Mailing Lists and Submitting Bug Reports::
+* GNU Free Documentation License:: The license for this documentation.
+* Concept Index::
+* Command Index::               Command Index
+* Key Index::                   Key Index
+* Variable Index::              Variable Index
+@end menu
+
+@node     Introduction
+@chapter  Introduction
+@cindex   Introduction
+
+Welcome to VHDL Mode. This is a GNU Emacs mode for editing files
+containing VHDL code.
+
+This manual will describe the following:
+
+@itemize @bullet
+@item
+How to get started using VHDL Mode.
+
+@item
+How the indentation engine works.
+
+@item
+How to customize the indentation engine.
+
+@end itemize
+
+@findex vhdl-version
+The major version number was incremented to 3 with the addition of
+many new features for editing VHDL code to the new indentation engine,
+which was introduced in major version 2. To find the minor revision
+number of this release, use @kbd{M-x vhdl-version RET}.
+
+A special word of thanks goes to Rod Whitby, who wrote the
+VHDL Mode indentation engine, and to Barry Warsaw, who wrote
+the CC Mode indentation engine that formed the basis
+thereof. Their manuals were also the basis for this manual.
+
+This manual is not very up-to-date. It basically contains the
+indentation machine documentation by Rod Whitby with only minor
+adaptions. A short documentation of the entire VHDL Mode is available
+within the mode itself by typing @kbd{C-c C-h}. Also, all commands and
+customization of most variables are available through the menu, which
+makes everything highly self-explaining.
+
+@node     Getting Connected
+@chapter  Getting Connected
+@cindex   Getting Connected
+
+To get started, simply visit a @file{.vhd} file in Emacs; or type
+@kbd{M-x vhdl-mode RET}.
+
+@node     New Indentation Engine
+@chapter  New Indentation Engine
+@cindex   New Indentation Engine
+
+VHDL Mode has a new indentation engine, providing a simplified, yet
+flexible and general mechanism for customizing indentation. It breaks
+indentation calculation into two steps. First for the line of code being
+indented, VHDL Mode analyzes what kind of language construct it's
+looking at, then it applies user defined offsets to the current line
+based on this analysis.
+
+This section will briefly cover how indentation is calculated in
+VHDL Mode. It is important to understand the indentation model
+being used so that you will know how to customize VHDL Mode for
+your personal coding style.
+
+@menu
+* Syntactic Analysis::       Step 1 -- Syntactic Analysis
+* Indentation Calculation::  Step 2 -- Indentation Calculation
+@end menu
+
+@node  Syntactic Analysis
+@section  Syntactic Analysis
+@cindex   Syntactic Analysis
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+@cindex relative buffer position
+@cindex syntactic symbol
+@cindex syntactic component
+@cindex syntactic component list
+@cindex relative buffer position
+The first thing VHDL Mode does when indenting a line of code, is
+to analyze the line, determining the @dfn{syntactic component list} of
+the construct on that line.  A @dfn{syntactic component} consists of a
+pair of information (in lisp parlance, a @emph{cons cell}), where the
+first part is a @dfn{syntactic symbol}, and the second part is a
+@dfn{relative buffer position}.  Syntactic symbols describe elements of
+VHDL code, e.g. @code{statement}, @code{comment}, @code{block-open},
+@code{block-close}, etc.  @xref{Syntactic Symbols}, for a complete list
+of currently recognized syntactic symbols and their semantics.  Also,
+the variable @code{vhdl-offsets-alist} contains the list of currently
+supported syntactic symbols.
+
+Conceptually, a line of VHDL code is always indented relative to the
+indentation of some line higher up in the buffer.  This is represented
+by the relative buffer position in the syntactic component.
+
+It might help to see an example. Suppose we had the following code as
+the only thing in a VHDL Mode buffer @footnote{The line numbers
+in this and future examples don't actually appear in the buffer.}:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:   q <= not d;
+  4:   wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+@kindex C-c C-x
+@findex vhdl-show-syntactic-information
+@findex show-syntactic-information (vhdl-)
+We can use the command @kbd{C-c C-x}
+(@code{vhdl-show-syntactic-information}) to simply report what the
+syntactic analysis is for the current line.  Running this command on
+line 4 of example 1, we'd see in the echo area:
+@example
+
+((statement . 28))
+
+@end example
+
+This tells us that the line is a statement and it is indented relative
+to buffer position 28, which happens to be the @samp{q} on line 3.  If
+you were to move point to line 3 and hit @kbd{C-c C-x}, you would see:
+@example
+
+((statement-block-intro . 20))
+
+@end example
+
+This indicates that line 3 is the first statement in a block, and is
+indented relative to buffer position 20, which is the @samp{b} in the
+@code{begin} keyword on line 2.
+
+@cindex comment only line
+Syntactic component lists can contain more than one component, and
+individual syntactic compenents need not have relative buffer positions.
+The most common example of this is a line that contains a @dfn{comment
+only line}.
+@example
+@group
+
+%%% TBD %%%
+
+@end group
+@end example
+
+@noindent
+Hitting @kbd{C-c C-x} on line 3 of the example gives us:
+@example
+
+((comment-intro) (block-intro . 46))
+
+@end example
+
+@noindent
+so you can see that the syntactic component list contains two syntactic
+components.  Also notice that the first component,
+@samp{(comment-intro)} has no relative buffer position.
+
+@node  Indentation Calculation
+@section  Indentation Calculation
+@cindex   Indentation Calculation
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+Indentation for the current line is calculated using the syntactic
+component list derived in step 1 above (see @ref{Syntactic
+Analysis}).  Each component contributes to the final total indentation
+of the line in two ways.
+
+First, the syntactic symbols are looked up in the @code{vhdl-offsets-alist}
+variable, which is an association list of syntactic symbols and the
+offsets to apply for those symbols.  These offsets are added to the
+running total.
+
+Second, if the component has a relative buffer position, VHDL Mode
+adds the column number of that position to the running total.  By adding
+up the offsets and columns for every syntactic component on the list,
+the final total indentation for the current line is computed.
+
+Let's use our code example above to see how this works.  Here is our
+example again.
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:   q <= not d;
+  4:   wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+@kindex TAB
+Let's say point is on line 3 and we hit the @key{TAB} key to re-indent
+the line.  Remember that the syntactic component list for that
+line is:
+@example
+
+((statement-block-intro . 20))
+
+@end example
+
+@noindent
+VHDL Mode looks up @code{statement-block-intro} in the
+@code{vhdl-offsets-alist} variable.  Let's say it finds the value @samp{2};
+it adds this to the running total (initialized to zero), yielding a
+running total indentation of 2 spaces.
+
+Next VHDL Mode goes to buffer position 20 and asks for the
+current column.  Since the @code{begin} keyword at buffer position 20 is
+in column zero, it adds @samp{0} to the running total.  Since there is
+only one syntactic component on the list for this line, indentation
+calculation is complete, and the total indentation for the line is 2
+spaces.
+Simple, huh?
+
+Actually, the mode usually just does The Right Thing without you having
+to think about it in this much detail.  But when customizing
+indentation, it's helpful to understand the general indentation model
+being used.
+
+@vindex vhdl-echo-syntactic-information-p
+@vindex echo-syntactic-information-p (vhdl-)
+@cindex TAB
+To help you configure VHDL Mode, you can set the variable
+@code{vhdl-echo-syntactic-information-p} to non-@code{nil} so that the
+syntactic component list and calculated offset will always be echoed in
+the minibuffer when you hit @kbd{TAB}.
+
+
+@ignore
+@node  Indentation Commands
+@chapter  Indentation Commands
+@cindex   Indentation Commands
+
+@strong{<TBD>}
+@end ignore
+
+
+@node     Customizing Indentation
+@chapter  Customizing Indentation
+@cindex   Customizing Indentation
+
+@cindex vhdl-set-offset
+@cindex set-offset (vhdl-)
+The @code{vhdl-offsets-alist} variable is where you customize all your
+indentations.  You simply need to decide what additional offset you want
+to add for every syntactic symbol.  You can use the command @kbd{C-c
+O} (@code{vhdl-set-offset}) as the way to set offsets, both
+interactively and from your mode hook.  Also, you can set up
+@emph{styles} of indentation.  Most likely, you'll find one of the
+pre-defined styles will suit your needs, but if not, this section will
+describe how to set up basic editing configurations.  @xref{Styles}, for
+an explanation of how to set up named styles.
+
+@cindex vhdl-basic-offset
+@cindex basic-offset (vhdl-)
+As mentioned previously, the variable @code{vhdl-offsets-alist} is an
+association list between syntactic symbols and the offsets to be applied
+for those symbols.  In fact, these offset values can be an integer, a
+function or variable name, or one of the following symbols: @code{+},
+@code{-}, @code{++}, @code{--}, @code{*}, or @code{/}.  The symbol
+values have the following meanings:
+
+@itemize @bullet
+
+@item
+@code{+}  --  1 x @code{vhdl-basic-offset}
+@item
+@code{-}  --  -1 x @code{vhdl-basic-offset}
+@item
+@code{++} --  2 x @code{vhdl-basic-offset}
+@item
+@code{--} --  -2 x @code{vhdl-basic-offset}
+@item
+@code{*}  --  0.5 x @code{vhdl-basic-offset}
+@item
+@code{/}  --  -0.5 x @code{vhdl-basic-offset}
+
+@end itemize
+
+@noindent
+So, for example, because most of the default offsets are defined in
+terms of @code{+}, @code{-}, and @code{0}, if you like the general
+indentation style, but you use 2 spaces instead of 4 spaces per level,
+you can probably achieve your style just by changing
+@code{vhdl-basic-offset} like so (in your @file{.emacs} file):
+@example
+
+(setq vhdl-basic-offset 2)
+
+@end example
+
+To change indentation styles more radically, you will want to change the
+value associated with the syntactic symbols in the
+@code{vhdl-offsets-alist} variable.  First, I'll show you how to do that
+interactively, then I'll describe how to make changes to your
+@file{.emacs} file so that your changes are more permanent.
+
+@menu
+* Interactive Customization::
+* Permanent Customization::
+* Styles::
+* Advanced Customizations::
+@end menu
+
+@node     Interactive Customization
+@section  Interactive Customization
+@cindex   Interactive Customization
+
+As an example of how to customize indentation, let's change the
+style of the example above from:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:   q <= not d;
+  4:   wait on d;
+  5: end inverter;
+
+@end group
+@end example
+@noindent
+to:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:     q <= not d;
+  4:     wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+In other words, we want to change the indentation of the statments
+inside the inverter process.  Notice that the construct we want to
+change starts on line 3.  To change the indentation of a line, we need
+to see which syntactic component affect the offset calculations for that
+line.  Hitting @kbd{C-c C-x} on line 3 yields:
+@example
+
+((statement-block-intro . 20))
+
+@end example
+
+@findex vhdl-set-offset
+@findex set-offset (vhdl-)
+@kindex C-c O
+@noindent
+So we know that to change the offset of the first signal assignment, we need to
+change the indentation for the @code{statement-block-intro} syntactic
+symbol.  To do this interactively, just hit @kbd{C-c O}
+(@code{vhdl-set-offset}).  This prompts you for the syntactic symbol to
+change, providing a reasonable default.  In this case, the default is
+@code{statement-block-intro}, which is just the syntactic symbol we want to
+change!
+
+After you hit return, VHDL Mode will then prompt you for the new
+offset value, with the old value as the default.  The default in this
+case is @samp{+}, so hit backspace to delete the @samp{+}, then hit
+@samp{++} and @kbd{RET}.  This will associate an offset of twice the
+basic indent with the syntactic symbol @code{statement-block-intro} in
+the @code{vhdl-offsets-alist} variable.
+
+@findex vhdl-indent-defun
+@findex indent-defun (vhdl-)
+To check your changes quickly, just enter @kbd{M-x vhdl-indent-defun} to
+reindent the entire function.  The example should now look like:
+@example
+@group
+
+  1: inverter : process
+  2: begin
+  3:     q <= not d;
+  4:     wait on d;
+  5: end inverter;
+
+@end group
+@end example
+
+Notice how just changing the offset on line 3 is all we needed to do.
+Since the other affected lines are indented relative to line 3, they are
+automatically indented the way you'd expect.  For more complicated
+examples, this may not always work.  The general approach to take is to
+always start adjusting offsets for lines higher up in the file, then
+re-indent and see if any following lines need further adjustments.
+
+@node     Permanent Customization
+@section  Permanent Indentation
+@cindex   Permanent Indentation
+
+@vindex vhdl-mode-hook
+@cindex hooks
+To make this change permanent, you need to add some lisp code to your
+@file{.emacs} file.  VHDL Mode provides a @code{vhdl-mode-hook}
+that you can use to customize your language editing styles.  This hook
+gets run as the last thing when you enter VHDL Mode.
+
+Here's a simplified example of what you can add to your @file{.emacs}
+file to make the changes described in the previous section
+(@ref{Interactive Customization}) more permanent.  See the Emacs
+manuals for more information on customizing Emacs via hooks.
+@xref{Sample .emacs File}, for a more complete sample @file{.emacs} file.
+
+@example
+@group
+
+(defun my-vhdl-mode-hook ()
+  ;; my customizations for all of vhdl-mode
+  (vhdl-set-offset 'statement-block-intro '++)
+  ;; other customizations can go here
+  )
+(add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
+
+@end group
+@end example
+
+For complex customizations, you will probably want to set up a
+@emph{style} that groups all your customizations under a single
+name.  @xref{Styles}.
+
+The offset value can also be a function, and this is how power users
+gain enormous flexibility in customizing indentation.  @xref{Advanced
+Customizations}.
+
+@node     Styles
+@section  Styles
+@cindex   Styles
+
+Most people only need to edit code formatted in just a few well-defined
+and consistent styles.  For example, their organization might impose a
+``blessed'' style that all its programmers must conform to.  Similarly,
+people who work on GNU software will have to use the GNU coding style on
+C code.  Some shops are more lenient, allowing some variety of coding
+styles, and as programmers come and go, there could be a number of
+styles in use.  For this reason, VHDL Mode makes it convenient for
+you to set up logical groupings of customizations called @dfn{styles},
+associate a single name for any particular style, and pretty easily
+start editing new or existing code using these styles.  This chapter
+describes how to set up styles and how to edit your C code using styles.
+
+@menu
+* Built-in Styles::
+* Adding Styles::
+* File Styles::
+@end menu
+
+
+@node     Built-in Styles
+@subsection  Built-in Styles
+@cindex   Built-in Styles
+
+If you're lucky, one of VHDL Mode's built-in styles might be just
+what you're looking for.  Some of the most common VHDL styles are
+already built-in.  These include:
+
+@itemize @bullet
+@item
+@cindex IEEE style
+@code{GNU} -- the coding style in the IEEE Language Reference Manual.
+
+@end itemize
+
+@findex vhdl-set-style
+@findex set-style (vhdl-)
+If you'd like to experiment with these built-in styles you can simply
+type @kbd{M-x vhdl-set-style RET} in a VHDL Mode buffer.
+
+You will be prompted for one of the above styles (with completion).
+Enter one of the styles and hit @kbd{RET}.  Note however that setting a
+style in this way does @emph{not} automatically re-indent your file.
+@ignore
+For commands that you can use to view the effect of your changes, see
+@ref{Indentation Commands}.
+@end ignore
+
+Once you find a built-in style you like, you can make the change
+permanent by adding a call to your @file{.emacs} file.  Let's say for
+example that you want to use the @code{IEEE} style in all your
+files.  You would add this:
+@example
+@group
+
+(defun my-vhdl-mode-hook ()
+  ;; use IEEE style for all VHDL code
+  (vhdl-set-style "IEEE")
+  ;; other customizations can go here
+  )
+(add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
+
+@end group
+@end example
+
+@noindent
+@xref{Permanent Customization}.
+
+@node     Adding Styles
+@subsection  Adding Styles
+@cindex   Adding Styles
+
+@vindex vhdl-style-alist
+@vindex style-alist (vhdl-)
+@findex vhdl-add-style
+@findex add-style (vhdl-)
+If none of the built-in styles is appropriate, you'll probably want to
+add a new style definition.  Styles are kept in the @code{vhdl-style-alist}
+variable, but you probably won't want to modify this variable directly.
+VHDL Mode provides a function, called @code{vhdl-add-style}, that you
+can use to easily add new styles or update existing styles.  This
+function takes two arguments, a @var{stylename} string, and an
+association list @var{description} of style customizations.  If
+@var{stylename} is not already in @code{vhdl-style-alist}, the new style is
+added, otherwise the style already associated with @var{stylename} is
+changed to the new @var{description}.  This function also takes an
+optional third argument, which if non-@code{nil}, automatically
+institutes the new style in the current buffer.
+
+The sample @file{.emacs} file provides a concrete example of how a new
+style can be added and automatically set.  @xref{Sample .emacs File}.
+
+@node     File Styles
+@subsection  File Styles
+@cindex   File Styles
+
+@cindex local variables
+The Emacs manual describes how you can customize certain variables on a
+per-file basis by including a @dfn{Local Variable} block at the end of
+the file.  So far, you've only seen a functional interface to
+VHDL Mode, which is highly inconvenient for use in a Local Variable
+block.  VHDL Mode provides two variables that make it easier for
+you to customize your style on a per-file basis.
+
+@vindex vhdl-file-style
+@vindex file-style (vhdl-)
+@vindex vhdl-file-offsets
+@vindex file-offsets (vhdl-)
+
+The variable @code{vhdl-file-style} can be set to a style name string as
+described in @ref{Built-in Styles}.  When the file is visited,
+VHDL Mode will automatically set the file's style to this style
+using @code{vhdl-set-style}.
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+@findex vhdl-set-offset
+@findex set-offset (vhdl-)
+Another variable, @code{vhdl-file-offsets}, takes an association list
+similar to what is allowed in @code{vhdl-offsets-alist}.  When the file is
+visited, VHDL Mode will automatically institute these offets using
+@code{vhdl-set-offset}.  @xref{Customizing Indentation}.
+
+Note that file style settings (i.e. @code{vhdl-file-style}) are applied
+before file offset settings (i.e. @code{vhdl-file-offsets}).
+
+
+@node     Advanced Customizations
+@section  Advanced Customizations
+@cindex   Advanced Customizations
+
+@vindex vhdl-style-alist
+@vindex style-alist (vhdl-)
+@vindex vhdl-basic-offset
+@vindex basic-offset (vhdl-)
+For most users, VHDL Mode will support their coding styles with
+very little need for customizations.  Usually, one of the standard
+styles defined in @code{vhdl-style-alist} will do the trick.  Sometimes,
+one of the syntactic symbol offsets will need to be tweeked slightly, or
+perhaps @code{vhdl-basic-offset} will need to be changed.  However, some
+styles require a more advanced ability for customization, and one of the
+real strengths of VHDL Mode is that the syntactic analysis model
+provides a very flexible framework for customizing indentation. This
+allows you to perform special indentation calculations for situations
+not handled by the mode directly.
+
+@menu
+* Custom Indentation Functions::
+* Other Special Indentations::
+@end menu
+
+@node     Custom Indentation Functions
+@subsection  Custom Indentation Functions
+@cindex   Custom Indentation Functions
+
+@cindex custom indentation functions
+One of the most common ways to customize VHDL Mode is by writing
+@dfn{custom indentation functions} and associating them with specific
+syntactic symbols (see @ref{Syntactic Symbols}).  VHDL Mode itself
+uses custom indentation functions to provide more sophisticated
+indentation, for example when lining up selected signal assignments:
+@example
+@group
+
+%%% TBD %%%
+
+@end group
+@end example
+
+In this example, the @code{statement-cont} syntactic symbol has an
+offset of @code{+}, and @code{vhdl-basic-offset} is 2, so lines 4
+through 6 are simply indented two spaces to the right of line 3.  But
+perhaps we'd like VHDL Mode to be a little more intelligent so
+that it offsets the waveform descriptions relative to the signal
+assignment operator in line 3.  To do this, we have to write a custom
+indentation function which finds the column of signal assignment
+operator on the first line of the statement.  Here is the lisp code
+(from the @file{vhdl-mode.el} source file) that implements this:
+@example
+@group
+
+(defun vhdl-lineup-statement-cont (langelem)
+  ;; line up statement-cont after the assignment operator
+  (save-excursion
+    (let* ((relpos (cdr langelem))
+          (assignp (save-excursion
+                    (goto-char (vhdl-point 'boi))
+                    (and (re-search-forward "\\(<\\|:\\)="
+                                            (vhdl-point 'eol) t)
+                         (- (point) (vhdl-point 'boi)))))
+          (curcol (progn
+                    (goto-char relpos)
+                    (current-column)))
+          foundp)
+      (while (and (not foundp)
+                 (< (point) (vhdl-point 'eol)))
+       (re-search-forward "\\(<\\|:\\)=\\|(" (vhdl-point 'eol) 'move)
+       (if (vhdl-in-literal (cdr langelem))
+           (forward-char)
+         (if (= (preceding-char) ?\()
+             ;; skip over any parenthesized expressions
+             (goto-char (min (vhdl-point 'eol)
+                             (scan-lists (point) 1 1)))
+           ;; found an assignment operator (not at eol)
+           (setq foundp (not (looking-at "\\s-*$"))))))
+      (if (not foundp)
+         ;; there's no assignment operator on the line
+         vhdl-basic-offset
+       ;; calculate indentation column after assign and ws, unless
+       ;; our line contains an assignment operator
+       (if (not assignp)
+           (progn
+             (forward-char)
+             (skip-chars-forward " \t")
+             (setq assignp 0)))
+       (- (current-column) assignp curcol))
+      )))
+
+@end group
+@end example
+@noindent
+Custom indent functions take a single argument, which is a syntactic
+component cons cell (see @ref{Syntactic Analysis}).  The
+function returns an integer offset value that will be added to the
+running total indentation for the lne.  Note that what actually gets
+returned is the difference between the column that the signal assignment
+operator is on, and the column of the buffer relative position passed in
+the function's argument.  Remember that VHDL Mode automatically
+adds in the column of the component's relative buffer position and we
+don't want that value added into the final total twice.
+
+@cindex statement-cont syntactic symbol
+@findex vhdl-lineup-statement-cont
+@findex lineup-statement-cont (vhdl-)
+Now, to associate the function @code{vhdl-lineup-statement-cont} with the
+@code{statement-cont} syntactic symbol, we can add something like the
+following to our @code{vhdl-mode-hook}:
+@example
+
+(vhdl-set-offset 'statement-cont 'vhdl-lineup-statement-cont)
+
+@end example
+
+@findex vhdl-indent-defun
+Now the function looks like this after re-indenting (using @kbd{M-x
+vhdl-indent-defun}):
+@example
+@group
+
+%%% TBD %%%
+
+@end group
+@end example
+
+@vindex vhdl-offsets-alist
+@vindex offsets-alist (vhdl-)
+Custom indentation functions can be as simple or as complex as you like,
+and any syntactic symbol that appears in @code{vhdl-offsets-alist} can have
+a custom indentation function associated with it.  Note however that
+using many custom indentation functions may have a performance impact on
+VHDL Mode.
+
+@node     Other Special Indentations
+@subsection  Other Special Indentations
+@cindex   Other Special Indentations
+
+@vindex vhdl-special-indent-hook
+@vindex special-indent-hook (vhdl-)
+One other variable is available for you to customize VHDL Mode:
+@code{vhdl-special-indent-hook}.  This is a standard hook variable that
+is called after every line is indented by VHDL Mode.  You can use
+it to do any special indentation or line adjustments your style
+dictates, such as adding extra indentation to the port map clause in a
+component instantiation, etc.  Note however, that you should not change
+@code{point} or @code{mark} inside your @code{vhdl-special-indent-hook}
+functions.
+
+
+@node  Syntactic Symbols
+@chapter  Syntactic Symbols
+@cindex   Syntactic Symbols
+
+@vindex vhdl-offsets-alist
+The complete list of recognized syntactic symbols is described in the
+@code{vhdl-offsets-alist} variable.  This chapter will provide some
+examples to help clarify these symbols.
+
+@cindex -open syntactic symbols
+@cindex -close syntactic symbols
+Most syntactic symbol names follow a general naming convention.  When a
+line begins with a @code{begin} or @code{end} keyword, the syntactic
+symbol will contain the suffix @code{-open} or @code{-close}
+respectively.
+
+@cindex -intro syntactic symbols
+@cindex -cont syntactic symbols
+@cindex -block-intro syntactic symbols
+Usually, a distinction is made between the first line that introduces a
+construct and lines that continue a construct, and the syntactic symbols
+that represent these lines will contain the suffix @code{-intro} or
+@code{-cont} respectively.  As a sub-classification of this scheme, a
+line which is the first of a particular block construct will contain the
+suffix @code{-block-intro}.
+
+@strong{<TBD> include the name and a brief example of every syntactic
+symbol currently recognized}
+
+@node  Frequently Asked Questions
+@chapter  Frequently Asked Questions
+@cindex   Frequently Asked Questions
+
+@kindex C-x h
+@kindex ESC C-\
+@kindex ESC C-q
+@kindex ESC C-u
+@kindex RET
+@kindex LFD
+@findex newline-and-indent
+@quotation
+
+@strong{Q.} @emph{How do I re-indent the whole file?}
+
+@strong{A.} Visit the file and hit @kbd{C-x h} to mark the whole
+buffer. Then hit @kbd{@key{ESC} C-\} to re-indent the entire region
+which you've just marked. Or just enter @kbd{M-x vhdl-indent-buffer}.
+@sp 2
+
+@strong{Q.} @emph{How do I re-indent the entire function?}
+
+@strong{A.} Hit @kbd{@key{ESC} C-h} to mark the entire function. Then
+hit @kbd{@key{ESC} C-\} to re-indent the entire region which you've just
+marked.
+@sp 2
+
+@strong{Q.} @emph{How do I re-indent the current block?}
+
+@strong{A.} First move to the brace which opens the block with
+@kbd{@key{ESC} C-u}, then re-indent that expression with
+@kbd{@key{ESC} C-q}.
+@sp 2
+
+@strong{Q.} @emph{How do I re-indent the current statement?}
+
+@strong{A.} First move to the beginning of the statement with
+@kbd{@key{ESC} a}, then re-indent that expression with @kbd{@key{ESC}
+C-q}.
+@sp 2
+
+@strong{Q.} @emph{I put @code{(vhdl-set-offset 'statement-cont 0)}
+in my @file{.emacs} file but I get an error saying that
+@code{vhdl-set-offset}'s function definition is void.}
+
+@strong{A.} This means that VHDL Mode wasn't loaded into your
+Emacs session by the time the @code{vhdl-set-offset} call was reached,
+mostly likely because VHDL Mode is being autoloaded.  Instead
+of putting the @code{vhdl-set-offset} line in your top-level
+@file{.emacs} file, put it in your @code{vhdl-mode-hook}, or
+simply add the following to the top of your @file{.emacs} file:
+@example
+
+(require 'vhdl-mode)
+
+@end example
+
+See the sample @file{.emacs} file @ref{Sample .emacs File} for
+details.
+
+@end quotation
+
+
+@node  Getting the latest VHDL Mode release
+@chapter  Getting the latest VHDL Mode release
+@cindex   Getting the latest VHDL Mode release
+
+The best way to be sure you always have the latest VHDL Mode release
+is to join the @code{vhdl-mode-announce} mailing list.  If you are a
+brave soul, and wish to participate in beta testing of new releases of
+VHDL Mode, you may also join the @code{vhdl-mode-victims} mailing
+list.  Send email to the maintainer @email{reto@@gnu.org} to join
+either of these lists.
+
+The official Emacs VHDL Mode Home Page can be found at
+@uref{http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html}.
+
+@node  Sample .emacs File
+@chapter  Sample @file{.emacs} file
+@cindex   Sample @file{.emacs} file
+
+Most customizations can be done using the `Customize' entry in the
+VHDL Mode menu, which requires no editing of the .emacs file.
+If you want to customize indentation, here you go:
+
+@example
+;; Here's a sample .emacs file that might help you along the way.  Just
+;; copy this region and paste it into your .emacs file.  You may want to
+;; change some of the actual values.
+
+(defconst my-vhdl-style
+  '((vhdl-tab-always-indent        . t)
+    (vhdl-comment-only-line-offset . 4)
+    (vhdl-offsets-alist            . ((arglist-close    . vhdl-lineup-arglist)
+                                      (statement-cont   . 0)
+                                      (case-alternative . 4)
+                                      (block-open       . 0)))
+    (vhdl-echo-syntactic-information-p . t)
+    )
+  "My VHDL Programming Style")
+
+;; Customizations for vhdl-mode
+(defun my-vhdl-mode-hook ()
+  ;; add my personal style and set it for the current buffer
+  (vhdl-add-style "PERSONAL" my-vhdl-style t)
+  ;; offset customizations not in my-vhdl-style
+  (vhdl-set-offset 'statement-case-intro '++)
+  ;; other customizations
+  (setq tab-width 8
+        ;; this will make sure spaces are used instead of tabs
+        indent-tabs-mode nil)
+  ;; keybindings for VHDL are put in vhdl-mode-map
+  (define-key vhdl-mode-map "\C-m" 'newline-and-indent)
+  )
+
+(add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
+@end example
+
+@node  Limitations and Known Bugs
+@chapter  Limitations and Known Bugs
+@cindex   Limitations and Known Bugs
+
+@itemize @bullet
+@item
+Re-indenting large regions or expressions can be slow.
+
+@ignore
+@item
+The index menu does not work on my XEmacs installation (don't know why).
+@end ignore
+
+@end itemize
+
+@node  Mailing Lists and Submitting Bug Reports
+@chapter  Mailing Lists and Submitting Bug Reports
+@cindex   Mailing Lists and Submitting Bug Reports
+
+@kindex C-c C-b
+@findex vhdl-submit-bug-report
+@findex submit-bug-report (vhdl-)
+@cindex beta testers mailing list
+@cindex announcement mailing list
+To report bugs, use the @kbd{C-c C-b} (@code{vhdl-submit-bug-report})
+command.  This provides vital information I need to reproduce your
+problem.  Make sure you include a concise, but complete code example.
+Please try to boil your example down to just the essential code needed
+to reproduce the problem, and include an exact recipe of steps needed to
+expose the bug.  Be especially sure to include any code that appears
+@emph{before} your bug example.
+
+For other help or suggestions, send a message to @email{reto@@gnu.org}.
+
+Send an add message to @email{reto@@gnu.org} to get on the
+@code{vhdl-mode-victims} beta testers list where beta releases of
+VHDL Mode are posted.  Note that you shouldn't expect beta
+releases to be as stable as public releases.
+
+There is also an announce only list where the latest public releases
+of VHDL Mode are posted.  Send an add message to
+@email{reto@@gnu.org} to be added to this list.
+
+
+@node GNU Free Documentation License
+@appendix GNU Free Documentation License
+@include doclicense.texi
+
+
+@node    Concept Index
+@unnumbered Concept Index
+
+@printindex cp
+
+
+@node    Command Index
+@unnumbered Command Index
+
+Since all VHDL Mode commands are prepended with the string
+@samp{vhdl-}, each appears under its @code{vhdl-<thing>} name and its
+@code{<thing> (vhdl-)} name.
+@iftex
+@sp 2
+@end iftex
+@printindex fn
+
+
+@node    Key Index
+@unnumbered Key Index
+
+@printindex ky
+
+
+@node    Variable Index
+@unnumbered Variable Index
+
+Since all VHDL Mode variables are prepended with the string
+@samp{vhdl-}, each appears under its @code{vhdl-<thing>} name and its
+@code{<thing> (vhdl-)} name.
+@iftex
+@sp 2
+@end iftex
+@printindex vr
+
+@bye
index e11a5eb4c8b1828a6d49269764f6d458376c12a4..2b255eefccae85deaa6e5cfb3a503d89f21c0e20 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo
-@setfilename ../../info/vip
+@setfilename ../../info/vip.info
 @settitle VIP
 
 @documentencoding UTF-8
@@ -38,7 +38,7 @@ modify this GNU manual.''
 
 @dircategory Emacs misc features
 @direntry
-* VIP: (vip).                   An older VI-emulation for Emacs.
+* VIP: (vip).                   An obsolete VI-emulation for Emacs.
 @end direntry
 
 @ifnottex
@@ -53,6 +53,9 @@ are fairly accustomed to Vi but not so much with Emacs.  Also we will
 concentrate mainly on differences from Vi, especially features unique to
 VIP.
 
+VIP is obsolete since Emacs 24.5---consider using Viper instead.
+@xref{Top, Viper,, viper, The Viper VI-emulation mode for Emacs}.
+
 It is recommended that you read nodes on survey and on customization before
 you start using VIP@.  Other nodes may be visited as needed.
 
@@ -83,6 +86,9 @@ fairly accustomed to Vi but not so much with Emacs.  Also we will
 concentrate mainly on differences from Vi, especially features unique to
 VIP.
 
+VIP is obsolete since Emacs 24.5---consider using Viper instead.
+@xref{Top, Viper,, viper, The Viper VI-emulation mode for Emacs}.
+
 It is recommended that you read chapters on survey and on customization
 before you start using VIP@.  Other chapters may be used as future
 references.
index ae122f5aae4c32c02ee09be0563498af4b4c63c4..837b8c2e2d2ed0169a1987022f39ed92b49abd2c 100644 (file)
@@ -4,7 +4,7 @@
 @comment Using viper.info instead of viper in setfilename breaks DOS.
 @comment @setfilename viper
 @comment @setfilename viper.info
-@setfilename ../../info/viper
+@setfilename ../../info/viper.info
 
 @documentencoding UTF-8
 
index 8aca11551ab240fedefee48dea6fcfa4eb94b69c..0685dbdb5b1908aeb23852098cd5cb6ec868181a 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo.tex
 @c %**start of header
-@setfilename ../../info/widget
+@setfilename ../../info/widget.info
 @settitle The Emacs Widget Library
 @syncodeindex fn cp
 @syncodeindex vr cp
index dce853a13d0d834dfaad125c84fb9211602b0510..b5d7899bd55ab60a4bd2de8a600a937db0eea49e 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/wisent
+@setfilename ../../info/wisent.info
 @set TITLE  Wisent Parser Development
 @set AUTHOR Eric M. Ludlam, David Ponce, and Richard Y. Kim
 @settitle @value{TITLE}
index 5a63d3523f6c9dad85205c93edd81da3ffba9f31..1e5e0a7dfa7c9d9bf146f05bea20c38cc8dea7ce 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo   @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../../info/woman
+@setfilename ../../info/woman.info
 @settitle WoMan: Browse Unix Manual Pages ``W.O. (without) Man''
 @include emacsver.texi
 @afourpaper
index 0ef64f5f343d8c75373efb0a71f654177e84a264..2b93bb25dab3dcb6d0a1b009b6cf9f9a17280019 100644 (file)
@@ -3,44 +3,33 @@ Foundation's distribution of GNU Emacs.  To show our appreciation for
 their public spirit, we list here in alphabetical order a condensed
 list of their contributions.
 
-Aaron Ecay: changed ob-R.el ob-core.el org-src.el ox-latex.el nsterm.m
-  ob-awk.el ob-exp.el ob-python.el ob-tangle.el org-bibtex.el org-id.el
-  org.el org.texi paren.el
+Aaron Ecay: changed nsterm.m
 
 Aaron Larson: co-wrote bibtex.el
 
-Aaron S. Hawley: wrote undo-tests.el
-and changed simple.el files.texi isearch.el morse.el sgml-mode.el
-  tar-mode.el thingatpt.el add-log.el autoinsert.el building.texi calc.el
-  cc-fonts.el comint.el compare-w.el custom.texi diff.el edebug.el
-  etags.el ffap.el files.el flyspell.el and 28 other files
+Aaron S. Hawley: changed files.texi morse.el tar-mode.el add-log.el
+  autoinsert.el building.texi custom.texi files.el glossary.texi
+  isearch.el jka-cmpr-hook.el misc.texi re-builder.el sgml-mode.el
+  texinfo.el thingatpt.el tutorial.el
 
-Abdó Roig-Maranges: changed org.el org-agenda.el ox-html.el ox-odt.el
-
-Abraham Nahum: changed configure.ac dgux4.h sysdep.c
+Abraham Nahum: changed configure.in dgux4.h sysdep.c
 
 Abramo Bagnara: changed term.c
 
-Achim Gratz: changed org.el org-compat.el org.texi org-clock.el
-  ob-core.el ob.el ob-exp.el ob-perl.el org-agenda.el org-macs.el
-  org-table.el ob-R.el ob-eval.el ob-fortran.el ob-ref.el ob-tangle.el
-  org-element.el org-exp-blocks.el org-macro.el ox-odt.el ob-C.el
-  and 17 other files
+Achim Gratz: changed org-clock.el org.el org.texi ob-ref.el ob.el
+  org-macs.el
 
-Adam Gołębiowski: changed lib-src/Makefile.in
+Adam Gołębiowski: changed Makefile.in
 
 Adam Hupp: changed emacs.py emacs2.py emacs3.py gud.el
   progmodes/python.el
 
-Adam Sjøgren: changed spam.el mml2015.el shr.el xterm.c blink.xpm
-  braindamaged.xpm cry.xpm dead.xpm evil.xpm forced.xpm frown.xpm
-  grin.xpm gtkutil.c indifferent.xpm reverse-smile.xpm sad.xpm smile.xpm
-  wry.xpm gnus-html.el gnus-spec.el gnus-start.el and 5 other files
-
-Adam Sokolnicki: changed ruby-mode.el
+Adam Sjøgren: changed spam.el blink.xpm braindamaged.xpm cry.xpm dead.xpm
+  evil.xpm forced.xpm frown.xpm grin.xpm indifferent.xpm
+  reverse-smile.xpm sad.xpm smile.xpm wry.xpm xterm.c gnus-html.el
+  gnus-start.el gnus-sum.el gnus.el gtkutil.c shr.el xterm.h
 
-Adam Spiers: changed org.texi calendar.el cus-edit.el org-clock.el
-  ox-html.el
+Adam Spiers: changed calendar.el
 
 Adam W: changed mail-source.el
 
@@ -55,17 +44,14 @@ Adrian Colley: changed aix3-2.h
 Adrian Lanz: changed mail-source.el spam.el
 
 Adrian Robert: co-wrote ns-win.el
-and changed nsterm.m nsfns.m nsfont.m nsterm.h nsmenu.m configure.ac
-  src/Makefile.in macos.texi README config.in emacs.c font.c keyboard.c
-  nsgui.h nsimage.m xdisp.c image.c lib-src/Makefile.in lisp.h menu.c
-  Makefile.in and 79 other files
+and changed nsterm.m nsfns.m nsfont.m nsterm.h Makefile.in nsmenu.m
+  configure.in README config.in emacs.c font.c keyboard.c nsgui.h
+  nsimage.m xdisp.c image.c lisp.h macos.texi menu.c Info-gnustep.plist
+  darwin.h and 82 other files
 
-Agustín Martín: changed ispell.el flyspell.el fixit.texi
+Ævar Arnfjörð Bjarmason: changed rcirc.el
 
-Aidan Gauland: wrote em-tramp.el
-and changed eshell.texi em-term.el em-unix.el erc-match.el
-  automated/eshell.el em-cmpl.el em-dirs.el em-ls.el em-script.el
-  esh-proc.el
+Agustín Martín: changed ispell.el flyspell.el fixit.texi
 
 Aidan Kehoe: changed ipa.el lread.c mm-util.el erc-log.el erc.el
   gnus-sum.el gnus-util.el latin-ltx.el nnfolder.el ob-tangle.el
@@ -77,19 +63,17 @@ and changed cc-mode.el perl-mode.el
 Aki Vehtari: changed bibtex.el gnus-art.el gnus-score.el gnus-sum.el
   nnmail.el tar-mode.el
 
-Akinori Musha: changed ruby-mode.el Makefile.in sieve-mode.el
+Akinori Musha: changed ruby-mode.el
 
 Alakazam Petrofsky: changed hanoi.el
 
 Alan Mackenzie: wrote cc-awk.el
 and co-wrote cc-align.el cc-cmds.el cc-defs.el cc-engine.el cc-fonts.el
   cc-langs.el cc-mode.el cc-styles.el cc-vars.el
-and changed cc-mode.texi lread.c programs.texi font-lock.el isearch.el
-  font-core.el lisp.el modes.texi search.texi cc-menus.el cc-subword.el
-  display.texi easy-mmode.el os.texi startup.el subr.el text.texi
-  INSTALL.REPO add-log.el buffers.texi bytecomp.el and 23 other files
-
-Alan Schmitt: changed ob-ocaml.el org-faces.el
+and changed cc-mode.texi lread.c programs.texi font-lock.el font-core.el
+  isearch.el lisp.el modes.texi cc-subword.el display.texi os.texi
+  search.texi startup.el subr.el text.texi INSTALL.REPO add-log.el
+  buffers.texi bytecomp.el callint.c cc-fix.el and 22 other files
 
 Alan Shutko: changed diary-lib.el calendar.el bindings.el cal-hebrew.el
   easy-mmode.el gnus-sum.el ibuf-ext.el ibuffer.el lunar.el macros.el
@@ -97,18 +81,13 @@ Alan Shutko: changed diary-lib.el calendar.el bindings.el cal-hebrew.el
 
 Alastair Burt: changed gnus-art.el smiley.el
 
-Albert Krewinkel: co-wrote sieve-manage.el
-and changed sieve.el sieve.texi
-
 Albert L. Ting: changed gnus-group.el mail-hist.el
 
 Aleksei Gusev: changed progmodes/compile.el
 
 Alex Coventry: changed files.el
 
-Alex Ott: changed TUTORIAL.ru ede/files.el ru-refcard.tex base.el
-  cedet-files.el cpp-root.el ede.el ede/generic.el idle.el ispell.el
-  semantic/format.el
+Alex Ott: changed TUTORIAL.ru ru-refcard.tex ispell.el ru-refcard.ps
 
 Alex Rezinsky: wrote which-func.el
 
@@ -117,17 +96,15 @@ Alex Schroeder: wrote ansi-color.el cus-theme.el erc-compat.el
   spam-stat.el sql.el
 and co-wrote longlines.el mail/rmailmm.el
 and changed erc.el erc-track.el erc-button.el erc-stamp.el erc-match.el
-  erc-autoaway.el erc-nickserv.el rcirc.texi Makefile erc-autojoin.el
-  erc-fill.el erc-pcomplete.el erc-complete.el erc-ibuffer.el
-  erc-members.el rmail.el comint.el custom.el erc-bbdb.el erc-chess.el
-  erc-ezbounce.el and 35 other files
+  erc-autoaway.el erc-nickserv.el rcirc.texi erc-autojoin.el erc-fill.el
+  erc-pcomplete.el erc-complete.el erc-ibuffer.el erc-members.el rmail.el
+  comint.el custom.el erc-bbdb.el erc-chess.el erc-ezbounce.el
+  erc-imenu.el and 32 other files
 
 Alex Shinn: changed files.el
 
 Alexander Becher: changed vc-annotate.el
 
-Alexander Haeckel: changed getset.el
-
 Alexander Klimov: changed files.el calc-graph.el files.texi man.el rx.el
   sendmail.el
 
@@ -140,8 +117,6 @@ and changed rmailsum.el man.el rmail.el sendmail.el
 
 Alexander Shopov: changed code-pages.el
 
-Alexander Vorobiev: changed org-compat.el
-
 Alexander Zhuckov: changed ebrowse.c
 
 Alexandre Julliard: wrote vc-git.el
@@ -162,7 +137,7 @@ Alfred M. Szmidt: changed html2text.el openbsd.h progmodes/compile.el
 
 Alfredo Finelli: changed TUTORIAL.it
 
-Ali Bahrami: changed configure configure.ac sol2-10.h
+Ali Bahrami: changed configure configure.in sol2-10.h
 
 Alin C. Soare: changed lisp-mode.el hexl.el
 
@@ -170,8 +145,8 @@ Allen S. Rout: changed org-capture.el
 
 Alon Albert: wrote rcompile.el
 
-Alp Aker: changed nsfont.m nsterm.m buff-menu.el nsfns.m nsmenu.m
-  nsterm.h configure.ac macfont.m mule-cmds.el nsselect.m window.el
+Alp Aker: changed nsfont.m nsterm.h nsterm.m buff-menu.el configure.in
+  nsfns.m nsmenu.m
 
 Ami Fischman: changed bindings.el calendar.el diary-lib.el print.c
   savehist.el vc-git.el
@@ -180,11 +155,8 @@ Anand Mitra: changed gnus-sum.el
 
 Anders Holst: wrote hippie-exp.el
 
-Anders Lindgern: changed nsterm.m
-
 Anders Lindgren: wrote autorevert.el cwarn.el follow.el
-and changed font-lock.el nsterm.m etags.c compile.el ert.el nsfont.m
-  nsterm.h
+and changed font-lock.el etags.c compile.el nsfont.m nsterm.m
 
 Andre Spiegel: changed vc.el vc-hooks.el vc-cvs.el vc-rcs.el vc-sccs.el
   files.el dired.el files.texi cperl-mode.el ediff-util.el log-view.el
@@ -196,8 +168,6 @@ Andre Srinivasan: changed gnus-group.el gnus-sum.el gnus.texi message.el
 
 Andrea Russo: changed erc-dcc.el info-look.el
 
-Andreas Amann: changed emacsclient.c
-
 Andreas Burtzlaff: changed org.el
 
 Andreas Büsching: changed emacsclient.c
@@ -214,21 +184,20 @@ and changed erc.el erc-bbdb.el erc-button.el erc-log.el erc-stamp.el
 Andreas Jaeger: changed gnus-msg.el gnus-start.el gnus-xmas.el
   nnfolder.el nnml.el
 
-Andreas Leha: changed ob-latex.el ob.el
+Andreas Leha: changed ob.el
 
 Andreas Leue: changed artist.el
 
 Andreas Luik: changed xfns.c xterm.c
 
-Andreas Politz: changed editfns.c elp.el frame.c ibuffer.el ido.el
-  imenu.el modes.texi outline.el sql.el subr.el term.el
+Andreas Politz: changed editfns.c elp.el ido.el outline.el term.el
 
 Andreas Rottmann: changed emacsclient.1 emacsclient.c misc.texi server.el
 
-Andreas Schwab: changed configure.ac lisp.h xdisp.c process.c alloc.c
-  coding.c Makefile.in keyboard.c files.el fileio.c xterm.c editfns.c
-  emacs.c print.c src/Makefile.in fns.c lread.c eval.c xfns.c font.c
-  sysdep.c and 632 other files
+Andreas Schwab: changed Makefile.in configure.in lisp.h xdisp.c alloc.c
+  process.c coding.c files.el keyboard.c xterm.c editfns.c emacs.c fns.c
+  print.c eval.c fileio.c lread.c sysdep.c dired.el xfns.c buffer.c
+  and 577 other files
 
 Andreas Seltenreich: changed nnweb.el gnus.texi message.el gnus-sum.el
   gnus.el nnslashdot.el gnus-srvr.el gnus-util.el mm-url.el mm-uu.el
@@ -238,54 +207,41 @@ Andreas Seltenreich: changed nnweb.el gnus.texi message.el gnus-sum.el
 
 Andreas Vögele: changed pgg-def.el
 
-Andrei Chițu: changed icalendar.el
-
-Andrew Beals: changed spook.lines
-
 Andrew Choi: changed macterm.c darwin.h mac-win.el sysdep.c emacs.c mac.c
   macfns.c fontset.c frame.c keyboard.c xfaces.c dispextern.h macmenu.c
-  unexmacosx.c configure.ac frame.h macterm.h titdic-cnv.el xdisp.c
-  alloc.c callproc.c and 27 other files
+  unexmacosx.c Makefile.in configure.in frame.h macterm.h titdic-cnv.el
+  xdisp.c alloc.c and 26 other files
 
 Andrew Cohen: wrote spam-wash.el
-and changed nnir.el gnus-sum.el nnimap.el gnus-msg.el gnus.texi
-  gnus-group.el gnus-int.el dns.el gnus-art.el gnus-registry.el
-  gnus-srvr.el gnus.el nnheader.el nnspool.el
+and changed nnir.el gnus-sum.el nnimap.el gnus.texi gnus-group.el
+  gnus-int.el dns.el gnus-art.el gnus-registry.el gnus-srvr.el gnus.el
+  nnheader.el nnspool.el
 
 Andrew Csillag: wrote m4-mode.el
 
 Andrew Hall: changed paren.el
 
-Andrew Hyatt: changed org-archive.el org.el org.texi
-
-Andrew Innes: changed makefile.nt w32fns.c w32term.c w32.c w32proc.c
-  makefile.w32-in fileio.c gmake.defs leim/makefile.w32-in
-  lib-src/makefile.w32-in w32-fns.el dos-w32.el inc/ms-w32.h nmake.defs
-  nt/makefile.w32-in src/makefile.w32-in w32term.h makefile.def unexw32.c
-  w32menu.c w32xfns.c and 139 other files
+Andrew Innes: changed makefile.w32-in makefile.nt w32fns.c w32term.c
+  w32.c w32proc.c fileio.c gmake.defs w32-fns.el dos-w32.el ms-w32.h
+  nmake.defs w32term.h makefile.def unexw32.c w32menu.c w32xfns.c addpm.c
+  cmdproxy.c emacs.c w32-win.el and 137 other files
 
-Andrew Oram: changed calendar.texi (and other doc files)
+Andrew Oram: changed calendar.texi (and other files in man/)
 
 Andrew Schein: changed sql.el
 
-Andrew W. Nosenko: changed tramp.el
-
 Andrew Zhilin: changed emacs22.png emacs22.ico
 
 Andrey Slusar: changed gnus-async.el gnus.el
 
 Andrey Zhdanov: changed gud.el
 
-Andrzej Lichnerowicz: wrote ob-io.el ob-scala.el
-
-Andy Moreton: changed emacs/makefile.w32-in
+Andy Moreton: changed makefile.w32-in
 
 Andy Norman: wrote ange-ftp.el
 
 Andy Petrusenco: changed w32term.c
 
-Andy Sawyer: changed saveplace.el
-
 Andy Seaborne: changed keyboard.c
 
 Andy Stewart: wrote org-w3m.el
@@ -299,12 +255,11 @@ Anna M. Bigatti: wrote cal-html.el
 
 Antoine Levitt: changed gnus-group.el gnus-sum.el message.texi ada-prj.el
   ange-ftp.el cus-edit.el dired-x.el ebnf2ps.el emerge.el erc-button.el
-  erc-goodies.el erc-stamp.el erc-track.el files.el find-file.el
-  gnus-art.el gnus-uu.el gnus.el gnus.texi message.el mh-funcs.el
-  and 8 other files
+  erc-goodies.el erc-track.el files.el find-file.el gnus-art.el
+  gnus-uu.el gnus.el gnus.texi message.el mh-funcs.el mh-mime.el
+  and 7 other files
 
-Ari Roponen: changed atimer.c doc.c hash.texi mule.texi package.el
-  startup.el time-date.el
+Ari Roponen: changed atimer.c doc.c mule.texi startup.el time-date.el
 
 Arisawa Akihiro: changed characters.el coding.c epa-file.el japan-util.el
   language/tibetan.el message.el mm-decode.el mm-view.el ps-print.el
@@ -315,31 +270,23 @@ Arnaud Giersch: changed gnus-sum.el
 Arne Georg Gleditsch: changed gnus-sum.el
 
 Arne Jørgensen: wrote latexenc.el
-and changed smime.el mml-smime.el smime-ldap.el flymake.el gnus-art.el
-  gnus-sieve.el ldap.el message.el mm-decode.el mml-sec.el mml.el
-  mule-conf.el nnimap.el nnrss.el wid-edit.el
+and changed smime.el mml-smime.el smime-ldap.el gnus-art.el gnus-sieve.el
+  ldap.el message.el mm-decode.el mml-sec.el mml.el mule-conf.el
+  nnimap.el nnrss.el wid-edit.el
 
-Arni Magnusson: wrote bat-mode.el
-and changed ada-mode.texi frames.texi generic-x.el texinfo.el
+Arni Magnusson: changed ada-mode.texi frames.texi texinfo.el
 
 Artem Chuprina: changed message.el
 
-Arun Persaud: changed org-agenda.el org-src.el
-
 Ashwin Ram: wrote refer.el
 
-Atsuo Ohki: changed lread.c
-
 Aubrey Jaffer: changed info.el unexelf.c
 
-Aurélien Aptel: changed cus-face.el dispextern.h display.texi faces.el
-  nsterm.m ox-html.el url.texi w32term.c xfaces.c xterm.c
-
 Axel Boldt: changed ehelp.el electric.el
 
 B. Anyos: changed w32term.c
 
-Baoqiu Cui: changed org-docbook.el
+Baoqiu Cui: wrote org-docbook.el
 
 Barry A. Warsaw: wrote assoc.el elp.el man.el regi.el reporter.el
   supercite.el
@@ -347,29 +294,23 @@ and co-wrote cc-align.el cc-cmds.el cc-compat.el cc-defs.el cc-engine.el
   cc-guess.el cc-langs.el cc-menus.el cc-mode.el cc-styles.el cc-vars.el
 and changed c++-mode.el cplus-md1.el syntax.c syntax.h
 
-Barry Fishman: changed configure.ac gnu-linux.h image.c
-
-Barry O'reilly: changed simple.el lisp.h keyboard.c markers.texi
-  undo-tests.el alloc.c bytecode.c casetab.c data.c eval.c fileio.c fw.el
-  idle.el insdel.c lread.c pulse.el search.c subr.el text.texi
-  timer-tests.el undo.c
+Barry Fishman: changed gnu-linux.h
 
-Bastien Guerry: wrote gnus-bookmark.el
+Bastien Guerry: wrote gnus-bookmark.el org-latex.el
 and co-wrote org-bibtex.el org-list.el org-protocol.el org-src.el
-and changed org.el org-agenda.el org.texi ox-html.el org-clock.el
-  org-table.el ox-latex.el org-capture.el ox.el ox-odt.el org-compat.el
-  ox-publish.el ob.el org-colview.el org-mobile.el org-macs.el
-  org-pcomplete.el org-faces.el org-timer.el ox-ascii.el org-archive.el
-  and 115 other files
+and changed org.el org-agenda.el org-html.el org-clock.el org-exp.el
+  org.texi org-table.el org-capture.el org-publish.el org-timer.el
+  org-export-latex.el org-archive.el org-ascii.el org-colview.el
+  org-exp-blocks.el org-mobile.el ob.el org-eshell.el bookmark.el info.el
+  org-attach.el and 36 other files
 
 Ben A. Mesander: co-wrote erc-dcc.el
 
-Ben Harris: changed configure.ac
+Ben Harris: changed configure.in
 
-Ben Key: changed w32.c w32fns.c w32menu.c configure.bat INSTALL
-  gmake.defs nmake.defs src/makefile.w32-in w32.h w32term.c configure.ac
-  emacs.c inc/ms-w32.h keyboard.c lib-src/makefile.w32-in make-docfile.c
-  nsfont.m nsterm.m sound.c xfaces.c
+Ben Key: changed w32.c w32fns.c w32menu.c configure.bat makefile.w32-in
+  INSTALL gmake.defs nmake.defs w32.h w32term.c configure.in emacs.c
+  keyboard.c make-docfile.c ms-w32.h nsfont.m nsterm.m sound.c xfaces.c
 
 Ben Menasha: changed nnmh.el
 
@@ -381,10 +322,10 @@ Bengt Martensson: co-wrote bibtex.el
 Benjamin Andresen: wrote ob-screen.el
 
 Benjamin Drieu: wrote pong.el
-and changed org-clock.el org.el
+and changed org-clock.el
 
-Benjamin Riefenstahl: changed w32select.c emacs.c inc/ms-w32.h lisp.h
-  mac-win.el macterm.c mule-cmds.el runemacs.c tcl.el w32.c w32.h
+Benjamin Riefenstahl: changed w32select.c emacs.c lisp.h mac-win.el
+  macterm.c ms-w32.h mule-cmds.el runemacs.c tcl.el w32.c w32.h
 
 Benjamin Rutt: co-wrote gnus-dired.el
 and changed vc.el gnus-msg.el message.el diff-mode.el ffap.el nnimap.el
@@ -393,7 +334,7 @@ and changed vc.el gnus-msg.el message.el diff-mode.el ffap.el nnimap.el
 Bernhard Herzog: changed vc-hg.el menu.c xsmfns.c
 
 Bernt Hansen: changed org-agenda.el org-clock.el org.el org-capture.el
-  org-indent.el org.texi ox-html.el
+  org-html.el org-indent.el org.texi
 
 Bill Atkins: changed wdired.el
 
@@ -402,13 +343,12 @@ Bill Burton: changed ptx.h sequent-ptx.h
 Bill Carpenter: wrote feedmail.el (public domain)
 
 Bill Mann: wrote perl-mode.el
-and changed configure.ac unexaix.c ibmrs6000.h usg5-4-3.h
+and changed configure.in unexaix.c ibmrs6000.h usg5-4-3.h
 
 Bill Pringlemeir: changed messcompat.el
 
 Bill Richter: changed fill.el quail.el ccl.el encoded-kb.el fontset.el
-  international/mule-util.el kinsoku.el kkc.el mule-cmds.el mule-conf.el
-  mule.el
+  kinsoku.el kkc.el mule-cmds.el mule-conf.el mule-util.el mule.el
 
 Bill Rozas: wrote scheme.el
 and changed xscheme.el
@@ -419,11 +359,11 @@ Bill Wohler: wrote mh-buffers.el mh-comp.el mh-compat.el mh-e.el
   mh-folder.el mh-funcs.el mh-letter.el mh-mime.el mh-scan.el mh-seq.el
   mh-show.el mh-utils.el mh-xface.el
 and co-wrote mh-junk.el
-and changed mh-customize.el mh-search.el mh-alias.el Makefile mh-e.texi
-  mh-identity.el README mh-speed.el mh-init.el mh-acros.el mh-gnus.el
-  mh-unit.el mh-inc.el mh-xemacs-compat.el mh-print.el lisp/Makefile.in
-  image.el mh-tool-bar.el mh-xemacs.el display.texi makefile.w32-in
-  and 87 other files
+and changed mh-customize.el mh-search.el mh-alias.el mh-identity.el
+  mh-e.texi mh-speed.el mh-init.el mh-acros.el mh-gnus.el mh-unit.el
+  mh-inc.el mh-xemacs-compat.el mh-print.el Makefile.in image.el
+  mh-tool-bar.el mh-xemacs.el README display.texi makefile.w32-in
+  mh-pick.el and 86 other files
 
 Bjorn Solberg: changed nnimap.el
 
@@ -456,17 +396,13 @@ Bojan Petrovic: changed pop3.el
 Boris Goldowsky: wrote avoid.el descr-text.el enriched.el facemenu.el
   format.el shadowfile.el
 and changed fill.el simple.el indent.el paragraphs.el cmds.c intervals.c
-  intervals.h add-log.el cc-mode.el enriched.txt fileio.c make-mode.el
+  intervals.h add-log.el cc-mode.el enriched.doc fileio.c make-mode.el
   text-mode.el textprop.c ada.el allout.el awk-mode.el bibtex.el buffer.c
   buffer.h c-mode.el and 38 other files
 
 Boris Samorodov: changed imap.el
 
-Boyd Lynn Gerber: changed configure.ac
-
-Bozhidar Batsov: changed ruby-mode.el subr-x.el subr.el bytecomp.el
-  lisp-mode.el package.el progmodes/python.el prolog.el
-  ruby-mode-tests.el scheme.el
+Boyd Lynn Gerber: changed configure.in
 
 Brad Howes: changed gnus-demon.el
 
@@ -476,22 +412,19 @@ Brendan Kehoe: changed hpux9.h
 
 Brent Goodrick: changed abbrev.el
 
-Brian Cully: changed macos.texi
+Brian Cully: changed ns-emacs.texi
 
 Brian D. Carlstrom: changed gud.el smtpmail.el
 
-Brian Fox: changed Makefile.in Makefile configure.ac minibuf.c dired.el
-  files.el lib-src/Makefile.in oldXMenu/Makefile.in rmail.el search.c
-  simple.el sysdep.c compile.el forms.texi frame.c keyboard.c make-dist
-  subr.el systty.h texindex.c xterm.c and 47 other files
-
-Brian Jenkins: changed frame.c frames.texi hooks.texi
+Brian Fox: changed Makefile.in Makefile configure.in minibuf.c dired.el
+  files.el rmail.el search.c simple.el sysdep.c compile.el forms.texi
+  frame.c info.texi keyboard.c make-dist subr.el systty.h texindex.c
+  xterm.c ymakefile and 46 other files
 
 Brian Marick: co-wrote hideif.el
 
 Brian P Templeton: changed erc.el erc-compat.el erc-fill.el
-  erc-nickserv.el erc-pcomplete.el erc-stamp.el erc-track.el lread.c
-  nsfont.m
+  erc-nickserv.el erc-pcomplete.el erc-stamp.el erc-track.el
 
 Brian Palmer: changed erc.el erc-list.el
 
@@ -502,23 +435,15 @@ Brian Preble: changed abbrev.el apropos.el asm-mode.el awk-mode.el
 
 Brian Sniffen: changed gnus-draft.el imap.el mm-decode.el
 
-Brian van den Broek: changed org.texi
-
-Bruno Félix Rezende Ribeiro: changed functions.texi
-
 Bruno Haible: co-wrote po.el
 and changed INSTALL emacs.1 epaths.in info.el paths.el
 
-Bryan Henderson: changed Makefile term.el
+Bryan Henderson: changed term.el
 
 Bryan O'Sullivan: changed ange-ftp.el
 
-Caio Tiago Oliveira: changed ob-scala.el
-
 Caleb Deupree: changed w32-fns.el
 
-Cameron Desautels: changed regexp-opt.el ruby-mode.el
-
 Carl D. Roth: changed gnus-nocem.el
 
 Carl Edman: co-wrote ns-win.el
@@ -528,25 +453,27 @@ Carl Henrik Lunde: changed format-spec.el
 Carsten Bormann: changed ibmrs6000.h latin-post.el
 
 Carsten Dominik: wrote idlw-complete-structtag.el idlw-toolbar.el
-  org-agenda.el org-archive.el org-capture.el org-clock.el org-colview.el
-  org-compat.el org-datetree.el org-faces.el org-feed.el org-footnote.el
-  org-id.el org-indent.el org-info.el org-inlinetask.el org-macs.el
-  org-mobile.el org-rmail.el org-table.el org-timer.el org.el
+  org-agenda.el org-archive.el org-ascii.el org-beamer.el org-capture.el
+  org-clock.el org-colview.el org-compat.el org-datetree.el org-exp.el
+  org-faces.el org-feed.el org-footnote.el org-html.el org-icalendar.el
+  org-id.el org-indent.el org-info.el org-inlinetask.el org-install.el
+  org-jsinfo.el org-macs.el org-mks.el org-mobile.el org-remember.el
+  org-rmail.el org-table.el org-timer.el org-vm.el org-xoxo.el org.el
   reftex-auc.el reftex-cite.el reftex-dcr.el reftex-global.el
   reftex-index.el reftex-parse.el reftex-ref.el reftex-sel.el
   reftex-toc.el reftex-vars.el reftex.el
 and co-wrote idlw-help.el idlw-shell.el idlwave.el org-bbdb.el
   org-bibtex.el org-entities.el org-gnus.el org-list.el org-pcomplete.el
-  org-src.el ox-beamer.el ox-html.el ox-icalendar.el
-and changed ox.el ox-latex.el org.texi org-remember.el orgcard.tex
-  ox-publish.el org-docbook.el ox-ascii.el org-attach.el org-protocol.el
-  org-mouse.el org-mac-message.el org-wl.el ox-jsinfo.el org-crypt.el
+  org-src.el
+and changed org-latex.el org.texi org-publish.el orgcard.tex
+  org-export-latex.el org-colview-xemacs.el org-docbook.el org-attach.el
+  org-mouse.el org-protocol.el org-mac-message.el org-wl.el org-crypt.el
   org-freemind.el idlw-rinfo.el org-exp-blocks.el org-habit.el org-mhe.el
-  org-plot.el and 35 other files
+  org-plot.el org-special-blocks.el reftex.texi and 24 other files
 
-Caveh Jalali: changed configure.ac intel386.h sol2-4.h
+Caveh Jalali: changed configure.in intel386.h sol2-4.h
 
-Chad Brown: changed aix4-2.h bsd-common.h config.in configure.ac cygwin.h
+Chad Brown: changed aix4-2.h bsd-common.h config.in configure.in cygwin.h
   dired.c gnu-linux.h mh-comp.el msdos.h sed2v2.inp sysdep.c usg5-4.h
 
 Changwoo Ryu: changed files.el
@@ -569,25 +496,25 @@ Chip Coldwell: changed font.c
 
 Chong Yidong: wrote compile-tests.el dichromacy-theme.el
   font-parse-tests.el redisplay-testsuite.el tabulated-list.el
-  xml-parse-tests.el
 and co-wrote longlines.el tango-dark-theme.el tango-theme.el
-and changed simple.el display.texi xdisp.c files.el frames.texi
-  cus-edit.el files.texi custom.el subr.el text.texi faces.el keyboard.c
-  startup.el package.el misc.texi emacs.texi modes.texi mouse.el
-  custom.texi image.c window.el and 949 other files
+and changed xdisp.c simple.el display.texi files.el frames.texi
+  files.texi cus-edit.el keyboard.c custom.el text.texi package.el
+  startup.el faces.el xterm.c emacs.texi misc.texi subr.el image.c
+  mouse.el custom.texi xfns.c and 845 other files
 
 Chris Chase: co-wrote idlw-shell.el idlwave.el
 
 Chris Foote: changed progmodes/python.el
 
-Chris Gray: changed mm-decode.el ox-html.el
+Chris Gray: wrote org-special-blocks.el
+and changed mm-decode.el
 
 Chris Hall: changed callproc.c frame.c
 
 Chris Hanson: changed xscheme.el scheme.el xterm.c hpux.h x11term.c
-  hp9000s300.h keyboard.c process.c texinfmt.el sort.el syntax.c
-  texnfo-upd.el x11fns.c xfns.c dired.el emacsclient.c fileio.c
-  hp9000s800.h indent.c info.el man.el and 17 other files
+  hp9000s300.h keyboard.c process.c texinfmt.el emacsclient.c sort.el
+  syntax.c texnfo-upd.el x11fns.c xfns.c dired.el fileio.c hp9000s800.h
+  indent.c info.el man.el and 17 other files
 
 Chris Hecker: changed calc-aent.el
 
@@ -605,59 +532,49 @@ Chris Prince: changed w32term.c
 Chris Smith: wrote icon.el
 and changed icon-mode.el
 
-Christian Egli: changed org-taskjuggler.el org.texi
+Christian Egli: wrote org-taskjuggler.el
+and changed org.texi
 
-Christian Faulhammer: changed configure configure.ac src/Makefile.in
+Christian Faulhammer: changed Makefile.in configure configure.in
   vc-bzr.el
 
 Christian Limpach: co-wrote ns-win.el
-and changed configure.ac
+and changed configure.in
 
 Christian Lynbech: changed appt.el emacsserver.c tramp.el
 
 Christian Millour: changed shell.el
 
-Christian Moe: changed org-bbdb.el org-special-blocks.el ox-html.el
-  ox-odt.el
+Christian Moe: changed org-bbdb.el org-html.el org-special-blocks.el
 
 Christian Neukirchen: changed mm-util.el
 
-Christian Ohler: wrote ert-tests.el ert.el
-and co-wrote ert-x.el
-and changed Makefile.in automated automated/Makefile.in configure.ac
-  ert-x-tests.el ert.texi misc/Makefile.in misc/makefile.w32-in
+Christian Ohler: wrote ert-tests.el ert-x.el ert.el
+and changed Makefile.in automated configure.in ert-x-tests.el ert.texi
+  makefile.w32-in
 
 Christian Plate: changed nnmaildir.el sgml-mode.el
 
 Christian Plaunt: wrote soundex.el
 
-Christian Wittern: changed image-mode.el
-
 Christian von Roques: changed mml2015.el epg.el gnus-start.el
 
-Christoph Bauer: changed configure.ac
-
-Christoph Conrad: changed gnus-agent.el gnus-score.el
-  lib-src/makefile.w32-in qp.el
+Christoph Bauer: changed configure.in
 
-Christoph Dittmann: changed ox-beamer.el
+Christoph Conrad: changed gnus-agent.el gnus-score.el makefile.w32-in
+  qp.el
 
-Christoph Egger: changed configure.ac
-
-Christoph Scholtes: changed README.W32 lib/makefile.w32-in
-  nt/makefile.w32-in progmodes/python.el stdint.h INSTALL
-  maintaining.texi src/makefile.w32-in zipdist.bat admin.el bookmark.el
-  config.nt configure.bat control.texi cua-base.el gmake.defs
-  help-mode.el help.el ido.el lib-src/makefile.w32-in make-dist
-  and 9 other files
+Christoph Scholtes: changed makefile.w32-in README.W32
+  progmodes/python.el stdint.h INSTALL maintaining.texi zipdist.bat
+  admin.el bookmark.el config.nt configure.bat control.texi cua-base.el
+  gmake.defs help-mode.el help.el ido.el make-dist makedist.bat menu.c
+  minibuf.c and 6 other files
 
 Christoph Wedler: wrote antlr-mode.el
 and changed format.el gnus-art.el gnus-picon.el message.el register.el
   smiley.el texinfmt.el
 
-Christophe Junke: changed org-agenda.el org.el
-
-Christophe Rhodes: changed ox-latex.el ox.el
+Christophe Rhodes: changed org-exp.el
 
 Christophe de Dinechin: co-wrote ns-win.el
 
@@ -672,19 +589,17 @@ Christopher J. White: changed url-http.el
 
 Christopher Oliver: changed mouse.el
 
-Christopher Schmidt: changed ibuffer.el tips.texi cl-macs.el comint.el
-  dired-x.el dired.el files.el files.texi find-dired.el gnus-int.el
-  gnus-msg.el gnus.texi help-fns.el info.el locate.el lread.c
-  minibuf-eldef.el mm-decode.el mml.el org.el org.texi and 11 other files
+Christopher Schmidt: changed ibuffer.el
+
+Christopher Suckling: co-wrote org-mac-message.el
 
 Chuck Blake: changed term.c
 
 Chunyu Wang: changed gnus-art.el pcl-cvs.texi
 
-Claudio Bley: changed image.c image.el process.c src/makefile.w32-in
-  stat.h w32-win.el w32.c
+Claudio Bley: changed makefile.w32-in process.c
 
-Claudio Fontana: changed Makefile.in leim/Makefile.in lib-src/Makefile.in
+Claudio Fontana: changed Makefile.in
 
 Colin Marquardt: changed gnus.el message.el
 
@@ -692,34 +607,29 @@ Colin Rafferty: changed message.el
 
 Colin Walters: wrote ibuf-ext.el ibuf-macs.el ibuffer.el
 and changed calc.el replace.el update-game-score.c calc-ext.el
-  calc-misc.el calc-macs.el calc-mode.el calc-graph.el gamegrid.el
-  calc-aent.el calc-bin.el calc-embed.el calc-keypd.el calc-math.el
-  calc-prog.el calc-units.el calcalg2.el font-core.el info.el calc-alg.el
-  calc-arith.el and 81 other files
+  calc-misc.el Makefile.in calc-macs.el calc-mode.el calc-graph.el
+  gamegrid.el calc-aent.el calc-bin.el calc-embed.el calc-keypd.el
+  calc-math.el calc-prog.el calc-units.el calcalg2.el font-core.el
+  info.el calc-alg.el and 78 other files
 
 Colin Williams: changed calc.texi
 
-Constantin Kulikov: changed server.el startup.el
-
 Courtney Bane: changed term.c
 
 Craig Markwardt: changed icalendar.el
 
 Craig McDaniel: changed sheap.c
 
-Craig Tanis: changed ox-latex.el
-
 D. E. Evans: changed basic.texi
 
 Daiki Ueno: wrote epa-dired.el epa-file.el epa-hook.el epa-mail.el epa.el
   epg-config.el epg.el pgg-def.el pgg-gpg.el pgg-parse.el pgg-pgp.el
   pgg-pgp5.el pgg.el plstore.el sasl.el starttls.el
 and co-wrote sasl-cram.el sasl-digest.el
-and changed mml2015.el mml1991.el epa.texi auth-source.el mml-smime.el
-  gnus.texi mm-decode.el mm-uu.el auth.texi gnus-sum.el mm-view.el
-  mml-sec.el mml.el package.el archive-contents archive-contents.sig
-  dired.el dired.texi epa-file-hook.el epa-setup.el epg-package-info.el
-  and 30 other files
+and changed mml2015.el mml1991.el epa.texi auth-source.el gnus.texi
+  mm-uu.el mml-smime.el Makefile.in auth.texi gnus-sum.el mm-decode.el
+  mm-view.el mml-sec.el mml.el dired.el dired.texi epa-file-hook.el
+  epa-setup.el epg-package-info.el faces.el files.el and 17 other files
 
 Dale Gulledge: changed TUTORIAL.eo
 
@@ -728,13 +638,9 @@ Dale Hagglund: changed unexelf.c
 Dale R. Worley: wrote emerge.el (public domain)
 and changed mail-extr.el
 
-Dale Sedivec: changed sgml-mode.el wisent/python.el
-
-Damien Cassou: changed info.el
-
 Damien Elmes: changed erc.el erc-dcc.el erc-track.el erc-log.el
-  erc-pcomplete.el README erc-button.el erc-nets.el erc-ring.el Makefile
-  erc-fill.el erc-match.el erc-members.el erc-nickserv.el
+  erc-pcomplete.el erc-button.el erc-nets.el erc-ring.el erc-fill.el
+  erc-match.el erc-members.el erc-nickserv.el
 
 Damon Anton Permezel: wrote hanoi.el (public domain)
 
@@ -745,59 +651,48 @@ Dan Christensen: changed gnus-sum.el nndoc.el nnfolder.el gnus-art.el
   spam.el time-date.el
 
 Dan Davison: wrote ob-matlab.el ob-octave.el
-and co-wrote ob-R.el ob-core.el ob-exp.el ob-lob.el ob-perl.el
-  ob-python.el ob-ref.el org-src.el
-and changed ob.el ob-sh.el org.el ox.el ox-latex.el ob-tangle.el ob-C.el
+and co-wrote ob-R.el ob-exp.el ob-lob.el ob-perl.el ob-python.el
+  ob-ref.el ob.el org-src.el
+and changed ob-sh.el org-exp.el org.el org-latex.el ob-tangle.el ob-C.el
   ob-asymptote.el ob-clojure.el ob-haskell.el ob-ruby.el ob-scheme.el
   ob-table.el ob-ditaa.el ob-dot.el ob-gnuplot.el ob-js.el ob-mscgen.el
-  ob-ocaml.el ob-org.el ob-plantuml.el and 14 other files
+  ob-ocaml.el ob-org.el ob-plantuml.el ob-sass.el and 13 other files
 
 Dan Nicolaescu: wrote iris-ansi.el romanian.el vc-dir.el
 and co-wrote hideshow.el
-and changed vc.el configure.ac vc-hg.el vc-git.el src/Makefile.in
-  vc-bzr.el sysdep.c emacs.c process.c vc-cvs.el lisp.h term.c
-  vc-hooks.el xterm.c keyboard.c vc-svn.el xterm.el callproc.c darwin.h
-  term.el gnu-linux.h and 925 other files
+and changed vc.el Makefile.in configure.in vc-hg.el vc-git.el vc-bzr.el
+  sysdep.c emacs.c process.c vc-cvs.el lisp.h term.c vc-hooks.el xterm.c
+  keyboard.c vc-svn.el xterm.el callproc.c darwin.h term.el gnu-linux.h
+  and 918 other files
 
 Dan Rosenberg: changed movemail.c
 
-Dani Moncayo: changed Makefile.in buffers.texi configure.ac lists.texi
-  mini.texi msys-to-w32 nt/makefile.w32-in INSTALL basic.texi custom.texi
-  dired.texi display.texi emacs-lisp-intro.texi killing.texi make-dist
-  mark.texi msysconfig.sh simple.el text.texi version.el zipdist.bat
-
-Daniel Bergey: changed indian.el
+Dani Moncayo: changed buffers.texi lists.texi custom.texi dired.texi
+  makefile.w32-in text.texi
 
 Daniel Brockman: changed cus-start.el format-spec.el ibuffer.el rcirc.el
 
-Daniel Clemente: changed generic-x.el ox-html.el
+Daniel Clemente: changed generic-x.el org-html.el
 
 Daniel Colascione: co-wrote js.el
-and changed w32fns.c emacs.c image.c keyboard.c configure.ac cygw32.c
-  process.c src/Makefile.in w32term.h cygw32.h dbusbind.c sh-script.el
-  unexw32.c w32term.c alloc.c cl-macs.el coding.c conf_post.h menu.c
-  w32-win.el w32.c and 100 other files
+and changed cmdproxy.c subr.el syntax.el DEBUG cc-engine.el cus-start.el
+  eval.c fns.c frames.texi imenu.el keyboard.c lisp.h nxml-mode.el
+  nxml-rap.el nxml-util.el sh-script.el which-func.el
 
-Daniel Dehennin: changed mml2015.el gnus-msg.el mm-decode.el ox.el
+Daniel Dehennin: changed mml2015.el gnus-msg.el mm-decode.el
 
 Daniel E. Doherty: changed calc.texi
 
-Daniel Elliott: changed octave.el
+Daniel Elliott: changed octave-mod.el
 
 Daniel Engeler: changed sysdep.c elisp.texi emacs.texi internals.texi
   misc.texi process.c process.h processes.texi term.el w32.c w32.h
 
-Daniel Hackney: wrote package-test.el package-x-test.el
-and co-wrote package.el
-and changed package-x.el ange-ftp.el automated/Makefile.in browse-url.el
-  dbus.el dired-x.el ediff-diff.el ediff-init.el ediff-merg.el
-  ediff-mult.el ediff-util.el ediff-wind.el ediff.el emacsclient.c
-  emerge.el eudc.el eudcb-ldap.el eww.el finder.el imap.el package
-  and 6 other files
+Daniel Hackney: changed emacsclient.c package.el process.c
 
 Daniel Jensen: changed apropos.el
 
-Daniel Laliberte: wrote cust-print.el edebug.el isearch.el
+Daniel Laliberte: wrote cl-specs.el cust-print.el edebug.el isearch.el
 and co-wrote hideif.el
 and changed mlconvert.el eval-region.el
 
@@ -829,42 +724,35 @@ Danny Roozendaal: wrote handwrite.el
 
 Danny Siu: changed gnus-sum.el gnus-picon.el nndoc.el nnimap.el smiley.el
 
-Darren Hoo: changed db-find.el db.el gnus-art.el isearch.el man.el
-  nsmenu.m startup.el
+Darren Hoo: changed db.el gnus-art.el
 
 Darren Stalder: changed gnus-util.el
 
 Darrin B. Jewell: changed etags.c lisp.h
 
-Dato Simó: changed network-stream.el
-
 Dave Detlefs: co-wrote cc-align.el cc-cmds.el cc-defs.el cc-engine.el
   cc-langs.el cc-menus.el cc-mode.el cc-styles.el cc-vars.el
 
-Dave Goldberg: changed message.el
-
 Dave Lambert: changed sol2-5.h xfns.c xterm.c xterm.h
 
 Dave Love: wrote autoarg.el autoconf.el benchmark.el cap-words.el
   cfengine.el elide-head.el hl-line.el language/georgian.el
-  latin1-disp.el quail/georgian.el refill.el rfc1345.el sgml-input.el
-  smiley.el sym-comp.el tool-bar.el uni-input.el utf-7.el utf-8-lang.el
-  vc/vc-bzr.el welsh.el
+  latin1-disp.el progmodes/python.el quail/georgian.el refill.el
+  rfc1345.el sgml-input.el smiley.el sym-comp.el tool-bar.el uni-input.el
+  utf-7.el utf-8-lang.el vc/vc-bzr.el welsh.el
 and co-wrote latin-ltx.el socks.el
-and changed configure.ac help.el mule-cmds.el fortran.el mule-conf.el
-  xterm.c browse-url.el mule.el coding.c src/Makefile.in european.el
-  fns.c mule-diag.el simple.el wid-edit.el cus-edit.el cus-start.el
-  files.el keyboard.c byte-opt.el info.el and 773 other files
+and changed Makefile.in configure.in help.el mule-cmds.el fortran.el
+  mule-conf.el xterm.c browse-url.el mule.el coding.c european.el fns.c
+  mule-diag.el simple.el wid-edit.el cus-edit.el cus-start.el files.el
+  keyboard.c byte-opt.el info.el and 770 other files
 
 Dave Pearson: wrote 5x5.el quickurl.el
 
 David A. Capello: changed etags.c
 
-David Abrahams: changed gnus-int.el gnus-sum.el nnimap.el
-  gnus-registry.el org-agenda.el auth-source.el coding.c cus-start.el
-  ediff-init.el ediff-util.el filelock.c gnus-range.el gnus-salt.el
-  gnus.texi mairix.el nnir.el nnmairix.el nnregistry.el org-clock.el
-  org.el
+David Abrahams: changed gnus-sum.el org-agenda.el coding.c ediff-init.el
+  gnus-registry.el gnus.texi mairix.el nnimap.el nnir.el nnmairix.el
+  nnregistry.el org-clock.el
 
 David Bakhash: wrote strokes.el
 
@@ -874,22 +762,20 @@ David Burger: changed macros.el
 
 David Byers: changed minibuf.c
 
-David Cadé: changed mpc.el
-
 David Casperson: changed font-core.el menu-bar.el tex-mode.el
 
 David De La Harpe Golden: changed files.el mouse.el simple.el fileio.c
   cus-start.el nsselect.m select.el w32-fns.el x-win.el xterm.c
 
-David Edmondson: changed message.el mml2015.el gnus-cite.el imap.el
-  mm-uu.el mm-view.el nnfolder.el nnimap.el nnml.el shr.el
+David Edmondson: changed message.el gnus-cite.el imap.el mm-uu.el
+  mm-view.el mml2015.el nnfolder.el nnimap.el nnml.el
 
 David Engster: wrote mairix.el nnmairix.el
-and changed cedet/semantic.el db.el insert.el semantic/complete.el c.el
-  db-el.el db-find.el ede-grammar.el eieio-opt.el eieio.el eieio.texi
-  gnus.texi registry.el srecode/compile.el wisent/python.el analyze.el
-  bovine/el.el bovine/grammar.el c.by db-file.el decorate/mode.el
-  and 83 other files
+and changed gnus.texi insert.el registry.el db-find.el gnus-msg.el
+  analyze/complete.el base.el bovine-grammar.el cedet/srecode.el
+  cpp-root.el db-typecache.el db.el dictionary.el display.texi
+  document.el ede-grammar.el ede/custom.el ede/generic.el files.el
+  filters.el gnus-registry.el and 23 other files
 
 David Gillespie: wrote calc-aent.el calc-alg.el calc-arith.el calc-bin.el
   calc-comb.el calc-cplx.el calc-embed.el calc-ext.el calc-fin.el
@@ -899,9 +785,9 @@ David Gillespie: wrote calc-aent.el calc-alg.el calc-arith.el calc-bin.el
   calc-prog.el calc-rewr.el calc-rules.el calc-sel.el calc-stat.el
   calc-store.el calc-stuff.el calc-trail.el calc-undo.el calc-units.el
   calc-vec.el calc-yank.el calc.el calcalg2.el calcalg3.el calccomp.el
-  calcsel2.el cl-compat.el cl-extra.el cl-macs.el cl-seq.el cl.texi
-  edmacro.el emacs-lisp/cl-lib.el obsolete/complete.el
-and changed info.el bytecomp.el cl.el complete.el
+  calcsel2.el cl-compat.el cl-extra.el cl-macs.el cl-seq.el cl.el cl.texi
+  edmacro.el obsolete/complete.el
+and changed info.el bytecomp.el complete.el
 
 David Glasser: changed tar-mode.el
 
@@ -914,27 +800,27 @@ David Hedbor: changed nnmail.el
 
 David Hull: changed vc-hg.el
 
-David Hunter: changed config.nt flymake.el inc/ms-w32.h process.c
+David Hunter: changed config.nt flymake.el ms-w32.h process.c
 
-David J. Biesack: changed antlr-mode.el quickurl.el
+David J. Biesack: changed antlr-mode.el
 
-David J. MacKenzie: changed configure.ac Makefile.in etags.c fakemail.c
-  cvtmail.c movemail.c termcap.c wakeup.c yow.c Makefile avoid.el b2m.c
-  config.in digest-doc.c emacsclient.c emacsserver.c emacstool.c
-  etags-vmslib.c fortran.el hexl.c isearch.el and 14 other files
+David J. MacKenzie: changed configure.in etags.c Makefile.in fakemail.c
+  movemail.c wakeup.c cvtmail.c qsort.c termcap.c yow.c Makefile avoid.el
+  b2m.c config.in digest-doc.c emacsclient.c emacsserver.c emacstool.c
+  etags-vmslib.c fortran.el hexl.c and 14 other files
 
-David Kastrup: changed greek.el replace.el efaq.texi search.c ange-ftp.el
-  calc.el help.el keymaps.texi mouse.el subr.el woman.el desktop.el
-  gnus-art.el keymap.c keymap.h lisp-mnt.el meta-mode.el mpuz.el
-  process.c search.texi startup.el and 81 other files
+David Kastrup: changed quail/greek.el replace.el faq.texi search.c
+  ange-ftp.el calc.el help.el keymaps.texi mouse.el subr.el woman.el
+  Makefile.in desktop.el gnus-art.el keymap.c keymap.h lisp-mnt.el
+  meta-mode.el mpuz.el process.c search.texi and 79 other files
 
 David Kågedal: wrote tempo.el
 and changed sendmail.el xmenu.c
 
 David Lawrence: changed comint.el simple.el files.el c++-mode.el
-  compile.el inf-lisp.el shell.el emerge.el tex-mode.el c-mode.el cl.el
-  dired.el getdate.y gnus.el history.el lisp-mode.el lisp.el mh-e.el
-  rnews.el subr.el Makefile and 79 other files
+  compile.el getdate.y inf-lisp.el shell.el emerge.el tex-mode.el
+  c-mode.el cl.el dired.el emacs.1 emacsserver.c gnus.el history.el
+  lisp-mode.el lisp.el mh-e.el rnews.el and 79 other files
 
 David Lord: changed timeclock.el
 
@@ -946,11 +832,12 @@ and changed display.texi
 David M. Smith: wrote ielm.el
 and changed imenu.el pgg-def.el xterm.c
 
-David Maus: changed org.el org-agenda.el ox.el org-feed.el org-wl.el
-  org-macs.el ox-html.el org-capture.el org.texi org-gnus.el org-bbdb.el
-  org-clock.el org-protocol.el ox-publish.el ob-haskell.el ob.el
-  org-bibtex.el org-compat.el org-footnote.el org-id.el org-list.el
-  and 20 other files
+David Maus: co-wrote org-wl.el
+and changed org.el org-agenda.el org-feed.el org-exp.el org-html.el
+  org-macs.el org-capture.el org.texi org-gnus.el org-bbdb.el
+  org-clock.el org-protocol.el org-publish.el ob-haskell.el ob.el
+  org-bibtex.el org-compat.el org-footnote.el org-id.el org-latex.el
+  org-list.el and 20 other files
 
 David McCabe: changed lisp-mode.el
 
@@ -963,45 +850,40 @@ David Moore: co-wrote nnvirtual.el
 and changed gnus-xmas.el
 
 David Mosberger-Tang: changed alpha.h unexelf.c cm.h config.in
-  configure.ac cvtmail.c data.c dispnew.c emacsserver.c etags.c
+  configure.in cvtmail.c data.c dispnew.c emacsserver.c etags.c
   fakemail.c keyboard.c mem-limits.h process.c profile.c sorted-doc.c
   sysdep.c terminfo.c unexelf1.c yow.c
 
-David O'Toole: wrote ox-publish.el
+David O'Toole: wrote org-publish.el
 and co-wrote ob-lisp.el
 
-David Ponce: wrote bovine/grammar.el cedet.el comp.el java-tags.el
-  mode-local.el recentf.el ruler-mode.el semantic/grammar.el
+David Ponce: wrote bovine-grammar.el cedet.el comp.el grammar-wy.el
+  grammar.el java-tags.el mode-local.el recentf.el ruler-mode.el
   semantic/java.el semantic/wisent.el senator.el tree-widget.el
-  wisent/grammar.el wisent/wisent.el
+  wisent-grammar.el wisent/wisent.el
 and co-wrote util-modes.el
 and changed w32menu.c w32term.c close.png close.xpm empty.png empty.xpm
   end-guide.png end-guide.xpm files.el guide.png guide.xpm handle.png
   handle.xpm keyboard.c leaf.png leaf.xpm no-guide.png no-guide.xpm
-  no-handle.png no-handle.xpm open.png and 22 other files
+  no-handle.png no-handle.xpm open.png and 20 other files
 
 David Reitter: wrote mailclient.el
-and changed nsterm.m nsfns.m ns-win.el nsfont.m cus-start.el macos.texi
-  menu-bar.el nsmenu.m simple.el commands.h cus-edit.el easy-mmode.el
-  emacsbug.el emacsclient.c faces.el flyspell.el info.el keyboard.c
-  keymap.c lib-src/Makefile.in macterm.c and 13 other files
+and changed nsterm.m nsfns.m ns-win.el nsfont.m Makefile.in cus-start.el
+  macos.texi menu-bar.el nsmenu.m simple.el commands.h cus-edit.el
+  easy-mmode.el emacsbug.el emacsclient.c faces.el flyspell.el info.el
+  keyboard.c keymap.c macterm.c and 12 other files
 
-David Robinow: changed w32inevt.c lib-src/makefile.w32-in
-  lispintro/makefile.w32-in
+David Robinow: changed makefile.w32-in w32inevt.c
 
 David Robinson: changed menu-bar.el x-win.el
 
-David Röthlisberger: changed ido.el
-
 David S. Goldberg: changed gnus-art.el message.el
 
 David Vazquez: changed m4-mode.el
 
 David Z. Maze: changed nnml.el nnrss.el
 
-Davor Cubranic: changed nsterm.m
-
-Deanna Phillips: changed configure.ac
+Deanna Phillips: changed configure.in
 
 Debarshi Ray: changed erc-backend.el erc.el
 
@@ -1021,10 +903,9 @@ and changed complete.el
 
 Denis Stünkel: changed ibuf-ext.el
 
-Deniz Dogan: changed rcirc.el simple.el css-mode.el TUTORIAL.sv
-  commands.texi erc-log.el erc.el image.el iswitchb.el lisp-mode.el
-  process.c progmodes/python.el quickurl.el rcirc.texi vc/vc-bzr.el
-  wdired.el window.el
+Deniz Dogan: changed rcirc.el simple.el css-mode.el commands.texi
+  image.el iswitchb.el lisp-mode.el process.c progmodes/python.el
+  quickurl.el rcirc.texi vc/vc-bzr.el wdired.el window.el
 
 Dennis Gilmore: changed sparc.h
 
@@ -1042,14 +923,14 @@ Detlev Zundel: wrote re-builder.el
 
 Devon Sean McCullough: changed comint.el url-http.el
 
-Dhruva Krishnamurthy: changed emacsclient.c fontset.c makefile.w32-in
-  misc/makefile.w32-in nt/makefile.w32-in sound.c w32proc.c
+Dhruva Krishnamurthy: changed makefile.w32-in emacsclient.c fontset.c
+  sound.c w32proc.c
 
 Diane Murray: changed erc.el erc-backend.el erc-menu.el erc-button.el
   erc-track.el erc-match.el erc-nets.el erc-list.el erc-autoaway.el
   erc-capab.el erc-nickserv.el erc-stamp.el erc-compat.el erc-fill.el
   erc-goodies.el erc-ibuffer.el erc-log.el erc-nicklist.el url-http.el
-  Makefile erc-dcc.el and 37 other files
+  erc-dcc.el erc-networks.el and 35 other files
 
 Didier Verna: wrote gnus-diary.el nndiary.el
 and co-wrote nnml.el
@@ -1057,11 +938,11 @@ and changed nntp.el message.el gnus-group.el gnus-sum.el gnus-msg.el
   gnus.texi gnus-art.el gnus-srvr.el gnus-start.el gnus-topic.el
   gnus-xmas.el gnus-picon.el gnus-salt.el cus-edit.el gnus-int.el
   gnus-util.el message.texi nnmail.el rect.el cl-indent.el gmm-utils.el
-  and 9 other files
+  and 8 other files
 
 Dieter Schuster: changed etags.c
 
-Dima Kogan: changed hideshow.el subword.el gud.el simple.el
+Dima Kogan: changed hideshow.el
 
 Dirk Herrmann: co-wrote bibtex.el
 
@@ -1071,21 +952,16 @@ Dirk-Jan C. Binnema: changed org-agenda.el
 
 Dmitri Paduchikh: changed advice.el
 
-Dmitry Antipov: changed xdisp.c alloc.c lisp.h xterm.c buffer.c window.c
-  frame.c xfns.c w32term.c frame.h font.c nsterm.m w32fns.c dispnew.c
-  editfns.c xfaces.c keyboard.c window.h xterm.h dispextern.h buffer.h
-  and 238 other files
+Dmitry Antipov: changed alloc.c keyboard.c buffer.c ccl.c editfns.c
+  emacs.c fontset.c keymap.c lisp.h lread.c lwlib-Xaw.c lwlib-Xm.c
+  lwlib-utils.c lwlib.c macmenu.c w32menu.c xdisp.c xlwmenu.c xmenu.c
 
 Dmitry Bolshakov: changed hideshow.el
 
 Dmitry Dzhus: changed gdb-mi.el gud.el fadr.el all.xpm building.texi
   emacs.texi process.c thread.xpm
 
-Dmitry Gutov: changed ruby-mode.el ruby-mode-tests.el ruby.rb package.el
-  log-edit.el vc-git.el package-test.el newcomment.el archive-contents
-  js.el lisp.el minibuffer.el package-x-test.el whitespace.el
-  lisp-mode.el package-x.el programs.texi simple.el smie.el vc.el
-  .dir-locals.el and 18 other files
+Dmitry Gutov: changed lisp.el ruby-mode.el
 
 Dmitry Kurochkin: changed isearch.el
 
@@ -1101,18 +977,14 @@ Doug Cutting: co-wrote disass.el
 
 Doug Maxey: changed mouse.el
 
-Douglas Lewan: changed TUTORIAL.pt_BR
-
 Drake Wilson: changed emacsclient.c files.el misc.texi
 
 Drew Adams: wrote light-blue-theme.el
 and co-wrote color.el
-and changed cus-edit.el dired.el faces.el files.el help-mode.el imenu.el
-  info.el isearch.el menu-bar.el mouse.el ange-ftp.el bindings.el
-  bookmark.el custom.el descr-text.el dired.texi etags.el finder.el
-  frame.el help-fns.el help.el and 10 other files
-
-E Sabof: changed hi-lock.el image-dired.el
+and changed cus-edit.el dired.el faces.el files.el info.el isearch.el
+  menu-bar.el mouse.el ange-ftp.el bindings.el bookmark.el custom.el
+  descr-text.el dired.texi etags.el finder.el frame.el help-fns.el
+  help.el image-dired.el modes.texi and 7 other files
 
 E. Jay Berkenbilt: changed b2m.c flyspell.el ispell.el unrmail.el
   whitespace.el window.h
@@ -1121,11 +993,9 @@ Ed L. Cashin: changed gnus-sum.el imap.el
 
 Ed Swarthout: changed hexl.el textmodes/table.el
 
-Eduard Wiebe: wrote flymake-tests.el
-and changed dired.el flymake.texi Makefile browse-url.el flymake.el
-  footnote.el javascript.el jit-lock.el korean.el locate.el mule-conf.el
-  nxml-mode.texi objects.texi ps-print.el sysdep.c test.c test.pl
-  vc-rcs.el
+Eduard Wiebe: changed dired.el browse-url.el flymake.texi footnote.el
+  javascript.el jit-lock.el korean.el locate.el mule-conf.el
+  nxml-mode.texi objects.texi ps-print.el vc-rcs.el
 
 Eduardo Muñoz: changed dired.el ls-lisp.el
 
@@ -1148,7 +1018,7 @@ Edward Trumbo: changed Makefile.in
 
 Edwin Steiner: changed gnus-nocem.el
 
-Ehud Karni: changed rmail.el aviion-intel.h complete.el configure.ac
+Ehud Karni: changed rmail.el aviion-intel.h complete.el configure.in
   frame.el progmodes/compile.el rmailsum.el sort.el xdisp.c
 
 Eirik Fuller: changed ralloc.c xterm.c
@@ -1157,20 +1027,19 @@ Eli Barzilay: wrote calculator.el
 
 Eli Tziperman: wrote rmail-spam-filter.el
 
-Eli Zaretskii: wrote [bidirectional display in xdisp.c]
-  [tty menus in term.c] bidi.c rxvt.el tty-colors.el
-and changed xdisp.c msdos.c w32.c w32fns.c files.el fileio.c simple.el
-  display.texi w32proc.c sed1v2.inp src/makefile.w32-in config.bat
-  msdos.h emacs.c term.c process.c dispnew.c src/Makefile.in dispextern.h
-  mainmake.v2 rmail.el and 795 other files
+Eli Zaretskii: wrote [bidirectional display in xdisp.c] bidi.c rxvt.el
+  tty-colors.el
+and changed makefile.w32-in xdisp.c msdos.c Makefile.in files.el
+  config.bat fileio.c simple.el msdos.h info.el mainmake.v2 rmail.el
+  sed1v2.inp display.texi w32.c pc-win.el process.c dispnew.c startup.el
+  dispextern.h dired.c and 702 other files
 
-Elias Oltmanns: changed tls.el gnus-agent.el gnus-cite.el gnus-int.el
-  gnus-srvr.el gnus.el
+Elias Oltmanns: changed tls.el gnus-agent.el gnus-int.el gnus-srvr.el
+  gnus.el
 
-Elias Pipping: changed doc-view.el XDelAssoc.c XMakeAssoc.c files.el
-  shr.el
+Elias Pipping: changed XDelAssoc.c XMakeAssoc.c shr.el
 
-Emanuele Giaquinta: changed configure.ac rxvt.el charset.c etags.c
+Emanuele Giaquinta: changed configure.in rxvt.el charset.c etags.c
   fontset.c frame.el gnus-faq.texi loadup.el lread.c sh-script.el
   text.texi
 
@@ -1180,29 +1049,29 @@ Emilio C. Lopes: changed woman.el cmuscheme.el help.el vc.el advice.el
   animate.el apropos.el artist.el bookmark.el cal-menu.el calc-prog.el
   calc-store.el calcalg3.el calendar.el calendar.texi checkdoc.el
   code-pages.el codepage.el completion.el cus-edit.el diff.el
-  and 54 other files
+  and 53 other files
 
 Emmanuel Briot: wrote ada-prj.el xml.el
 and co-wrote ada-mode.el ada-xref.el
 and changed ada-stmt.el
 
-Era Eriksson: changed bibtex.el dired.el ses.el ses.texi shell.el
-  tramp.el tramp.texi
-
-Eric Abrahamsen: changed org.el org.texi ox-html.el ox-latex.el
+Era Eriksson: changed bibtex.el dired.el shell.el tramp.el tramp.texi
 
 Eric Bélanger: changed image.c
 
-Eric Decker: changed sysdep.c (and other files for HP-UX support)
+Eric Decker: changed hp800.h hpux10-20.h sysdep.c
 
 Eric Ding: wrote goto-addr.el
 and changed mh-utils.el mh-e.el mh-comp.el mh-mime.el
 
 Eric Eide: changed gnus-xmas.el
 
-Eric Hanchrow: changed erc.el vc-git.el TUTORIAL.es abbrev.el
-  autorevert.el cperl-mode.el dired.el emacsclient.c env.el frames.texi
-  ibuf-ext.el ispell.el ldap.el make-dist opascal.el tramp.texi window.el
+Eric Hanchrow: changed vc-git.el TUTORIAL.es abbrev.el autorevert.el
+  cperl-mode.el delphi.el dired.el emacsclient.c env.el erc.el
+  frames.texi ibuf-ext.el ispell.el ldap.el make-dist tramp.texi
+  window.el
+
+Éric Jacoboni: changed fr-refcard.tex
 
 Eric Knauel: changed gnus.el spam-report.el spam.el
 
@@ -1217,13 +1086,12 @@ Eric M. Ludlam: wrote analyze.el analyze/complete.el analyze/debug.el
   ede.el ede/custom.el ede/dired.el ede/files.el ede/generic.el
   ede/linux.el ede/locate.el ede/make.el ede/shell.el ede/simple.el
   ede/speedbar.el ede/srecode.el ede/util.el edit.el eieio-base.el
-  eieio-core.el eieio-custom.el eieio-datadebug.el eieio-opt.el
-  eieio-speedbar.el eieio-test-methodinvoke.el eieio-test-persist.el
-  eieio-tests.el eieio.el emacs-lisp/chart.el emacs.el expandproto.el
-  extract.el ezimage.el fcn.el fields.el filter.el filters.el fw.el
-  gcc.el getset.el global.el html.el ia-sb.el ia.el idle.el idutils.el
-  include.el insert.el inversion.el javascript.el lex-spp.el lex.el
-  list.el makefile-edit.el map.el mru-bookmark.el pconf.el pmake.el
+  eieio-custom.el eieio-datadebug.el eieio-opt.el eieio-speedbar.el
+  eieio.el emacs-lisp/chart.el emacs.el expandproto.el extract.el
+  ezimage.el fcn.el fields.el filter.el filters.el fw.el gcc.el getset.el
+  global.el html.el ia-sb.el ia.el idle.el idutils.el include.el
+  insert.el inversion.el javascript.el lex-spp.el lex.el list.el
+  makefile-edit.el map.el mru-bookmark.el pconf.el pmake.el
   proj-archive.el proj-aux.el proj-comp.el proj-elisp.el proj-info.el
   proj-misc.el proj-obj.el proj-prog.el proj-scheme.el proj-shared.el
   proj.el project-am.el pulse.el refs.el sb-image.el sb.el scm.el
@@ -1237,52 +1105,48 @@ Eric M. Ludlam: wrote analyze.el analyze/complete.el analyze/debug.el
   srt.el symref.el symref/grep.el system.el tag-file.el tag-ls.el
   tag-write.el tag.el test.el
 and co-wrote db-ebrowse.el srecode/cpp.el util-modes.el
-and changed c.srt ede.texi info.el rmail.el speedbspec.el cedet.el
-  ede-autoconf.srt ede-make.srt eieio.texi gud.el sb-dir-minus.xpm
+and changed info.el rmail.el speedbspec.el gud.el sb-dir-minus.xpm
   sb-dir-plus.xpm sb-dir.xpm sb-mail.xpm sb-pg-minus.xpm sb-pg-plus.xpm
   sb-pg.xpm sb-tag-gt.xpm sb-tag-minus.xpm sb-tag-plus.xpm
-  sb-tag-type.xpm and 30 other files
+  sb-tag-type.xpm sb-tag-v.xpm sb-tag.xpm Makefile.in c-by.el cedet.el
+  comint.el and 18 other files
 
 Eric Marsden: changed gnus-cache.el url-util.el
 
 Eric S Fraga: wrote ob-ledger.el
 and co-wrote ob-maxima.el
-and changed ox-icalendar.el org.texi ox-latex.el
+and changed org-icalendar.el org-latex.el org.texi
 
 Eric S. Raymond: wrote AT386.el asm-mode.el cookie1.el finder.el gud.el
   keyswap.el lisp-mnt.el loadhist.el
 and co-wrote make-mode.el
-and changed vc.el vc-hooks.el vc-svn.el vc-cvs.el vc-git.el files.texi
-  vc-bzr.el vc-dispatcher.el vc-hg.el vc-sccs.el vc-rcs.el vc-mcvs.el
-  files.el comint.el emacsbug.el simple.el vc-arch.el vc-mtn.el
-  add-log.el cust-print.el dired.el and 257 other files
+and changed vc.el vc-hooks.el vc-svn.el vc-cvs.el files.texi vc-bzr.el
+  vc-dispatcher.el vc-git.el vc-hg.el vc-sccs.el vc-rcs.el vc-mcvs.el
+  Makefile.in files.el comint.el simple.el vc-arch.el vc-mtn.el
+  add-log.el cust-print.el dired.el and 249 other files
 
 Eric Schulte: wrote ob-C.el ob-asymptote.el ob-awk.el ob-calc.el
   ob-comint.el ob-css.el ob-ditaa.el ob-dot.el ob-emacs-lisp.el
   ob-eval.el ob-gnuplot.el ob-haskell.el ob-java.el ob-js.el ob-keys.el
-  ob-latex.el ob-makefile.el ob-ocaml.el ob-org.el ob-ruby.el ob-sass.el
+  ob-latex.el ob-ocaml.el ob-org.el ob-ruby.el ob-sass.el ob-scheme.el
   ob-sh.el ob-shen.el ob-sql.el ob-sqlite.el ob-table.el ob-tangle.el
-  ob.el org-plot.el
-and co-wrote ob-R.el ob-clojure.el ob-core.el ob-exp.el ob-fortran.el
-  ob-lisp.el ob-lob.el ob-maxima.el ob-perl.el ob-picolisp.el
-  ob-python.el ob-ref.el ob-scheme.el org-bibtex.el
-and changed org.texi org.el org-exp-blocks.el ox.el ox-latex.el
-  org-src.el ob-plantuml.el org-macs.el org-table.el ob-screen.el
-  org-agenda.el org-mouse.el orgcard.tex ob-lilypond.el ob-mscgen.el
-  ob-octave.el org-clock.el org-compat.el org-footnote.el ox-ascii.el
-  ox-html.el and 12 other files
+  org-exp-blocks.el org-plot.el
+and co-wrote ob-R.el ob-clojure.el ob-exp.el ob-fortran.el ob-lisp.el
+  ob-lob.el ob-maxima.el ob-perl.el ob-picolisp.el ob-python.el ob-ref.el
+  ob.el org-bibtex.el
+and changed org.texi org.el org-exp.el org-latex.el ob-plantuml.el
+  org-src.el org-table.el org-agenda.el org-macs.el orgcard.tex
+  ob-lilypond.el ob-mscgen.el ob-octave.el ob-screen.el org-ascii.el
+  org-footnote.el org-html.el org-mouse.el gnus-art.el ob-ledger.el
+  ob-matlab.el and 5 other files
 
 Eric Youngdale: changed etags-vmslib.c
 
 Eric Yu: changed speedbar.texi
 
-Erik Charlebois: changed syntax.el w32fns.c w32term.c w32term.h
-
-Erik Hetzner: changed org.el
-
 Erik Naggum: wrote disp-table.el mailheader.el parse-time.el
 and changed simple.el emacs.c files.el lread.c rmail.el alloc.c editfns.c
-  keyboard.c apropos.el configure.ac dispnew.c filelock.c fns.c keymap.c
+  keyboard.c apropos.el configure.in dispnew.c filelock.c fns.c keymap.c
   lisp.h print.c process.c add-log.el buffer.c casetab.c cl-macs.el
   and 114 other files
 
@@ -1295,7 +1159,7 @@ Espen Wiborg: changed utf-7.el
 Ethan Bradford: changed ispell.el ange-ftp.el gnus.el gnuspost.el lpr.el
   mailalias.el vt-control.el
 
-Ethan Ligon: changed org-docbook.el ox-html.el
+Ethan Ligon: changed org-docbook.el org-html.el
 
 Eugene Exarevsky: changed sql.el
 
@@ -1305,31 +1169,21 @@ Evgeni Dobrev: changed man.el
 
 Evgeny Roubinchtein: changed mail-source.el pc-select.el
 
-Exal de Jesus Garcia Carrillo: changed erc-sound.el erc.texi
-
-Eyal Lotem: changed ido.el
+Exal de Jesus Garcia Carrillo: changed erc.texi erc-sound.el
 
 F. Thomas May: wrote blackbox.el
 
-Fabián Ezequiel Gallina: wrote progmodes/python.el
-and changed python-tests.el imenu.el
+Fabian Ezequiel Gallina: changed progmodes/python.el
 
 Fabrice Bauzac: changed dired-aux.el
 
-Fabrice Niessen: wrote leuven-theme.el
-and changed org-agenda.el
-
-Fabrice Popineau: changed w32.c w32fns.c ms-w32.h w32heap.c w32term.c
-  configure.ac lisp.h nmake.defs unexw32.c w32proc.c addsection.c alloc.c
-  config.nt dispextern.h emacs-x64.manifest emacs-x86.manifest emacs.c
-  etags.c fileio.c frame.c gmake.defs and 19 other files
+Fabrice Popineau: changed config.nt etags.c fileio.c gnus-cache.el
+  inttypes.h lisp.h ms-w32.h nmake.defs regex.c stdint.h w32.c w32heap.c
 
 Fan Kai: changed esh-arg.el
 
 Faried Nawaz: changed message.el
 
-Felix H. Dahlke: changed js.el
-
 Felix Lee: changed flyspell.el outline.el cl.texi data.c gud.el nntp.el
   process.c progmodes/compile.el vc.el xdisp.c
 
@@ -1337,22 +1191,14 @@ Felix Mueller: changed nsterm.m
 
 Felix S. T. Wu: co-wrote vi.el (public domain)
 
-Feng Li: changed calc-ext.el pascal.el which-func.el
-
-Feng Shu: changed org.el org.texi ox.el ox-html.el ox-latex.el ox-odt.el
+Feng Li: changed calc-ext.el
 
 Ferenc Wagner: changed nnweb.el
 
 Filipe Cabecinhas: changed nsterm.m
 
-Filipp Gunbin: changed cc-menus.el
-
 Flemming Hoejstrup Hansen: changed forms.el
 
-Florian Adamsky: changed recentf.el
-
-Florian Beck: changed org.el
-
 Florian Ragwitz: changed gnus-html.el sieve-manage.el
 
 Florian Weimer: changed message.el gnus.el coding.c gnus-sum.el gnus.texi
@@ -1364,13 +1210,11 @@ Francesc Rocher: changed MORE.STUFF startup.el cus-start.el gnus.el
   gnus.png gnus.svg macterm.c splash.png splash.svg splash8.xpm w32term.c
   xdisp.c xterm.c
 
-Francesco Pizzolante: changed org-clock.el org-macs.el org.el ox-html.el
-
 Francesco Potortì: wrote cmacexp.el
-and changed etags.c man.el delta.h etags.1 undigest.el comint.el
-  configure.ac maintaining.texi uniquify.el latin-post.el rmail.el
-  etags.el latin-alt.el lib-src/Makefile.in sgml-mode.el Makefile.in
-  data.c european.el filelock.c files.el generic-x.el and 44 other files
+and changed etags.c man.el delta.h etags.1 undigest.el Makefile.in
+  comint.el configure.in maintaining.texi uniquify.el latin-post.el
+  rmail.el etags.el latin-alt.el sgml-mode.el data.c european.el
+  filelock.c files.el generic-x.el gud.el and 45 other files
 
 Francis Devereux: changed nsfont.m
 
@@ -1378,10 +1222,10 @@ Francis J. Wright: wrote woman.el
 and changed dired.el comint.el cus-edit.el files.el ps-print.el
 
 Francis Litterio: changed erc.el erc-list.el erc-dcc.el erc-notify.el
-  erc-button.el erc-goodies.el erc-nets.el erc-ring.el Makefile
-  erc-pcomplete.el message.el erc-backend.el erc-ibuffer.el erc-match.el
-  erc-nickserv.el erc-page.el erc-speedbar.el gnus-util.el keymaps.texi
-  os.texi saveplace.el and 4 other files
+  erc-button.el erc-goodies.el erc-nets.el erc-ring.el erc-pcomplete.el
+  message.el erc-backend.el erc-ibuffer.el erc-match.el erc-nickserv.el
+  erc-page.el erc-speedbar.el gnus-util.el keymaps.texi os.texi
+  saveplace.el w32term.c and 3 other files
 
 Francois Felix Ingrand: changed gnus-salt.el
 
@@ -1396,8 +1240,6 @@ Frank Schmitt: changed gnus-sum.el cmdargs.texi gnus-faq.texi
 
 Frank Weinberg: changed gnus-art.el
 
-François Allisson: changed org.texi
-
 François Pinard: co-wrote po.el
 and changed nndoc.el allout.el bytecomp.el gnus-sum.el gnus-util.el
   gnus-uu.el make-mode.el nnmail.el org.el rmailsum.el timezone.el
@@ -1415,9 +1257,9 @@ and changed gnus.el
 
 Frederic Pierresteguy: wrote widget.c
 and changed xmenu.c xterm.c xfns.c dpx2.h lwlib.c rmailsum.el rmail.el
-  xlwmenu.c xterm.h lwlib-Xaw.c lwlib-Xlw.c configure.ac lwlib-Xaw.h
-  lwlib-int.h xdisp.c compile.el editfns.c fns.c frame.h hilit19.el
-  keyboard.c and 10 other files
+  xlwmenu.c xterm.h lwlib-Xaw.c lwlib-Xlw.c Makefile.in configure.in
+  lwlib-Xaw.h lwlib-int.h xdisp.c compile.el editfns.c fns.c frame.h
+  hilit19.el and 9 other files
 
 Frederik Fouvry: changed sendmail.el TUTORIAL.nl emacs.bash faces.el
   filecache.el mailalias.el rmail.el thumbs.el
@@ -1457,56 +1299,45 @@ Geoff Gole: changed align.el ibuffer.el whitespace.el
 
 Geoff Greene: changed message.el
 
-Geoff Kuenning: changed gnus-art.el gnus.texi
-
 Geoff Voelker: wrote ms-w32.h w32-fns.el w32.c w32.h w32heap.c w32heap.h
   w32inevt.c w32proc.c w32term.c
 and changed makefile.nt w32fns.c fileio.c makefile.def callproc.c
-  s/ms-w32.h emacs.bat.in unexw32.c w32term.h dos-w32.el loadup.el
-  w32-win.el emacs.c keyboard.c ntterm.c process.c w32console.c addpm.c
-  cmdproxy.c comint.el files.el and 102 other files
+  s/ms-w32.h unexw32.c w32term.h dos-w32.el emacs.bat loadup.el
+  w32-win.el emacs.c keyboard.c process.c w32console.c addpm.c cmdproxy.c
+  comint.el files.el ntterm.c and 104 other files
 
 Georg C. F. Greve: changed pgg-gpg.el
 
-George Kettleborough: changed org-clock.el org-timer.el
-
-George Mcninch: changed nnir.el
-
 George V. Reilly: changed emacs.ico makefile.nt
 
 Georges Brun-Cottan: wrote easy-mmode.el
 
 Gerd Möllmann: wrote authors.el ebrowse.el jit-lock.el rx.el tooltip.el
 and changed xdisp.c xterm.c dispnew.c dispextern.h xfns.c xfaces.c
-  window.c keyboard.c lisp.h faces.el alloc.c buffer.c startup.el xterm.h
-  fns.c simple.el term.c configure.ac frame.c xmenu.c emacs.c
-  and 613 other files
+  window.c keyboard.c lisp.h Makefile.in faces.el alloc.c buffer.c
+  startup.el xterm.h fns.c simple.el term.c frame.c xmenu.c emacs.c
+  and 617 other files
 
 Gergely Nagy: changed erc.el
 
-Gergely Risko: changed coding.c
-
 Germano Caronni: changed ralloc.c
 
 Gernot Heiser: changed refer.el
 
-Giorgos Keramidas: changed configure.ac erc-backend.el erc.el .bzrignore
-  alloc.c amdx86-64.h apropos.el display.texi erc-services.el filelock.c
-  fringe.c fringe.el lisp.h rcirc.el windows.texi xmenu.c
-
-Giovanni Ridolfi: changed org.texi
+Giorgos Keramidas: changed configure.in erc-backend.el erc.el alloc.c
+  amdx86-64.h apropos.el display.texi erc-services.el filelock.c fringe.c
+  fringe.el lisp.h rcirc.el windows.texi xmenu.c
 
 Giuliano Procida: changed perl-mode.el
 
-Giuseppe Scrivano: changed browse-url.el buffer.c configure.ac sysdep.c
+Giuseppe Scrivano: changed browse-url.el buffer.c configure.in sysdep.c
   xsmfns.c
 
 Glenn Morris: wrote automated/f90.el automated/vc-bzr.el check-declare.el
-and changed configure.ac src/Makefile.in Makefile.in calendar.el
-  diary-lib.el files.el lisp/Makefile.in rmail.el progmodes/f90.el
-  bytecomp.el emacs.texi simple.el make-dist ack.texi misc/Makefile.in
-  cal-menu.el appt.el cal-hebrew.el display.texi startup.el calendar.texi
-  and 1534 other files
+and changed Makefile.in configure.in calendar.el diary-lib.el rmail.el
+  progmodes/f90.el files.el cal-menu.el appt.el cal-hebrew.el fortran.el
+  bytecomp.el holidays.el emacs.texi calendar.texi ack.texi make-dist
+  simple.el sed1v2.inp cal-islam.el dired-x.el and 1249 other files
 
 Glynn Clements: wrote gamegrid.el snake.el tetris.el
 
@@ -1514,7 +1345,7 @@ Gordon Matzigkeit: changed gnus-uu.el
 
 Greg Hill: changed bytecomp.el
 
-Greg Hudson: changed configure.ac indent.c
+Greg Hudson: changed configure.in indent.c
 
 Greg Klanderman: changed messagexmas.el
 
@@ -1523,22 +1354,15 @@ and changed tar-mode.el
 
 Greg Stark: changed gnus-ems.el timezone.el
 
-Gregor Kappler: changed ox.el
-
 Gregor Schmid: changed intervals.c intervals.h tcl-mode.el textprop.c
   dispnew.c indent.c xdisp.c
 
-Gregor Zattler: changed emacs-lisp-intro.texi
-
 Gregorio Gervasio, Jr.: changed gnus-sum.el
 
 Gregory Chernov: changed nnslashdot.el
 
 Gregory Neil Shapiro: changed mailabbrev.el
 
-Grégoire Jadi: changed org.texi ob-core.el org-id.el org.el reporter.el
-  sendmail.el
-
 Guanpeng Xu: changed add-log.el TUTORIAL.cn display.texi mouse.el
   pcomplete.el search.c subr.el type-break.el
 
@@ -1546,14 +1370,10 @@ Gunnar Horrigmo: changed gnus-sum.el
 
 Gustav Hållberg: changed descr-text.el progmodes/compile.el rect.el vc.el
 
-Gustav Wikström: changed org-agenda.el org.texi
-
 Guy Geens: changed gnus-score.el
 
 Gwern Branwen: changed browse-url.el
 
-Gábor Vida: changed gnus-demon.el auth-source.el ido.el
-
 Göran Uddeborg: changed isc4-1.h
 
 Hallvard B. Furuseth: co-wrote byte-opt.el byte-run.el bytecomp.el
@@ -1566,8 +1386,6 @@ Han Boetes: changed netbsd.h
 
 Han-Wen Nienhuys: changed emacsclient.c server.el
 
-Hanataka, Shinya: changed coding.c
-
 Hans Chalupsky: wrote advice.el trace.el
 and changed bytecomp.el
 
@@ -1575,24 +1393,19 @@ Hans Henrik Eriksen: wrote simula.el
 
 Hans de Graaff: changed mml.el
 
-Hans-Peter Deifel: changed ob.el
-
 Harald Maier: changed w32heap.c
 
 Harald Meland: changed gnus-art.el gnus-salt.el gnus-score.el
   gnus-util.el gnus-win.el mail-source.el
 
-Harri Kiiskinen: changed org-protocol.el ox-publish.el
+Harri Kiiskinen: changed org-publish.el
 
 Heiko Muenkel: changed b2m.c
 
-Helmut Eller: changed emacs-lisp/debug.el cl-indent.el cl-macs.el eval.c
-  lisp-mode.el process-tests.el process.c
+Helmut Eller: changed cl-macs.el emacs-lisp/debug.el process.c
 
 Helmut Waitzmann: changed gnus-sum.el gnus.texi
 
-Henning Weiss: changed org-mobile.el
-
 Henrik Enberg: changed rmailout.el gnus-art.el gnus-msg.el lread.c
   mail/rmailmm.el rmail.el rmailedit.el rmailkwd.el rmailmsc.el
   rmailsort.el rmailsum.el xfaces.c
@@ -1609,7 +1422,7 @@ Hewlett-Packard: changed emacsclient.c keyboard.c server.el
 
 Hideki Iwamoto: changed etags.c
 
-Hiroshi Fujishima: changed efaq.texi gnus-score.el mail-source.el
+Hiroshi Fujishima: changed faq.texi gnus-score.el mail-source.el
   spam-stat.el
 
 Hiroshi Nakano: changed ralloc.c unexelf.c
@@ -1644,7 +1457,7 @@ Håkan Granath: changed dired.el
 
 Håkon Malmedal: changed calendar.el holidays.el
 
-Ian Eure: changed sql.el url-util.el
+Ian Eure: changed sql.el
 
 Ian Lance Taylor: changed sco4.h
 
@@ -1653,8 +1466,6 @@ and changed ange-ftp.el desktop.el tex-mode.el
 
 Igor Kuzmin: wrote cconv.el
 
-Ikumi Keita: changed characters.el minibuf.c
-
 Ilja Weis: co-wrote gnus-topic.el
 
 Ilya N. Golubev: changed mm-util.el shell.el
@@ -1664,10 +1475,8 @@ Ilya Shlyakhter: changed org.el ob-lilypond.el org-clock.el
 
 Ilya Zakharevich: wrote tmm.el
 and co-wrote cperl-mode.el
-and changed syntax.c intervals.c syntax.h textprop.c dired.c font-lock.el
-  intervals.h regex.c regex.h search.c
-
-Ilya Zonov: changed org-mouse.el
+and changed syntax.c syntax.h textprop.c dired.c font-lock.el interval.c
+  intervals.c intervals.h regex.c regex.h search.c
 
 Indiana University Foundation: changed buffer.c buffer.h indent.c
   region-cache.c region-cache.h search.c xdisp.c
@@ -1678,33 +1487,27 @@ Inge Frick: changed easymenu.el keyboard.c view.el compile.el
 
 Inge Wallin: co-wrote avl-tree.el ewoc.el
 
-Ingo Lohmar: changed help-fns.el ls-lisp.el org-agenda.el org.el
-
 Inoue Seiichiro: changed xterm.c xfns.c xterm.h
 
 International Business Machines: changed emacs.c fileio.c process.c
   sysdep.c unexcoff.c
 
-Ippei Furuhashi: changed org.texi org-colview.el org-table.el org.el
-
 Irie Shinsuke: changed subr.el
 
 Irie Tetsuya: changed gnus.texi message.texi
 
+İsmail Dönmez: changed nsfont.m nsterm.m url-auth.el xterm.c
+
 Istvan Marko: changed gnus-agent.el xfns.c
 
 Itai Zukerman: changed mm-decode.el
 
-Ivan Andrus: changed find-file.el ibuf-ext.el ibuffer.el
-
 Ivan Boldyrev: changed mml1991.el
 
 Ivan Kanis: wrote vc-hg.el
-and changed eww.el shr.el appt.el dired.el saveplace.el term.el time.el
-
-Ivan Shmakov: changed diff-mode.el nndoc.el tcl.el tex-mode.el
+and changed appt.el term.el time.el
 
-Ivan Vilata I Balaguer: changed org-clock.el org.texi
+Ivan Shmakov: changed tcl.el
 
 Ivan Zakharyaschev: changed codepage.el lread.c
 
@@ -1712,10 +1515,6 @@ Ivar Rummelhoff: wrote winner.el
 
 Iwamuro Motonori: changed gnus-kill.el
 
-J. R. Hacker: wrote new-pkg-1.0.el signed-bad-1.0.el signed-good-1.0.el
-  simple-depend-1.0.el simple-single-1.3.el simple-single-1.4.el
-  simple-two-depend-1.1.el
-
 J.D. Smith: co-wrote idlw-help.el idlw-shell.el idlwave.el
 and changed idlw-rinfo.el idlw-toolbar.el comint.el idlwave.texi vc.el
   bibtex.el files.texi hideshow.el idlw-complete-structtag.el misc.texi
@@ -1723,10 +1522,6 @@ and changed idlw-rinfo.el idlw-toolbar.el comint.el idlwave.texi vc.el
 
 Jaap-Henk Hoepman: changed mm-decode.el
 
-Jacek Chrząszcz: changed ispell.el
-
-Jack Duthen: changed which-func.el
-
 Jack Repenning: changed unexelfsgi.c
 
 Jack Twilley: changed message.el
@@ -1739,13 +1534,10 @@ Jae-Hyeon Park: changed fontset.el
 
 Jaeyoun Chung: changed hangul3.el hanja3.el gnus-mule.el hangul.el
 
-Jambunathan K: wrote ox-odt.el
-and co-wrote ox-html.el
-and changed org-lparse.el org.el org.texi ox.el icomplete.el
-  OrgOdtContentTemplate.xml OrgOdtStyles.xml hi-lock.el replace.el
-  minibuffer.el org-footnote.el org-inlinetask.el register.el doc-view.el
-  etags.el htmlfontify.el ido.el indian.el iswitchb.el org-bbdb.el
-  org-compat.el and 6 other files
+Jambunathan K: wrote org-lparse.el org-odt.el
+and changed org.el org-exp.el org.texi OrgOdtContentTemplate.xml
+  org-footnote.el org-inlinetask.el OrgOdtStyles.xml htmlfontify.el
+  org-html.el package-x.el quail/indian.el tar-mode.el
 
 James Clark: wrote nxml-enc.el nxml-glyph.el nxml-maint.el nxml-mode.el
   nxml-ns.el nxml-outln.el nxml-parse.el nxml-rap.el nxml-uchnm.el
@@ -1763,12 +1555,12 @@ James R. Larus: co-wrote mh-e.el
 James R. Van Zandt: changed sh-script.el
 
 James TD Smith: changed org.el org-colview.el org-clock.el
-  org-remember.el org-plot.el org-agenda.el org-compat.el org-habit.el
-  org.texi
+  org-remember.el org-colview-xemacs.el org-plot.el org-agenda.el
+  org-compat.el org-habit.el org.texi
 
 James Troup: changed gnus-sum.el
 
-James Van Artsdalen: changed unexcoff.c
+James Van Artsdalen: changed unexcoff.c usg5-4.h
 
 James Wright: changed em-unix.el
 
@@ -1776,20 +1568,19 @@ Jamie Zawinski: wrote mailabbrev.el tar-mode.el
 and co-wrote byte-opt.el byte-run.el bytecomp.el disass.el font-lock.el
 and changed bytecode.c mail-extr.el subr.el
 
-Jan Beich: changed configure.ac
-
 Jan Böcker: wrote org-docview.el
-and changed org.el org.texi
+and changed org.el
+
+Jan Böker: changed org.el
 
 Jan Djärv: wrote dnd.el dynamic-setting.el x-dnd.el
-and changed gtkutil.c xterm.c nsterm.m xfns.c configure.ac xmenu.c
-  xterm.h nsfns.m nsterm.h nsmenu.m gtkutil.h keyboard.c x-win.el frame.c
-  emacs.c process.c xsettings.c src/Makefile.in frames.texi nsfont.m
-  ns-win.el and 301 other files
+and changed gtkutil.c xterm.c xfns.c configure.in xmenu.c xterm.h
+  gtkutil.h nsterm.m x-win.el keyboard.c Makefile.in frames.texi
+  xsettings.c emacs.c frame.c nsfns.m xselect.c process.c xlwmenu.c
+  config.in cus-start.el and 303 other files
 
 Jan Moringen: co-wrote srecode/cpp.el tango-dark-theme.el tango-theme.el
-and changed dbus.el dbus.texi dbusbind.c eieio.el idle.el insert.el
-  log-edit.el srecode/find.el wisent/python.el zeroconf.el
+and changed dbus.el dbus.texi dbusbind.c eieio.el log-edit.el zeroconf.el
 
 Jan Nieuwenhuizen: changed info.el TUTORIAL.nl add-log.el emacs.c
   emacsclient.c gnus-start.el gud.el nnmh.el server.el startup.el
@@ -1798,10 +1589,7 @@ Jan Rychter: changed gnus-msg.el
 
 Jan Schormann: wrote solitaire.el
 
-Jan Seeger: changed ox-publish.el parse-time.el
-
-Jan Tatarik: wrote gnus-icalendar.el
-and changed gnus-score.el gnus-logic.el
+Jan Seeger: changed org-publish.el parse-time.el
 
 Jan Vroonhof: changed gnus-cite.el gnus-msg.el nntp.el
 
@@ -1809,24 +1597,15 @@ Jan-Hein Buhrman: changed ange-ftp.el env.el
 
 Jared Finder: changed progmodes/compile.el
 
-Jarek Czekalski: changed keyboard.c callproc.c mini.texi minibuf.c
-  misc.texi shell.el w32fns.c xgselect.c
-
 Jari Aalto: changed add-log.el filecache.el progmodes/grep.el comint.el
   gnus-art.el gnus-sum.el gnus.texi ispell.el lisp-mnt.el man.el
-  nnmail.el apropos.el autorevert.el checkdoc.el cperl-mode.el
-  css-mode.el desktop.el em-ls.el emacs-lisp/debug.el emacsclient.1
-  executable.el and 23 other files
-
-Jarmo Hurri: changed org-gnus.el org-table.el org.texi
-
-Jarosław Rzeszótko: changed url-http.el
+  nnmail.el apropos.el autorevert.el checkdoc.el cperl-mode.el desktop.el
+  em-ls.el emacs-lisp/debug.el emacsclient.1 executable.el files.el
+  and 20 other files
 
 Jason Baker: changed gnus-art.el
 
-Jason Dunsmore: changed org.el ox-html.el
-
-Jason L. Wright: changed smtpmail.el
+Jason Dunsmore: changed org-html.el org.el
 
 Jason Merrill: changed gnus-sum.el add-log.el gnus-salt.el imap.el
   nnfolder.el
@@ -1834,33 +1613,23 @@ Jason Merrill: changed gnus-sum.el add-log.el gnus-salt.el imap.el
 Jason Riedy: changed org-table.el org.texi
 
 Jason Rumney: wrote w32-vars.el
-and changed w32fns.c w32term.c w32font.c w32menu.c w32-win.el w32term.h
-  w32.c w32uniscribe.c src/makefile.w32-in w32-fns.el makefile.nt
-  w32console.c w32bdf.c lib-src/makefile.w32-in configure.bat keyboard.c
-  w32proc.c w32select.c font.c image.c w32font.h and 166 other files
+and changed w32fns.c w32term.c w32font.c makefile.w32-in w32menu.c
+  w32-win.el w32term.h w32.c w32uniscribe.c w32-fns.el makefile.nt
+  w32console.c w32bdf.c configure.bat keyboard.c w32proc.c w32select.c
+  font.c image.c w32font.h w32gui.h and 160 other files
 
-Jason S. Cornez: changed keyboard.c
-
-Jay Belanger: changed calc.texi calc.el calc-ext.el calc-units.el
-  calc-aent.el calc-embed.el calc-help.el calc-lang.el calc-prog.el
-  calc-forms.el calccomp.el calc-math.el calc-arith.el calc-graph.el
-  calc-misc.el calcalg2.el calc-alg.el calc-store.el calc-yank.el
-  calc-bin.el calc-mode.el and 39 other files
+Jay Belanger: changed calc.texi calc.el calc-ext.el calc-aent.el
+  calc-units.el calc-embed.el calc-help.el calc-lang.el calc-prog.el
+  calc-math.el calccomp.el calc-arith.el calc-graph.el calc-forms.el
+  calc-misc.el calc-store.el calc-yank.el calcalg2.el calc-bin.el
+  calc-alg.el calc-vec.el and 40 other files
 
 Jay K. Adams: wrote jka-cmpr-hook.el jka-compr.el
 
-Jay McCarthy: changed org-colview.el
-
 Jay Sachs: changed gnus-score.el gnus-win.el
 
-Jean Haidouk: changed latin-alt.el latin-post.el latin-pre.el
-
-Jean-Philippe Gravel: changed gdb-mi.el
-
 Jean-Philippe Theberge: wrote thumbs.el
 
-Jed Brown: changed progmodes/compile.el
-
 Jeff Dairiki: changed whitespace.el
 
 Jeff Dwork: changed ehelp.el facemenu.el
@@ -1873,12 +1642,11 @@ Jeff Morgenthaler: changed flow-ctrl.el vt200.el vt201.el vt220.el
 Jeff Norden: wrote kermit.el
 
 Jeff Peck: wrote sun.el
-and changed emacstool.1 emacstool.c
 
 Jeffrey C Honig: wrote mh-print.el
 and changed mh-e.el mh-comp.el mh-utils.el mh-mime.el mh-customize.el
-  mh-folder.el mh-funcs.el mh-alias.el mh-seq.el mh-show.el Makefile
-  bsdos4.h mh-junk.el mh-letter.el
+  mh-funcs.el mh-alias.el mh-seq.el bsdos4.h mh-folder.el mh-junk.el
+  mh-show.el
 
 Jens Krinke: changed smime.el
 
@@ -1892,13 +1660,11 @@ Jens Toivo Berger Thielemann: changed word-help.el
 Jens-Ulrik Holger Petersen: changed cus-edit.el ffap.el find-func.el
   gnus.el
 
-Jeramey Crawford: changed amdx86-64.h configure.ac
+Jeramey Crawford: changed amdx86-64.h configure.in
 
 Jeremy Bertram Maitin-Shepard: changed erc.el erc-backend.el
   erc-button.el erc-track.el mml.el
 
-Jeremy Moore: changed hideif.el
-
 Jeremy Whitlock: changed progmodes/python.el
 
 Jerry Frain: changed systime.h usg5-4.h
@@ -1921,22 +1687,18 @@ Jihyun Cho: wrote hangul.el hanja-util.el
 
 Jim Blandy: wrote tvi970.el
 and co-wrote wyse50.el
-and changed keyboard.c xterm.c xfns.c window.c process.c ymakefile
-  dispnew.c xdisp.c sysdep.c configure.ac lisp.h Makefile.in keymap.c
+and changed keyboard.c xterm.c xfns.c Makefile.in window.c process.c
+  ymakefile dispnew.c xdisp.c sysdep.c configure.in lisp.h keymap.c
   configure make-dist buffer.c frame.c screen.c simple.el alloc.c emacs.c
-  and 402 other files
+  and 388 other files
 
-Jim Diamond: changed server.el
-
-Jim Kingdon: changed emacs.texi emacsclient.c functions.texi hp300bsd.h
+Jim Kingdon: changed emacsclient.c emacs.tex functions.texinfo hp300bsd.h
   rmail.el
 
-Jim Meyering: changed lread.c make-docfile.c w32.c w32font.c copyright.el
-  ebrowse.c emacs.c nsfont.m pop.c term.c xfaces.c xselect.c xterm.c
-  alloc.c artist.el autoinsert.el buffer.h callproc.c character.h
-  charset.c configure and 56 other files
-
-Jim Paris: changed process.c
+Jim Meyering: changed lread.c w32.c copyright.el ebrowse.c emacs.c
+  make-docfile.c nsfont.m term.c w32font.c xfaces.c xselect.c Makefile.in
+  alloc.c artist.el autoinsert.el buffer.h character.h charset.c
+  configure configure.in doprnt.c and 53 other files
 
 Jim Radford: changed gnus-start.el
 
@@ -1944,7 +1706,7 @@ Jim Salem: wrote completion.el
 
 Jim Thompson: co-wrote ps-print.el ps-samp.el
 
-Jim Wilson: changed alloca.c oldXMenu/Makefile.in
+Jim Wilson: changed Makefile.in alloca.c
 
 Jindrich Makovicka: changed eval.c fns.c
 
@@ -1956,11 +1718,9 @@ Joachim Reiter: changed org-footnote.el
 
 Joakim Hove: wrote html2text.el
 
-Joakim Hårsman: changed w32fns.c
-
 Joakim Verona: wrote db-javascript.el
 and co-wrote db-ebrowse.el
-and changed Makefile.in configure.ac image-mode.el image.c image.el
+and changed Makefile.in configure.in image-mode.el image.c image.el
   nnrss.el progmodes/compile.el thingatpt.el window.c window.h
 
 Joanna Pluta: changed TUTORIAL.pl
@@ -1969,11 +1729,11 @@ Jochen Hein: changed gnus-art.el
 
 Jochen Küpper: changed gnus.texi calc-units.el
 
-Joe Buehler: changed configure.ac cygwin.h src/Makefile.in Makefile.in
-  browse-url.el comint.el configure dired-aux.el dired.el dirtrack.el
-  dos-w32.el fast-lock.el filecache.el fileio.c files.el gmalloc.c
-  gnus-util.el hippie-exp.el keyboard.c lastfile.c lib-src/Makefile.in
-  and 13 other files
+Joe Buehler: changed Makefile.in configure.in cygwin.h browse-url.el
+  comint.el configure dired-aux.el dired.el dirtrack.el dos-w32.el
+  fast-lock.el filecache.el fileio.c files.el gmalloc.c gnus-util.el
+  hippie-exp.el keyboard.c lastfile.c loadup.el mem-limits.h
+  and 11 other files
 
 Joe Casadonte: changed gnus-srvr.el
 
@@ -1987,14 +1747,10 @@ Joe Ramey: changed filelock.c rmailsum.el
 
 Joe Reiss: changed gnus-art.el
 
-Joe Vornehm Jr.: changed ido.el
-
 Joe Wells: wrote mail-extr.el resume.el
 and co-wrote apropos.el
 and changed arc-mode.el tex-mode.el
 
-Joel Bion: changed pcmpl-gnu.el
-
 Joel Boehland: co-wrote ob-clojure.el ob-lisp.el
 
 Joel N. Weber II: changed comint.el make-dist
@@ -2004,21 +1760,19 @@ Joel Ray Holveck: changed gnus-sum.el info.el
 Joev Dubach: changed nntp.el
 
 Johan Bockgård: changed erc.el cl-macs.el erc-backend.el erc-button.el
-  erc-match.el icomplete.el xdisp.c browse-url.el bytecomp.el custom.el
-  display.texi erc-compat.el erc-nickserv.el erc-ring.el erc-speak.el
-  erc-track.el help-fns.el mouse-sel.el simple.el subr.el xterm.el
-  and 54 other files
+  erc-match.el xdisp.c browse-url.el bytecomp.el custom.el display.texi
+  erc-compat.el erc-nickserv.el erc-ring.el erc-speak.el erc-track.el
+  help-fns.el icomplete.el mouse-sel.el simple.el subr.el xterm.el
+  and 48 other files
 
 Johan Euphrosine: changed ibuf-ext.el
 
 Johan Vromans: wrote forms-d2.el forms.el iso-acc.el
 and changed complete.el
 
-Johannes Weiner: changed browse-url.el keyboard.c configure.ac
+Johannes Weiner: changed browse-url.el keyboard.c configure.in
   lisp-mode.el lisp.h pp.el sound.c w32term.c xfaces.c xterm.c
 
-John Anthony: changed inf-lisp.el ruby-mode.el text-mode.el
-
 John Basrai: changed man.el
 
 John F. Carr: changed dired.c
@@ -2038,10 +1792,6 @@ John Hughes: changed term.c
 John J Foerch: changed display.texi erc-stamp.el org.el
   progmodes/compile.el
 
-John K. Luebs: changed org.el
-
-John Marino: changed configure.ac
-
 John Mongan: changed progmodes/f90.el
 
 John Paul Wallington: changed ibuffer.el ibuf-ext.el subr.el help-fns.el
@@ -2053,44 +1803,38 @@ John Sullivan: changed window.c
 
 John Tobey: changed gud.el
 
-John W. Eaton: co-wrote octave.el
+John W. Eaton: co-wrote octave-mod.el
+and changed octave-inf.el
 
-John Wiegley: wrote align.el automated/eshell.el cal-bahai.el em-alias.el
-  em-banner.el em-basic.el em-cmpl.el em-dirs.el em-glob.el em-hist.el
-  em-ls.el em-pred.el em-prompt.el em-rebind.el em-script.el em-smart.el
+John Wiegley: wrote align.el cal-bahai.el em-alias.el em-banner.el
+  em-basic.el em-cmpl.el em-dirs.el em-glob.el em-hist.el em-ls.el
+  em-pred.el em-prompt.el em-rebind.el em-script.el em-smart.el
   em-term.el em-unix.el em-xtra.el erc-identd.el esh-arg.el esh-cmd.el
   esh-ext.el esh-io.el esh-mode.el esh-module.el esh-opt.el esh-proc.el
   esh-util.el esh-var.el eshell/eshell.el eudcb-mab.el isearchb.el
   org-attach.el org-crypt.el org-habit.el pcmpl-cvs.el pcomplete.el
-  remember.el timeclock.el
-and co-wrote org-pcomplete.el
+  remember.el test/eshell.el timeclock.el
+and co-wrote org-mac-message.el org-pcomplete.el
 and changed org-clock.el org-agenda.el erc-chess.el org.el erc.el
-  iswitchb.el ido.el alloc.c allout.el auth-source.el cal-menu.el
+  iswitchb.el ido.el esh-test.el Makefile.in allout.el cal-menu.el
   calendar.el desktop.el diary-lib.el erc-bbdb.el erc-button.el
   erc-complete.el erc-fill.el erc-ibuffer.el erc-list.el erc-match.el
-  and 22 other files
+  and 19 other files
 
 John Williams: changed etags.el
 
 John Yates: changed hideshow.el
 
-Jon Anders Skorpen: changed ox-publish.el
+Jon Anders Skorpen: changed org-publish.el
 
 Jon Ericson: changed gnus.el spam-report.el
 
 Jon K Hellan: wrote utf7.el
 
-Jonas Bernoulli: changed eieio.el button.el lisp-mnt.el tabulated-list.el
-  tips.texi
-
-Jonas Hoersch: changed org-inlinetask.el org.el
-
-Jonathan I. Kamens: changed pop.c movemail.c rmail.el configure.ac b2m.pl
-  lib-src/Makefile.in Makefile.in config.in files.el pop.h terminal.el
-  vc.el gnus-sum.el jka-compr.el rmailout.el rnewspost.el sendmail.el
-  simple.el timezone.el vc-hooks.el
-
-Jonathan Leech-Pepin: wrote ox-texinfo.el
+Jonathan I. Kamens: changed pop.c movemail.c rmail.el Makefile.in
+  configure.in b2m.pl config.in files.el pop.h terminal.el vc.el
+  gnus-sum.el jka-compr.el rmailout.el rnewspost.el sendmail.el simple.el
+  timezone.el vc-hooks.el
 
 Jonathan Marchand: changed cpp-root.el
 
@@ -2102,35 +1846,29 @@ Jonathan Vail: changed vc.el
 
 Jonathan Yavner: wrote ses.el tcover-ses.el tcover-unsafep.el
   testcover.el unsafep.el
-and changed ses.texi ses-example.ses edebug.el editfns.c files.el
-  functions.texi misc/Makefile.in subr.el variables.texi
+and changed ses.texi ses-example.ses Makefile.in edebug.el editfns.c
+  files.el functions.texi subr.el variables.texi
 
-Joost Diepenmaat: changed org.el
-
-Jorgen Schäfer: wrote erc-autoaway.el erc-goodies.el erc-spelling.el
+Jorgen Schaefer: wrote erc-autoaway.el erc-goodies.el erc-spelling.el
 and changed erc.el erc-track.el erc-backend.el erc-match.el erc-stamp.el
-  erc-button.el erc-fill.el erc-members.el erc-truncate.el erc-compat.el
-  Makefile erc-dcc.el erc-ibuffer.el erc-macs.el erc-page.el
-  erc-pcomplete.el erc-sound.el minibuffer.el erc-bbdb.el erc-imenu.el
-  erc-lang.el and 10 other files
+  erc-button.el erc-fill.el erc-truncate.el erc-compat.el erc-members.el
+  erc-dcc.el erc-ibuffer.el erc-page.el erc-pcomplete.el erc-sound.el
+  erc-bbdb.el erc-imenu.el erc-lang.el erc-list.el erc-macs.el
+  erc-menu.el and 8 other files
 
 Jose A. Ortega Ruiz: changed gnus-sum.el
 
 Jose E. Marchesi: changed ada-mode.el gomoku.el simple.el smtpmail.el
 
-Jose Marino: changed idlw-shell.el
-
 Joseph Arceneaux: wrote xrdb.c
 and changed xterm.c xfns.c keyboard.c screen.c dispnew.c xdisp.c window.c
   x-win.el fileio.c buffer.c xterm.h minibuf.c editfns.c lread.c
   process.c alloc.c buffer.h files.el screen.el insdel.c emacs.c
   and 106 other files
 
-Joseph M. Kelsey: changed fileio.c skeleton.el
+Joseph M. Kelsey: changed dir.h fileio.c skeleton.el
 
-Josh Elsasser: changed configure.ac
-
-Josh Feinstein: changed erc-join.el erc.el
+Josh Elsasser: changed configure.in
 
 Josh Huber: changed mml-sec.el mml.el message.el gnus-msg.el mml2015.el
   nnmail.el ChangeLog ChangeLog.1 gnus-cite.el gnus-delay.el gnus-spec.el
@@ -2144,23 +1882,17 @@ Jouni K. Seppänen: changed gnus.texi nnimap.el mm-url.el
 
 João Cachopo: changed spam.el
 
-João Távora: wrote elec-pair.el electric-tests.el
-and changed electric.el emacs.texi lisp-mode.el progmodes/python.el
-  python-tests.el shr.el simple.el tex-mode.el tls.el vc.el
-
 Juan León Lahoz García: wrote wdired.el
 and changed files.el perl-mode.el
 
 Juan Pechiar: wrote ob-mscgen.el
 and changed ob-octave.el
 
-Juanma Barranquero: wrote emacs-lock.el frameset.el
-and changed src/makefile.w32-in subr.el desktop.el config.nt w32fns.c
-  lib-src/makefile.w32-in server.el emacsclient.c files.el simple.el
-  bs.el faces.el help-fns.el org.el w32term.c xdisp.c buffer.c keyboard.c
-  w32.c ido.el makefile.w32-in and 1130 other files
-
-Juergen Hoetzel: wrote tramp-adb.el
+Juanma Barranquero: wrote emacs-lock.el
+and changed makefile.w32-in subr.el w32fns.c files.el server.el bs.el
+  emacsclient.c help-fns.el faces.el org.el simple.el buffer.c xdisp.c
+  keyboard.c desktop.el process.c w32term.c window.c ido.el w32.c
+  allout.el and 1089 other files
 
 Juergen Kreileder: changed imap.el nnimap.el
 
@@ -2168,19 +1900,19 @@ Juergen Nickelsen: wrote ws-mode.el
 
 Julian Gehring: changed org.texi orgcard.tex
 
-Julian Scheid: changed tramp.el color.el
+Julian Scheid: changed tramp.el
 
 Julien Avarre: changed gnus-fun.el
 
 Julien Barnier: changed ob-comint.el ob-sh.el org.el
 
-Julien Danjou: wrote erc-desktop-notifications.el gnus-gravatar.el
-  gnus-notifications.el gravatar.el notifications.el shr-color.el
+Julien Danjou: wrote gnus-gravatar.el gravatar.el notifications.el
+  shr-color.el
 and co-wrote color.el
-and changed shr.el org-agenda.el gnus-art.el nnimap.el gnus-html.el
-  gnus.el message.el gnus-group.el gnus-sum.el gnus-util.el mm-decode.el
-  mm-view.el org.el gnus.texi nnir.el sieve-manage.el mm-uu.el
-  color-lab.el gnus-demon.el gnus-int.el gnus-msg.el and 96 other files
+and changed shr.el org-agenda.el gnus-art.el gnus-html.el gnus.el
+  mm-decode.el gnus-group.el gnus-util.el message.el org.el gnus-sum.el
+  gnus.texi mm-view.el nnimap.el mm-uu.el nnir.el sieve-manage.el
+  color-lab.el url-cache.el auth-source.el gnus-ems.el and 82 other files
 
 Julien Gilles: wrote gnus-ml.el
 
@@ -2189,30 +1921,24 @@ Junio Hamano: changed window.el
 Jure Cuhalev: changed ispell.el
 
 Juri Linkov: wrote files-x.el misearch.el occur-tests.el
-and changed isearch.el info.el replace.el simple.el dired-aux.el
-  progmodes/grep.el dired.el progmodes/compile.el startup.el faces.el
-  files.el menu-bar.el display.texi descr-text.el bindings.el desktop.el
-  image-mode.el cus-edit.el ispell.el man.el comint.el
-  and 355 other files
+and changed info.el isearch.el simple.el replace.el progmodes/grep.el
+  dired-aux.el progmodes/compile.el dired.el startup.el faces.el files.el
+  display.texi menu-bar.el descr-text.el bindings.el cus-edit.el
+  image-mode.el ispell.el man.el dired-x.el log-view.el
+  and 338 other files
 
 Justin Bogner: changed fortune.el
 
-Justin Gordon: changed ox-md.el
-
 Justin Sheehy: changed gnus-sum.el nntp.el
 
-Justus Piater: changed org-agenda.el smtpmail.el
+Justus Piater: changed smtpmail.el
 
-Jérémie Courrèges-Anglas: changed org.texi ox-latex.el
+Jérémy Compostella: changed battery.el windmove.el window.el
 
-Jérémy Compostella: changed battery.el keyboard.c windmove.el window.el
-  xdisp.c
+Jérôme Marant: changed Makefile.in make-dist bindings.el configure.in
+  emacsclient.c misc.texi
 
-Jérôme Marant: changed make-dist Makefile.in bindings.el configure.ac
-  emacsclient.c leim/Makefile.in misc.texi
-
-Jürgen Hötzel: changed tramp-adb.el comint.el em-unix.el esh-util.el
-  tramp.el url-handlers.el wid-edit.el
+Jürgen Hötzel: changed comint.el url-handlers.el wid-edit.el
 
 K. Shane Hartman: wrote chistory.el echistory.el electric.el emacsbug.el
   helper.el picture.el view.el
@@ -2226,32 +1952,30 @@ Kahlil Hodgson: changed timeclock.el
 Kai Großjohann: wrote gnus-delay.el nnir.el tramp-uu.el trampver.el
 and co-wrote longlines.el tramp-sh.el tramp.el
 and changed message.el gnus-agent.el gnus-sum.el files.el nnmail.el
-  tramp.texi nntp.el gnus.el simple.el ange-ftp.el dired.el paragraphs.el
-  bindings.el files.texi gnus-art.el gnus-group.el man.el INSTALL
-  Makefile.in crisp.el fileio.c and 45 other files
-
-Kai Tetzlaff: changed ox-publish.el url-http.el
+  tramp.texi nntp.el gnus.el simple.el ange-ftp.el Makefile.in dired.el
+  paragraphs.el bindings.el files.texi gnus-art.el gnus-group.el man.el
+  INSTALL crisp.el fileio.c and 45 other files
 
-Kailash C. Chowksey: changed HELLO ind-util.el kannada.el knd-util.el
-  lisp/Makefile.in loadup.el makefile.w32-in
+Kai Tetzlaff: changed org-publish.el url-http.el
 
-Kalle Kankare: changed image.c
+Kailash C. Chowksey: changed HELLO Makefile.in ind-util.el kannada.el
+  knd-util.el loadup.el makefile.w32-in
 
 Kalle Olavi Niemitalo: changed keyboard.c
 
 Kan-Ru Chen: changed nnir.el ecomplete.el gnus-diary.el gnus.texi
-  ibuf-ext.el nnmbox.el nroff-mode.el
+  nroff-mode.el
 
 Kanematsu Daiji: changed nnimap.el
 
-Karel Klíč: changed fileio.c files.el configure.ac eval.c ftfont.c lisp.h
-  src/Makefile.in text.texi tramp.el
+Karel Klíč: changed fileio.c files.el Makefile.in configure.in eval.c
+  ftfont.c lisp.h text.texi tramp.el
 
-Karl Berry: changed info.texi emacs.texi elisp.texi text.texi anti.texi
-  display.texi efaq.texi ada-mode.texi autotype.texi calc.texi
-  cc-mode.texi cl.texi dired-x.texi ebrowse.texi ediff.texi
-  emacs-mime.texi emacs-xtra.texi eshell.texi eudc.texi filelock.c
-  forms.texi and 94 other files
+Karl Berry: changed emacs.texi info.texi elisp.texi text.texi anti.texi
+  display.texi emacs-xtra.texi faq.texi filelock.c gnu.texi macos.texi
+  minibuf.texi mule.texi processes.texi texinfo.tex ada-mode.texi
+  autotype.texi building.texi calc.texi cc-mode.texi cl.texi
+  and 93 other files
 
 Karl Chen: changed files.el align.el cc-vars.el emacsclient.c gnus-art.el
   help-mode.el jka-cmpr-hook.el make-mode.el perl-mode.el
@@ -2263,13 +1987,13 @@ Karl Eichwalder: changed Makefile.in add-log.el bookmark.el dired-aux.el
 Karl Fogel: wrote bookmark.el mail-hist.el saveplace.el
 and changed files.el doc-view.el image-mode.el info.el simple.el INSTALL
   autogen.sh isearch.el menu-bar.el thingatpt.el INSTALL.REPO configure
-  configure.ac editfns.c gnus-bookmark.el gnus-msg.el gnus-sum.el man.el
+  configure.in editfns.c gnus-bookmark.el gnus-msg.el gnus-sum.el man.el
   nnmail.el org-agenda.el vc-svn.el and 4 other files
 
 Karl Heuer: changed keyboard.c lisp.h xdisp.c buffer.c xfns.c xterm.c
-  alloc.c files.el frame.c configure.ac window.c data.c minibuf.c
-  editfns.c fns.c process.c Makefile.in fileio.c simple.el keymap.c
-  indent.c and 446 other files
+  alloc.c files.el frame.c window.c configure.in Makefile.in data.c
+  minibuf.c editfns.c fns.c process.c fileio.c simple.el keymap.c
+  indent.c and 444 other files
 
 Karl Kleinpaste: changed gnus-sum.el gnus-art.el gnus-picon.el
   gnus-score.el gnus-uu.el gnus-xmas.el gnus.el mm-uu.el mml.el nnmail.el
@@ -2285,10 +2009,10 @@ Karl Pflästerer: changed gnus-art.el gnus-score.el mml.el spam-stat.el
 Katsuhiro Hermit Endo: changed gnus-group.el gnus-spec.el
 
 Katsumi Yamaoka: wrote canlock.el
-and changed gnus-art.el message.el gnus-sum.el gnus.texi mm-decode.el
-  mm-util.el gnus-msg.el gnus-util.el mm-view.el mml.el gnus-group.el
-  rfc2047.el gnus-start.el gnus.el shr.el nntp.el gnus-agent.el nnrss.el
-  nnmail.el mm-uu.el gnus-html.el and 147 other files
+and changed gnus-art.el gnus-sum.el message.el gnus.texi mm-decode.el
+  mm-util.el mm-view.el gnus-group.el mml.el rfc2047.el gnus-util.el
+  gnus-start.el gnus-msg.el gnus.el shr.el nntp.el gnus-agent.el nnrss.el
+  mm-uu.el nnmail.el gnus-html.el and 135 other files
 
 Kaushik Srenevasan: changed gdb-mi.el
 
@@ -2296,8 +2020,7 @@ Kaveh R. Ghazi: changed delta88k.h xterm.c
 
 Kayvan Sylvan: changed supercite.el
 
-Kazuhiro Ito: changed coding.c flow-fill.el font.c keyboard.c
-  make-mode.el starttls.el xdisp.c
+Kazuhiro Ito: changed coding.c flow-fill.el
 
 Kazushi Marukawa: changed filelock.c hexl.c profile.c unexalpha.c
 
@@ -2311,12 +2034,9 @@ Keith Gabryelski: wrote hexl.c hexl.el
 
 Keith Packard: changed font.c
 
-Kelly Dean: changed simple.el fileio.c help-macro.el
-
-Ken Brown: changed configure.ac gmalloc.c sheap.c cygwin.h browse-url.el
-  emacs.c emacs.rc dispextern.h frame.c src/Makefile.in unexcw.c
-  vm-limit.c w32term.c xgselect.c CPP-DEFINES alloc.c callproc.c
-  conf_post.h config.nt dired.c fileio.c and 12 other files
+Ken Brown: changed configure.in cygwin.h sheap.c browse-url.el gmalloc.c
+  vm-limit.c callproc.c dired.c emacs.c fileio.c gdb-mi.el loadup.el
+  mem-limits.h unexcw.c
 
 Ken Brush: changed emacsclient.c
 
@@ -2327,28 +2047,24 @@ and changed pgg-gpg.el pgg.el progmodes/python.el locked-encrypted.png
   locked-encrypted.xpm pgg-pgp.el pgg-pgp5.el unlocked-encrypted.png
   unlocked-encrypted.xpm README edebug.el pgg.texi tips.texi
 
-Ken Olum: changed message.el
-
-Ken Raeburn: changed lisp.h lread.c alloc.c buffer.c fns.c keyboard.c
-  minibuf.c coding.c editfns.c fileio.c keymap.c xdisp.c configure.ac
-  emacs.c undo.c xfns.c xterm.c charset.h coding.h fontset.c process.c
-  and 97 other files
+Ken Raeburn: changed lisp.h lread.c Makefile.in alloc.c buffer.c fns.c
+  keyboard.c minibuf.c coding.c editfns.c fileio.c keymap.c xdisp.c
+  configure.in emacs.c undo.c xfns.c xterm.c charset.h coding.h fontset.c
+  and 93 other files
 
 Ken Stevens: wrote ispell.el
 
-Kenichi Handa: wrote composite.el decoder-tests.el isearch-x.el
-  language/cyrillic.el ps-bdf.el py-punct.el pypunct-b5.el thai-word.el
+Kenichi Handa: wrote composite.el isearch-x.el language/cyrillic.el
+  ps-bdf.el py-punct.el pypunct-b5.el thai-word.el
 and co-wrote ps-def.el ps-mule.el ps-print.el ps-samp.el quail.el
 and changed coding.c mule-cmds.el mule.el fontset.c charset.c xdisp.c
-  font.c fontset.el xterm.c fileio.c mule-conf.el characters.el fns.c
-  ftfont.c mule-diag.el coding.h charset.h ccl.c xfaces.c editfns.c
-  composite.c and 392 other files
+  fontset.el font.c xterm.c Makefile.in fileio.c mule-conf.el
+  characters.el fns.c ftfont.c mule-diag.el charset.h ccl.c coding.h
+  xfaces.c editfns.c and 388 other files
 
 Kenichi Okada: co-wrote sasl-cram.el sasl-digest.el
 
-Kenjiro Nakayama: changed eww.el
-
-Kenneth Stailey: changed alpha.h configure.ac ns32000.h openbsd.h pmax.h
+Kenneth Stailey: changed alpha.h configure.in ns32000.h openbsd.h pmax.h
   sparc.h unexalpha.c unexelf.c
 
 Kentaro Ohkouchi: changed emacs.png README emacs.ico emacs.svg
@@ -2380,19 +2096,19 @@ and changed gnus-agent.el gnus-sum.el gnus-start.el gnus-int.el nntp.el
   nnagent.el nnheader.el gnus-async.el gnus-registry.el gnus-salt.el
   gnus-uu.el and 3 other files
 
-Kevin Layer: changed mml.el w32proc.c
+Kevin Layer: changed w32proc.c
 
-Kevin Rodgers: changed compile.el mailabbrev.el progmodes/compile.el
-  dired-x.el files.el ange-ftp.el byte-opt.el desktop.el diff-mode.el
+Kevin Rodgers: changed compile.el mailabbrev.el dired-x.el files.el
+  progmodes/compile.el ange-ftp.el byte-opt.el desktop.el diff-mode.el
   dired-x.texi ffap.el files.texi flyspell.el isearch.el killing.texi
   lisp.el loadhist.el mailalias.el menu-bar.el print.c progmodes/grep.el
   and 8 other files
 
 Kevin Ryde: wrote info-xref.el
 and changed info-look.el info.el checkdoc.el cl.texi compilation.txt
-  etags.c arc-mode.el ffap.el gnus-art.el gnus-sum.el mule.el os.texi
-  progmodes/compile.el woman.el MORE.STUFF browse-url.el copyright.el
-  dig.el flyspell.el keyboard.c mailcap.el and 85 other files
+  arc-mode.el ffap.el gnus-art.el gnus-sum.el mule.el os.texi
+  progmodes/compile.el MORE.STUFF browse-url.el copyright.el dig.el
+  etags.c flyspell.el keyboard.c mailcap.el man.el and 80 other files
 
 Kim F. Storm: wrote bindat.el cua-base.el cua-gmrk.el cua-rect.el ido.el
   keypad.el kmacro.el
@@ -2407,16 +2123,14 @@ Kim-Minh Kaplan: changed gnus-picon.el gnus-sum.el gnus-start.el
 
 Kimit Yada: changed copyright.el
 
-Kirill A. Korinskiy: changed fortune.el
-
-Kirk Kelsey: changed make-mode.el vc-hg.el
+Kirk Kelsey: changed make-mode.el
 
 Kishore Kumar: changed terminal.el
 
 Klaus Straubinger: changed url-http.el url-history.el pcmpl-rpm.el
   url-cookie.el url.el
 
-Klaus Zeitler: changed configure.ac files.el sh-script.el vcursor.el
+Klaus Zeitler: changed configure.in files.el sh-script.el vcursor.el
 
 Knut Anders Hatlen: changed nnimap.el imap.el
 
@@ -2426,8 +2140,6 @@ and changed hanja.el hangul.el hangul3.el hanja-jis.el symbol-ksc.el
 Kobayashi Yasuhiro: changed w32fns.c configure.bat indent.c info.el
   w32term.c w32term.h window.c xfns.c
 
-Kodi Arfer: changed org.texi ox-html.el
-
 Konrad Hinsen: wrote org-eshell.el
 and changed ob-python.el
 
@@ -2437,8 +2149,9 @@ Kristoffer Grönlund: wrote wombat-theme.el
 
 Kurt B. Kaiser: changed message.el
 
-Kurt Hornik: co-wrote octave.el
-and changed battery.el ielm.el octave-hlp.el octave-mode.texi term.el
+Kurt Hornik: wrote octave-inf.el
+and co-wrote octave-mod.el
+and changed battery.el ielm.el octave-hlp.el term.el
 
 Kurt Swanson: changed gnus-art.el gnus-salt.el gnus-sum.el gnus-ems.el
   gnus-group.el gnus-msg.el gnus-score.el gnus-util.el nnmail.el window.c
@@ -2451,15 +2164,13 @@ Kyotaro Horiguchi: changed coding.c indent.c
 Károly Lőrentey: changed xfns.c bindings.el keyboard.c menu-bar.el
   buffer.c coding.c frame.el print.c rxvt.el simple.el spam.el sysdep.c
   x-win.el xdisp.c xt-mouse.el xterm.c xterm.h .gdbinit AT386.el HELLO
-  README and 101 other files
-
-Laimonas Vėbra: changed european.el
+  Makefile.in and 101 other files
 
 Lara Rios: co-wrote cal-menu.el
 
 Lars Balker Rasmussen: changed gnus-art.el gnus-agent.el message.el
 
-Lars Brinkhoff: changed building.texi config.in configure.ac editfns.c
+Lars Brinkhoff: changed building.texi config.in configure.in editfns.c
   fns.c os.texi
 
 Lars Hansen: changed desktop.el tramp.el info.el mh-e.el dired-x.el
@@ -2472,26 +2183,26 @@ and co-wrote dabbrev.el imenu.el
 
 Lars Ljung: changed esh-ext.el
 
-Lars Magne Ingebrigtsen: wrote compface.el dns.el ecomplete.el eww.el
+Lars Magne Ingebrigtsen: wrote compface.el dns.el ecomplete.el
   format-spec.el gnus-agent.el gnus-art.el gnus-async.el gnus-bcklg.el
   gnus-cache.el gnus-demon.el gnus-draft.el gnus-dup.el gnus-eform.el
   gnus-ems.el gnus-fun.el gnus-group.el gnus-html.el gnus-int.el
   gnus-logic.el gnus-picon.el gnus-range.el gnus-salt.el gnus-spec.el
   gnus-srvr.el gnus-start.el gnus-sum.el gnus-undo.el gnus-util.el
   gnus-uu.el gnus-win.el ietf-drums.el mail-parse.el mail-prsvr.el
-  mail-source.el message.el messcompat.el mm-archive.el mm-view.el mml.el
-  netrc.el network-stream.el nnagent.el nndir.el nndraft.el nngateway.el
-  nnmail.el nnoo.el nntp.el nnweb.el qp.el rfc2045.el rfc2231.el rtree.el
-  score-mode.el shr.el spam.el url-domsuf.el url-queue.el zlib-tests.el
+  mail-source.el message.el messcompat.el mm-view.el mml.el netrc.el
+  network-stream.el nnagent.el nndir.el nndraft.el nngateway.el nnmail.el
+  nnoo.el nntp.el nnweb.el qp.el rfc2045.el rfc2231.el rtree.el
+  score-mode.el shr.el spam.el url-queue.el
 and co-wrote gnus-kill.el gnus-mh.el gnus-msg.el gnus-score.el
   gnus-topic.el gnus.el gssapi.el mailcap.el mm-bodies.el mm-decode.el
   mm-encode.el mm-util.el nnbabyl.el nndoc.el nneething.el nnfolder.el
   nnheader.el nnimap.el nnmbox.el nnmh.el nnml.el nnspool.el nnvirtual.el
   rfc2047.el time-date.el
-and changed gnus.texi gnus-cite.el smtpmail.el pop3.el gnus-xmas.el
-  auth-source.el proto-stream.el subr.el url-http.el dired.el simple.el
-  files.el image.c gnutls.c xml.c editfns.c nnrss.el nnultimate.el
-  gnus-nocem.el gnus-registry.el imap.el and 237 other files
+and changed gnus.texi gnus-cite.el pop3.el smtpmail.el gnus-xmas.el
+  auth-source.el proto-stream.el url-http.el gnutls.c subr.el xml.c
+  dired.el editfns.c nnultimate.el gnus-nocem.el imap.el nnkiboze.el
+  nnrss.el nnslashdot.el simple.el spam-report.el and 210 other files
 
 Lars Rasmusson: changed ebrowse.c
 
@@ -2500,10 +2211,11 @@ Lasse Rasinen: changed gnus-start.el
 Laurent Martelli: changed mm-decode.el
 
 Lawrence Mitchell: wrote erc-backend.el erc-log.el
-and changed erc.el ox-latex.el org.el ox.el erc-match.el erc-nets.el
-  erc-nickserv.el ox-html.el browse-url.el erc-button.el erc-compat.el
-  erc-dcc.el erc-fill.el erc-list.el erc-track.el ielm.el ob.el Makefile
-  cl-macs.el erc-autoaway.el erc-autojoin.el and 25 other files
+and changed erc.el org-latex.el org.el erc-match.el erc-nets.el
+  erc-nickserv.el org-exp.el browse-url.el erc-button.el erc-compat.el
+  erc-dcc.el erc-fill.el erc-list.el erc-track.el ielm.el ob.el
+  org-html.el cl-macs.el erc-autoaway.el erc-autojoin.el erc-bbdb.el
+  and 23 other files
 
 Lawrence R. Dodd: co-wrote dired-x.el
 and changed fortran.el ispell.el sendmail.el cmuscheme.el comint.el
@@ -2511,54 +2223,41 @@ and changed fortran.el ispell.el sendmail.el cmuscheme.el comint.el
   lisp.el man.el minibuf.c rcs2log rmail.el simple.el terminal.el
   text-mode.el tpu-edt.el and 3 other files
 
-Le Wang: changed org-src.el comint.el hilit-chg.el misc.el
-
 Leigh Stoller: changed emacsclient.c server.el
 
-Lennart Borgman: co-wrote ert-x.el
+Lennart Borgman: wrote ert-x.el org-freemind.el
 and changed nxml-mode.el tutorial.el window.el ada-xref.el buff-menu.el
   emacs-lisp/debug.el emacsclient.c filesets.el flymake.el help-fns.el
-  isearch.el linum.el lisp-mode.el lisp.el mouse.el recentf.el
-  remember.el replace.el ruby-mode.el shell.el texinfmt.el
-  and 3 other files
+  isearch.el linum.el lisp-mode.el mouse.el recentf.el remember.el
+  replace.el ruby-mode.el shell.el texinfmt.el w32term.c w32term.h
 
 Lennart Staflin: changed dired.el diary-ins.el diary-lib.el tq.el xdisp.c
 
-Leo Liu: wrote pcmpl-x.el
-and changed octave.el ido.el rcirc.el subr.el files.el simple.el
-  flymake.el smie.el abbrev.el eldoc.el progmodes/python.el
-  progmodes/compile.el register.el rng-valid.el bindings.el comint.el
-  diff-mode.el dired-x.el font-lock.el indent.el kmacro.el
-  and 129 other files
-
-Leo P. White: changed eieio-custom.el
+Leo Liu: changed rcirc.el ido.el abbrev.el makefile.w32-in subr.el
+  Makefile.in deps.mk diff-mode.el dnd.el em-hist.el erc.el files.el
+  fns.c font-lock.el footnote.el gl-comp.m4 gnulib.mk help-mode.el
+  iswitchb.el minibuf.c minibuffer.el and 62 other files
 
 Leonard H. Tower Jr.: changed rnews.el rnewspost.el emacsbug.el
   rmailout.el sendmail.el
 
-Leonard Randall: changed org-bibtex.el
-
-Levin Du: changed parse-time.el org-clock.el
+Levin Du: changed parse-time.el
 
-Lewis Perin: changed emacs-x86.manifest
+Lewis Perin: changed emacs.manifest
 
 Liam Healy: changed outline.el
 
-Liam Stitt: changed url-file.el url-vars.el
-
 Liang Wang: changed etags.el
 
 Litvinov Sergey: changed ob-maxima.el ob-octave.el
 
 Lloyd Zusman: changed mml.el pgg-gpg.el
 
-Lluís Vilanova: changed ede/linux.el
-
 Luc Teirlinck: wrote help-at-pt.el
 and changed files.el autorevert.el cus-edit.el subr.el simple.el
-  frames.texi startup.el display.texi files.texi dired.el comint.el
-  modes.texi custom.texi emacs.texi fns.c frame.el ielm.el minibuf.texi
-  variables.texi buffers.texi commands.texi and 215 other files
+  frames.texi startup.el display.texi files.texi Makefile.in dired.el
+  comint.el custom.texi emacs.texi fns.c frame.el ielm.el minibuf.texi
+  modes.texi variables.texi buffers.texi and 212 other files
 
 Luca Capello: changed mm-encode.el
 
@@ -2566,39 +2265,39 @@ Lucid, Inc.: changed byte-opt.el byte-run.el bytecode.c bytecomp.el
   delsel.el disass.el faces.el font-lock.el lmenu.el mailabbrev.el
   select.el xfaces.c xselect.c
 
-Ludovic Courtès: wrote nnregistry.el
-and changed configure.ac gnus.texi
-
-Luis Felipe López Acevedo: changed TUTORIAL.es
+Ludovic Courtes: changed nnregistry.el
 
-Luis R Anaya: co-wrote ox-man.el
+Ludovic Courtès: wrote nnregistry.el
+and changed gnus.texi
 
 Lukas Huonker: changed tetris.el
 
-Luke Lee: changed hideif.el
+Łukasz Demianiuk: changed erc.el
+
+Łukasz Stelmach: changed cookie1.el message.el org-agenda.el org-bbdb.el
+  org-exp.el org-html.el org.el
 
 Lute Kamstra: changed modes.texi emacs-lisp/debug.el generic-x.el
-  generic.el font-lock.el simple.el subr.el battery.el debugging.texi
-  easy-mmode.el elisp.texi emacs-lisp/generic.el hl-line.el info.el
-  octave.el basic.texi bindings.el calc.el cmdargs.texi diff-mode.el
-  doclicense.texi and 291 other files
+  generic.el font-lock.el simple.el subr.el Makefile.in battery.el
+  debugging.texi easy-mmode.el elisp.texi emacs-lisp/generic.el
+  hl-line.el info.el basic.texi bindings.el calc.el cmdargs.texi
+  diff-mode.el doclicense.texi and 291 other files
 
 Lynn Slater: wrote help-macro.el
 
 Maciek Pasternacki: changed nnrss.el
 
-Madan Ramakrishnan: changed org-agenda.el
-
-Magnus Henoch: changed url-http.el ispell.el url.el dbusbind.c
-  configure.ac dns.el nnmaildir.el url-gw.el url-parse.el url-proxy.el
-  autoinsert.el cl.texi cyrillic.el dbus.el gnus.texi hashcash.el image.c
-  log-edit.el message.el org-clock.el org-table.el and 13 other files
+Magnus Henoch: changed url-http.el ispell.el url.el dbusbind.c dns.el
+  url-gw.el url-parse.el url-proxy.el autoinsert.el cl.texi configure.in
+  dbus.el gnus.texi hashcash.el log-edit.el message.el org-clock.el
+  org-latex.el org-table.el process.c quail/cyrillic.el
+  and 10 other files
 
 Malcolm Purvis: changed spam-stat.el
 
 Manoj Srivastava: wrote manoj-dark-theme.el
 
-Manuel Giraud: changed ox-html.el ox-publish.el org.texi
+Manuel Giraud: changed org-html.el org-publish.el org.texi
 
 Manuel Gómez: changed speedbar.el
 
@@ -2621,15 +2320,13 @@ Marco Melgazzi: changed term.el
 
 Marco Walther: changed mips-siemens.h unexelfsni.c unexsni.c
 
-Marcus G. Daniels: changed xterm.c configure.ac lwlib-Xm.c lwlib.c
-  xdisp.c xfns.c dispnew.c src/Makefile.in xmenu.c alloc.c config.in
+Marcus G. Daniels: changed xterm.c configure.in lwlib-Xm.c lwlib.c
+  xdisp.c xfns.c Makefile.in dispnew.c xmenu.c alloc.c config.in
   editfns.c emacs.c frame.c frame.h irix5-0.h keyboard.c linux.h
   lwlib-Xm.h lwlib.h ntterm.c and 11 other files
 
 Marcus Harnisch: changed gnus-art.el
 
-Marcus Karlsson: changed image.c
-
 Marek Martin: changed nnfolder.el
 
 Marien Zwart: changed progmodes/python.el
@@ -2638,38 +2335,35 @@ Mario Lang: wrote erc-button.el erc-ibuffer.el erc-imenu.el erc-menu.el
   erc-netsplit.el erc-networks.el erc-notify.el erc-speedbar.el
   erc-stamp.el erc-track.el erc-xdcc.el
 and co-wrote erc-fill.el
-and changed erc.el erc-dcc.el erc-speak.el Makefile erc-bbdb.el
-  erc-complete.el erc-pcomplete.el erc-chess.el erc-list.el battery.el
-  erc-match.el erc-autojoin.el erc-nets.el erc-nickserv.el erc-ring.el
-  artist.el cpp-root.el db-el.el db-global.el db-javascript.el db.el
-  and 25 other files
+and changed erc.el erc-dcc.el erc-speak.el erc-bbdb.el erc-complete.el
+  erc-pcomplete.el erc-chess.el erc-list.el battery.el erc-match.el
+  erc-autojoin.el erc-nets.el erc-nickserv.el erc-ring.el artist.el
+  cpp-root.el db-el.el db-global.el db-javascript.el db.el diff.el
+  and 24 other files
 
 Mark A. Hershberger: changed xml.el nnrss.el mm-url.el cperl-mode.el
-  isearch.el vc-bzr.el  NXML-NEWS cc-mode.texi compilation.txt ede.texi
-  eieio.texi esh-mode.el flymake.el gnus-group.el misc/Makefile.in
-  misc/makefile.w32-in nxml-mode.texi progmodes/compile.el
+  isearch.el vc-bzr.el  Makefile.in NXML-NEWS cc-mode.texi
+  compilation.txt ede.texi eieio.texi esh-mode.el flymake.el
+  gnus-group.el makefile.w32-in nxml-mode.texi progmodes/compile.el
   progmodes/python.el programs.texi and 7 other files
 
 Mark D. Baushke: changed mh-e.el mh-utils.el mh-mime.el mh-comp.el
-  mh-search.el mh-customize.el Makefile mh-identity.el mh-seq.el
-  mh-speed.el mh-funcs.el mh-alias.el etags.c mh-junk.el mh-tool-bar.el
+  mh-search.el mh-customize.el mh-identity.el mh-seq.el mh-speed.el
+  mh-funcs.el mh-alias.el etags.c mh-junk.el mh-tool-bar.el
   mh-xemacs-compat.el pgg-gpg.el
 
-Mark Davies: changed amdx86-64.h configure configure.ac hp800.h
-  lib-src/Makefile.in netbsd.h ralloc.c sh3el.h sort.el
+Mark Davies: changed Makefile.in amdx86-64.h configure configure.in
+  hp800.h netbsd.h ralloc.c sh3el.h sort.el
 
 Mark Diekhans: changed files.el progmodes/compile.el subr.el
 
-Mark E. Shoulson: changed org.el org-entities.el
-
 Mark H. Weaver: changed comint.el
 
 Mark Hood: changed gnus-uu.el
 
 Mark Lambert: changed process.c process.h
 
-Mark Lillibridge: changed rmail.el mail-utils.el mail/rmailmm.el
-  unrmail.el
+Mark Lillibridge: changed rmail.el mail-utils.el unrmail.el
 
 Mark Mitchell: changed font-lock.el
 
@@ -2679,6 +2373,8 @@ Mark Osbourne: changed hexl-mode.el
 
 Mark Plaksin: changed nnrss.el term.el
 
+Mark Shoulson: changed org.el
+
 Mark Thomas: changed flow-fill.el gnus-sum.el gnus-util.el nnmail.el
 
 Mark Triggs: changed nnir.el
@@ -2693,8 +2389,6 @@ Markus Armbruster: changed avoid.el
 
 Markus Gritsch: changed ebrowse.el
 
-Markus Hauck: changed org-agenda.el
-
 Markus Heiser: changed gud.el
 
 Markus Heritsch: co-wrote ada-mode.el ada-stmt.el ada-xref.el
@@ -2702,11 +2396,11 @@ Markus Heritsch: co-wrote ada-mode.el ada-stmt.el ada-xref.el
 Markus Holmberg: changed thingatpt.el
 
 Markus Rost: wrote cus-test.el
-and changed cus-edit.el files.el progmodes/compile.el rmail.el
-  tex-mode.el find-func.el rmailsum.el simple.el cus-dep.el dired.el
-  mule-cmds.el rmailout.el checkdoc.el configure.ac custom.el emacsbug.el
-  gnus.el help-fns.el ls-lisp.el mwheel.el sendmail.el
-  and 126 other files
+and changed cus-edit.el Makefile.in files.el progmodes/compile.el
+  rmail.el tex-mode.el find-func.el rmailsum.el simple.el cus-dep.el
+  dired.el mule-cmds.el rmailout.el checkdoc.el configure.in custom.el
+  emacsbug.el gnus.el help-fns.el ls-lisp.el mwheel.el
+  and 122 other files
 
 Markus Sauermann: changed lisp-mode.el
 
@@ -2719,7 +2413,6 @@ and changed bytecomp.el byte-opt.el doctor.el image-mode.el
 Marshall T. Vandegrift: changed gnus-fun.el
 
 Martin Blais: co-wrote rst.el
-and changed progmodes/compile.el
 
 Martin Boyer: changed bibtex.el menu-bar.el
 
@@ -2732,24 +2425,24 @@ Martin Kretzschmar: changed gnus-spec.el gnus-sum.el
 Martin Larose: changed message.el
 
 Martin Lorentzon: wrote vc-annotate.el
-and changed vc.el vc-cvs.el vc-rcs.el vc-sccs.el vc-hooks.el
+and changed vc.el vc-cvs.el vc-hooks.el vc-rcs.el vc-sccs.el
 
 Martin Neitzel: changed supercite.el
 
 Martin Pohlack: changed iimage.el pc-select.el
 
-Martin Rudalics: changed window.el window.c windows.texi frame.c xdisp.c
-  help.el w32term.c xterm.c buffer.c w32fns.c cus-start.el dired.el
-  window.h frame.el files.el mouse.el subr.el xfns.c buffers.texi
-  cus-edit.el display.texi and 165 other files
+Martin Rudalics: changed window.el window.c windows.texi frame.c buffer.c
+  help.el window.h cus-start.el frame.el cus-edit.el files.el
+  buffers.texi dired.el subr.el add-log.el xdisp.c font-lock.el
+  help-fns.el lisp.h mouse.el wid-edit.el and 137 other files
 
 Martin Stjernholm: wrote cc-bytecomp.el
 and co-wrote cc-align.el cc-cmds.el cc-compat.el cc-defs.el cc-engine.el
   cc-fonts.el cc-langs.el cc-menus.el cc-mode.el cc-styles.el cc-vars.el
-and changed cc-fix.el nnimap.el cc-guess.el cc-mode-19.el cc-mode.texi
-  lisp/Makefile.in ack.texi awk-mode.el cc-awk.el cc-lobotomy.el
-  cc-make.el cc-subword.el files.el generic-x.el gnus-agent.el
-  gnus-art.el gnus-demon.el mm-decode.el simple.el
+and changed cc-fix.el cc-mode.texi Makefile.in cc-guess.el cc-mode-19.el
+  nnimap.el ack.texi awk-mode.el cc-awk.el cc-lobotomy.el cc-make.el
+  cc-style.el cc-subword.el files.el generic-x.el gnus-agent.el
+  gnus-art.el mm-decode.el simple.el
 
 Martin Svenson: changed progmodes/python.el
 
@@ -2766,15 +2459,12 @@ and co-wrote gnus-kill.el gnus-mh.el gnus-msg.el gnus.el nnbabyl.el
   nnspool.el nnvirtual.el time-date.el
 and changed gnuspost.el
 
-Masashi Fujimoto: changed battery.el
-
-Masatake Yamato: wrote add-log-tests.el imenu-test.el ld-script.el
-  subword.el
+Masatake Yamato: wrote ld-script.el subword.el
 and co-wrote cc-guess.el
 and changed etags.el asm-mode.el hexl.el xdisp.c bindings.el man.el
   xfaces.c simple.el vc.el wid-edit.el add-log.el etags.c faces.el
-  pcvs.el progmodes/compile.el register.el ruler-mode.el sh-script.el
-  buffer.c cc-langs.el cus-face.el and 79 other files
+  pcvs.el progmodes/compile.el register.el ruler-mode.el buffer.c
+  cc-langs.el cus-face.el dired-x.el and 73 other files
 
 Masayuki Ataka: changed texinfmt.el texinfo.el characters.el cmuscheme.el
   make-mode.el
@@ -2784,13 +2474,9 @@ Masayuki Fujii: changed dnd.el w32-win.el
 Mathias Dahl: wrote image-dired.el
 and changed tumme.el dired.el dired.texi
 
-Mathias Megyei: changed lisp/Makefile.in
-
-Mats Lidell: changed TUTORIAL.sv european.el gnus-art.el org-element.el
+Mathias Megyei: changed Makefile.in
 
-Matt Armstrong: changed gnus-topic.el gnus.el imap.el message.el
-
-Matt Fidler: changed package.el
+Mats Lidell: changed TUTORIAL.sv european.el gnus-art.el
 
 Matt Hodges: changed textmodes/table.el faces.el iswitchb.el simple.el
   tmm.el cal-menu.el calendar.el calendar.texi diary-lib.el easymenu.el
@@ -2798,9 +2484,6 @@ Matt Hodges: changed textmodes/table.el faces.el iswitchb.el simple.el
   locate.el paragraphs.el pcomplete.el repeat.el and 3 other files
 
 Matt Lundin: changed org-agenda.el org-bibtex.el org-footnote.el org.el
-  org-bbdb.el org-datetree.el org-gnus.el
-
-Matt McClure: changed progmodes/python.el
 
 Matt Pharr: changed message.el
 
@@ -2811,9 +2494,7 @@ Matt Swift: changed dired.el editfns.c lisp-mode.el mm-decode.el
 
 Matthew Junker: changed cal-tex.el
 
-Matthew Leach: changed font-lock.el
-
-Matthew Luckie: changed configure.ac
+Matthew Luckie: changed configure.in
 
 Matthew Mundell: changed calendar.texi diary-lib.el files.texi
   type-break.el debugging.texi display.texi edebug.texi editfns.c eval.c
@@ -2821,42 +2502,30 @@ Matthew Mundell: changed calendar.texi diary-lib.el files.texi
   objects.texi os.texi positions.texi searching.texi subr.el text.texi
   and 3 other files
 
-Matthias Dahl: changed faces.el
-
 Matthias Förste: changed files.el
 
-Matthias Meulien: changed bookmark.el buff-menu.el tabify.el vc-dir.el
-
 Matthias Wiehl: changed gnus.el
 
 Matthieu Devin: wrote delsel.el
 
 Matthieu Moy: changed gnus-msg.el message.el
 
-Max Mikhanosha: changed org-agenda.el org-habit.el org.el
-
 Maxime Edouard Robert Froumentin: changed gnus-art.el mml.el
 
-Memnon Anon: changed org.texi
-
-Micah Anderson: changed spook.lines
-
-Michael Albinus: wrote dbus-tests.el dbus.el file-notify-tests.el
-  filenotify.el secrets.el tramp-cmds.el tramp-compat.el tramp-ftp.el
-  tramp-gvfs.el tramp-gw.el tramp-smb.el tramp-tests.el xesam.el
+Michael Albinus: wrote dbus.el secrets.el tramp-cmds.el tramp-compat.el
+  tramp-ftp.el tramp-gvfs.el tramp-gw.el tramp-smb.el xesam.el
   zeroconf.el
 and co-wrote tramp-cache.el tramp-sh.el tramp.el
-and changed tramp.texi dbusbind.c trampver.texi trampver.el ange-ftp.el
-  dbus.texi tramp-adb.el tramp-fish.el files.el autorevert.el files.texi
-  tramp-imap.el notifications.el tramp-vc.el configure.ac
-  lisp/Makefile.in tramp-uu.el em-unix.el keyboard.c simple.el
-  tramp-util.el and 101 other files
+and changed tramp.texi dbusbind.c trampver.texi dbus.texi trampver.el
+  ange-ftp.el tramp-fish.el files.el files.texi tramp-imap.el Makefile.in
+  tramp-vc.el tramp-util.el tramp-uu.el notifications.el simple.el
+  auth-source.el dired-aux.el configure.in em-unix.el fileio.c
+  and 66 other files
 
-Michael Ben-Gershon: changed acorn.h configure.ac riscix1-1.h riscix1-2.h
+Michael Ben-Gershon: changed acorn.h configure.in riscix1-1.h riscix1-2.h
   unexec.c
 
-Michael Brand: changed org.texi org-table.el org.el org-agenda.el
-  org-capture.el ob-tangle.el org-feed.el org-id.el org-list.el
+Michael Brand: changed org.el org-agenda.el org.texi org-table.el
 
 Michael D. Ernst: wrote reposition.el
 and changed dired-x.el uniquify.el ispell.el bibtex.el rmail.el dired.el
@@ -2869,24 +2538,18 @@ and changed tex-mode.el
 
 Michael Downes: changed gnus-sum.el
 
-Michael Gauland: co-wrote ob-scheme.el
-and changed ebnf2ps.el org-src.el
-
 Michael Gschwind: wrote iso-cvt.el
 
 Michael Harnois: changed nnimap.el
 
-Michael Heerdegen: changed dired.el eldoc.el wdired.el
-
-Michael Hoffman: changed term.el
-
 Michael Hotchin: changed progmodes/compile.el
 
 Michael I. Bushnell: changed rmail.el simple.el callproc.c gnu.h gnus.el
   lread.c process.c screen.el search.c sendmail.el startup.el timer.c
 
-Michael K. Johnson: changed configure.ac emacs.c process.c sysdep.c
-  syssignal.h systty.h unexcoff.c
+Michael K. Johnson: changed configure.in emacs.c intel386.h linux.h
+  mem-limits.h process.c sysdep.c syssignal.h systty.h template.h
+  unexcoff.c
 
 Michael Kifer: wrote ediff-diff.el ediff-help.el ediff-hook.el
   ediff-init.el ediff-merg.el ediff-mult.el ediff-ptch.el ediff-util.el
@@ -2894,28 +2557,28 @@ Michael Kifer: wrote ediff-diff.el ediff-help.el ediff-hook.el
   viper-init.el viper-keym.el viper-macs.el viper-mous.el viper-util.el
   viper.el
 and co-wrote cal-x.el
-and changed viper*.el ediff*.el viper.texi ediff.texi ediff-merge.el
-  menu-bar.el appt.el desktop.el ediff-meta.el viper-mouse.el
-
-Michael Marchionna: changed nsterm.m
+and changed viper*.el ediff*.el viper.texi ediff.texi ediff-hooks.el
+  ediff-merge.el menu-bar.el appt.el desktop.el ediff-meta.el
+  viper-mouse.el
 
-Michael Markert: changed ob.el org-agenda.el org-docbook.el org-table.el
-  org.el ox-ascii.el ox-html.el ox-latex.el
+Michael Markert: changed ob.el org-agenda.el org-ascii.el
+  org-contacts-wl.el org-docbook.el org-html.el org-latex.el org-table.el
+  org.el
 
 Michael McNamara: co-wrote verilog-mode.el
 
-Michael Olson: changed erc.el erc-backend.el Makefile erc-track.el
+Michael Olson: changed erc.el erc-backend.el erc.texi erc-track.el
   erc-log.el erc-stamp.el erc-autoaway.el erc-dcc.el erc-goodies.el
-  erc-list.el erc-compat.el erc-identd.el erc.texi ERC-NEWS erc-bbdb.el
+  erc-list.el erc-compat.el erc-identd.el ERC-NEWS erc-bbdb.el
   erc-match.el erc-notify.el erc-ibuffer.el erc-services.el remember.el
-  erc-button.el and 63 other files
+  erc-button.el erc-nicklist.el and 60 other files
 
 Michael Piotrowski: changed gnus-art.el gnus-sum.el ps-print.el
 
 Michael R. Cook: changed gnus-sum.el gnus-topic.el gnus-art.el
 
-Michael R. Mauger: changed sql.el emacsclient.c comint.el cua-base.el
-  custom.el facemenu.el recentf.el replace.el tramp.el w32fns.c
+Michael R. Mauger: changed sql.el emacsclient.c cua-base.el custom.el
+  facemenu.el recentf.el replace.el tramp.el w32fns.c
 
 Michael R. Wolf: changed ange-ftp.el
 
@@ -2930,30 +2593,22 @@ Michael Sperber: changed aix3-1.h aix4-2.h gnus.texi mail-source.el
 
 Michael Staats: wrote pc-select.el
 
-Michael Vehrs: changed woman.el
-
-Michael Welsh Duggan: changed nnimap.el lisp.h sh-script.el w32term.c
+Michael Welsh Duggan: changed lisp.h nnimap.el sh-script.el w32term.c
   buffer.c gnus-spec.el keyboard.c nnir.el nnmail.el print.c
   sieve-manage.el termhooks.h url-http.el w32-win.el w32fns.c w32menu.c
   w32term.h woman.el xdisp.c xterm.c
 
-Michael Weylandt: changed ox-latex.el
-
-Michael Witten: changed TUTORIAL fixit.texi intro.texi
-
 Michal Jankowski: changed insdel.c keyboard.c
 
-Michal Nazarewicz: changed remember.el simple.el bindings.el buffer.c
-  cmds.c files.el fill.el flyspell.el frame.c frame.h ispell.el mpc.el
-  server.el startup.el w32term.c xterm.c
+Michal Nazarewicz: changed frame.c frame.h ispell.el w32term.c xterm.c
 
-Michal Sojka: changed ox-icalendar.el
+Michal Sojka: changed org-icalendar.el
 
-Michaël Cadilhac: changed browse-url.el fr-dired-ref.tex gnus-sum.el
-  gnus.texi ido.el Makefile emacsbug.el files.el fill.el flyspell.el
-  fr-refcard.tex ispell.el meta-mode.el nnrss.el anti.texi battery.el
-  blackbox.el bs.el calccard.tex callint.c cmuscheme.el
-  and 58 other files
+Michaël Cadilhac: changed browse-url.el gnus-sum.el gnus.texi ido.el
+  emacsbug.el files.el fill.el flyspell.el fr-drdref.tex fr-refcard.ps
+  fr-refcard.tex ispell.el meta-mode.el nnrss.el
+  refcards/fr-dired-ref.pdf Makefile anti.texi battery.el blackbox.el
+  bs.el calccard.pdf and 93 other files
 
 Michelangelo Grigni: wrote ffap.el
 and changed gnus-score.el
@@ -2963,8 +2618,6 @@ Microelectronics and Computer Technology Corporation: changed
   rmailkwd.el rmailmsc.el rmailout.el rmailsum.el scribe.el server.el
   sysdep.c unexcoff.c xmenu.c
 
-Mihir Rege: changed js.el
-
 Mikael Djurfeldt: changed xdisp.c
 
 Mikael Fornius: changed org.el org-habit.el
@@ -2986,8 +2639,6 @@ Mike Newton: co-wrote bibtex.el
 Mike Rowan: changed process.c alloc.c dispnew.c keyboard.c process.h
   sysdep.c xdisp.c
 
-Mike Sperber: changed org.el org-footnote.el
-
 Mike Williams: wrote mouse-sel.el thingatpt.el
 and changed sgml-mode.el xml-lite.el
 
@@ -2998,33 +2649,28 @@ Mikio Nakajima: changed ring.el viper-util.el
 Milan Zamazal: wrote glasses.el language/czech.el quail/czech.el
   tildify.el
 and co-wrote language/slovak.el prolog.el quail/slovak.el
-and changed czech.el abbrev.el filecache.el files.el mm-view.el org.el
-  progmodes/compile.el slovak.el
+and changed abbrev.el filecache.el files.el mm-view.el org.el
+  progmodes/compile.el
 
 Miles Bader: wrote button.el face-remap.el image-file.el macroexp.el
   mb-depth.el minibuf-eldef.el rfn-eshadow.el
 and changed comint.el faces.el simple.el editfns.c xfaces.c xdisp.c
-  info.el minibuf.c display.texi wid-edit.el xterm.c dispextern.h
-  quick-install-emacs subr.el window.el cus-edit.el diff-mode.el xfns.c
-  bytecomp.el help.el lisp.h and 273 other files
+  info.el minibuf.c display.texi wid-edit.el xterm.c Makefile.in
+  dispextern.h quick-install-emacs subr.el window.el cus-edit.el
+  diff-mode.el xfns.c bytecomp.el help.el and 270 other files
 
 Milton Wulei: changed gdb-ui.el
 
-Mirek Kaim: changed configure.ac
-
 Mirko Vukovic: changed emacs.texi maintaining.texi
 
-Mitchel Humpherys: changed vc-git.el
-
 Miyashita Hisashi: changed ccl.c coding.c coding.h mule-cmds.el
   mule-conf.el mule.el pop3.el
 
 Miyoshi Masanori: changed mouse.el smtpmail.el xdisp.c
 
 Mohsen Banan: wrote persian.el
-and changed loadup.el
 
-Mon Key: changed animate.el imap.el syntax.el
+Mon Key: changed animate.el syntax.el
 
 Morten Welinder: wrote [many MS-DOS files] arc-mode.el desktop.el
   dosfns.c internal.el msdos.h pc-win.el s-region.el
@@ -3037,12 +2683,8 @@ Mosur Mohan: changed etags.c
 
 Motorola: changed buff-menu.el
 
-Muchenxuan Tong: changed org-agenda.el org-mobile.el org-timer.el
-
 Murata Shuuichirou: changed coding.c
 
-Myles English: changed org-clock.el
-
 N. Raghavendra: changed timezone.el
 
 Nachum Dershowitz: co-wrote cal-hebrew.el
@@ -3052,21 +2694,18 @@ and changed imap.el gnus.el
 
 Nakagawa Makoto: changed ldap.el
 
-Nakaji Hiroyuki: changed mm-util.el amdx86-64.h configure.ac smiley.el
+Nakaji Hiroyuki: changed mm-util.el amdx86-64.h configure.in smiley.el
 
 Nakamura Toshikazu: changed w32fns.c
 
-Nali Toja: changed configure.ac
+Nali Toja: changed configure.in
 
 Naohiro Aota: changed fontset.c ftfont.c gnus-art.el mm-view.el tls.el
   xftfont.c
 
 Nathan J. Williams: changed imap.el
 
-Nathan Trapuzzano: changed cconv.el cl-macs.el cperl-mode.el gnus.texi
-  linum.el progmodes/python.el python-tests.el
-
-Nathan Weizenbaum: changed js.el progmodes/python.el
+Nathan Weizenbaum: changed js.el
 
 Nathaniel Flath: changed cc-menus.el cc-engine.el cc-fonts.el cc-langs.el
   cc-mode.el cc-vars.el
@@ -3077,61 +2716,48 @@ Neil Mager: wrote appt.el
 
 Neil W. Van Dyke: wrote webjump.el
 
-Nelson H. F. Beebe: changed configure.ac
+Nelson H. F. Beebe: changed configure.in
 
-Nelson Jose dos Santos Ferreira: changed nnsoup.el emacs.el gnus-art.el
-  gnus-dup.el gnus-win.el spam-stat.el
+Nelson Jose dos Santos Ferreira: changed nnsoup.el gnus-art.el
+  gnus-dup.el spam-stat.el
 
 Nevin Kapur: changed nnmail.el gnus-sum.el nnimap.el gnus-group.el
   gnus-registry.el gnus.el nnbabyl.el nnfolder.el nnmbox.el nnmh.el
   nnml.el
 
-Nguyen Thai Ngoc Duy: co-wrote vnvni.el
-
 Niall Mansfield: changed etags.c
 
-Nic Ferrier: changed ert.el tramp.el
+Nic Ferrier: changed tramp.el
 
 Nicholas Maniscalco: changed term.el
 
 Nick Alcock: changed gnus.el
 
-Nick Dokos: changed ox.el icalendar.el mh-search.el org-mobile.el org.el
-  url-cache.el
+Nick Dokos: changed org-exp.el mh-search.el org.el url-cache.el
 
 Nick Roberts: wrote gdb-mi.el t-mouse.el
 and changed gdb-ui.el gud.el building.texi tooltip.el speedbar.el
   bindings.el thumbs.el xt-mouse.el .gdbinit DEBUG cc-mode.el comint.el
   keyboard.c subr.el frames.texi help-mode.el progmodes/compile.el
-  xdisp.c display.texi term.c vc-svn.el and 145 other files
+  xdisp.c Makefile.in display.texi term.c and 154 other files
 
 Nico Francois: changed w32fns.c w32inevt.c w32menu.c
 
 Nicolas Avrutin: changed url-http.el
 
-Nicolas Calderon Asselin: changed org-clock.el
-
-Nicolas Goaziou: wrote org-element.el org-macro.el ox-ascii.el
-  ox-latex.el ox-md.el ox-org.el ox.el
-and co-wrote ox-beamer.el ox-icalendar.el ox-man.el
-and changed org-list.el org.el ox-html.el org-footnote.el org.texi
-  ox-publish.el org-inlinetask.el org-indent.el ox-odt.el org-docbook.el
-  ox-texinfo.el ob-exp.el org-timer.el ob.el org-agenda.el org-capture.el
-  ob-asymptote.el org-macs.el org-pcomplete.el org-clock.el org-table.el
-  and 22 other files
-
-Nicolas Richard: changed simple.el align.el battery.el eieio-opt.el
-  ispell.el minibuffer.el ob.el org.el package.el
+Nicolas Goaziou: changed org-list.el org.el org-footnote.el org-exp.el
+  org-latex.el org-html.el org-inlinetask.el org-indent.el org-docbook.el
+  org-timer.el ob-asymptote.el org-ascii.el org-capture.el ob.el
+  org-agenda.el org-archive.el ob-exp.el org-clock.el org-macs.el
+  org-mouse.el org.texi and 3 other files
 
 Niels Giesen: changed icalendar.el org-agenda.el org-clock.el
-  org-docbook.el org-table.el ox-icalendar.el ox-latex.el
+  org-docbook.el org-icalendar.el
 
 Niimi Satoshi: changed pp.el search.c
 
 Niklas Morberg: changed nnweb.el gnus-art.el nnimap.el spam.el
 
-Nikolai Weibull: changed org.el
-
 Nikolaj Schumacher: changed flymake.el progmodes/compile.el eldoc.el
   elp.el nsfont.m rx.el
 
@@ -3143,7 +2769,7 @@ Noah Friedman: wrote eldoc.el rlogin.el type-break.el
 and co-wrote erc-dcc.el
 and changed rsz-mini.el comint.el emacs-buffer.gdb files.el Makefile
   mailabbrev.el sendmail.el subr.el timer.el yow.el apropos.el battery.el
-  bytecomp.el calc.el coding.c complete.el config.in configure.ac
+  bytecomp.el calc.el coding.c complete.el config.in configure.in
   copyright.h fns.c gnu-linux.h and 19 other files
 
 Noah Lavine: changed tramp.el
@@ -3154,7 +2780,7 @@ Nobuyuki Hikichi: changed news-risc.h
 
 Noel Cragg: changed mh-junk.el
 
-Noorul Islam: changed ox-latex.el org.el org.texi ox-html.el
+Noorul Islam: changed org-latex.el org-html.el org.el org.texi
   org-capture.el org-gnus.el org-habit.el package.el
 
 Norbert Koch: changed gnus-msg.el gnus-score.el
@@ -3166,18 +2792,16 @@ Nuutti Kotivuori: changed gnus-sum.el flow-fill.el gnus-cache.el
 
 Odd Gripenstam: wrote dcl-mode.el
 
-Ognyan Kulev: changed TUTORIAL.bg cyrillic.el
+Ognyan Kulev: changed TUTORIAL.bg quail/cyrillic.el
 
-Okazaki Tetsurou: changed cc-fonts.el vc-svn.el vc.el
+Okazaki Tetsurou: changed cc-fonts.el
 
 Olaf Sylvester: wrote bs.el
 
 Ole Aamot: changed compile.el
 
-Oleg S. Tihonov: changed cyrillic.el ispell.el language/cyrillic.el
-  map-ynp.el subr.el
-
-Oleh Krehel: changed org-capture.el org-clock.el replace.el
+Oleg S. Tihonov: changed ispell.el language/cyrillic.el map-ynp.el
+  quail/cyrillic.el subr.el
 
 Oleksandr Gavenko: changed generic-x.el progmodes/grep.el
 
@@ -3190,8 +2814,7 @@ Oliver Scholz: wrote ipa-praat.el
 and changed gamegrid.el gnus-cite.el nonascii.texi rx.el startup.el
   update-game-score.c
 
-Oliver Seidel: wrote otodo-mode.el
-and co-wrote todo-mode.el
+Oliver Seidel: wrote todo-mode.el
 
 Olivier Laurens: changed forms.el
 
@@ -3209,9 +2832,11 @@ Oscar Figueiredo: wrote eudc-bob.el eudc-export.el eudc-hotlist.el
   eudc-vars.el eudc.el eudcb-bbdb.el eudcb-ldap.el eudcb-ph.el ldap.el
 and changed ph.el
 
+Óscar Fuentes: changed ido.el cmdproxy.c emacsclient.c vc-bzr.el
+
 P. E. Jareth Hein: changed gnus-util.el
 
-Pascal Dupuis: changed octave.el
+Pascal Dupuis: changed octave-inf.el
 
 Pascal Rigaux: changed image.c rfc2231.el
 
@@ -3226,12 +2851,12 @@ Paul Curry: changed cc-subword.el
 Paul D. Smith: wrote snmp-mode.el
 and changed imenu.el make-mode.el
 
-Paul Eggert: wrote rcs2log
+Paul Eggert: wrote rcs2log vcdiff
 and co-wrote cal-dst.el
-and changed lisp.h configure.ac alloc.c process.c fileio.c sysdep.c
-  xdisp.c image.c editfns.c keyboard.c emacs.c data.c lread.c callproc.c
-  xterm.c fns.c eval.c Makefile.in dispextern.h dispnew.c gnulib.mk
-  and 1015 other files
+and changed lisp.h Makefile.in editfns.c alloc.c xdisp.c configure.in
+  fileio.c image.c process.c fns.c xterm.c dispextern.h keyboard.c data.c
+  lread.c sysdep.c xfns.c eval.c emacs.c buffer.c config.in
+  and 573 other files
 
 Paul Fisher: changed fns.c
 
@@ -3244,15 +2869,14 @@ and changed message.el gnus-util.el gnus-int.el gnus.el gnus-agent.el
   gnus-start.el gnus-sum.el nnmail.el
 
 Paul Pogonyshev: changed progmodes/python.el subr.el which-func.el
-  align.el byte-opt.el configure.ac dabbrev.el display.texi eldoc.el
-  etags.el image-file.el image.c image.el info.el replace.el search.texi
-  searching.texi ses.el src/Makefile.in tar-mode.el url-http.el window.el
-
-Paul Reilly: changed dgux.h lwlib-Xm.c lwlib.c xlwmenu.c configure.ac
-  mail-utils.el process.c rmail.el xfns.c dgux5-4R2.h dgux5-4R3.h
-  files.el keyboard.c lwlib-Xaw.c lwlib-Xm.h lwlib-int.h lwlib.h
-  lwlib/Makefile.in mail/rmailmm.el rmailedit.el rmailkwd.el
-  and 10 other files
+  Makefile.in align.el byte-opt.el configure.in dabbrev.el display.texi
+  eldoc.el etags.el image-file.el image.c image.el info.el replace.el
+  search.texi searching.texi ses.el tar-mode.el url-http.el window.el
+
+Paul Reilly: changed dgux.h lwlib-Xm.c lwlib.c xlwmenu.c configure.in
+  mail-utils.el process.c rmail.el xfns.c Makefile.in dgux5-4R2.h
+  dgux5-4R3.h files.el keyboard.c lwlib-Xaw.c lwlib-Xm.h lwlib-int.h
+  lwlib.h mail/rmailmm.el rmailedit.el rmailkwd.el and 10 other files
 
 Paul Rivier: changed ada-mode.el mixal-mode.el reftex-vars.el reftex.el
 
@@ -3264,10 +2888,10 @@ Paul Stevenson: changed nnvirtual.el
 
 Paul Stodghill: changed gnus-agent.el gnus-util.el
 
-Pavel Janík: changed keyboard.c xterm.c COPYING xdisp.c process.c emacs.c
-  lisp.h menu-bar.el ldap.el make-dist xfns.c buffer.c coding.c eval.c
-  fileio.c flyspell.el fns.c indent.c Makefile.in callint.c cus-start.el
-  and 712 other files
+Pavel Janík: changed keyboard.c xterm.c COPYING xdisp.c Makefile.in
+  process.c emacs.c lisp.h menu-bar.el ldap.el make-dist xfns.c buffer.c
+  coding.c eval.c fileio.c flyspell.el fns.c indent.c callint.c
+  cus-start.el and 710 other files
 
 Pavel Kobiakov: wrote flymake.el
 and changed flymake.texi
@@ -3294,13 +2918,11 @@ and changed vc.el vc-hooks.el diff-mode.el etags.c etags.el forms.el
 Per Persson: wrote gnus-vm.el
 and co-wrote erc-dcc.el
 
-Per Starbäck: changed ispell.el characters.el dired.el gnus-start.el BUGS
-  apropos.el bibtex.el bytecomp.el charset.h coding.c doctor.el emacs.c
+Per Starbäck: changed ispell.el dired.el gnus-start.el BUGS apropos.el
+  bytecomp.el characters.el charset.h coding.c doctor.el emacs.c
   european.el iso-transl.el pcmpl-gnu.el replace.el startup.el
   trouble.texi vc.el xdisp.c
 
-Pete Beardmore: changed semantic/complete.el idle.el
-
 Pete Kazmier: changed gnus-art.el
 
 Pete Ware: changed message.el
@@ -3327,29 +2949,25 @@ Peter Kleiweg: wrote ps-mode.el
 
 Peter Liljenberg: wrote elint.el
 
-Peter Münster: changed gnus-demon.el gnus-group.el gnus-start.el
-  gnus.texi org-agenda.el org.el
+Peter Münster: changed gnus.texi org-agenda.el org.el
 
-Peter O'Gorman: changed configure.ac frame.h hpux10-20.h termhooks.h
+Peter O'Gorman: changed configure.in frame.h hpux10-20.h termhooks.h
 
-Peter Oliver: changed perl-mode.el server.el
+Peter Oliver: changed server.el
 
 Peter Povinec: changed term.el
 
-Peter Rosin: changed configure.ac
-
-Peter Runestig: changed configure.bat dos-w32.el emacs.rc
-  emacs/makefile.w32-in envadd.bat gmake.defs lispintro/makefile.w32-in
-  lispref/makefile.w32-in misc/makefile.w32-in multi-install-info.bat
-  nmake.defs nt/makefile.w32-in src/makefile.w32-in w32fns.c zone-mode.el
+Peter Runestig: changed makefile.w32-in configure.bat dos-w32.el emacs.rc
+  envadd.bat gmake.defs multi-install-info.bat nmake.defs w32fns.c
+  zone-mode.el
 
 Peter S. Galbraith: wrote mh-alias.el mh-identity.el mh-inc.el
   mh-limit.el
 and changed mh-comp.el mh-e.el mh-utils.el mh-mime.el mh-customize.el
-  mh-seq.el Makefile mh-init.el mh-search.el mh-xemacs-compat.el
-  mh-xemacs-toolbar.el README info-look.el mh-compat.el mh-funcs.el
-  alias.pbm alias.xpm cabinet.xpm goto-addr.el highlight.xpm mh-junk.el
-  and 11 other files
+  mh-seq.el mh-init.el mh-search.el mh-xemacs-compat.el
+  mh-xemacs-toolbar.el info-look.el mh-compat.el mh-funcs.el alias.pbm
+  alias.xpm cabinet.xpm goto-addr.el highlight.xpm mh-junk.el
+  mh-xemacs-icons.el mh-xemacs.el and 9 other files
 
 Peter Seibel: changed cl-indent.el lisp-mode.el
 
@@ -3361,26 +2979,19 @@ Peter Whaite: changed data.c
 
 Peter von der Ahe: changed gnus-ems.el
 
-Petr Hracek: changed emacs.1
-
-Petr Salinger: changed configure.ac gnu-kfreebsd.h
+Petr Salinger: changed configure.in gnu-kfreebsd.h
 
-Petri Kaurinkoski: changed configure.ac iris4d.h irix6-0.h irix6-5.h
+Petri Kaurinkoski: changed configure.in iris4d.h irix6-0.h irix6-5.h
   usg5-4.h
 
 Phil Hagelberg: wrote ert-x-tests.el
 and changed package.el pcmpl-unix.el subr.el
 
-Phil Sainty: changed subword.el
-
 Phil Sung: changed follow.el progmodes/python.el wdired.el
 
 Philip Jackson: wrote find-cmd.el org-irc.el
 
-Philipp Haselwarter: changed gnus-agent.el gnus-sum.el gnus-sync.el
-  gnus.texi newcomment.el
-
-Philipp Rumpf: changed electric.el
+Philipp Haselwarter: changed gnus-agent.el gnus.texi
 
 Philippe Schnoebelen: wrote gomoku.el mpuz.el
 
@@ -3398,29 +3009,29 @@ Pieter Schoenmakers: changed TUTORIAL.nl
 
 Pinku Surana: changed sql.el
 
-Piotr Zieliński: wrote org-mouse.el
+Piotr Zielinski: wrote org-mouse.el
 
 Prestoo Ten: changed screen.el
 
 Primoz Peterlin: changed TUTORIAL.sl
 
-Puneeth Chaganti: changed org.texi ox.el org-agenda.el org-capture.el
-  ox-html.el
+Puneeth Chaganti: changed org.texi org-exp.el org-agenda.el
+  org-capture.el org-html.el
 
 R. Bernstein: changed gud.el
 
-Rafael Laboissiere: changed org-remember.el org-bibtex.el org.el org.texi
+Rafael Laboissiere: changed org.el org.texi
 
 Rafael Sepúlveda: changed TUTORIAL.es
 
 Raffael Mancini: changed misc.el
 
-Rainer Orth: changed gtkutil.c lisp/Makefile.in
+Rainer Orth: changed Makefile.in
 
-Rainer Schöpf: changed osf1.h unexalpha.c alloc.c alpha.h buffer.c
-  callint.c data.c dispextern.h doc.c editfns.c floatfns.c frame.h lisp.h
-  lread.c marker.c mem-limits.h print.c puresize.h window.h xdisp.c
-  xterm.h
+Rainer Schoepf: wrote alpha.h unexalpha.c
+and changed osf1.h alloc.c buffer.c callint.c data.c dispextern.h doc.c
+  editfns.c floatfns.c frame.h lisp.h lread.c marker.c mem-limits.h
+  print.c puresize.h window.h xdisp.c xterm.h
 
 Raja R. Harinath: changed gnus-salt.el nnml.el
 
@@ -3430,16 +3041,14 @@ Rajesh Vaidheeswarran: wrote old-whitespace.el
 and changed whitespace.el ffap.el
 
 Ralf Angeli: wrote scroll-lock.el
-and changed w32fns.c reftex-cite.el gnus-art.el reftex-toc.el reftex.el
-  reftex-auc.el reftex-dcr.el reftex-global.el reftex-index.el
-  reftex-parse.el reftex-ref.el reftex-sel.el reftex-vars.el reftex.texi
+and changed w32fns.c gnus-art.el reftex-cite.el reftex-toc.el reftex.el
   tex-mode.el comint.el flow-fill.el frame.el killing.texi mm-uu.el
-  mm-view.el and 6 other files
+  mm-view.el package.el pcl-cvs.texi reftex-auc.el reftex-dcr.el
+  reftex-global.el reftex-index.el reftex-parse.el reftex-ref.el
+  reftex-sel.el and 6 other files
 
 Ralf Fassel: changed dabbrev.el files.el fill.el iso-acc.el tar-mode.el
 
-Ralf Mattes: changed el.srt
-
 Ralph Schleicher: wrote battery.el info-look.el
 and changed libc.el browse-url.el fileio.c info.el mm-decode.el
   nnultimate.el perl-mode.el which-func.el
@@ -3450,14 +3059,9 @@ Randal Schwartz: wrote pp.el
 
 Randall Smith: changed dired.el
 
-Ransom Williams: changed files.el
-
-Rasmus Pank: changed org.el ox-latex.el ob-C.el org-entities.el
-  org-src.el ox.el
-
 Raul Acevedo: changed info.el options.el
 
-Ray Blaak: co-wrote opascal.el
+Ray Blaak: co-wrote delphi.el
 
 Raymond Scholz: co-wrote deuglify.el
 and changed gnus-art.el gnus-msg.el gnus.texi message.el nnmail.el
@@ -3467,7 +3071,7 @@ Reiner Steib: wrote gmm-utils.el gnus-news.el
 and changed message.el gnus.texi gnus-art.el gnus-sum.el gnus-group.el
   gnus.el mml.el gnus-faq.texi mm-util.el gnus-score.el message.texi
   gnus-msg.el gnus-start.el gnus-util.el spam-report.el mm-uu.el spam.el
-  mm-decode.el files.el gnus-agent.el nnmail.el and 176 other files
+  mm-decode.el files.el gnus-agent.el nnmail.el and 182 other files
 
 Remek Trzaska: changed gnus-ems.el
 
@@ -3475,33 +3079,30 @@ Remi Letot: changed nnmaildir.el
 
 Renaud Rioboo: changed nnmail.el
 
-René Kyllingstad: changed editfns.c mule-cmds.el pcomplete.el
+René Kyllingstad: changed pcomplete.el
 
 Reto Zimmermann: wrote vera-mode.el
 and co-wrote vhdl-mode.el
 
-Reuben Thomas: changed remember.el files.el flymake.el indent.c
-  loading.texi pcvs-defs.el rect.el simple.el
+Reuben Thomas: changed files.el flymake.el loading.texi pcvs-defs.el
+  simple.el
 
 Riccardo Murri: changed vc-bzr.el tls.el
 
-Richard Copley: changed Makefile.in epaths.in epaths.nt gdb-mi.el
-
-Richard Dawe: changed config.in src/Makefile.in
+Richard Dawe: changed Makefile.in config.in
 
 Richard G. Bielawski: changed modes.texi paren.el
 
 Richard Hoskins: changed message.el
 
 Richard Kim: wrote wisent/python.el
-and changed bovine.texi db-global.el loading.texi python-wy.el
-  texnfo-upd.el wisent.texi
+and changed loading.texi python-wy.el texnfo-upd.el
 
 Richard King: wrote filelock.c uniquify.el userlock.el
 
 Richard L. Pieri: wrote pop3.el
 
-Richard Lawrence: changed org-agenda.el ox-latex.el
+Richard Lawrence: changed org-latex.el
 
 Richard Levitte: changed vc-mtn.el
 
@@ -3512,13 +3113,13 @@ Richard M. Stallman: wrote [The original GNU Emacs and numerous files]
 and co-wrote cc-align.el cc-cmds.el cc-defs.el cc-engine.el cc-langs.el
   cc-menus.el cc-mode.el cc-styles.el cc-vars.el font-lock.el
 and changed files.el keyboard.c simple.el xterm.c xdisp.c rmail.el
-  fileio.c process.c sysdep.c buffer.c xfns.c window.c configure.ac
-  subr.el startup.el sendmail.el emacs.c Makefile.in editfns.c info.el
-  dired.el and 1340 other files
+  Makefile.in fileio.c process.c sysdep.c buffer.c xfns.c window.c
+  configure.in subr.el startup.el sendmail.el emacs.c editfns.c info.el
+  dispnew.c and 1350 other files
 
 Richard Mlynarik: wrote cl-indent.el ebuff-menu.el ehelp.el rfc822.el
   terminal.el yow.el
-and changed files.el rmail.el simple.el info.el sysdep.c bytecomp.el
+and changed files.el simple.el rmail.el info.el sysdep.c bytecomp.el
   startup.el keyboard.c fileio.c process.c sendmail.el window.c editfns.c
   unexec.c xfns.c keymap.c lisp-mode.el minibuf.c buffer.c dired.el
   dispnew.c and 140 other files
@@ -3528,12 +3129,10 @@ and changed sh-script.el ediff-init.el regexp-opt.el simple.el
 
 Rick Farnbach: wrote morse.el
 
-Rick Frankel: changed ox-html.el ob-sql.el org.texi
-
 Rick Sladkey: wrote backquote.el
 and changed gud.el intervals.c intervals.h simple.el
 
-Rob Browning: changed configure.ac
+Rob Browning: changed configure.in
 
 Rob Christie: changed nsmenu.m
 
@@ -3541,8 +3140,8 @@ Rob Giardina: changed org-agenda.el
 
 Rob Kaut: changed vhdl-mode.el
 
-Rob Riepel: wrote tpu-edt.doc tpu-edt.el tpu-extras.el tpu-mapper.el
-  vt-control.el
+Rob Riepel: wrote tpu-edt.el tpu-extras.el tpu-mapper.el vt-control.el
+and changed tpu-doc.el
 
 Robert Bihlmeyer: changed gnus-score.el gnus-util.el message.el
 
@@ -3552,22 +3151,20 @@ Robert Fenk: changed desktop.el
 
 Robert J. Chassell: wrote makeinfo.el page-ext.el texinfo.el
   texnfo-upd.el
-and changed texinfmt.el emacs-lisp-intro.texi emacs.texi texinfo.tex
-  info.el texinfo-update.el INSTALL case-table.el cl.texi help-fns.el
+and changed texinfmt.el emacs-lisp-intro.texi emacs.tex texinfo.tex
+  info.el texinfo-update.el INSTALL case-table.el cl.texinfo help-fns.el
   help-mode.el history.el informat.el latin-1.el latin-2.el latin-3.el
-  latin-4.el page.el tex-mode.el texinfo.texi vip.texi
-
-Robert Jarzmik: changed ede/linux.el inversion.el
+  latin-4.el page.el tex-mode.el texinfo.texinfo vip.texinfo
 
 Robert Marshall: changed mule-cmds.el
 
-Robert P. Goldman: changed org.texi ob-exp.el org.el ox-latex.el
+Robert P. Goldman: changed org.texi ob-exp.el org-latex.el org.el
 
 Robert Pluim: changed gnus-demon.el org-agenda.el
 
 Robert Thorpe: changed cus-start.el indent.el
 
-Roberto Huelga Díaz: changed org-clock.el org-timer.el
+Roberto Huelga: changed org-clock.el
 
 Roberto Rodríguez: changed ada-mode.texi glossary.texi widget.texi
 
@@ -3575,36 +3172,35 @@ Roderick Schertler: changed dgux.h dgux4.h gud.el sysdep.c
 
 Rodney J. Whitby: co-wrote vhdl-mode.el
 
-Rodrigo Real: changed pt-br-refcard.tex
+Rodrigo Real: changed pt-br-refcard.tex pt-br-refcard.ps
 
 Roger Breitenstein: changed smtpmail.el
 
 Roland B. Roberts: changed buffer.h callproc.c dired.c files.el
   gnus-group.el gnus-sum.el process.c sort.el sysdep.c systty.h
 
-Roland Kaufmann: changed ox.el
+Roland Kaufmann: changed org-exp.el
 
 Roland McGrath: wrote autoload.el etags.el map-ynp.el progmodes/grep.el
 and co-wrote find-dired.el progmodes/compile.el
-and changed compile.el add-log.el configure.ac files.el vc.el simple.el
-  mailabbrev.el comint.el Makefile.in buffer.c upd-copyr.el menu-bar.el
-  etags.c mem-limits.h ralloc.c src/Makefile.in fileio.c data.c process.c
-  rlogin.el rmail.el and 139 other files
+and changed compile.el add-log.el configure.in files.el Makefile.in vc.el
+  simple.el mailabbrev.el comint.el buffer.c upd-copyr.el etags.c
+  menu-bar.el mem-limits.h ralloc.c fileio.c data.c process.c rlogin.el
+  rmail.el shell.el and 137 other files
 
 Roland Winkler: wrote proced.el
-and changed bibtex.el faces.el crm.el process.c appt.el artist.el
-  conf-mode.el cus-edit.el diary-lib.el flyspell.el hideshow.el
-  ibuf-ext.el ibuffer.el ispell.el make-mode.el sgml-mode.el sh-script.el
-  skeleton.el smtpmail.el
+and changed bibtex.el process.c appt.el artist.el conf-mode.el
+  flyspell.el hideshow.el ibuffer.el ispell.el make-mode.el sgml-mode.el
+  sh-script.el skeleton.el smtpmail.el
 
 Rolf Ebert: co-wrote ada-mode.el ada-stmt.el ada-xref.el
 and changed files.el find-file.el
 
-Romain Francoise: changed efaq.texi message.el make-dist gnus.texi
-  dired-x.el Makefile.in comint.el fileio.c ibuf-ext.el subr.el
-  configure.ac files.texi gnus-sum.el gnus-uu.el progmodes/compile.el
-  puresize.h replace.el startup.el doclicense.texi emacs.c gnus-fun.el
-  and 150 other files
+Romain Francoise: changed faq.texi message.el Makefile.in make-dist
+  gnus.texi dired-x.el comint.el ibuf-ext.el subr.el gnus-sum.el
+  gnus-uu.el progmodes/compile.el puresize.h replace.el startup.el
+  configure.in doclicense.texi emacs.c files.texi gnus-fun.el help-fns.el
+  and 146 other files
 
 Roman Belenov: changed which-func.el
 
@@ -3614,15 +3210,13 @@ Ronan Waide: changed smtpmail.el
 
 Ross Patterson: co-wrote org-protocol.el
 
-Roy Hashimoto: changed mm-view.el
-
 Roy Liu: changed ns-win.el
 
 Rui-Tao Dong: changed nnweb.el
 
 Rune Kleveland: changed xfns.c
 
-Rupert Swarbrick: changed cal-html.el gnus-score.el
+Rupert Swarbrick: changed gnus-score.el
 
 Russ Allbery: changed message.el
 
@@ -3630,31 +3224,21 @@ Ryan Barrett: changed dirtrack.el
 
 Ryan C. Thompson: changed savehist.el
 
-Ryan Crum: changed json.el
-
 Ryan Twitchell: changed ido.el
 
 Ryan Yeske: wrote rcirc.el
 and changed ffap.el ispell.el message.texi rmailsum.el simple.el
   testcover.el webjump.el
 
-Ryo Takaishi: changed ob-tangle.el org-capture.el org-protocol.el
-
 Ryo Yoshitake: changed xterm.c frame.c frame.h mac.c macfns.c w32fns.c
   xfns.c
 
 Ryszard Kubiak: co-wrote ogonek.el
 
-Rémi Vanicat: changed ox-icalendar.el org-table.el
-
-Rüdiger Sonderfeld: wrote inotify-test.el reftex-tests.el
-and changed octave.el eww.el shr.el bibtex.el configure.ac
-  misc/Makefile.in reftex-vars.el TUTORIAL.de ada-mode.el building.texi
-  calc-lang.el dired.texi editfns.c emacs.c emacs.texi epa.el erc.el
-  eww.texi ffap.el files.texi floatfns.c and 28 other files
+Rémi Vanicat: changed org-icalendar.el
 
 Sacha Chua: wrote erc-pcomplete.el
-and changed erc.el org.el erc-button.el org.texi
+and changed erc.el erc-button.el
 
 Saito Takuya: changed mule.el progmodes/compile.el
 
@@ -3666,14 +3250,12 @@ Sam Kendall: changed etags.c etags.el
 
 Sam Steingold: wrote gulp.el midnight.el
 and changed progmodes/compile.el cl-indent.el vc-cvs.el vc.el mouse.el
-  simple.el font-lock.el vc-hg.el ange-ftp.el files.el tex-mode.el
-  window.el add-log.el bindings.el bookmark.el bug-reference.el
-  calendar.el diary-lib.el dired.el etags.el pcvs.el and 145 other files
-
-Samuel Bronson: changed custom.el emacsclient.c keyboard.c
-  progmodes/grep.el
+  simple.el font-lock.el ange-ftp.el vc-hg.el window.el add-log.el
+  bookmark.el bug-reference.el diary-lib.el dired.el etags.el pcvs.el
+  tex-mode.el apropos.el bindings.el emacs-lisp/debug.el
+  and 126 other files
 
-Samuel Loury: changed org.el
+Samuel Bronson: changed custom.el
 
 Samuel Tardieu: changed smime.el
 
@@ -3681,22 +3263,20 @@ Samuel Thibault: changed gnu.h sysdep.c term.c
 
 Sanghyuk Suh: changed mac-win.el macterm.c
 
-Santiago Payà I Miralta: changed vc-hg.el
-
 Sascha Lüdecke: co-wrote mml1991.el
 and changed gnus-win.el
 
-Sascha Wilde: changed pgg-gpg.el pgg.texi pgg.el bubbles.el configure.ac
+Sascha Wilde: changed pgg-gpg.el pgg.texi pgg.el bubbles.el configure.in
   ede/srecode.el proj-shared.el vc-hg.el
 
 Satyaki Das: wrote mh-acros.el mh-gnus.el mh-search.el mh-speed.el
   mh-thread.el mh-tool-bar.el
 and co-wrote mh-junk.el
 and changed mh-e.el mh-utils.el mh-seq.el mh-comp.el mh-mime.el
-  mh-customize.el mh-funcs.el Makefile mh-alias.el mh-unit.el mh-init.el
+  mh-customize.el mh-funcs.el mh-alias.el mh-unit.el mh-init.el
   mh-identity.el mh-make.el mh-xemacs-toolbar.el mh-xemacs-compat.el
-  pgg-gpg.el mh-inc.el highlight.xpm mh-logo.xpm mh-print.el mh-xemacs.el
-  simple.el
+  pgg-gpg.el mh-inc.el highlight.xpm mh-func.el mh-logo.xpm mh-print.el
+  mh-xemacs.el simple.el
 
 Schlumberger Technology Corporation: changed gud.el
 
@@ -3715,8 +3295,6 @@ Scott Frazer: wrote deeper-blue-theme.el whiteboard-theme.el
 
 Scott M. Meyers: changed cmacexp.el
 
-Sean Connor: changed gnus-sum.el
-
 Sean Neakums: changed gnus-msg.el gnus-uu.el supercite.el
 
 Sean O'Halpin: changed ob.el
@@ -3735,18 +3313,15 @@ and co-wrote dired-x.el find-dired.el
 and changed add-log.el
 
 Sebastian Rose: co-wrote org-protocol.el
-and changed ox-publish.el ftfont.c ox-jsinfo.el
+and changed org-publish.el ftfont.c org-jsinfo.el
 
 Sebastian Tennant: changed desktop.el
 
-Sebastian Wiesner: changed bytecomp.el comint.el files.el replace.el
-  simple.el
-
 Sebastien Kirche: changed mail-extr.el
 
-Seiji Zenitani: changed nsfns.m frame.c xterm.c PkgInfo document.icns
-  find-func.el frame.h help-fns.el macfns.c nsfont.m nsterm.m w32fns.c
-  xdisp.c xfns.c
+Seiji Zenitani: changed nsfns.m frame.c xterm.c Info.plist PkgInfo
+  document.icns find-func.el frame.h help-fns.el macfns.c nsfont.m
+  nsterm.m w32fns.c xdisp.c xfns.c
 
 Sen Nagata: wrote crm.el rfc2368.el
 
@@ -3760,10 +3335,6 @@ Sergey Litvinov: co-wrote ob-fortran.el
 
 Sergey Poznyakoff: changed mh-mime.el rmail.el rmail.texi smtpmail.el
 
-Sergio Durigan Junior: changed eudcb-bbdb.el gdb-mi.el
-
-Sergio Martinez: changed nnimap.el
-
 Sergio Pokrovskij: changed TUTORIAL.eo
 
 Seweryn Kokot: changed positions.texi searching.texi
@@ -3772,7 +3343,7 @@ Shaun Johnson: changed ob-tangle.el org-exp-blocks.el
 
 Shawn Boles: changed url-cookie.el
 
-Shawn M. Carey: wrote [some early FreeBSD support]
+Shawn M. Carey: wrote freebsd.h
 
 Shenghuo Zhu: wrote binhex.el mm-extern.el mm-partial.el mm-url.el
   mm-uu.el mml2015.el nnrss.el rfc1843.el uudecode.el
@@ -3781,11 +3352,11 @@ and changed gnus-art.el message.el gnus-sum.el gnus-msg.el gnus.el
   gnus-agent.el mm-decode.el mm-util.el gnus-group.el mml.el
   gnus-start.el gnus-util.el mm-view.el nnslashdot.el nnmail.el nntp.el
   gnus-topic.el gnus-xmas.el rfc2047.el mail-source.el gnus-win.el
-  and 95 other files
+  and 97 other files
 
 Shigeru Fukaya: wrote bytecomp-tests.el
-and changed apropos.el byte-opt.el bytecomp.el elint.el rx-new.el ses.el
-  texinfmt.el
+and changed byte-opt.el bytecomp-testsuite.el bytecomp.el elint.el
+  rx-new.el ses.el texinfmt.el
 
 Shinichirou Sugou: changed etags.c
 
@@ -3804,23 +3375,19 @@ Sidney Markowitz: changed doctor.el nsmenu.m
 
 Sigbjorn Finne: changed gnus-srvr.el
 
-Simen Heggestøyl: changed scheme.el
-
 Simon Josefsson: wrote dig.el dns-mode.el flow-fill.el fringe.el imap.el
-  mml-sec.el mml-smime.el password-cache.el rfc2104.el sieve-mode.el
-  sieve.el smime.el starttls.el tls.el url-imap.el
+  mml-sec.el mml-smime.el password-cache.el rfc2104.el sieve-manage.el
+  sieve-mode.el sieve.el smime.el starttls.el tls.el url-imap.el
 and co-wrote gnus-sieve.el gssapi.el mml1991.el nnfolder.el nnimap.el
-  nnml.el sieve-manage.el
+  nnml.el
 and changed message.el gnus-sum.el gnus-art.el smtpmail.el pgg-gpg.el
   pgg.el gnus-agent.el mml2015.el mml.el gnus-group.el mm-decode.el
   gnus-msg.el gnus.texi pgg-pgp5.el browse-url.el gnus-int.el gnus.el
-  hashcash.el mm-view.el password.el gnus-cache.el and 100 other files
-
-Simon Law: changed delsel.el electric.el
+  hashcash.el mm-view.el password.el gnus-cache.el and 99 other files
 
 Simon Leinen: changed Makefile.in smtpmail.el Makefile cm.c cm.h hpux9.h
-  indent.c leim/Makefile.in process.c sc.texi sgml-mode.el term.c vc.el
-  xfns.c xmenu.c xterm.c
+  indent.c process.c sc.texinfo sgml-mode.el term.c vc.el xfns.c xmenu.c
+  xterm.c
 
 Simon Marshall: wrote fast-lock.el lazy-lock.el regexp-opt.el
 and co-wrote comint.el shell.el
@@ -3829,11 +3396,7 @@ and changed font-lock.el rmail.el fortran.el sendmail.el subr.el dired.el
   menu-bar.el perl-mode.el ps-print.el rmailsum.el bytecomp.el
   cc-fonts.el data.c faces.el lisp-mode.el and 56 other files
 
-Simon Schubert: changed json.el
-
-Simon South: co-wrote opascal.el
-
-Simon Thum: changed ob-maxima.el
+Simon South: co-wrote delphi.el
 
 Skip Collins: changed w32fns.c w32term.c w32term.h
 
@@ -3853,17 +3416,15 @@ Stefan Guath: changed find-dired.el
 
 Stefan Merten: co-wrote rst.el
 
-Stefan Monnier: wrote bibtex-style.el bzrmerge.el cl.el
-  completion-tests.el core-elisp-tests.el css-mode.el cvs-status.el
-  diff-mode.el gv.el lexbind-tests.el log-edit.el log-view.el
-  minibuffer.el mpc.el nadvice.el pcase.el pcvs-defs.el pcvs-info.el
-  pcvs-parse.el pcvs-util.el regexp-tests.el reveal.el smerge-mode.el
-  smie.el subword-tests.el vc-mtn.el
+Stefan Monnier: wrote bibtex-style.el bzrmerge.el css-mode.el
+  cvs-status.el diff-mode.el lexbind-tests.el log-edit.el log-view.el
+  minibuffer.el mpc.el pcase.el pcvs-defs.el pcvs-info.el pcvs-parse.el
+  pcvs-util.el reveal.el smerge-mode.el smie.el vc-mtn.el
 and co-wrote font-lock.el
-and changed subr.el simple.el lisp.h keyboard.c files.el vc.el
-  bytecomp.el xdisp.c alloc.c eval.c cl-macs.el progmodes/compile.el
-  keymap.c pcvs.el sh-script.el newcomment.el tex-mode.el buffer.c
-  vc-hooks.el window.c lread.c and 1206 other files
+and changed vc.el subr.el simple.el lisp.h keyboard.c files.el
+  bytecomp.el keymap.c Makefile.in progmodes/compile.el xdisp.c pcvs.el
+  alloc.c newcomment.el vc-hooks.el tex-mode.el buffer.c fileio.c eval.c
+  sh-script.el fill.el and 1033 other files
 
 Stefan Reichör: changed gnus-agent.el
 
@@ -3875,32 +3436,32 @@ Stefan Waldherr: changed nnweb.el
 
 Stefan Wiens: changed gnus-sum.el
 
-Stefan-W. Hahn: changed org-bibtex.el ps-print.el simple.el
-
-Stefano Facchini: changed gtkutil.c
+Steinar Bang: changed imap.el
 
-Steinar Bang: changed gnus-setup.el imap.el
+Štěpán Němec: changed INSTALL calc-ext.el cl.texi comint.el edebug.texi
+  font-lock.el loading.texi maps.texi mark.texi message.texi mini.texi
+  minibuf.texi misc.texi programs.texi subr.el tips.texi url-vars.el
+  url.texi vc-git.el window.c windows.texi
 
 Stephan Stahl: changed which-func.el buff-menu.el buffer.c dired-x.texi
   ediff-mult.el
 
 Stephen A. Wood: changed fortran.el
 
-Stephen Berman: co-wrote todo-mode.el
-and changed diary-lib.el minibuffer.el todo-mode.texi info.el
-  otodo-mode.el allout.el dframe.el dir dired-aux.el dired.el elpa
-  files.el find-dired.el frame.c gamegrid.el gnus-group.el gomoku.el
-  gtkutil.c misc/Makefile.in newcomment.el page.el and 7 other files
+Stephen Berman: changed diary-lib.el todo-mode.el allout.el dframe.el
+  dired-aux.el dired.el files.el find-dired.el frame.c gnus-group.el
+  gtkutil.c info.el minibuffer.el newcomment.el page.el proced.el
+  recentf.el rfc822.el subr.el
 
-Stephen C. Gilardi: changed configure.ac
+Stephen C. Gilardi: changed configure.in
 
 Stephen Compall: changed saveplace.el texinfo.el
 
 Stephen Eglen: wrote iswitchb.el mspools.el
-and changed diary-lib.el octave.el org-agenda.el locate.el replace.el
+and changed diary-lib.el locate.el octave-inf.el org-agenda.el replace.el
   hexl.el info-look.el sendmail.el spell.el uce.el MORE.STUFF add-log.el
   advice.el allout.el autoinsert.el avoid.el backquote.el battery.el
-  bib-mode.el bruce.el c-mode.el and 80 other files
+  bib-mode.el bruce.el c-mode.el and 78 other files
 
 Stephen Gildea: wrote refcard.tex
 and co-wrote mh-funcs.el mh-search.el
@@ -3923,15 +3484,15 @@ Steve Grubb: changed vcdiff
 
 Steve Nygard: changed unexnext.c
 
-Steve Purcell: changed nnimap.el nsterm.m
+Steve Purcell: changed nnimap.el
 
 Steve Strassmann: wrote spook.el
 
 Steve Youngs: changed mh-utils.el mh-xemacs-compat.el mh-customize.el
-  mh-e.el mh-comp.el mh-mime.el Makefile dns.el gnus-art.el browse-url.el
+  mh-e.el mh-comp.el mh-mime.el dns.el gnus-art.el browse-url.el
   gnus-sum.el gnus-xmas.el mh-search.el mh-seq.el password.el
   run-at-time.el em-unix.el gmm-utils.el gnus-cite.el gnus-demon.el
-  gnus-ems.el and 17 other files
+  gnus-ems.el gnus-msg.el and 16 other files
 
 Steven E. Harris: changed nnheader.el
 
@@ -3943,10 +3504,10 @@ and changed gnus-xmas.el gnus-msg.el add-log.el edebug.el gnus-ems.el
 
 Steven Suhr: changed dispnew.c scroll.c term.c termchar.h
 
-Steven Tamm: changed macterm.c mac.c macfns.c configure.ac mac-win.el
-  unexmacosx.c darwin.h editfns.c lread.c macmenu.c scroll-bar.el
-  src/Makefile.in Makefile.in config.h config.in dispnew.c eval.c
-  fileio.c fns.c generic-x.el image.c and 4 other files
+Steven Tamm: changed macterm.c mac.c macfns.c configure.in mac-win.el
+  unexmacosx.c Makefile.in darwin.h editfns.c lread.c macmenu.c
+  scroll-bar.el config.h config.in dispnew.c eval.c fileio.c fns.c
+  generic-x.el image.c process.c and 3 other files
 
 Stewart M. Clamen: co-wrote cal-mayan.el cc-align.el cc-cmds.el
   cc-defs.el cc-engine.el cc-langs.el cc-menus.el cc-mode.el cc-styles.el
@@ -3958,12 +3519,8 @@ Stuart D. Herring: changed desktop.el files.el isearch.el align.el
   allout.el comint.el edebug.el find-lisp.el keymap.c minibuf.c sregex.el
   timeclock.el widget.texi
 
-Stuart Hickinbottom: changed org-clock.el
-
 Sudish Joseph: changed mac-win.el
 
-Suhail Shergill: changed ob-core.el ox-html.el
-
 Sun Microsystems, Inc: wrote emacs.icon sun.el
 and changed emacsclient.c server.el
 
@@ -3971,7 +3528,7 @@ Sun Yijiang: changed TUTORIAL.cn
 
 Sundar Narasimhan: changed rnews.el
 
-Suvayu Ali: changed org.texi org-inlinetask.el org-src.el org.el ox.el
+Suvayu Ali: changed org.texi org-exp.el org-inlinetask.el org-src.el
 
 Sven Joachim: changed files.el de-refcard.tex dired-aux.el emacs.1
   arc-mode.el dired-x.el em-cmpl.el em-hist.el em-ls.el esh-cmd.el
@@ -3984,34 +3541,26 @@ Syver Enstad: changed gud.el
 
 Sébastien Delafond: changed org.el
 
-Sébastien Gross: changed hideshow.el
-
-Sébastien Vauban: changed org.el org-agenda.el ox-latex.el ob-core.el
-  org-clock.el ox-html.el
-
-T.F. Torrey: changed org-rmail.el ox.el
+Sébastien Vauban: changed org.el org-agenda.el org-html.el org-latex.el
 
 T.V. Raman: changed completion.el files.el json.el mairix.el mspools.el
   xml.c
 
 Taichi Kawabata: wrote quail/indian.el ucs-normalize.el
-and changed indian.el devanagari.el ind-util.el devan-util.el
-  language/indian.el characters.el fontset.el leim/Makefile.in
-  lisp/Makefile.in malayalam.el mlm-util.el mule-conf.el tamil.el
-  tml-util.el
+and changed devanagari.el ind-util.el Makefile.in devan-util.el
+  language/indian.el characters.el fontset.el malayalam.el mlm-util.el
+  mule-conf.el tamil.el tml-util.el
 
 Takaaki Ota: wrote textmodes/table.el
 and changed appt.el dired.c etags.c ldap.el makefile.w32-in
   progmodes/compile.el recentf.el replace.el subr.el w32bdf.c
 
-Takafumi Arakaki: changed url-expand.el url-http.el which-func.el
-
 Takahashi Kaoru: changed texinfmt.el
 
 Takahashi Naoto: wrote ethio-util.el language/ethiopic.el latin-post.el
   quail/cyrillic.el quail/ethiopic.el robin.el
 and co-wrote latin-ltx.el quail.el
-and changed ethiopic.el fontset.el mule-conf.el
+and changed fontset.el mule-conf.el
 
 Takai Kousuke: changed ccl.el compface.el
 
@@ -4022,31 +3571,27 @@ and changed arc-mode.el
 
 Tassilo Horn: wrote doc-view.el
 and co-wrote org-gnus.el
-and changed reftex-vars.el gnus-sum.el tsdh-dark-theme.el gnus.texi
-  subword.el image-mode.el reftex.el tsdh-light-theme.el cc-cmds.el
-  display.texi em-term.el emacsbug.el files.el gnus-art.el misc.texi
-  nnimap.el reftex-cite.el buffers.texi control.texi help.texi info.el
-  and 53 other files
+and changed subword.el image-mode.el Makefile.in cc-cmds.el emacsbug.el
+  gnus-art.el gnus.texi nnimap.el files.el gnus-sum.el info.el
+  org-footnote.el org.el reftex-ref.el saveplace.el simple.el
+  tsdh-dark-theme.el tsdh-light-theme.el ack.texi artist.el bindings.el
+  and 26 other files
 
 Tatsuya Ichikawa: changed gnus-agent.el gnus-cache.el
 
 Ted Lemon: changed emacs.c lastfile.c puresize.h
 
-Ted Phelps: changed mh-search.el mh-e.el mh-folder.el mh-junk.el
-  mh-scan.el mh-tool-bar.el shr.el
-
-Ted Wiles: changed org-habit.el
+Ted Phelps: changed mh-search.el mh-tool-bar.el
 
-Teemu Likonen: changed dired.el erc-backend.el gnus-agent.el indent.el
-  message.el
+Teemu Likonen: changed dired.el gnus-agent.el message.el
 
 Teodor Zlatanov: wrote auth-source.el gnus-registry.el gnus-sync.el
   gnus-tests.el gnutls.el registry.el spam-report.el url-future-tests.el
-  url-future.el url-util-tests.el
-and changed spam.el gnus.el nnimap.el gnus.texi gnus-sum.el cfengine.el
-  auth.texi gnutls.c gnus-util.el netrc.el gnus-start.el message.el
-  spam-stat.el encrypt.el nnir.el nnmail.el gnutls.h imap.el
-  mail-source.el nnmairix.el nntp.el and 110 other files
+  url-future.el
+and changed spam.el gnus.el nnimap.el gnus.texi gnus-sum.el gnus-util.el
+  auth.texi netrc.el gnus-start.el gnutls.c message.el spam-stat.el
+  encrypt.el nnir.el nnmail.el imap.el mail-source.el nnmairix.el nntp.el
+  Makefile.in gnus-encrypt.el and 97 other files
 
 Terje Rosten: changed xfns.c version.el xterm.c xterm.h
 
@@ -4056,35 +3601,32 @@ Terry Jones: wrote shadow.el
 
 Tetsuo Tsukamoto: changed nnrss.el
 
-Tetsurou Okazaki: changed Makefile.in byte-opt.el lib-src/Makefile.in
-  log-edit.el lread.c xterm.c
+Tetsurou Okazaki: changed Makefile.in byte-opt.el log-edit.el lread.c
+  xterm.c
 
 Thamer Mahmoud: changed arabic.el
 
 Theodore Jump: changed makefile.nt makefile.def w32-win.el w32faces.c
 
 Thien-Thi Nguyen: co-wrote hideshow.el
-and changed ewoc.el vc.el info.el zone.el processes.texi lisp-mode.el
-  text.texi vc-rcs.el display.texi fileio.c files.el scheme.el vc-git.el
-  MORE.STUFF TUTORIAL.it bindat.el cc-vars.el configure.ac dcl-mode.el
-  diff-mode.el dired.el and 160 other files
+and changed ewoc.el vc.el info.el zone.el Makefile.in processes.texi
+  lisp-mode.el text.texi vc-rcs.el display.texi fileio.c files.el
+  scheme.el vc-git.el MORE.STUFF TUTORIAL.it bindat.el cc-vars.el
+  configure.in dcl-mode.el diff-mode.el and 158 other files
 
 Thierry Emery: changed kinsoku.el timezone.el url-http.el wid-edit.el
 
 Thierry Volpiatto: changed bookmark.el files.el dired-aux.el
-  eshell/eshell.el gnus-sum.el net-utils.el tramp.el files.texi
-  image-mode.el info.el man.el woman.el avoid.el dired.el doc-view.el
-  find-func.el font-lock.el gnus-art.el gnus-msg.el image-dired.el
-  message.el and 4 other files
-
-Thomas Bach: changed wisent/python.el
+  eshell/eshell.el gnus-sum.el files.texi image-mode.el info.el man.el
+  woman.el dired.el doc-view.el find-func.el gnus-art.el gnus-msg.el
+  image-dired.el tramp.el vc-rcs.el
 
 Thomas Baumann: wrote org-mhe.el
 and co-wrote org-bbdb.el
 
 Thomas Bellman: co-wrote avl-tree.el
 
-Thomas DeWeese: changed x-win.el
+Thomas Deweese: changed x-win.el
 
 Thomas Dorner: changed ange-ftp.el
 
@@ -4095,8 +3637,6 @@ Thomas Horsley: changed cxux-crt0.s cxux.h cxux7.h emacs.c nh3000.h
 
 Thomas Hühn: changed tutorial.el
 
-Thomas Kappler: changed nsfont.m
-
 Thomas Link: wrote filesets.el
 
 Thomas Morgan: changed org-habit.el forms.el select.el
@@ -4123,23 +3663,17 @@ Tibor Šimko: co-wrote language/slovak.el quail/slovak.el
 
 Tijs van Bakel: changed erc.el
 
-Tim Burt: changed org-datetree.el
-
 Tim Cross: changed keymaps.texi
 
 Tim Harper: changed ns-win.el
 
-Tim Howe: changed org-clock.el
-
 Tim Landscheidt: changed gnus.texi icalendar.el sort.el ws-mode.el
 
-Tim Van Holder: changed emacsclient.c Makefile.in configure.ac
+Tim Van Holder: changed emacsclient.c Makefile.in configure.in
   progmodes/compile.el which-func.el
 
 Timo Juhani Lindfors: changed gnus-msg.el
 
-Timo Myyrä: changed battery.el
-
 Timo Savola: changed emacs.c gtkutil.c startup.el x-win.el xfns.c xterm.c
   xterm.h
 
@@ -4150,14 +3684,13 @@ Tobias Ringström: changed etags.c
 Toby Allsopp: changed ldap.el eudc.el
 
 Toby Cubitt: co-wrote avl-tree.el
-and changed org-capture.el org.el org-agenda.el org-clock.el
-  org-colview.el org.texi
 
-Toby Speight: changed generic-x.el window.el
+Toby S. Cubitt: changed org.el
 
-Toke Høiland-Jørgensen: changed nnmaildir.el smime.el
+Toby Speight: changed generic-x.el window.el
 
-Tokuya Kameshima: changed org-mew.el org-agenda.el
+Tokuya Kameshima: wrote org-mew.el
+and co-wrote org-wl.el
 
 Tom Breton: changed autoinsert.el cus-edit.el gnus-agent.el lread.c
 
@@ -4169,23 +3702,15 @@ Tom Perrine: co-wrote modula2.el (public domain)
 
 Tom Rauchenwald: changed spam.el
 
-Tom Regner: changed notifications.el
-
-Tom Seddon: changed w32font.c
-
-Tom Tromey: wrote bug-reference.el erc-list.el package-x.el
-and co-wrote package.el tcl.el
-and changed buffer.c lisp.h makefile.el window.c keyboard.c keymap.c
-  xfns.c buffer.h bytecode.c callint.c callproc.c cmds.c composite.c
-  configure.ac dispextern.h doc.c editfns.c fileio.c frame.c insdel.c
-  intervals.h and 136 other files
-
-Tom Willemse: changed package.el
+Tom Tromey: wrote bug-reference.el erc-list.el package-x.el package.el
+and co-wrote tcl.el
+and changed buffer.c lisp.h makefile.el window.c xfns.c callint.c cmds.c
+  configure.in frame.c keyboard.c keymap.c xdisp.c buffer.h bytecode.c
+  callproc.c category.c character.c character.h charset.c coding.c
+  composite.c and 133 other files
 
 Tomas Abrahamsson: wrote artist.el
 
-Tomasz Gajewski: changed cpp-root.el
-
 Tommi Vainikainen: changed gnus-sum.el message.el mml-sec.el
 
 Tomohiko Morioka: co-wrote mm-bodies.el mm-decode.el mm-encode.el
@@ -4195,10 +3720,6 @@ and changed rmail.el nnmail.el rmailout.el gnus-sum.el nnfolder.el
   gnus-ems.el gnus-mule.el message.el nnspool.el nntp.el rmailkwd.el
   smiley.el
 
-Tomohiro Matsuyama: wrote profiler.el
-and changed profiler.c alloc.c emacs.c eval.c lisp.h src/Makefile.in
-  src/makefile.w32-in xdisp.c
-
 Tomoji Kagatani: wrote smtpmail.el
 
 Torbjörn Axelsson: changed options.el
@@ -4206,26 +3727,26 @@ Torbjörn Axelsson: changed options.el
 Torbjörn Einarsson: wrote progmodes/f90.el
 and changed f90.el
 
-Torsten Anders: changed ox-beamer.el
+Torsten Anders: changed org-beamer.el
 
 Torsten Bronger: changed latin-ltx.el
 
 Toru Tomabechi: wrote language/tibetan.el quail/tibetan.el tibet-util.el
 
 Toru Tsuneyoshi: changed ange-ftp.el buff-menu.el cus-start.el fileio.c
-  files.el fill.el lisp.h tramp.el w32fns.c
+  files.el lisp.h tramp.el w32fns.c
 
 Toshiaki Nomura: changed uxpds.h
 
-Trent W. Buck: changed rcirc.el remember.el rx.el
+Travis Jeffery: changed Info.plist
 
-Trevor Murphy: changed org.el
+Trent W. Buck: changed rcirc.el remember.el rx.el
 
 Trey Jackson: changed spam-stat.el
 
 Triet Hoai Lai: changed vntelex.el viet-util.el vietnamese.el
 
-Troels Nielsen: changed process.c buffer.c progmodes/compile.el window.el
+Troels Nielsen: changed process.c
 
 Trung Tran-Duc: changed nntp.el
 
@@ -4234,68 +3755,65 @@ Tsuchiya Masatoshi: changed gnus-art.el mm-view.el gnus-sum.el
   gnus-cache.el gnus-msg.el gnus.el nndiary.el nnfolder.el nnimap.el
   nnmaildir.el pgg.el rfc2047.el
 
-Tsugutomo Enami: changed frame.c keyboard.c configure.ac dispnew.c
+Tsugutomo Enami: changed frame.c keyboard.c configure.in dispnew.c
   fileio.c process.c simple.el sysdep.c xdisp.c add-log.el bytecomp.el
   editfns.c emacs.c frame.h gnus-group.el netbsd.h nnheader.el
-  perl-mode.el regex.c regex.h rmailsum.el and 5 other files
+  perl-mode.el regex.c regex.h rmailsum.el and 4 other files
 
 Tsuyoshi Akiho: changed gnus-sum.el nnrss.el
 
 Tudor Hulubei: changed iso-acc.el latin-pre.el
 
-U-Usuario: changed ob-gnuplot.el
-
 Uday S Reddy: changed etags.el fill.el
 
 Ulf Jasper: wrote bubbles.el icalendar-tests.el icalendar.el
   newst-backend.el newst-plainview.el newst-reader.el newst-ticker.el
   newst-treeview.el newsticker-tests.el newsticker.el
-and changed calendar.texi newsticker-plainview.el newsticker-treeview.el
-  newsticker.texi newsticker-backend.el newsticker-reader.el
-  newsticker-ticker.el Makefile.in README browse-url.xpm get-all.xpm
-  mark-immortal.xpm mark-read.xpm narrow.xpm newsticker next-feed.xpm
-  next-item.xpm prev-feed.xpm prev-item.xpm update.xpm xml.el
+and changed icalendar-testsuite.el calendar.texi newsticker-plainview.el
+  newsticker-treeview.el newsticker.texi newsticker-backend.el
+  newsticker-reader.el newsticker-ticker.el Makefile.in README
+  browse-url.xpm get-all.xpm mark-immortal.xpm mark-read.xpm narrow.xpm
+  newsticker newsticker-testsuite.el next-feed.xpm next-item.xpm
+  prev-feed.xpm prev-item.xpm and 3 other files
 
 Ulf Stegemann: co-wrote org-entities.el
 and changed org-gnus.el smime.el
 
 Ulrich Leodolter: changed w32proc.c
 
-Ulrich Müller: changed configure.ac doctor.el emacs.1 files.el gud.el
-  server.el src/Makefile.in ChgPane.c ChgSel.c HELLO INSTALL Makefile.in
-  XMakeAssoc.c authors.el bytecomp.el calc-units.el case-table.el
-  configure descr-text.el em-ls.el emacs.c and 34 other files
+Ulrich Mueller: changed configure.in Makefile.in doctor.el files.el
+  gud.el server.el ChgPane.c ChgSel.c HELLO INSTALL XMakeAssoc.c
+  authors.el bytecomp.el calc-units.el case-table.el configure em-ls.el
+  emacs.1 emacs.c emacs.desktop emacsclient.c and 26 other files
 
 Ulrich Neumerkel: changed xterm.c
 
 Ulrik Vieth: wrote meta-mode.el
 and changed files.el
 
-Uwe Brauer: changed mml-smime.el
-
 Vadim Nasardinov: changed allout.el
 
 Vagn Johansen: changed gnus-cache.el vc-svn.el
 
 Valentin Wüstholz: changed org.el
 
-Valery Alexeev: changed cyril-util.el cyrillic.el
-
-Vasily Korytov: changed cyrillic.el message.el cperl-mode.el gnus-art.el
-  gnus-dired.el gnus-msg.el gnus-util.el mail-source.el smiley.el
+Valery Alexeev: changed cyril-util.el quail/cyrillic.el
 
-Vegard Øye: changed viper-init.el
+Vasily Korytov: changed message.el quail/cyrillic.el cperl-mode.el
+  gnus-art.el gnus-dired.el gnus-msg.el gnus-util.el mail-source.el
+  smiley.el
 
 Victor Zandy: wrote zone.el
 
-Viktor Rosenfeld: changed ob-sql.el org.el
+Vida Gábor: changed gnus-demon.el
+
+Viktor Rosenfeld: changed ob-sql.el
 
 Ville Skyttä: changed mh-comp.el pgg.el tcl.el
 
 Vincent Belaïche: changed ses.el 5x5.el calc-alg.el calc-vec.el calc.texi
-  calc-embed.el calc-help.el calc-misc.el calc.el configure.bat
-  floatfns.c org.el recentf.el reftex-parse.el reftex-toc.el reftex.el
-  ses.texi
+  calc-embed.el calc-help.el calc-misc.el calc.el floatfns.c org.el
+  recentf.el
 
 Vincent Del Vecchio: changed info.el mh-utils.el
 
@@ -4306,52 +3824,40 @@ and co-wrote ps-def.el ps-mule.el ps-print.el ps-samp.el
 and changed ps-prin1.ps ps-bdf.el ps-prin0.ps blank-mode.el ps-prin3.ps
   ps-prin2.ps lpr.el subr.el diff-mode.el TUTORIAL.pt_BR compilation.txt
   easymenu.el loading.texi menu-bar.el misc.texi progmodes/compile.el
-  ps-print-def.el ps-vars.el
+  ps-print-def.el ps-print.ps ps-vars.el
 
-Vitalie Spinu: changed comint.el message.el ob-R.el ob-core.el
-  ob-tangle.el subr.el
+Vitalie Spinu: changed ob-R.el
 
 Vivek Dasmohapatra: wrote hfy-cmap.el htmlfontify.el
-and changed erc.el erc-backend.el erc-services.el hexl.el emacs.c
-  erc-join.el htmlfontify.texi sh-script.el xterm.c xterm.h
+and changed erc.el erc-backend.el emacs.c erc-join.el erc-services.el
+  sh-script.el xterm.c xterm.h
 
 Vladimir Alexiev: changed arc-mode.el nnvirtual.el tmm.el
 
-Vladimir Kazanov: changed java.srt
-
-Vladimir Lomov: changed ox-html.el
-
 Vladimir Volovich: changed smime.el
 
 Volker Sobek: changed programs.texi
 
 W. Martin Borgert: changed files.el schemas.xml
 
-W. Trevor King: changed xterm.el
-
 Walter C. Pelissero: changed browse-url.el url-methods.el
 
 Wang Diancheng: changed gdb-mi.el nnml.el
 
-Wei-Wei Guo: co-wrote rst.el
-
 Werner Benger: changed keyboard.c
 
 Werner Lemberg: wrote sisheng.el vntelex.el
-and co-wrote vnvni.el
-and changed TUTORIAL.de calc.texi chinese.el emacs.1 european.el
-  idlwave.el language/czech.el language/slovak.el lispref/Makefile.in
+and changed Makefile.in TUTORIAL.de calc.texi chinese.el emacs.1
+  european.el idlwave.el language/czech.el language/slovak.el
   reftex-vars.el reftex.el reftex.texi supercite.el advice.el
   calc-forms.el calc-sel.el calendar.el china-util.el cl-macs.el cl.texi
-  complete.el and 53 other files
+  complete.el and 50 other files
 
 Werner Meisner: changed lwlib-Xm.c
 
 Wes Hardaker: changed gnus-score.el gnus-art.el gnus-sum.el gnus-win.el
   spam.el
 
-Wesley Dawson: changed icomplete.el
-
 Wilfred Hughes: changed vc-git.el
 
 Will Glozer: changed macterm.c
@@ -4364,22 +3870,18 @@ William M. Perry: wrote url-dav.el url-gw.el url-http.el url-util.el
   url.el vc-dav.el
 and co-wrote mailcap.el socks.el
 and changed url-handlers.el url-file.el url-methods.el url-vars.el
-  url-https.el url-imap.el url-news.el url-nfs.el image.el mwheel.el
-  url-about.el url-auth.el url-cid.el url-dired.el url-expand.el
-  url-ftp.el url-history.el url-irc.el url-misc.el url-parse.el
-  url-privacy.el and 3 other files
-
-William Parsons: changed ange-ftp.el
+  url-https.el aclocal.m4 mule-sysdp.el url-imap.el url-news.el
+  url-nfs.el image.el mwheel.el url-about.el url-auth.el url-cid.el
+  url-dired.el url-expand.el url-ftp.el url-history.el url-irc.el
+  url-misc.el and 5 other files
 
 William Smith: changed strftime.c
 
 William Sommerfeld: wrote emacsclient.c scribe.el server.el
 
 William Stevenson: wrote adwaita-theme.el
-and changed artist.el
 
-William Xu: changed arc-mode.el gcc.el nsterm.m outline.el url.el
-  webjump.el
+William Xu: changed nsterm.m outline.el webjump.el
 
 Wilson H. Tien: changed unexelf.c
 
@@ -4389,23 +3891,20 @@ and changed files.el
 Wim Nieuwenhuizen: changed TUTORIAL.nl
 
 Wlodzimierz Bzyl: co-wrote ogonek.el
-and changed latin-pre.el pl-refcard.tex survival.tex
+and changed latin-pre.el pl-refcard.ps pl-refcard.tex refcard-pl.ps
+  refcard-pl.tex survival.tex
 
 Wolfgang Glas: changed unexsgi.c
 
-Wolfgang Jenkner: wrote man-tests.el
-and changed gnus-agent.el image-mode.el man.el ansi-color.el gnus-spec.el
-  gnus-sum.el gnus-util.el conf-mode.el functions.texi gnus-group.el
-  gnus-picon.el gnus-salt.el gnus-start.el gnus.texi intro.texi lread.c
-  network-stream.el nntp.el pcvs.el pop3.el progmodes/grep.el
-  and 3 other files
+Wolfgang Jenkner: changed conf-mode.el gnus-agent.el gnus-sum.el lread.c
+  network-stream.el pcvs.el pop3.el
 
 Wolfgang Lux: changed nsterm.m keyboard.c
 
 Wolfgang Rupprecht: wrote float-sup.el floatfns.c sup-mouse.el
-and changed process.c alloc.c callint.c config.in configure.ac data.c
-  fns.c lisp-mode.el lisp.h loadup.el lread.c net-utils.el nntp.el
-  print.c sort.el
+and changed config.in process.c alloc.c callint.c configure.in data.c
+  ecrt0.c fns.c lisp-mode.el lisp.h loadup.el lread.c net-utils.el
+  nntp.el print.c sort.el
 
 Wolfgang Scherer: changed vc-cvs.el
 
@@ -4417,32 +3916,21 @@ Wolfram Gloger: changed emacs.c
 
 Xavier Maillard: changed gnus-faq.texi gnus-score.el mh-utils.el spam.el
 
-Xue Fuqiao: changed display.texi maintaining.texi files.texi
-  nonascii.texi text.texi windows.texi os.texi vc-cvs.el vc-dir.el
-  emacs.texi ido.texi vc-git.el vc-hg.el vc-hooks.el vc-svn.el vc.el
-  vc/vc-bzr.el INSTALL cl.texi emacs-lisp-intro.texi frames.texi
-  and 92 other files
-
 Yagi Tatsuya: changed gnus-art.el gnus-start.el
 
-Yair F: changed hebrew.el
+Yair F: changed quail/hebrew.el
 
-Yamamoto Mitsuharu: wrote uvs.el
-and changed macterm.c macfns.c mac-win.el mac.c macterm.h macmenu.c
-  macgui.h image.c xdisp.c xterm.c macselect.c keyboard.c w32term.c
-  src/Makefile.in unexmacosx.c emacs.c darwin.h dispnew.c configure.ac
-  dispextern.h alloc.c and 90 other files
+Yamamoto Mitsuharu: changed macterm.c macfns.c mac-win.el mac.c macterm.h
+  macmenu.c macgui.h image.c xdisp.c macselect.c keyboard.c xterm.c
+  Makefile.in emacs.c darwin.h dispnew.c unexmacosx.c w32term.c alloc.c
+  dispextern.h configure.in and 88 other files
 
 Yann Dirson: changed imenu.el
 
-Yann Hodique: changed ox-publish.el package.el rcirc.el
-
-Yasushi Shoji: changed org-clock.el org.texi ox-ascii.el
-
-Yavor Doganov: changed configure.ac Makefile.in emacs.1 etags.1 make-dist
-  nsfont.m
+Yann Hodique: changed rcirc.el
 
-Ye Qianchuan: changed descr-text.el
+Yavor Doganov: changed configure.in Info-gnustep.plist Makefile.in
+  emacs.1 etags.1 make-dist nsfont.m
 
 Yoichi Nakayama: changed browse-url.el finder.el man.el rfc2368.el
 
@@ -4456,8 +3944,6 @@ Yoshiaki Kasahara: changed buffer.c term.c
 
 Yoshiki Hayashi: changed texinfmt.el nnheader.el
 
-Yoshinari Nomura: changed ox-html.el ox.el
-
 Yoshinori Koseki: wrote iimage.el
 and changed fontset.el message.el nnheader.el nnmail.el
 
@@ -4471,22 +3957,15 @@ Yuri Karaban: changed pop3.el
 
 Yuri Shtil: changed etags.c
 
-Yuriy Vostrikov: changed vc-git.el
-
-Yutaka Niibe: changed indent.c xdisp.c configure.ac dispnew.c sysdep.c
-  Makefile.in config.in dired.el emacs.c fill.el fns.c gmalloc.c
-  gnu-linux.h indent.h process.c simple.el src/Makefile.in term.c
-  window.c
-
-Yuya Nishihara: changed vc-hooks.el
-
-Yves Baumes: changed package.el
+Yutaka Niibe: changed indent.c xdisp.c configure.in Makefile.in dispnew.c
+  sysdep.c config.in dired.el emacs.c fill.el fns.c gmalloc.c gnu-linux.h
+  indent.h process.c simple.el term.c window.c
 
-Zachary Kanfer: changed org.el cus-edit.el keyboard.c
+Zachary Kanfer: changed cus-edit.el keyboard.c
 
 Zhang Wei: changed chinese.el characters.el mule-cmds.el xfns.c erc.el
-  faces.el fontset.el lib-src/makefile.w32-in mm-util.el mule.el
-  org-publish.el rfc2047.el x-win.el
+  faces.el fontset.el makefile.w32-in mm-util.el mule.el org-publish.el
+  rfc2047.el x-win.el
 
 Zhang Weize: wrote ob-plantuml.el
 
@@ -4494,28 +3973,7 @@ Zoltan Kemenczy: changed gud.el
 
 Zoran Milojevic: changed avoid.el
 
-Ævar Arnfjörð Bjarmason: changed rcirc.el
-
-Éric Jacoboni: changed fr-refcard.tex
-
-Óscar Fuentes: changed ido.el cmdproxy.c diff-mode.el emacsclient.c
-  vc-bzr.el
-
-İsmail Dönmez: changed nsfont.m nsterm.m url-auth.el xterm.c
-
-Łukasz Demianiuk: changed erc.el
-
-Łukasz Stelmach: changed cookie1.el gtkutil.c message.el org-agenda.el
-  org-bbdb.el org.el ox-html.el ox.el
-
-Štěpán Němec: changed INSTALL calc-ext.el cl.texi comint.el edebug.texi
-  font-lock.el loading.texi maps.texi mark.texi message.texi mini.texi
-  minibuf.texi misc.texi programs.texi subr.el tips.texi url-vars.el
-  url.texi vc-git.el window.c windows.texi
-
-Дядов Васил Стоянов: changed org-docview.el
-
-Йордан Миладинов: changed cyrillic.el
+Йордан Миладинов: changed quail/cyrillic.el
 
 Local Variables:
 coding: utf-8
index 33da02ca1003b781b06aac16d5a2220640fad7f9..a276331c57664fea543b10defd367c2b8733162d 100644 (file)
@@ -1,87 +1,8 @@
-               Censoring my Software
-                  Richard Stallman
-                       [From Datamation, 1 March 1996]
+Censoring my Software
 
+Note added March 2014:
 
-Last summer, a few clever legislators proposed a bill to "prohibit
-pornography" on the Internet.  Last fall, right-wing Christians made
-this cause their own.  Last week, President Clinton signed the bill,
-and we lost the freedom of the press for the public library of the
-future.  This week, I'm censoring GNU Emacs.
+This file is obsolete and will be removed in future.
+Please update any references to use
 
-No, GNU Emacs does not contain pornography.  It is a software package,
-an award-winning extensible and programmable text editor.  But the law
-that was passed applies to far more than pornography.  It prohibits
-"indecent" speech, which can include anything from famous poems, to
-masterpieces hanging in the Louvre, to advice about safe sex...to
-software.
-
-Naturally, there was a lot of opposition to this bill.  Not only from
-people who use the Internet, and people who appreciate erotica, but
-from everyone who cares about freedom of the press.
-
-But every time we tried to tell the public what was at stake, the
-forces of censorship responded with a lie: they told the public that
-the issue was simply pornography.  By embedding this lie as a
-presupposition in their statements about the issue, they succeeded in
-misinforming the public.  So here I am, censoring my software.
-
-You see, Emacs contains a version of the famous "doctor program",
-a.k.a. Eliza, originally developed by Professor Weizenbaum at MIT.
-This is the program that imitates a Rogerian psychotherapist.  The
-user talks to the program, and the program responds--by playing back
-the user's own statements, and by recognizing a long list of
-particular words.
-
-The Emacs doctor program was set up to recognize many common curse
-words, and respond with an appropriately cute message such as, "Would
-you please watch your tongue?" or "Let's not be vulgar."  In order to
-do this, it had to have a list of curse words.  That means the source
-code for the program was indecent.
-
-Because of the censorship law, I had to remove this feature.  (I
-replaced it with a message announcing that the program has been
-censored for your protection.)  The new version of the doctor doesn't
-recognize the indecent words.  If you curse at it, it curses right
-back to you--for lack of knowing better.
-
-Now that people are facing the threat of two years in prison for
-indecent network postings, it would be helpful if they could access
-precise rules via the Internet for how to avoid imprisonment.
-However, this is impossible.  The rules would have to mention the
-forbidden words, so posting them on the Internet would be against the
-rules.
-
-Of course, I'm making an assumption about just what "indecent" means.
-I have to do this, because nobody knows for sure.  The most obvious
-possible meaning is the meaning it has for television, so I'm using
-that as a tentative assumption.  However, there is a good chance that
-our courts will reject that interpretation of the law as
-unconstitutional.
-
-We can hope that the courts will recognize the Internet as a medium of
-publication like books and magazines.  If they do, they will entirely
-reject any law prohibiting "indecent" publications on the Internet.
-
-What really worries me is that the courts might take a muddled
-in-between escape route--by choosing another interpretation of
-"indecent", one that permits the doctor program or a statement of the
-decency rules, but prohibits some of the books that children can
-browse through in the public library and the bookstore.  Over the
-years, as the Internet replaces the public library and the bookstore,
-some of our freedom of the press will be lost.
-
-Just a few weeks ago, another country imposed censorship on the
-Internet.  That was China.  We don't think well of China in this
-country--its government doesn't respect basic freedoms.  But how well
-does our government respect them?  And do you care enough to preserve
-them here?
-
-If you care, stay in touch with the Voters Telecommunications Watch.
-Look in their Web site http://www.vtw.org/ for background information
-and political action recommendations.  Censorship won in February, but
-we can beat it in November.
-
-Copyright 1996 Richard Stallman
-Verbatim copying and distribution is permitted in any medium
-provided this notice is preserved.
+<http://www.gnu.org/philosophy/censoring-emacs.html>
index 06a0c4b531245833fe9ca37948db616995e9be8c..fdaf1f0cabd10951b3bdcece59ac22138cc14724 100644 (file)
@@ -1,40 +1,80 @@
-2014-07-12  Eli Zaretskii  <eliz@gnu.org>
+2014-07-21  Dmitry Antipov  <dmantipov@yandex.ru>
 
-       * PROBLEMS: Mention the problem from bug #17950.
+       * TODO: remove frame height remark.
 
-2014-07-04  Eli Zaretskii  <eliz@gnu.org>
+2014-07-11  Michael Albinus  <michael.albinus@gmx.de>
 
-       * TODO: Remove items that were already done.  Rearrange a few
-       items that are closely related.  Update a couple of items with new
-       information.
+       * NEWS: Passwords in batch mode are hidden.
 
-       * NEWS: Mention 'network-interface-list' and 'network-interface-info'
-       being available on MS-Windows.
-
-2014-06-29  Glenn Morris  <rgm@gnu.org>
+2014-07-03  Glenn Morris  <rgm@gnu.org>
 
        * refcards/calccard.tex (section{Getting Help}):
        Meaning of "on-line" has changed.
 
-2014-06-27  Glenn Morris  <rgm@gnu.org>
+2014-06-28  Glenn Morris  <rgm@gnu.org>
 
        * publicsuffix.txt: Update from source.
 
+2014-06-24  Eli Barzilay  <eli@barzilay.org>
+
+       * NEWS: calculator.el user-visible changes.
+
+2014-06-15  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: New Tramp method "nc".
+
 2014-06-08  Leo Liu  <sdl.web@gmail.com>
 
        * themes/deeper-blue-theme.el: Use another fix.  (Bug#17695)
 
-2014-06-05  Juri Linkov  <juri@jurta.org>
+2014-06-08  Juri Linkov  <juri@jurta.org>
 
        * themes/deeper-blue-theme.el (diff-added, diff-changed, diff-removed):
        Set face definitions explicitly.  Inherit indicator faces from them.
        (Bug#17695)
 
-2014-05-24  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-28  Reuben Thomas  <rrt@sc3d.org>
+
+       * TODO: add a note that undo-tree could be used to save undo
+       information (Bug #17581).
+
+2014-05-27  Fabrice Popineau  <fabrice.popineau@gmail.com>
+
+       * NEWS: Mention build changes on MS-Windows.
+
+2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        Specify coding if Latin-1 Emacs would misinterpret (Bug#17575).
        * ETAGS.EBNF, NEWS, ORG-NEWS: Add "coding: utf-8".
 
+2014-05-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * NEWS: Assume C99 or later (Bug#17487).
+
+2014-05-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't require pkg-config when building from repository.
+       * NEWS: Prefer './configure FOO=BAR' to 'FOO=BAR ./configure'.
+       * PROBLEMS (Build-time-problems): Remove pkg-config problem
+       that is no longer an issue.
+
+2014-05-13  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * PROBLEMS: Mention potential problems with
+       --enable-link-time-optimization and clang on Fedora 20.
+
+2014-05-04  Leo Liu  <sdl.web@gmail.com>
+
+       * NEWS: Mention support for Chinese dates in calendar and diary.
+
+2014-04-20  Daniel Colascione  <dancol@dancol.org>
+
+       * NEWS: Mention new struct functions and changes to `cl-the'.
+
+2014-04-17  Daniel Colascione  <dancol@dancol.org>
+
+       * NEWS: Mention bracketed paste support.
+
 2014-04-11  Glenn Morris  <rgm@gnu.org>
 
        * refcards/cs-dired-ref.tex, refcards/cs-refcard.tex:
        * refcards/sk-refcard.tex, refcards/sk-survival.tex:
        Input "utf8off", which seems to be needed.
 
+2014-04-01  Michael Albinus  <michael.albinus@gmx.de>
+
+       * NEWS: `url-handler-mode' passes operations to Tramp for some
+       protocols.
+
+2014-03-28  Tassilo Horn  <tsdh@gnu.org>
+
+       * themes/tsdh-light-theme.el (tsdh-light): Add gnus-group-* faces.
+
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * CENSORSHIP, GNU, LINUX-GNU, THE-GNU-PROJECT, WHY-FREE: Replace
+       contents with pointers to www.gnu.org or emacs.info, mark obsolete.
+
 2014-03-14  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
 
        * tutorials/TUTORIAL.de: Adapt to recent changes in TUTORIAL.
diff --git a/etc/GNU b/etc/GNU
index 5562a142c03f802e63b6a33eb8280e904e7d82d7..f8078d41cd34d325473175864bae9914d669ab6b 100644 (file)
--- a/etc/GNU
+++ b/etc/GNU
@@ -1,544 +1,8 @@
-Copyright (C) 1985, 1993, 2001-2014 Free Software Foundation, Inc.
-
-   Permission is granted to anyone to make or distribute verbatim copies
-of this document, in any medium, provided that the copyright notice and
-permission notice are preserved, and that the distributor grants the
-recipient permission for further redistribution as permitted by this
-notice.
-
-   Modified versions may not be made.
-
 The GNU Manifesto
-*****************
-
-     The GNU Manifesto which appears below was written by Richard
-     Stallman at the beginning of the GNU project, to ask for
-     participation and support.  For the first few years, it was
-     updated in minor ways to account for developments, but now it
-     seems best to leave it unchanged as most people have seen it.
-
-     Since that time, we have learned about certain common
-     misunderstandings that different wording could help avoid.
-     Footnotes added in 1993 help clarify these points.
-
-     For up-to-date information about the available GNU software,
-     please see www.gnu.org.  For software tasks to work on, see
-     http://savannah.gnu.org/projects/tasklist.  For other ways
-     to contribute, see http://www.gnu.org/help.
-
-What's GNU?  Gnu's Not Unix!
-============================
-
-   GNU, which stands for Gnu's Not Unix, is the name for the complete
-Unix-compatible software system which I am writing so that I can give it
-away free to everyone who can use it.(1) Several other volunteers are
-helping me.  Contributions of time, money, programs and equipment are
-greatly needed.
-
-   So far we have an Emacs text editor with Lisp for writing editor
-commands, a source level debugger, a yacc-compatible parser generator,
-a linker, and around 35 utilities.  A shell (command interpreter) is
-nearly completed.  A new portable optimizing C compiler has compiled
-itself and may be released this year.  An initial kernel exists but
-many more features are needed to emulate Unix.  When the kernel and
-compiler are finished, it will be possible to distribute a GNU system
-suitable for program development.  We will use TeX as our text
-formatter, but an nroff is being worked on.  We will use the free,
-portable X window system as well.  After this we will add a portable
-Common Lisp, an Empire game, a spreadsheet, and hundreds of other
-things, plus on-line documentation.  We hope to supply, eventually,
-everything useful that normally comes with a Unix system, and more.
-
-   GNU will be able to run Unix programs, but will not be identical to
-Unix.  We will make all improvements that are convenient, based on our
-experience with other operating systems.  In particular, we plan to
-have longer file names, file version numbers, a crashproof file system,
-file name completion perhaps, terminal-independent display support, and
-perhaps eventually a Lisp-based window system through which several
-Lisp programs and ordinary Unix programs can share a screen.  Both C
-and Lisp will be available as system programming languages.  We will
-try to support UUCP, MIT Chaosnet, and Internet protocols for
-communication.
-
-   GNU is aimed initially at machines in the 68000/16000 class with
-virtual memory, because they are the easiest machines to make it run
-on.  The extra effort to make it run on smaller machines will be left
-to someone who wants to use it on them.
-
-   To avoid horrible confusion, please pronounce the `G' in the word
-`GNU' when it is the name of this project.
-
-Why I Must Write GNU
-====================
-
-   I consider that the golden rule requires that if I like a program I
-must share it with other people who like it.  Software sellers want to
-divide the users and conquer them, making each user agree not to share
-with others.  I refuse to break solidarity with other users in this
-way.  I cannot in good conscience sign a nondisclosure agreement or a
-software license agreement.  For years I worked within the Artificial
-Intelligence Lab to resist such tendencies and other inhospitalities,
-but eventually they had gone too far: I could not remain in an
-institution where such things are done for me against my will.
-
-   So that I can continue to use computers without dishonor, I have
-decided to put together a sufficient body of free software so that I
-will be able to get along without any software that is not free.  I
-have resigned from the AI lab to deny MIT any legal excuse to prevent
-me from giving GNU away.
-
-Why GNU Will Be Compatible with Unix
-====================================
-
-   Unix is not my ideal system, but it is not too bad.  The essential
-features of Unix seem to be good ones, and I think I can fill in what
-Unix lacks without spoiling them.  And a system compatible with Unix
-would be convenient for many other people to adopt.
-
-How GNU Will Be Available
-=========================
-
-   GNU is not in the public domain.  Everyone will be permitted to
-modify and redistribute GNU, but no distributor will be allowed to
-restrict its further redistribution.  That is to say, proprietary
-modifications will not be allowed.  I want to make sure that all
-versions of GNU remain free.
-
-Why Many Other Programmers Want to Help
-=======================================
-
-   I have found many other programmers who are excited about GNU and
-want to help.
-
-   Many programmers are unhappy about the commercialization of system
-software.  It may enable them to make more money, but it requires them
-to feel in conflict with other programmers in general rather than feel
-as comrades.  The fundamental act of friendship among programmers is the
-sharing of programs; marketing arrangements now typically used
-essentially forbid programmers to treat others as friends.  The
-purchaser of software must choose between friendship and obeying the
-law.  Naturally, many decide that friendship is more important.  But
-those who believe in law often do not feel at ease with either choice.
-They become cynical and think that programming is just a way of making
-money.
-
-   By working on and using GNU rather than proprietary programs, we can
-be hospitable to everyone and obey the law.  In addition, GNU serves as
-an example to inspire and a banner to rally others to join us in
-sharing.  This can give us a feeling of harmony which is impossible if
-we use software that is not free.  For about half the programmers I
-talk to, this is an important happiness that money cannot replace.
-
-How You Can Contribute
-======================
-
-   I am asking computer manufacturers for donations of machines and
-money.  I'm asking individuals for donations of programs and work.
-
-   One consequence you can expect if you donate machines is that GNU
-will run on them at an early date.  The machines should be complete,
-ready to use systems, approved for use in a residential area, and not
-in need of sophisticated cooling or power.
-
-   I have found very many programmers eager to contribute part-time
-work for GNU.  For most projects, such part-time distributed work would
-be very hard to coordinate; the independently-written parts would not
-work together.  But for the particular task of replacing Unix, this
-problem is absent.  A complete Unix system contains hundreds of utility
-programs, each of which is documented separately.  Most interface
-specifications are fixed by Unix compatibility.  If each contributor
-can write a compatible replacement for a single Unix utility, and make
-it work properly in place of the original on a Unix system, then these
-utilities will work right when put together.  Even allowing for Murphy
-to create a few unexpected problems, assembling these components will
-be a feasible task.  (The kernel will require closer communication and
-will be worked on by a small, tight group.)
-
-   If I get donations of money, I may be able to hire a few people full
-or part time.  The salary won't be high by programmers' standards, but
-I'm looking for people for whom building community spirit is as
-important as making money.  I view this as a way of enabling dedicated
-people to devote their full energies to working on GNU by sparing them
-the need to make a living in another way.
-
-Why All Computer Users Will Benefit
-===================================
-
-   Once GNU is written, everyone will be able to obtain good system
-software free, just like air.(2)
-
-   This means much more than just saving everyone the price of a Unix
-license.  It means that much wasteful duplication of system programming
-effort will be avoided.  This effort can go instead into advancing the
-state of the art.
-
-   Complete system sources will be available to everyone.  As a result,
-a user who needs changes in the system will always be free to make them
-himself, or hire any available programmer or company to make them for
-him.  Users will no longer be at the mercy of one programmer or company
-which owns the sources and is in sole position to make changes.
-
-   Schools will be able to provide a much more educational environment
-by encouraging all students to study and improve the system code.
-Harvard's computer lab used to have the policy that no program could be
-installed on the system if its sources were not on public display, and
-upheld it by actually refusing to install certain programs.  I was very
-much inspired by this.
-
-   Finally, the overhead of considering who owns the system software
-and what one is or is not entitled to do with it will be lifted.
-
-   Arrangements to make people pay for using a program, including
-licensing of copies, always incur a tremendous cost to society through
-the cumbersome mechanisms necessary to figure out how much (that is,
-which programs) a person must pay for.  And only a police state can
-force everyone to obey them.  Consider a space station where air must
-be manufactured at great cost: charging each breather per liter of air
-may be fair, but wearing the metered gas mask all day and all night is
-intolerable even if everyone can afford to pay the air bill.  And the
-TV cameras everywhere to see if you ever take the mask off are
-outrageous.  It's better to support the air plant with a head tax and
-chuck the masks.
-
-   Copying all or parts of a program is as natural to a programmer as
-breathing, and as productive.  It ought to be as free.
-
-Some Easily Rebutted Objections to GNU's Goals
-==============================================
-
-     "Nobody will use it if it is free, because that means they can't
-     rely on any support."
-
-     "You have to charge for the program to pay for providing the
-     support."
-
-   If people would rather pay for GNU plus service than get GNU free
-without service, a company to provide just service to people who have
-obtained GNU free ought to be profitable.(3)
-
-   We must distinguish between support in the form of real programming
-work and mere handholding.  The former is something one cannot rely on
-from a software vendor.  If your problem is not shared by enough
-people, the vendor will tell you to get lost.
-
-   If your business needs to be able to rely on support, the only way
-is to have all the necessary sources and tools.  Then you can hire any
-available person to fix your problem; you are not at the mercy of any
-individual.  With Unix, the price of sources puts this out of
-consideration for most businesses.  With GNU this will be easy.  It is
-still possible for there to be no available competent person, but this
-problem cannot be blamed on distribution arrangements.  GNU does not
-eliminate all the world's problems, only some of them.
-
-   Meanwhile, the users who know nothing about computers need
-handholding: doing things for them which they could easily do
-themselves but don't know how.
-
-   Such services could be provided by companies that sell just
-hand-holding and repair service.  If it is true that users would rather
-spend money and get a product with service, they will also be willing
-to buy the service having got the product free.  The service companies
-will compete in quality and price; users will not be tied to any
-particular one.  Meanwhile, those of us who don't need the service
-should be able to use the program without paying for the service.
-
-     "You cannot reach many people without advertising, and you must
-     charge for the program to support that."
-
-     "It's no use advertising a program people can get free."
-
-   There are various forms of free or very cheap publicity that can be
-used to inform numbers of computer users about something like GNU.  But
-it may be true that one can reach more microcomputer users with
-advertising.  If this is really so, a business which advertises the
-service of copying and mailing GNU for a fee ought to be successful
-enough to pay for its advertising and more.  This way, only the users
-who benefit from the advertising pay for it.
-
-   On the other hand, if many people get GNU from their friends, and
-such companies don't succeed, this will show that advertising was not
-really necessary to spread GNU.  Why is it that free market advocates
-don't want to let the free market decide this?(4)
-
-     "My company needs a proprietary operating system to get a
-     competitive edge."
-
-   GNU will remove operating system software from the realm of
-competition.  You will not be able to get an edge in this area, but
-neither will your competitors be able to get an edge over you.  You and
-they will compete in other areas, while benefiting mutually in this
-one.  If your business is selling an operating system, you will not
-like GNU, but that's tough on you.  If your business is something else,
-GNU can save you from being pushed into the expensive business of
-selling operating systems.
-
-   I would like to see GNU development supported by gifts from many
-manufacturers and users, reducing the cost to each.(5)
-
-     "Don't programmers deserve a reward for their creativity?"
-
-   If anything deserves a reward, it is social contribution.
-Creativity can be a social contribution, but only in so far as society
-is free to use the results.  If programmers deserve to be rewarded for
-creating innovative programs, by the same token they deserve to be
-punished if they restrict the use of these programs.
-
-     "Shouldn't a programmer be able to ask for a reward for his
-     creativity?"
-
-   There is nothing wrong with wanting pay for work, or seeking to
-maximize one's income, as long as one does not use means that are
-destructive.  But the means customary in the field of software today
-are based on destruction.
-
-   Extracting money from users of a program by restricting their use of
-it is destructive because the restrictions reduce the amount and the
-ways that the program can be used.  This reduces the amount of wealth
-that humanity derives from the program.  When there is a deliberate
-choice to restrict, the harmful consequences are deliberate destruction.
-
-   The reason a good citizen does not use such destructive means to
-become wealthier is that, if everyone did so, we would all become
-poorer from the mutual destructiveness.  This is Kantian ethics; or,
-the Golden Rule.  Since I do not like the consequences that result if
-everyone hoards information, I am required to consider it wrong for one
-to do so.  Specifically, the desire to be rewarded for one's creativity
-does not justify depriving the world in general of all or part of that
-creativity.
-
-     "Won't programmers starve?"
-
-   I could answer that nobody is forced to be a programmer.  Most of us
-cannot manage to get any money for standing on the street and making
-faces.  But we are not, as a result, condemned to spend our lives
-standing on the street making faces, and starving.  We do something
-else.
-
-   But that is the wrong answer because it accepts the questioner's
-implicit assumption: that without ownership of software, programmers
-cannot possibly be paid a cent.  Supposedly it is all or nothing.
-
-   The real reason programmers will not starve is that it will still be
-possible for them to get paid for programming; just not paid as much as
-now.
-
-   Restricting copying is not the only basis for business in software.
-It is the most common basis because it brings in the most money.  If it
-were prohibited, or rejected by the customer, software business would
-move to other bases of organization which are now used less often.
-There are always numerous ways to organize any kind of business.
-
-   Probably programming will not be as lucrative on the new basis as it
-is now.  But that is not an argument against the change.  It is not
-considered an injustice that sales clerks make the salaries that they
-now do.  If programmers made the same, that would not be an injustice
-either.  (In practice they would still make considerably more than
-that.)
-
-     "Don't people have a right to control how their creativity is
-     used?"
-
-   "Control over the use of one's ideas" really constitutes control over
-other people's lives; and it is usually used to make their lives more
-difficult.
-
-   People who have studied the issue of intellectual property rights(6)
-carefully (such as lawyers) say that there is no intrinsic right to
-intellectual property.  The kinds of supposed intellectual property
-rights that the government recognizes were created by specific acts of
-legislation for specific purposes.
-
-   For example, the patent system was established to encourage
-inventors to disclose the details of their inventions.  Its purpose was
-to help society rather than to help inventors.  At the time, the life
-span of 17 years for a patent was short compared with the rate of
-advance of the state of the art.  Since patents are an issue only among
-manufacturers, for whom the cost and effort of a license agreement are
-small compared with setting up production, the patents often do not do
-much harm.  They do not obstruct most individuals who use patented
-products.
-
-   The idea of copyright did not exist in ancient times, when authors
-frequently copied other authors at length in works of non-fiction.  This
-practice was useful, and is the only way many authors' works have
-survived even in part.  The copyright system was created expressly for
-the purpose of encouraging authorship.  In the domain for which it was
-invented--books, which could be copied economically only on a printing
-press--it did little harm, and did not obstruct most of the individuals
-who read the books.
-
-   All intellectual property rights are just licenses granted by society
-because it was thought, rightly or wrongly, that society as a whole
-would benefit by granting them.  But in any particular situation, we
-have to ask: are we really better off granting such license?  What kind
-of act are we licensing a person to do?
-
-   The case of programs today is very different from that of books a
-hundred years ago.  The fact that the easiest way to copy a program is
-from one neighbor to another, the fact that a program has both source
-code and object code which are distinct, and the fact that a program is
-used rather than read and enjoyed, combine to create a situation in
-which a person who enforces a copyright is harming society as a whole
-both materially and spiritually; in which a person should not do so
-regardless of whether the law enables him to.
-
-     "Competition makes things get done better."
-
-   The paradigm of competition is a race: by rewarding the winner, we
-encourage everyone to run faster.  When capitalism really works this
-way, it does a good job; but its defenders are wrong in assuming it
-always works this way.  If the runners forget why the reward is offered
-and become intent on winning, no matter how, they may find other
-strategies--such as, attacking other runners.  If the runners get into
-a fist fight, they will all finish late.
-
-   Proprietary and secret software is the moral equivalent of runners
-in a fist fight.  Sad to say, the only referee we've got does not seem
-to object to fights; he just regulates them ("For every ten yards you
-run, you can fire one shot").  He really ought to break them up, and
-penalize runners for even trying to fight.
-
-     "Won't everyone stop programming without a monetary incentive?"
-
-   Actually, many people will program with absolutely no monetary
-incentive.  Programming has an irresistible fascination for some
-people, usually the people who are best at it.  There is no shortage of
-professional musicians who keep at it even though they have no hope of
-making a living that way.
-
-   But really this question, though commonly asked, is not appropriate
-to the situation.  Pay for programmers will not disappear, only become
-less.  So the right question is, will anyone program with a reduced
-monetary incentive?  My experience shows that they will.
-
-   For more than ten years, many of the world's best programmers worked
-at the Artificial Intelligence Lab for far less money than they could
-have had anywhere else.  They got many kinds of non-monetary rewards:
-fame and appreciation, for example.  And creativity is also fun, a
-reward in itself.
-
-   Then most of them left when offered a chance to do the same
-interesting work for a lot of money.
-
-   What the facts show is that people will program for reasons other
-than riches; but if given a chance to make a lot of money as well, they
-will come to expect and demand it.  Low-paying organizations do poorly
-in competition with high-paying ones, but they do not have to do badly
-if the high-paying ones are banned.
-
-     "We need the programmers desperately.  If they demand that we stop
-     helping our neighbors, we have to obey."
-
-   You're never so desperate that you have to obey this sort of demand.
-Remember: millions for defense, but not a cent for tribute!
-
-     "Programmers need to make a living somehow."
-
-   In the short run, this is true.  However, there are plenty of ways
-that programmers could make a living without selling the right to use a
-program.  This way is customary now because it brings programmers and
-businessmen the most money, not because it is the only way to make a
-living.  It is easy to find other ways if you want to find them.  Here
-are a number of examples.
-
-   A manufacturer introducing a new computer will pay for the porting of
-operating systems onto the new hardware.
-
-   The sale of teaching, hand-holding and maintenance services could
-also employ programmers.
-
-   People with new ideas could distribute programs as freeware(7), asking
-for donations from satisfied users, or selling hand-holding services.
-I have met people who are already working this way successfully.
-
-   Users with related needs can form users' groups, and pay dues.  A
-group would contract with programming companies to write programs that
-the group's members would like to use.
-
-   All sorts of development can be funded with a Software Tax:
-
-     Suppose everyone who buys a computer has to pay x percent of the
-     price as a software tax.  The government gives this to an agency
-     like the NSF to spend on software development.
-
-     But if the computer buyer makes a donation to software development
-     himself, he can take a credit against the tax.  He can donate to
-     the project of his own choosing--often, chosen because he hopes to
-     use the results when it is done.  He can take a credit for any
-     amount of donation up to the total tax he had to pay.
-
-     The total tax rate could be decided by a vote of the payers of the
-     tax, weighted according to the amount they will be taxed on.
-
-     The consequences:
-
-        * The computer-using community supports software development.
-
-        * This community decides what level of support is needed.
-
-        * Users who care which projects their share is spent on can
-          choose this for themselves.
-
-   In the long run, making programs free is a step toward the
-post-scarcity world, where nobody will have to work very hard just to
-make a living.  People will be free to devote themselves to activities
-that are fun, such as programming, after spending the necessary ten
-hours a week on required tasks such as legislation, family counseling,
-robot repair and asteroid prospecting.  There will be no need to be
-able to make a living from programming.
-
-   We have already greatly reduced the amount of work that the whole
-society must do for its actual productivity, but only a little of this
-has translated itself into leisure for workers because much
-nonproductive activity is required to accompany productive activity.
-The main causes of this are bureaucracy and isometric struggles against
-competition.  Free software will greatly reduce these drains in the
-area of software production.  We must do this, in order for technical
-gains in productivity to translate into less work for us.
-
-   ---------- Footnotes ----------
-
-   (1)  The wording here was careless.  The intention was that nobody
-would have to pay for *permission* to use the GNU system.  But the
-words don't make this clear, and people often interpret them as saying
-that copies of GNU should always be distributed at little or no charge.
-That was never the intent; later on, the manifesto mentions the
-possibility of companies providing the service of distribution for a
-profit.  Subsequently I have learned to distinguish carefully between
-"free" in the sense of freedom and "free" in the sense of price.  Free
-software is software that users have the freedom to distribute and
-change.  Some users may obtain copies at no charge, while others pay to
-obtain copies--and if the funds help support improving the software, so
-much the better.  The important thing is that everyone who has a copy
-has the freedom to cooperate with others in using it.
-
-   (2)  This is another place I failed to distinguish carefully between
-the two different meanings of "free".  The statement as it stands is
-not false--you can get copies of GNU software at no charge, from your
-friends or over the net.  But it does suggest the wrong idea.
-
-   (3)  Several such companies now exist.
-
-   (4)  The Free Software Foundation raised most of its funds for 10
-years from a distribution service, although it is a charity rather
-than a company.
-
-   (5) A group of computer companies pooled funds around 1991 to
-support maintenance of the GNU C Compiler.
 
-   (6) In the 80s I had not yet realized how confusing it was to speak
-of "the issue" of "intellectual property".  That term is obviously
-biased; more subtle is the fact that it lumps together various
-disparate laws which raise very different issues.  Nowadays I urge
-people to reject the term "intellectual property" entirely, lest it
-lead others to suppose that those laws form one coherent issue.  The way to be
-clear is to discuss patents, copyrights, and trademarks separately.
-See http://www.gnu.org/philosophy/not-ipr.xhtml for more explanation
-of how this term spreads confusion and bias.
+Note added March 2014:
 
-   (7) Subsequently we have learned to distinguish between "free
-software" and "freeware".  The term "freeware" means software you are
-free to redistribute, but usually you are not free to study and change
-the source code, so most of it is not free software.  See
-http://www.gnu.org/philosophy/words-to-avoid.html for more
-explanation.
+This file is obsolete and will be removed in future.
+Please update any references to use
+  info node `(emacs)Manifesto'
+instead.
index 8d55f1a5c2d38abbea8b9b2c0752b0b1158bc7f2..9e1c1a513a14a3a533ce1f4e867ea571724bfb7f 100644 (file)
@@ -1,147 +1,8 @@
-                    Linux and the GNU system
+Linux and the GNU system
 
-The GNU project started in 1984 with the goal of developing a complete
-free Unix-like operating system: GNU.  "Free" refers to freedom, not
-price; it means you are free to run, copy, distribute, study, change,
-and improve the software.
+Note added March 2014:
 
-A Unix-like system consists of many different programs.  We found some
-components already available as free software--for example, X Windows
-and TeX.  We obtained other components by helping to convince their
-developers to make them free--for example, the Berkeley network
-utilities.  This left many missing components that we had to write in
-order to produce GNU--for example, GNU Emacs, the GNU C compiler, the
-GNU C library, Bash, and Ghostscript.  The GNU system consists of all
-these components together.
-
-The GNU project is not just about developing and distributing some
-useful free software.  The heart of the GNU project is an idea: that
-software should be free, that software users should have freedom to
-participate in a community.  To run your computer, you need an
-operating system; if it is not free, your freedom has been denied.  To
-have freedom, you need a free operating system.  We therefore set out
-to write one.
-
-In the long run, though, we cannot expect to keep the free operating
-system free unless the users are aware of the freedom it gives them,
-and value that freedom.  People who do not appreciate their freedom
-will not keep it long.  If we want to make freedom last, we need to
-spread awareness of the freedoms they have in free software.
-
-The GNU project's method is that free software and the idea of users'
-freedom support each other.  We develop GNU software, and as people
-encounter GNU programs or the GNU system and start to use them, they
-also think about the GNU idea.  The software shows that the idea can
-work in practice.  Some of these people come to agree with the idea,
-and then they are more likely to write additional free software.
-Thus, the software embodies the idea, spreads the idea, and grows from
-the idea.
-
-Early on in the development of GNU, various parts of it became popular
-even though users needed proprietary systems to run them on.  Porting
-the system to many systems and maintaining them required a lot of
-work.  After that work, most GNU software is easily configured for a
-variety of different platforms.
-
-By 1991, we had found or written all of the essential major components
-of the system except the kernel, which we were writing.  (This kernel
-consists of the Mach microkernel plus the GNU HURD.  The first test
-release was made in 1996.  Now, in 2002, it is running well, and
-Hurd-based GNU systems are starting to be used.)
-
-That was the situation when Linux came into being.  Linux is a kernel,
-like the kernel of Unix; it was written by Linus Torvalds, who
-released it under the GNU General Public License.  He did not write
-this kernel for GNU, but it fit into the gap in GNU.  The combination
-of GNU and Linux included all the major essential components of a
-Unix-compatible operating system.  Other people, with some work made
-the combination into a usable system.  The principal use of Linux, the
-kernel, is as part of this combination.
-
-The popularity of the GNU/Linux combination is success, in the sense
-of popularity, for GNU.  Ironically, the popularity of GNU/Linux
-undermines our method of communicating the ideas of GNU to people who
-use GNU.
-
-When GNU programs were only usable individually on top of another
-operating system, installing and using them meant knowing and
-appreciating these programs, and thus being aware of GNU, which led
-people to think about the philosophical base of GNU.  Now users can
-install a unified operating system which is basically GNU, but they
-usually think these are "Linux systems".  At first impression, a
-"Linux system" sounds like something completely distinct from the "GNU
-system," and that is what most users think.
-
-This leads many users to identify themselves as a separate community
-of "Linux users", distinct from the GNU user community.  They use more
-than just some GNU programs, they use almost all of the GNU system,
-but they don't think of themselves as GNU users.  Often they never
-hear about the GNU idea; if they do, they may not think it relates to
-them.
-
-Most introductions to the "Linux system" acknowledge that GNU software
-components play a role in it, but they don't say that the system as a
-whole is a modified version of the GNU system that the GNU project has
-been developing and compiling since Linus Torvalds was in junior high
-school.  They don't say that the main reason this free operating
-exists is that the GNU Project worked persistently to achieve its goal
-of freedom.
-
-As a result, most users don't know these things.  They believe that
-the "Linux system" was developed by Linus Torvalds "just for fun", and
-that their freedom is a matter of good fortune rather than the
-dedicated pursuit of freedom.  This creates a danger that they will
-leave the survival of free software to fortune as well.
-
-Since human beings tend to correct their first impressions less than
-called for by additional information they learn later, these users
-will tend to continue to underestimate their connection to GNU even if
-they do learn the facts.
-
-When we began trying to support the GNU/Linux system, we found this
-widespread misinformation led to a practical problem--it hampered
-cooperation on software maintenance.  Normally when users change a GNU
-program to make it work better on a particular system, they send the
-change to the maintainer of that program; then they work with the
-maintainer, explaining the change, arguing for it, and sometimes
-rewriting it for the sake of the overall coherence and maintainability
-of the package, to get the patch installed.  But people who thought of
-themselves as "Linux users" showed a tendency to release a forked
-"Linux-only" version of the GNU program and consider the job done.  In
-some cases we had to redo their work in order to make GNU programs run
-as released in GNU/Linux systems.
-
-How should the GNU project encourage its users to cooperate?  How
-should we spread the idea that freedom for computer users is
-important?
-
-We must continue to talk about the freedom to share and change
-software--and to teach other users to value these freedoms.  If we
-value having a free operating system, it makes sense to think about
-preserving those freedoms for the long term.  If we value having a
-variety of free software, it makes sense to think about encouraging
-others to write free software, instead of proprietary software.
-
-However, it is not enough just to talk about freedom; we must also
-make sure people know the reasons it is worth listening to what we
-say.
-
-Long explanations such as our philosophical articles are one way of
-informing the public, but you may not want to spend so much time on
-the matter.  The most effective way you can help with a small amount
-of work is simply by using the terms "Linux-based GNU system" or
-"GNU/Linux system", instead of "Linux system," when you write about or
-mention such a system.  Seeing these terms will show many people the
-reason to pay attention to our philosophical articles.
-
-The system as a whole is more GNU than Linux; the name "GNU/Linux" is
-fair.  When you are choosing the name of a distribution or a user
-group, a name with "GNU/Linux" will reflect both roots of the combined
-system, and will bring users into connection with both--including the
-spirit of freedom and community that is the basis and purpose of GNU.
-
-
-Copyright 1996, 2002 Richard Stallman
-Verbatim copying and redistribution is permitted
-without royalty as long as this notice is preserved.
+This file is obsolete and will be removed in future.
+Please update any references to use
 
+<http://www.gnu.org/gnu/linux-and-gnu.html>
index d60510eab91792ec257a1d23ff63e383d548885e..a51b4c93da7526930fc2ffc8844a69fc10b83d65 100644 (file)
@@ -39,8 +39,8 @@ the list at the end of this file.
   The GNU project wants users of GNU/Linux systems to be aware of how
   these systems relate to the GNU project, because that will help
   spread the GNU idea that software should be free--and thus encourage
-  people to write more free software.  See the file LINUX-GNU in this
-  directory for more explanation.
+  people to write more free software.  For more information, see
+  <http://www.gnu.org/gnu/linux-and-gnu.html>.
 
 *** 64-bit GNU/Linux
 
@@ -102,103 +102,21 @@ the list at the end of this file.
 
 ** Irix 6.5
 
-  It *may* be possible to build Emacs on Irix 6.5 with an old version
-  (3.1) of gcc.  Newer versions of gcc may not work.  None of the
-  current Emacs developers use Irix, though.  If you want to help
-  make Emacs on Irix work, see <http://debbugs.gnu.org/9684>.
+  Emacs versions later than 24.4 will not compile on Irix by default.
+  (Note that SGI stopped supporting Irix in December 2013.)
+  You should be able to work around the problem either by porting the
+  Emacs undumping code to GCC under Irix, or by configuring --with-wide-int.
+  Older versions of Emacs 24 (and 23?) also had problems on Irix.
+  It *may* be possible to build Emacs <= 24.4 on Irix 6.5 with an old
+  version (3.1) of gcc.  Newer versions of gcc may not work.
+  See <http://debbugs.gnu.org/9684>.
 
 \f
 * Obsolete platforms
 
-Support for the following obsolete platforms was removed in Emacs 23.1
-(the names in parentheses state the files in src/ that were removed):
-
-  Apollo SR10.x (unexapollo.c)
-  Convex (unexconvex.c and m/convex.c)
-  Xenix (unexenix.c and s/xenix.h)
-  Iris  (unexmips.c m/iris4d.h m/irist.h s/iris3-5.h s/iris3-6.h)
-  Gould (m/gould*)
-  Siemens machines running Sinix (unexsni.c)
-  Harris CXUX (s/cxux*)
-  ESIX, a variant of v.5.3 for the 386 (s/esix*)
-  Interactive (ISC) Unix (s/isc*)
-  Sony News (s/newsos*)
-  RTU 3.0, ucb universe (s/rtu.h)
-  UniSoft's UniPlus 5.2 (s/uniplus.h)
-  UMAX (s/umax.h)
-  AT&T UNIX PC model 7300 (m/7300.h)
-  Acorn
-  Alliant (m/alliant*)
-  Amdahl (m/amdahl*)
-  Altos 3068 Unix System V Release 2 (m/altos.h)
-  Apollo (m/apollo.h)
-  AT&T 3b (m/att3b.h)
-  Aviion (m/aviion*)
-  Berkeley 4.1 (m/bsd4.1.h)
-  Berkeley 4.2 (m/bsd4.2.h)
-  Berkeley 4.3 (m/bsd4.3.h)
-  Celerity (m/celerity.h)
-  clipper (m/clipper.h)
-  convergent S series (m/cnvrgnt.h)
-  cydra (m/cydra5.h)
-  Motorola System V/88 machines (m/delta88k.h)
-  Bull DPX/2 range (m/dpx2.h)
-  Dual machines using unisoft port (m/dual.h)
-  Elxsi machine (running enix) (m/elxsi.h)
-  Fujitsu F301 machine (m/f301.h)
-  i860 (m/i860.h)
-  ibm ps/2 aix386 (m/ibmps2-aix.h)
-  ISI 68000's (m/is*)
-  Masscomp 5000 series running RTU, ucb universe (m/masscomp.h)
-  Megatest 68000's (m/mega68.h)
-  Whitechapel Computer Works MG1 (ns16000 based) (m/mg1.h)
-  Harris Night Hawk Series 1200 and Series 3000 (m/nh3000.h m/nh4000.h)
-  ns16000 (m/ns16000.h)
-  National Semiconductor 32000, running Genix (m/ns32000.h)
-  TI Nu machines using system V (m/nu.h)
-  HLH Orion (m/orion.h m/orion105.h)
-  Paragon i860 (m/paragon.h)
-  PFU A-series (m/pfa50.h)
-  Plexus running System V.2 (m/plexus.h)
-  pyramid. (m/pyramid.h)
-  Bull SPS-7 (m/sps7.h)
-  Hitachi SR2001/SR2201 (m/sr2k.h)
-  Stride (m/stride.h)
-  Sun 1 (m/sun1.h)
-  Sun 2 (m/sun2.h)
-  SEQUENT SYMMETRY  (m/symmetry.h)
-  Tadpole 68k machines (m/tad68k.h)
-  tahoe (m/tahoe.h)
-  targon31 (m/targon31.h)
-  Tektronix* (m/tek4300.h m/tekxd88.h)
-  NCR Tower 32 running System V.2 (m/tower32.h)
-  NCR Tower 32 running System V.3 (m/tower32v3.h)
-  U-station (Nihon Unisys, SS5E; Sumitomo Denkoh, U-Station E30) (m/ustation.h)
-  Wicat (m/wicat.h)
-  Honeywell XPS100 running UNIX System V.2 (m/xps100.h)
-  Data General's DG/UX  (s/dgux*)
-  Irix before version 6
-  osf1 (s/osf*)
-  SunOS4 (s/sunos*)
-  RISCiX (s/riscix*)
-  SCO 3.2v4 (s/sco4.h)
-  SCO 3.2v5 (s/sco5.h)
-  Sun's 386-based RoadRunner (m/sun386.h)
-  Sun3 machines (m/sun3*)
-  Integrated Solutions 386 machine (m/is386.h)
-  Integrated Solutions `Optimum V' -- m68k-isi-bsd4.2 or -bsd4.3
-  Harris Power PC (powerpc-harris-powerunix)
-  Hewlett-Packard 9000 series 200 or 300 on some platforms -- m68k-hp-bsd or
-    m68k-hp-hpux; note m68k-*-netbsd* still works
-  IBM PS/2 -- i386-ibm-aix1.1 or i386-ibm-aix1.2
-  GEC 63 -- local-gec63-usg5.2
-  Tandem Integrity S2 -- mips-tandem-sysv
-  System V rel 0 -- usg5.0
-  System V rel 2 -- usg5.2
-  System V rel 2.2 -- usg5.2.2
-  System V rel 3 -- usg5.3
-  Ultrix -- bsd4.3
-  VMS (s/vms.h)
+Support for many obsolete platforms was removed in Emacs 23.1.
+If for some reason you encounter an ancient machine where current
+Emacs does not compile, try an older release like Emacs 22.3.
 
 \f
 Local variables:
index 654160c4a7ad5898b87e6a2d1ac30e563786ee47..9a2c03aad15b59317ee28c2b874d881a5ce6b2c3 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -14,6 +14,206 @@ and NEWS.1-17 for changes in older Emacs versions.
 You can narrow news to a specific version by calling `view-emacs-news'
 with a prefix argument or by typing C-u C-h C-n.
 
+Temporary note:
++++ indicates that all necessary documentation updates are complete.
+    (This means all relevant manuals in doc/ AND lisp doc-strings.)
+--- means no change in the manuals is needed.
+When you add a new item, use the appropriate mark if you are sure it applies,
+otherwise leave it unmarked.
+
+\f
+* Installation Changes in Emacs 24.5
+
++++
+** Building Emacs now requires C99 or later.
+
+** Building Emacs now requires GNU make, version 3.81 or later.
+
+** By default, Emacs no longer works on IRIX.  We expect that Emacs
+users are not affected by this, as SGI stopped supporting IRIX in
+December 2013.  If you are affected, please send a bug report.  You
+should be able to work around the problem either by porting the Emacs
+undumping code to GCC under IRIX, or by configuring --with-wide-int,
+or by sticking with Emacs 24.4.
+
+---
+** The configure option `--with-pkg-config-prog' has been removed.
+Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to.
+
+\f
+* Startup Changes in Emacs 24.5
+
+\f
+* Changes in Emacs 24.5
+
+** New var `truncate-string-ellipsis' to choose how to indicate truncation.
+
+---
+** The default value of `history-length' has increased to 100.
+
++++
+** The new variable `term-file-aliases' replaces some files from lisp/term.
+The function `tty-run-terminal-initialization' consults this variable
+when deciding what terminal-specific initialization code to run.
+
+---
+** New variable `system-configuration-features', listing some of the
+main features that Emacs was compiled with.  This is mainly intended
+for use in Emacs bug reports.
+
++++
+** A password is now hidden also when typed in batch mode.  Another
+hiding character but the default `.' can be used by let-binding the
+variable `read-hide-char'.
+
+\f
+* Editing Changes in Emacs 24.5
+
+** Emacs now supports "bracketed paste mode" when running on a terminal
+that supports it.  This facility allows Emacs to understand pasted
+chunks of text as strings to be inserted, instead of interpreting each
+character in the pasted text as actual user input.  This results in a
+paste experience similar to that under a window system, and significant
+performance improvements when pasting large amounts of text.
+
+\f
+* Changes in Specialized Modes and Packages in Emacs 24.5
+
+** Lisp mode
+*** Strings after `:documentation' are highlighted as docstrings.
+
+** Rectangle editing
+*** Rectangle Mark mode can have corners past EOL or in the middle of a TAB.
+*** C-x C-x in rectangle-mark-mode now cycles through the four corners.
+*** `string-rectangle' provides on-the-fly preview of the result.
+
+** New font-lock functions font-lock-ensure and font-lock-flush, which
+should be used instead of font-lock-fontify-buffer when called from Elisp.
+
+** Calendar and diary
+
++++
+*** New commands to insert diary entries with Chinese dates:
+`diary-chinese-insert-anniversary-entry' `diary-chinese-insert-entry'
+`diary-chinese-insert-monthly-entry', `diary-chinese-insert-yearly-entry'.
+
++++
+*** Calendar can list and mark diary entries with Chinese dates.
+See `diary-chinese-list-entries' and `diary-chinese-mark-entries'.
+
+** New ERT function `ert-summarize-tests-batch-and-exit'.
+
+---
+** The Rmail commands d, C-d and u now handle repeat counts to delete or
+undelete multiple messages.
+
+** SES now supports local printer functions; see `ses-define-local-printer'.
+
+** In sh-mode, you can now use `sh-shell' as a file-local variable to
+specify the type of shell in use (bash, csh, etc).
+
+** The URL package accepts now the protocols "ssh", "scp" and "rsync".
+When `url-handler-mode' is enabled, file operations for these
+protocols as well as for "telnet" and "ftp" are passed to Tramp.
+
+** Tramp
+
+*** New connection method "nc", which allows to access dumb busyboxes.
+
+** VC and related modes
+
+*** New option `vc-annotate-background-mode' controls whether
+the color range from `vc-annotate-color-map' is applied to the
+background or to the foreground.
+
+** Calculator: decimal display mode uses "," groups, so it's more
+fitting for use in money calculations; factorial works with
+non-integer inputs.
+
+** HideIfDef mode now support full C/C++ expressions, argumented macro expansions
+, interactive macro evaluation and automatic scanning of #defined symbols.
+
+*** New custom variable `hide-ifdef-header-regexp' to define C/C++ header file
+name patterns. Default case-insensitive .h, .hh, .hpp and .hxx.
+*** New custom variable `hide-ifdef-expand-reinclusion-protection' to prevent
+reinclusion protected header files from being fully hidden.
+*** New custom variable `hide-ifdef-exclude-define-regexp' to define symbol
+name patterns (e.x. all "FOR_DOXYGEN_ONLY_*") to be excluded.
+
+** Obsolete packages
+
+---
+*** gulp.el
+
+---
+*** crisp.el, tpu-edt.el, ws-mode.el
+These emulations of old editors are believed to be no longer relevant
+ - contact emacs-devel@gnu.org if you disagree.
+
+---
+*** vi.el, vip.el (try M-x viper instead)
+
+\f
+* New Modes and Packages in Emacs 24.5
+
+\f
+* Incompatible Lisp Changes in Emacs 24.5
+
+** window-configurations no longer record the buffers's marks.
+
+** inhibit-modification-hooks now also inhibits lock-file checks, as well as
+active region handling.
+
+** deactivate-mark is now buffer-local.
+
+** `cl-the' now asserts that its argument is of the given type.
+
++++
+** Mouse click events on mode line or header line no longer include
+any reference to a buffer position.  The 6th member of the mouse
+position list returned for such events is now nil.
+
+
+\f
+* Lisp Changes in Emacs 24.5
+
+** New function `funcall-interactively', which works like `funcall'
+but makes `called-interactively-p' treat the function as (you guessed it)
+called interactively.
+
+** New function `function-put' to use instead of `put' for function properties.
+
++++
+** New properties that can be specified with `declare':
+*** (interactive-only INSTEAD), says to use INSTEAD for non-interactive use.
+*** (pure VAL), if VAL is non-nil, indicates the function is pure.
+*** (side-effect-free VAL), if VAL is non-nil, indicates the function does not
+have side effects.
+
++++
+** New macro `with-file-modes', for evaluating expressions with default file
+permissions set to temporary values (e.g., for creating private files).
+
+** You can access the slots of structures using `cl-struct-slot-value'.
+
+** Functions `rmail-delete-forward' and `rmail-delete-backward' take an
+optional repeat-count argument.
+
+---
+** New utilities in subr-x.el:
+*** New macros `if-let' and `when-let' allow defining bindings and to
+    execute code depending whether all values are true.
+*** New macros `thread-first' and `thread-last' allow threading a form
+    as the first or last argument of subsequent forms.
+
+\f
+* Changes in Emacs 24.5 on Non-Free Operating Systems
+
+---
+** Building Emacs for MS-Windows requires at least Windows XP
+or Windows Server 2003.  The built binaries still run on all versions
+of Windows starting with Windows 9X.
+
 \f
 * Installation Changes in Emacs 24.4
 
index 3b73e863ceb7af223ee6c573d05b14bc6910d523..17104aaf3ca73ef8e36b10042695357125556e2f 100644 (file)
@@ -614,7 +614,7 @@ be different.
 It is generally recommended to use `system-configuration' rather
 than `system-type'.
 
-See the file LINUX-GNU in this directory for more about this.
+See <http://www.gnu.org/gnu/linux-and-gnu.html> for more about this.
 
 ** The functions shell-command and dired-call-process
 now run file name handlers for default-directory, if it has them.
index cea2213a24edc8f66c133bbf00a3106eac03269b..ed41ddf65a3d5413197a4fdaecd1ddd79d664b77 100644 (file)
@@ -835,6 +835,20 @@ you want to use fcitx with Emacs, you have two choices.  Toggle fcitx
 by another key (e.g. C-\) by modifying ~/.fcitx/config, or be
 accustomed to use C-@ for `set-mark-command'.
 
+*** Link-time optimization with clang doesn't work on Fedora 20.
+
+As of May 2014, Fedora 20 has broken LLVMgold.so plugin support in clang
+(tested with clang-3.4-6.fc20) - `clang --print-file-name=LLVMgold.so'
+prints `LLVMgold.so' instead of full path to plugin shared library, and
+`clang -flto' is unable to find the plugin with the following error:
+
+/bin/ld: error: /usr/bin/../lib/LLVMgold.so: could not load plugin library:
+/usr/bin/../lib/LLVMgold.so: cannot open shared object file: No such file
+or directory
+
+The only way to avoid this is to build your own clang from source code
+repositories, as described at http://clang.llvm.org/get_started.html.
+
 *** M-SPC seems to be ignored as input.
 
 See if your X server is set up to use this as a command
@@ -1233,7 +1247,7 @@ https://bugzilla.xfce.org/show_bug.cgi?id=7588 .
 
 When you start Emacs you may see something like this:
 
-(emacs:2286): LIBDBUSMENU-GTK-CRITICAL **: watch_submenu: assertion 
+(emacs:2286): LIBDBUSMENU-GTK-CRITICAL **: watch_submenu: assertion
 `GTK_IS_MENU_SHELL(menu)' failed
 
 This happens if the Emacs binary has been renamed.  The cause is the Ubuntu
@@ -2534,22 +2548,6 @@ or
 
 (The -R option disables address space randomization.)
 
-*** test-distrib says that the distribution has been clobbered.
-*** or, temacs prints "Command key out of range 0-127".
-*** or, temacs runs and dumps emacs, but emacs totally fails to work.
-*** or, temacs gets errors dumping emacs.
-
-This can be because the .elc files have been garbled.  Do not be
-fooled by the fact that most of a .elc file is text: these are
-binary files and can contain all 256 byte values.
-
-If you have a copy of Emacs whose .elc files have been damaged in this
-way, you should be able to fix it by using:
-
- make bootstrap
-
-to regenerate all the .elc files.
-
 *** temacs prints "Pure Lisp storage exhausted".
 
 This means that the Lisp code loaded from the .elc and .el files during
@@ -2589,27 +2587,6 @@ occurring with older versions of GCC (e.g. 3.3.5).
 This is due to a bug in the bcopy implementation in openSUSE 10.3.
 It is/will be fixed in an openSUSE update.
 
-** Installation
-
-*** On Solaris, use GNU Make when installing an out-of-tree build
-
-The Emacs configuration process allows you to configure the
-build environment so that you can build emacs in a directory
-outside of the distribution tree.  When installing Emacs from an
-out-of-tree build directory on Solaris, you may need to use GNU
-make.  The make programs bundled with Solaris support the VPATH
-macro but use it differently from the way the VPATH macro is
-used by GNU make.  The differences will cause the "make install"
-step to fail, leaving you with an incomplete emacs
-installation.  GNU make is available in /usr/sfw/bin on Solaris
-10 and can be installed as /opt/sfw/bin/gmake from the Solaris 9
-Software Companion CDROM.
-
-The problems due to the VPATH processing differences affect only
-out of tree builds so, if you are on a Solaris installation
-without GNU make, you can install Emacs completely by installing
-from a build environment using the original emacs distribution tree.
-
 ** First execution
 
 *** Emacs binary is not in executable format, and cannot be run.
index f3d554e45bfd41491651f78881da220f9813a84d..ece9aa6d8885b326f50e563d8b8904e660db65d9 100644 (file)
@@ -1,903 +1,8 @@
-  The GNU Project
+The GNU Project
 
-   by Richard Stallman
+Note added March 2014:
 
-   originally published in the book "Open Sources"
+This file is obsolete and will be removed in future.
+Please update any references to use
 
-  The first software-sharing community
-
-   When I started working at the MIT Artificial Intelligence Lab in 1971,
-   I became part of a software-sharing community that had existed for many
-   years. Sharing of software was not limited to our particular community;
-   it is as old as computers, just as sharing of recipes is as old as
-   cooking. But we did it more than most.
-
-   The AI Lab used a timesharing operating system called ITS (the
-   Incompatible Timesharing System) that the lab's staff hackers (1) had
-   designed and written in assembler language for the Digital PDP-10, one
-   of the large computers of the era. As a member of this community, an AI
-   lab staff system hacker, my job was to improve this system.
-
-   We did not call our software "free software", because that term did not
-   yet exist; but that is what it was. Whenever people from another
-   university or a company wanted to port and use a program, we gladly let
-   them. If you saw someone using an unfamiliar and interesting program,
-   you could always ask to see the source code, so that you could read it,
-   change it, or cannibalize parts of it to make a new program.
-
-   (1) The use of "hacker" to mean "security breaker" is a confusion on
-   the part of the mass media. We hackers refuse to recognize that
-   meaning, and continue using the word to mean, "Someone who loves to
-   program and enjoys being clever about it."
-
-  The collapse of the community
-
-   The situation changed drastically in the early 1980s when Digital
-   discontinued the PDP-10 series. Its architecture, elegant and powerful
-   in the 60s, could not extend naturally to the larger address spaces
-   that were becoming feasible in the 80s. This meant that nearly all of
-   the programs composing ITS were obsolete.
-
-   The AI lab hacker community had already collapsed, not long before. In
-   1981, the spin-off company Symbolics had hired away nearly all of the
-   hackers from the AI lab, and the depopulated community was unable to
-   maintain itself. (The book Hackers, by Steve Levy, describes these
-   events, as well as giving a clear picture of this community in its
-   prime.) When the AI lab bought a new PDP-10 in 1982, its administrators
-   decided to use Digital's non-free timesharing system instead of ITS.
-
-   The modern computers of the era, such as the VAX or the 68020, had
-   their own operating systems, but none of them were free software: you
-   had to sign a nondisclosure agreement even to get an executable copy.
-
-   This meant that the first step in using a computer was to promise not
-   to help your neighbor. A cooperating community was forbidden. The rule
-   made by the owners of proprietary software was, "If you share with your
-   neighbor, you are a pirate. If you want any changes, beg us to make
-   them."
-
-   The idea that the proprietary-software social system--the system that
-   says you are not allowed to share or change software--is antisocial,
-   that it is unethical, that it is simply wrong, may come as a surprise
-   to some readers. But what else could we say about a system based on
-   dividing the public and keeping users helpless? Readers who find the
-   idea surprising may have taken proprietary-software social system as
-   given, or judged it on the terms suggested by proprietary software
-   businesses. Software publishers have worked long and hard to convince
-   people that there is only one way to look at the issue.
-
-   When software publishers talk about "enforcing" their "rights" or
-   "stopping piracy", what they actually *say* is secondary. The real
-   message of these statements is in the unstated assumptions they take
-   for granted; the public is supposed to accept them uncritically. So
-   let's examine them.
-
-   One assumption is that software companies have an unquestionable
-   natural right to own software and thus have power over all its users.
-   (If this were a natural right, then no matter how much harm it does to
-   the public, we could not object.) Interestingly, the US Constitution
-   and legal tradition reject this view; copyright is not a natural right,
-   but an artificial government-imposed monopoly that limits the users'
-   natural right to copy.
-
-   Another unstated assumption is that the only important thing about
-   software is what jobs it allows you to do--that we computer users
-   should not care what kind of society we are allowed to have.
-
-   A third assumption is that we would have no usable software (or would
-   never have a program to do this or that particular job) if we did not
-   offer a company power over the users of the program. This assumption
-   may have seemed plausible, before the free software movement
-   demonstrated that we can make plenty of useful software without putting
-   chains on it.
-
-   If we decline to accept these assumptions, and judge these issues based
-   on ordinary common-sense morality while placing the users first, we
-   arrive at very different conclusions. Computer users should be free to
-   modify programs to fit their needs, and free to share software, because
-   helping other people is the basis of society.
-
-   There is no room here for an extensive statement of the reasoning
-   behind this conclusion, so I refer the reader to the web page,
-   http://www.gnu.org/philosophy/why-free.html.
-
-  A stark moral choice.
-
-   With my community gone, to continue as before was impossible. Instead,
-   I faced a stark moral choice.
-
-   The easy choice was to join the proprietary software world, signing
-   nondisclosure agreements and promising not to help my fellow hacker.
-   Most likely I would also be developing software that was released under
-   nondisclosure agreements, thus adding to the pressure on other people
-   to betray their fellows too.
-
-   I could have made money this way, and perhaps amused myself writing
-   code. But I knew that at the end of my career, I would look back on
-   years of building walls to divide people, and feel I had spent my life
-   making the world a worse place.
-
-   I had already experienced being on the receiving end of a nondisclosure
-   agreement, when someone refused to give me and the MIT AI lab the
-   source code for the control program for our printer. (The lack of
-   certain features in this program made use of the printer extremely
-   frustrating.) So I could not tell myself that nondisclosure agreements
-   were innocent. I was very angry when he refused to share with us; I
-   could not turn around and do the same thing to everyone else.
-
-   Another choice, straightforward but unpleasant, was to leave the
-   computer field. That way my skills would not be misused, but they would
-   still be wasted. I would not be culpable for dividing and restricting
-   computer users, but it would happen nonetheless.
-
-   So I looked for a way that a programmer could do something for the
-   good. I asked myself, was there a program or programs that I could
-   write, so as to make a community possible once again?
-
-   The answer was clear: what was needed first was an operating system.
-   That is the crucial software for starting to use a computer. With an
-   operating system, you can do many things; without one, you cannot run
-   the computer at all. With a free operating system, we could again have
-   a community of cooperating hackers--and invite anyone to join. And
-   anyone would be able to use a computer without starting out by
-   conspiring to deprive his or her friends.
-
-   As an operating system developer, I had the right skills for this job.
-   So even though I could not take success for granted, I realized that I
-   was elected to do the job. I chose to make the system compatible with
-   Unix so that it would be portable, and so that Unix users could easily
-   switch to it. The name GNU was chosen following a hacker tradition, as
-   a recursive acronym for "GNU's Not Unix."
-
-   An operating system does not mean just a kernel, barely enough to run
-   other programs. In the 1970s, every operating system worthy of the name
-   included command processors, assemblers, compilers, interpreters,
-   debuggers, text editors, mailers, and much more. ITS had them, Multics
-   had them, VMS had them, and Unix had them. The GNU operating system
-   would include them too.
-
-   Later I heard these words, attributed to Hillel (1):
-
-     If I am not for myself, who will be for me?
-     If I am only for myself, what am I?
-     If not now, when?
-
-   The decision to start the GNU project was based on a similar spirit.
-
-   (1) As an Atheist, I don't follow any religious leaders, but I
-   sometimes find I admire something one of them has said.
-
-  Free as in freedom
-
-   The term "free software" is sometimes misunderstood--it has nothing to
-   do with price. It is about freedom. Here, therefore, is the definition
-   of free software: a program is free software, for you, a particular
-   user, if:
-     * You have the freedom to run the program, for any purpose.
-     * You have the freedom to modify the program to suit your needs. (To
-       make this freedom effective in practice, you must have access to
-       the source code, since making changes in a program without having
-       the source code is exceedingly difficult.)
-     * You have the freedom to redistribute copies, either gratis or for a
-       fee.
-     * You have the freedom to distribute modified versions of the
-       program, so that the community can benefit from your improvements.
-
-   Since "free" refers to freedom, not to price, there is no contradiction
-   between selling copies and free software. In fact, the freedom to sell
-   copies is crucial: collections of free software sold on CD-ROMs are
-   important for the community, and selling them is an important way to
-   raise funds for free software development. Therefore, a program which
-   people are not free to include on these collections is not free
-   software.
-
-   Because of the ambiguity of "free", people have long looked for
-   alternatives, but no one has found a suitable alternative. The English
-   Language has more words and nuances than any other, but it lacks a
-   simple, unambiguous, word that means "free", as in
-   freedom--"unfettered" being the word that comes closest in meaning.
-   Such alternatives as "liberated", "freedom", and "open" have either the
-   wrong meaning or some other disadvantage.
-
-  GNU software and the GNU system
-
-   Developing a whole system is a very large project. To bring it into
-   reach, I decided to adapt and use existing pieces of free software
-   wherever that was possible. For example, I decided at the very
-   beginning to use TeX as the principal text formatter; a few years
-   later, I decided to use the X Window System rather than writing another
-   window system for GNU.
-
-   Because of this decision, the GNU system is not the same as the
-   collection of all GNU software. The GNU system includes programs that
-   are not GNU software, programs that were developed by other people and
-   projects for their own purposes, but which we can use because they are
-   free software.
-
-  Commencing the project
-
-   In January 1984 I quit my job at MIT and began writing GNU software.
-   Leaving MIT was necessary so that MIT would not be able to interfere
-   with distributing GNU as free software. If I had remained on the staff,
-   MIT could have claimed to own the work, and could have imposed their
-   own distribution terms, or even turned the work into a proprietary
-   software package. I had no intention of doing a large amount of work
-   only to see it become useless for its intended purpose: creating a new
-   software-sharing community.
-
-   However, Professor Winston, then the head of the MIT AI Lab, kindly
-   invited me to keep using the lab's facilities.
-
-  The first steps
-
-   Shortly before beginning the GNU project, I heard about the Free
-   University Compiler Kit, also known as VUCK. (The Dutch word for "free"
-   is written with a V.) This was a compiler designed to handle multiple
-   languages, including C and Pascal, and to support multiple target
-   machines. I wrote to its author asking if GNU could use it.
-
-   He responded derisively, stating that the university was free but the
-   compiler was not. I therefore decided that my first program for the GNU
-   project would be a multi-language, multi-platform compiler.
-
-   Hoping to avoid the need to write the whole compiler myself, I obtained
-   the source code for the Pastel compiler, which was a multi-platform
-   compiler developed at Lawrence Livermore Lab. It supported, and was
-   written in, an extended version of Pascal, designed to be a
-   system-programming language. I added a C front end, and began porting
-   it to the Motorola 68000 computer. But I had to give that up when I
-   discovered that the compiler needed many megabytes of stack space, and
-   the available 68000 Unix system would only allow 64k.
-
-   I then realized that the Pastel compiler functioned by parsing the
-   entire input file into a syntax tree, converting the whole syntax tree
-   into a chain of "instructions", and then generating the whole output
-   file, without ever freeing any storage. At this point, I concluded I
-   would have to write a new compiler from scratch. That new compiler is
-   now known as GCC; none of the Pastel compiler is used in it, but I
-   managed to adapt and use the C front end that I had written. But that
-   was some years later; first, I worked on GNU Emacs.
-
-  GNU Emacs
-
-   I began work on GNU Emacs in September 1984, and in early 1985 it was
-   beginning to be usable. This enabled me to begin using Unix systems to
-   do editing; having no interest in learning to use vi or ed, I had done
-   my editing on other kinds of machines until then.
-
-   At this point, people began wanting to use GNU Emacs, which raised the
-   question of how to distribute it. Of course, I put it on the anonymous
-   ftp server on the MIT computer that I used. (This computer,
-   prep.ai.mit.edu, thus became the principal GNU ftp distribution site;
-   when it was decommissioned a few years later, we transferred the name
-   to our new ftp server.) But at that time, many of the interested people
-   were not on the Internet and could not get a copy by ftp. So the
-   question was, what would I say to them?
-
-   I could have said, "Find a friend who is on the net and who will make a
-   copy for you." Or I could have done what I did with the original PDP-10
-   Emacs: tell them, "Mail me a tape and a SASE, and I will mail it back
-   with Emacs on it." But I had no job, and I was looking for ways to make
-   money from free software. So I announced that I would mail a tape to
-   whoever wanted one, for a fee of $150. In this way, I started a free
-   software distribution business, the precursor of the companies that
-   today distribute entire Linux-based GNU systems.
-
-  Is a program free for every user?
-
-   If a program is free software when it leaves the hands of its author,
-   this does not necessarily mean it will be free software for everyone
-   who has a copy of it. For example, public domain software (software
-   that is not copyrighted) is free software; but anyone can make a
-   proprietary modified version of it. Likewise, many free programs are
-   copyrighted but distributed under simple permissive licenses which
-   allow proprietary modified versions.
-
-   The paradigmatic example of this problem is the X Window System.
-   Developed at MIT, and released as free software with a permissive
-   license, it was soon adopted by various computer companies. They added
-   X to their proprietary Unix systems, in binary form only, and covered
-   by the same nondisclosure agreement. These copies of X were no more
-   free software than Unix was.
-
-   The developers of the X Window System did not consider this a
-   problem--they expected and intended this to happen. Their goal was not
-   freedom, just "success", defined as "having many users." They did not
-   care whether these users had freedom, only that they should be
-   numerous.
-
-   This led to a paradoxical situation where two different ways of
-   counting the amount of freedom gave different answers to the question,
-   "Is this program free?" If you judged based on the freedom provided by
-   the distribution terms of the MIT release, you would say that X was
-   free software. But if you measured the freedom of the average user of
-   X, you would have to say it was proprietary software. Most X users were
-   running the proprietary versions that came with Unix systems, not the
-   free version.
-
-  Copyleft and the GNU GPL
-
-   The goal of GNU was to give users freedom, not just to be popular. So
-   we needed to use distribution terms that would prevent GNU software
-   from being turned into proprietary software. The method we use is
-   called "copyleft".(1)
-
-   Copyleft uses copyright law, but flips it over to serve the opposite of
-   its usual purpose: instead of a means of privatizing software, it
-   becomes a means of keeping software free.
-
-   The central idea of copyleft is that we give everyone permission to run
-   the program, copy the program, modify the program, and distribute
-   modified versions--but not permission to add restrictions of their own.
-   Thus, the crucial freedoms that define "free software" are guaranteed
-   to everyone who has a copy; they become inalienable rights.
-
-   For an effective copyleft, modified versions must also be free. This
-   ensures that work based on ours becomes available to our community if
-   it is published. When programmers who have jobs as programmers
-   volunteer to improve GNU software, it is copyleft that prevents their
-   employers from saying, "You can't share those changes, because we are
-   going to use them to make our proprietary version of the program."
-
-   The requirement that changes must be free is essential if we want to
-   ensure freedom for every user of the program. The companies that
-   privatized the X Window System usually made some changes to port it to
-   their systems and hardware. These changes were small compared with the
-   great extent of X, but they were not trivial. If making changes were an
-   excuse to deny the users freedom, it would be easy for anyone to take
-   advantage of the excuse.
-
-   A related issue concerns combining a free program with non-free code.
-   Such a combination would inevitably be non-free; whichever freedoms are
-   lacking for the non-free part would be lacking for the whole as well.
-   To permit such combinations would open a hole big enough to sink a
-   ship. Therefore, a crucial requirement for copyleft is to plug this
-   hole: anything added to or combined with a copylefted program must be
-   such that the larger combined version is also free and copylefted.
-
-   The specific implementation of copyleft that we use for most GNU
-   software is the GNU General Public License, or GNU GPL for short. We
-   have other kinds of copyleft that are used in specific circumstances.
-   GNU manuals are copylefted also, but use a much simpler kind of
-   copyleft, because the complexity of the GNU GPL is not necessary for
-   manuals.(2)
-
-   (1) In 1984 or 1985, Don Hopkins (a very imaginative fellow) mailed me
-   a letter. On the envelope he had written several amusing sayings,
-   including this one: "Copyleft--all rights reversed." I used the word
-   "copyleft" to name the distribution concept I was developing at the
-   time.
-
-   (2) We now use the GNU Free Documentation License for documentation.
-
-  The Free Software Foundation
-
-   As interest in using Emacs was growing, other people became involved in
-   the GNU project, and we decided that it was time to seek funding once
-   again. So in 1985 we created the Free Software Foundation, a tax-exempt
-   charity for free software development. The FSF also took over the Emacs
-   tape distribution business; later it extended this by adding other free
-   software (both GNU and non-GNU) to the tape, and by selling free
-   manuals as well.
-
-   The FSF accepts donations, but most of its income has always come from
-   sales--of copies of free software, and of other related services. Today
-   it sells CD-ROMs of source code, CD-ROMs with binaries, nicely printed
-   manuals (all with freedom to redistribute and modify), and Deluxe
-   Distributions (where we build the whole collection of software for your
-   choice of platform).
-
-   Free Software Foundation employees have written and maintained a number
-   of GNU software packages. Two notable ones are the C library and the
-   shell. The GNU C library is what every program running on a GNU/Linux
-   system uses to communicate with Linux. It was developed by a member of
-   the Free Software Foundation staff, Roland McGrath. The shell used on
-   most GNU/Linux systems is BASH, the Bourne Again Shell(1), which was
-   developed by FSF employee Brian Fox.
-
-   We funded development of these programs because the GNU project was not
-   just about tools or a development environment. Our goal was a complete
-   operating system, and these programs were needed for that goal.
-
-   (1) "Bourne again Shell" is a joke on the name ``Bourne Shell'', which
-   was the usual shell on Unix.
-
-  Free software support
-
-   The free software philosophy rejects a specific widespread business
-   practice, but it is not against business. When businesses respect the
-   users' freedom, we wish them success.
-
-   Selling copies of Emacs demonstrates one kind of free software
-   business. When the FSF took over that business, I needed another way to
-   make a living. I found it in selling services relating to the free
-   software I had developed. This included teaching, for subjects such as
-   how to program GNU Emacs and how to customize GCC, and software
-   development, mostly porting GCC to new platforms.
-
-   Today each of these kinds of free software business is practiced by a
-   number of corporations. Some distribute free software collections on
-   CD-ROM; others sell support at levels ranging from answering user
-   questions, to fixing bugs, to adding major new features. We are even
-   beginning to see free software companies based on launching new free
-   software products.
-
-   Watch out, though--a number of companies that associate themselves with
-   the term "open source" actually base their business on non-free
-   software that works with free software. These are not free software
-   companies, they are proprietary software companies whose products tempt
-   users away from freedom. They call these "value added", which reflects
-   the values they would like us to adopt: convenience above freedom. If
-   we value freedom more, we should call them "freedom subtracted"
-   products.
-
-  Technical goals
-
-   The principal goal of GNU was to be free software. Even if GNU had no
-   technical advantage over Unix, it would have a social advantage,
-   allowing users to cooperate, and an ethical advantage, respecting the
-   user's freedom.
-
-   But it was natural to apply the known standards of good practice to the
-   work--for example, dynamically allocating data structures to avoid
-   arbitrary fixed size limits, and handling all the possible 8-bit codes
-   wherever that made sense.
-
-   In addition, we rejected the Unix focus on small memory size, by
-   deciding not to support 16-bit machines (it was clear that 32-bit
-   machines would be the norm by the time the GNU system was finished),
-   and to make no effort to reduce memory usage unless it exceeded a
-   megabyte. In programs for which handling very large files was not
-   crucial, we encouraged programmers to read an entire input file into
-   core, then scan its contents without having to worry about I/O.
-
-   These decisions enabled many GNU programs to surpass their Unix
-   counterparts in reliability and speed.
-
-  Donated computers
-
-   As the GNU project's reputation grew, people began offering to donate
-   machines running UNIX to the project. These were very useful, because
-   the easiest way to develop components of GNU was to do it on a UNIX
-   system, and replace the components of that system one by one. But they
-   raised an ethical issue: whether it was right for us to have a copy of
-   UNIX at all.
-
-   UNIX was (and is) proprietary software, and the GNU project's
-   philosophy said that we should not use proprietary software. But,
-   applying the same reasoning that leads to the conclusion that violence
-   in self defense is justified, I concluded that it was legitimate to use
-   a proprietary package when that was crucial for developing a free
-   replacement that would help others stop using the proprietary package.
-
-   But, even if this was a justifiable evil, it was still an evil. Today
-   we no longer have any copies of Unix, because we have replaced them
-   with free operating systems. If we could not replace a machine's
-   operating system with a free one, we replaced the machine instead.
-
-  The GNU Task List
-
-   As the GNU project proceeded, and increasing numbers of system
-   components were found or developed, eventually it became useful to make
-   a list of the remaining gaps. We used it to recruit developers to write
-   the missing pieces. This list became known as the GNU task list. In
-   addition to missing Unix components, we listed added various other
-   useful software and documentation projects that, we thought, a truly
-   complete system ought to have.
-
-   Today, hardly any Unix components are left in the GNU task list--those
-   jobs have been done, aside from a few inessential ones. But the list is
-   full of projects that some might call "applications". Any program that
-   appeals to more than a narrow class of users would be a useful thing to
-   add to an operating system.
-
-   Even games are included in the task list--and have been since the
-   beginning. Unix included games, so naturally GNU should too. But
-   compatibility was not an issue for games, so we did not follow the list
-   of games that Unix had. Instead, we listed a spectrum of different
-   kinds of games that users might like.
-
-  The GNU Library GPL
-
-   The GNU C library uses a special kind of copyleft called the GNU
-   Library General Public License(1), which gives permission to link
-   proprietary software with the library. Why make this exception?
-
-   It is not a matter of principle; there is no principle that says
-   proprietary software products are entitled to include our code. (Why
-   contribute to a project predicated on refusing to share with us?) Using
-   the LGPL for the C library, or for any library, is a matter of
-   strategy.
-
-   The C library does a generic job; every proprietary system or compiler
-   comes with a C library. Therefore, to make our C library available only
-   to free software would not have given free software any advantage--it
-   would only have discouraged use of our library.
-
-   One system is an exception to this: on the GNU system (and this
-   includes GNU/Linux), the GNU C library is the only C library. So the
-   distribution terms of the GNU C library determine whether it is
-   possible to compile a proprietary program for the GNU system. There is
-   no ethical reason to allow proprietary applications on the GNU system,
-   but strategically it seems that disallowing them would do more to
-   discourage use of the GNU system than to encourage development of free
-   applications.
-
-   That is why using the Library GPL is a good strategy for the C library.
-   For other libraries, the strategic decision needs to be considered on a
-   case-by-case basis. When a library does a special job that can help
-   write certain kinds of programs, then releasing it under the GPL,
-   limiting it to free programs only, is a way of helping other free
-   software developers, giving them an advantage against proprietary
-   software.
-
-   Consider GNU Readline, a library that was developed to provide
-   command-line editing for BASH. Readline is released under the ordinary
-   GNU GPL, not the Library GPL. This probably does reduce the amount
-   Readline is used, but that is no loss for us. Meanwhile, at least one
-   useful application has been made free software specifically so it could
-   use Readline, and that is a real gain for the community.
-
-   Proprietary software developers have the advantages money provides;
-   free software developers need to make advantages for each other. I hope
-   some day we will have a large collection of GPL-covered libraries that
-   have no parallel available to proprietary software, providing useful
-   modules to serve as building blocks in new free software, and adding up
-   to a major advantage for further free software development.
-
-   (1) This license is now called the GNU Lesser General Public License,
-   to avoid giving the idea that all libraries ought to use it.
-   See http://www.gnu.org/philosophy/why-not-lgpl.html.
-
-  Scratching an itch?
-
-   Eric Raymond says that "Every good work of software starts by
-   scratching a developer's personal itch." Maybe that happens sometimes,
-   but many essential pieces of GNU software were developed in order to
-   have a complete free operating system. They come from a vision and a
-   plan, not from impulse.
-
-   For example, we developed the GNU C library because a Unix-like system
-   needs a C library, the Bourne-Again Shell (bash) because a Unix-like
-   system needs a shell, and GNU tar because a Unix-like system needs a
-   tar program. The same is true for my own programs--the GNU C compiler,
-   GNU Emacs, GDB and GNU Make.
-
-   Some GNU programs were developed to cope with specific threats to our
-   freedom. Thus, we developed gzip to replace the Compress program, which
-   had been lost to the community because of the LZW patents. We found
-   people to develop LessTif, and more recently started GNOME and Harmony,
-   to address the problems caused by certain proprietary libraries (see
-   below). We are developing the GNU Privacy Guard to replace popular
-   non-free encryption software, because users should not have to choose
-   between privacy and freedom.
-
-   Of course, the people writing these programs became interested in the
-   work, and many features were added to them by various people for the
-   sake of their own needs and interests. But that is not why the programs
-   exist.
-
-  Unexpected developments
-
-   At the beginning of the GNU project, I imagined that we would develop
-   the whole GNU system, then release it as a whole. That is not how it
-   happened.
-
-   Since each component of the GNU system was implemented on a Unix
-   system, each component could run on Unix systems, long before a
-   complete GNU system existed. Some of these programs became popular, and
-   users began extending them and porting them---to the various
-   incompatible versions of Unix, and sometimes to other systems as well.
-
-   The process made these programs much more powerful, and attracted both
-   funds and contributors to the GNU project. But it probably also delayed
-   completion of a minimal working system by several years, as GNU
-   developers' time was put into maintaining these ports and adding
-   features to the existing components, rather than moving on to write one
-   missing component after another.
-
-  The GNU Hurd
-
-   By 1990, the GNU system was almost complete; the only major missing
-   component was the kernel. We had decided to implement our kernel as a
-   collection of server processes running on top of Mach. Mach is a
-   microkernel developed at Carnegie Mellon University and then at the
-   University of Utah; the GNU HURD is a collection of servers (or ``herd
-   of gnus'') that run on top of Mach, and do the various jobs of the Unix
-   kernel. The start of development was delayed as we waited for Mach to
-   be released as free software, as had been promised.
-
-   One reason for choosing this design was to avoid what seemed to be the
-   hardest part of the job: debugging a kernel program without a
-   source-level debugger to do it with. This part of the job had been done
-   already, in Mach, and we expected to debug the HURD servers as user
-   programs, with GDB. But it took a long time to make that possible, and
-   the multi-threaded servers that send messages to each other have turned
-   out to be very hard to debug. Making the HURD work solidly has
-   stretched on for many years.
-
-  Alix
-
-   The GNU kernel was not originally supposed to be called the HURD. Its
-   original name was Alix--named after the woman who was my sweetheart at
-   the time. She, a Unix system administrator, had pointed out how her
-   name would fit a common naming pattern for Unix system versions; as a
-   joke, she told her friends, "Someone should name a kernel after me." I
-   said nothing, but decided to surprise her with a kernel named Alix.
-
-   It did not stay that way. Michael Bushnell (now Thomas), the main
-   developer of the kernel, preferred the name HURD, and redefined Alix to
-   refer to a certain part of the kernel--the part that would trap system
-   calls and handle them by sending messages to HURD servers.
-
-   Ultimately, Alix and I broke up, and she changed her name;
-   independently, the HURD design was changed so that the C library would
-   send messages directly to servers, and this made the Alix component
-   disappear from the design.
-
-   But before these things happened, a friend of hers came across the name
-   Alix in the HURD source code, and mentioned the name to her. So the
-   name did its job.
-
-  Linux and GNU/Linux
-
-   The GNU Hurd is not ready for production use. Fortunately, another
-   kernel is available. In 1991, Linus Torvalds developed a
-   Unix-compatible kernel and called it Linux. Around 1992, combining
-   Linux with the not-quite-complete GNU system resulted in a complete
-   free operating system. (Combining them was a substantial job in itself,
-   of course.) It is due to Linux that we can actually run a version of
-   the GNU system today.
-
-   We call this system version GNU/Linux, to express its composition as a
-   combination of the GNU system with Linux as the kernel.
-
-  Challenges in our future
-
-   We have proved our ability to develop a broad spectrum of free
-   software. This does not mean we are invincible and unstoppable. Several
-   challenges make the future of free software uncertain; meeting them
-   will require steadfast effort and endurance, sometimes lasting for
-   years. It will require the kind of determination that people display
-   when they value their freedom and will not let anyone take it away.
-
-   The following four sections discuss these challenges.
-
-  Secret hardware
-
-   Hardware manufacturers increasingly tend to keep hardware
-   specifications secret. This makes it difficult to write free drivers so
-   that Linux and XFree86 can support new hardware. We have complete free
-   systems today, but we will not have them tomorrow if we cannot support
-   tomorrow's computers.
-
-   There are two ways to cope with this problem. Programmers can do
-   reverse engineering to figure out how to support the hardware. The rest
-   of us can choose the hardware that is supported by free software; as
-   our numbers increase, secrecy of specifications will become a
-   self-defeating policy.
-
-   Reverse engineering is a big job; will we have programmers with
-   sufficient determination to undertake it? Yes--if we have built up a
-   strong feeling that free software is a matter of principle, and
-   non-free drivers are intolerable. And will large numbers of us spend
-   extra money, or even a little extra time, so we can use free drivers?
-   Yes, if the determination to have freedom is widespread.
-
-  Non-free libraries
-
-   A non-free library that runs on free operating systems acts as a trap
-   for free software developers. The library's attractive features are the
-   bait; if you use the library, you fall into the trap, because your
-   program cannot usefully be part of a free operating system. (Strictly
-   speaking, we could include your program, but it won't run with the
-   library missing.) Even worse, if a program that uses the proprietary
-   library becomes popular, it can lure other unsuspecting programmers
-   into the trap.
-
-   The first instance of this problem was the Motif toolkit, back in the
-   80s. Although there were as yet no free operating systems, it was clear
-   what problem Motif would cause for them later on. The GNU Project
-   responded in two ways: by asking individual free software projects to
-   support the free X toolkit widgets as well as Motif, and by asking for
-   someone to write a free replacement for Motif. The job took many years;
-   LessTif, developed by the Hungry Programmers, became powerful enough to
-   support most Motif applications only in 1997.
-
-   Between 1996 and 1998, another non-free GUI toolkit library, called Qt,
-   was used in a substantial collection of free software, the desktop KDE.
-
-   Free GNU/Linux systems were unable to use KDE, because we could not use
-   the library. However, some commercial distributors of GNU/Linux systems
-   who were not strict about sticking with free software added KDE to
-   their systems--producing a system with more capabilities, but less
-   freedom. The KDE group was actively encouraging more programmers to use
-   Qt, and millions of new "Linux users" had never been exposed to the
-   idea that there was a problem in this. The situation appeared grim.
-
-   The free software community responded to the problem in two ways: GNOME
-   and Harmony.
-
-   GNOME, the GNU Network Object Model Environment, is GNU's desktop
-   project. Started in 1997 by Miguel de Icaza, and developed with the
-   support of Red Hat Software, GNOME set out to provide similar desktop
-   facilities, but using free software exclusively. It has technical
-   advantages as well, such as supporting a variety of languages, not just
-   C++. But its main purpose was freedom: not to require the use of any
-   non-free software.
-
-   Harmony is a compatible replacement library, designed to make it
-   possible to run KDE software without using Qt.
-
-   In November 1998, the developers of Qt announced a change of license
-   which, when carried out, should make Qt free software. There is no way
-   to be sure, but I think that this was partly due to the community's
-   firm response to the problem that Qt posed when it was non-free. (The
-   new license is inconvenient and inequitable, so it remains desirable to
-   avoid using Qt.)
-
-   [Subsequent note: in September 2000, Qt was rereleased under the GNU
-   GPL, which essentially solved this problem.]
-
-   How will we respond to the next tempting non-free library? Will the
-   whole community understand the need to stay out of the trap? Or will
-   many of us give up freedom for convenience, and produce a major
-   problem? Our future depends on our philosophy.
-
-  Software patents
-
-   The worst threat we face comes from software patents, which can put
-   algorithms and features off limits to free software for up to twenty
-   years. The LZW compression algorithm patents were applied for in 1983,
-   and we still cannot release free software to produce proper compressed
-   GIFs. In 1998, a free program to produce MP3 compressed audio was
-   removed from distribution under threat of a patent suit.
-
-   There are ways to cope with patents: we can search for evidence that a
-   patent is invalid, and we can look for alternative ways to do a job.
-   But each of these methods works only sometimes; when both fail, a
-   patent may force all free software to lack some feature that users
-   want. What will we do when this happens?
-
-   Those of us who value free software for freedom's sake will stay with
-   free software anyway. We will manage to get work done without the
-   patented features. But those who value free software because they
-   expect it to be technically superior are likely to call it a failure
-   when a patent holds it back. Thus, while it is useful to talk about the
-   practical effectiveness of the "cathedral" model of development (1),
-   and the reliability and power of some free software, we must not stop
-   there. We must talk about freedom and principle.
-
-   (1) It would have been clearer to write `of the "bazaar" model', since
-   that was the alternative that was new and initially controversial.
-
-  Free documentation
-
-   The biggest deficiency in our free operating systems is not in the
-   software--it is the lack of good free manuals that we can include in
-   our systems. Documentation is an essential part of any software
-   package; when an important free software package does not come with a
-   good free manual, that is a major gap. We have many such gaps today.
-
-   Free documentation, like free software, is a matter of freedom, not
-   price. The criterion for a free manual is pretty much the same as for
-   free software: it is a matter of giving all users certain freedoms.
-   Redistribution (including commercial sale) must be permitted, on-line
-   and on paper, so that the manual can accompany every copy of the
-   program.
-
-   Permission for modification is crucial too. As a general rule, I don't
-   believe that it is essential for people to have permission to modify
-   all sorts of articles and books. For example, I don't think you or I
-   are obliged to give permission to modify articles like this one, which
-   describe our actions and our views.
-
-   But there is a particular reason why the freedom to modify is crucial
-   for documentation for free software. When people exercise their right
-   to modify the software, and add or change its features, if they are
-   conscientious they will change the manual too--so they can provide
-   accurate and usable documentation with the modified program. A manual
-   which does not allow programmers to be conscientious and finish the
-   job, does not fill our community's needs.
-
-   Some kinds of limits on how modifications are done pose no problem. For
-   example, requirements to preserve the original author's copyright
-   notice, the distribution terms, or the list of authors, are ok. It is
-   also no problem to require modified versions to include notice that
-   they were modified, even to have entire sections that may not be
-   deleted or changed, as long as these sections deal with nontechnical
-   topics. These kinds of restrictions are not a problem because they
-   don't stop the conscientious programmer from adapting the manual to fit
-   the modified program. In other words, they don't block the free
-   software community from making full use of the manual.
-
-   However, it must be possible to modify all the *technical* content of
-   the manual, and then distribute the result in all the usual media,
-   through all the usual channels; otherwise, the restrictions do obstruct
-   the community, the manual is not free, and we need another manual.
-
-   Will free software developers have the awareness and determination to
-   produce a full spectrum of free manuals? Once again, our future depends
-   on philosophy.
-
-  We must talk about freedom
-
-   Estimates today are that there are ten million users of GNU/Linux
-   systems such as Debian GNU/Linux and Red Hat Linux. Free software has
-   developed such practical advantages that users are flocking to it for
-   purely practical reasons.
-
-   The good consequences of this are evident: more interest in developing
-   free software, more customers for free software businesses, and more
-   ability to encourage companies to develop commercial free software
-   instead of proprietary software products.
-
-   But interest in the software is growing faster than awareness of the
-   philosophy it is based on, and this leads to trouble. Our ability to
-   meet the challenges and threats described above depends on the will to
-   stand firm for freedom. To make sure our community has this will, we
-   need to spread the idea to the new users as they come into the
-   community.
-
-   But we are failing to do so: the efforts to attract new users into our
-   community are far outstripping the efforts to teach them the civics of
-   our community. We need to do both, and we need to keep the two efforts
-   in balance.
-
-  "Open Source"
-
-   Teaching new users about freedom became more difficult in 1998, when a
-   part of the community decided to stop using the term "free software"
-   and say "open source software" instead.
-
-   Some who favored this term aimed to avoid the confusion of "free" with
-   "gratis"--a valid goal. Others, however, aimed to set aside the spirit
-   of principle that had motivated the free software movement and the GNU
-   project, and to appeal instead to executives and business users, many
-   of whom hold an ideology that places profit above freedom, above
-   community, above principle. Thus, the rhetoric of "open source" focuses
-   on the potential to make high quality, powerful software, but shuns the
-   ideas of freedom, community, and principle.
-
-   The "Linux" magazines are a clear example of this--they are filled with
-   advertisements for proprietary software that works with GNU/Linux. When
-   the next Motif or Qt appears, will these magazines warn programmers to
-   stay away from it, or will they run ads for it?
-
-   The support of business can contribute to the community in many ways;
-   all else being equal, it is useful. But winning their support by
-   speaking even less about freedom and principle can be disastrous; it
-   makes the previous imbalance between outreach and civics education even
-   worse.
-
-   "Free software" and "open source" describe the same category of
-   software, more or less, but say different things about the software,
-   and about values. The GNU Project continues to use the term "free
-   software", to express the idea that freedom, not just technology, is
-   important.
-
-  Try!
-
-   Yoda's philosophy ("There is no `try'") sounds neat, but it doesn't
-   work for me. I have done most of my work while anxious about whether I
-   could do the job, and unsure that it would be enough to achieve the
-   goal if I did. But I tried anyway, because there was no one but me
-   between the enemy and my city. Surprising myself, I have sometimes
-   succeeded.
-
-   Sometimes I failed; some of my cities have fallen. Then I found another
-   threatened city, and got ready for another battle. Over time, I've
-   learned to look for threats and put myself between them and my city,
-   calling on other hackers to come and join me.
-
-   Nowadays, often I'm not the only one. It is a relief and a joy when I
-   see a regiment of hackers digging in to hold the line, and I realize,
-   this city may survive--for now. But the dangers are greater each year,
-   and now Microsoft has explicitly targeted our community. We can't take
-   the future of freedom for granted. Don't take it for granted! If you
-   want to keep your freedom, you must be prepared to defend it.
-
-  Copyright (C) 1998 Richard Stallman
-
-  Verbatim copying and distribution of this entire article is permitted
-  in any medium, provided this notice is preserved.
+<http://www.gnu.org/gnu/thegnuproject.html>
index 85022a5598f6cee6f9ee9774e4775471d8436304..11bbd356a884b8f64d7403744ecabae6f7161876 100644 (file)
--- a/etc/TODO
+++ b/etc/TODO
@@ -144,11 +144,6 @@ for users to customize.
   http://lists.gnu.org/archive/html/emacs-pretest-bug/2005-12/msg00165.html,
   and the rest of that discussion.
 
-** Height returned by frame-parameter ... and height given to
-   make-frame does not mean the same thing.  The former includes menu and
-   tool bar lines, the latter don't.  frame-parameter should return height
-   without menu and tool bar lines.
-
 ** In Emacs Info, examples of using Customize should be clickable
    and they should create Custom buffers.
 
@@ -308,6 +303,12 @@ familiar with GNUstep and Objective C.
 
 * Other features we would like:
 
+** A more modern printing interface.  One that pops up a dialog that lets
+you choose printer, page style, etc.
+Integration with the Gtk print dialog is apparently difficult.  See eg:
+http://lists.gnu.org/archive/html/emacs-devel/2009-03/msg00501.html
+http://lists.gnu.org/archive/html/emacs-devel/2009-04/msg00034.html
+
 ** Allow frames(terminals) created by emacsclient to inherit their environment
 from the emacsclient process.
 
@@ -405,6 +406,8 @@ rather than interactively.  This a trivial one-liner in easy-mode.el.
 
 ** Save undo information in special temporary files, and reload it
   when needed for undoing.  This could extend undo capacity.
+  undo-tree, in ELPA, already does this; its saving code could be
+  integrated without requiring the use of undo-tree.
 
 ** Change the Windows NT menu code
   so that it handles the deep_p argument and avoids
index 0678d99ddb79b3ce50b6d781297d6fd5b69a6a8f..a70232d84a6fa0343f76951bb815b293c2287ce8 100644 (file)
@@ -1,244 +1,8 @@
-                  Why Software Should Not Have Owners
+Why Software Should Not Have Owners
 
-                         by Richard Stallman
+Note added March 2014:
 
-Digital information technology contributes to the world by making it
-easier to copy and modify information.  Computers promise to make this
-easier for all of us.
+This file is obsolete and will be removed in future.
+Please update any references to use
 
-Not everyone wants it to be easier.  The system of copyright gives
-software programs "owners", most of whom aim to withhold software's
-potential benefit from the rest of the public.  They would like to be
-the only ones who can copy and modify the software that we use.
-
-The copyright system grew up with printing--a technology for mass
-production copying.  Copyright fit in well with this technology
-because it restricted only the mass producers of copies.  It did not
-take freedom away from readers of books.  An ordinary reader, who did
-not own a printing press, could copy books only with pen and ink, and
-few readers were sued for that.
-
-Digital technology is more flexible than the printing press: when
-information has digital form, you can easily copy it to share it with
-others.  This very flexibility makes a bad fit with a system like
-copyright.  That's the reason for the increasingly nasty and draconian
-measures now used to enforce software copyright.  Consider these four
-practices of the Software Publishers Association (SPA):
-
-* Massive propaganda saying it is wrong to disobey the owners
-to help your friend.
-
-* Solicitation for stool pigeons to inform on their coworkers and
-colleagues.
-
-* Raids (with police help) on offices and schools, in which people are
-told they must prove they are innocent of illegal copying.
-
-* Prosecution (by the US government, at the SPA's request) of people
-such as MIT's David LaMacchia, not for copying software (he is not
-accused of copying any), but merely for leaving copying facilities
-unguarded and failing to censor their use.
-
-All four practices resemble those used in the former Soviet Union,
-where every copying machine had a guard to prevent forbidden copying,
-and where individuals had to copy information secretly and pass it
-from hand to hand as "samizdat".  There is of course a difference: the
-motive for information control in the Soviet Union was political; in
-the US the motive is profit.  But it is the actions that affect us,
-not the motive.  Any attempt to block the sharing of information, no
-matter why, leads to the same methods and the same harshness.
-
-Owners make several kinds of arguments for giving them the power
-to control how we use information:
-
-* Name calling.
-
-Owners use smear words such as "piracy" and "theft", as well as expert
-terminology such as "intellectual property" and "damage", to suggest a
-certain line of thinking to the public--a simplistic analogy between
-programs and physical objects.
-
-Our ideas and intuitions about property for material objects are about
-whether it is right to *take an object away* from someone else.  They
-don't directly apply to *making a copy* of something.  But the owners
-ask us to apply them anyway.
-
-* Exaggeration.
-
-Owners say that they suffer "harm" or "economic loss" when users copy
-programs themselves.  But the copying has no direct effect on the
-owner, and it harms no one.  The owner can lose only if the person who
-made the copy would otherwise have paid for one from the owner.
-
-A little thought shows that most such people would not have bought
-copies.  Yet the owners compute their "losses" as if each and every
-one would have bought a copy.  That is exaggeration--to put it kindly.
-
-* The law.
-
-Owners often describe the current state of the law, and the harsh
-penalties they can threaten us with.  Implicit in this approach is the
-suggestion that today's law reflects an unquestionable view of
-morality--yet at the same time, we are urged to regard these penalties
-as facts of nature that can't be blamed on anyone.
-
-This line of persuasion isn't designed to stand up to critical
-thinking; it's intended to reinforce a habitual mental pathway.
-
-It's elemental that laws don't decide right and wrong.  Every American
-should know that, forty years ago, it was against the law in many
-states for a black person to sit in the front of a bus; but only
-racists would say sitting there was wrong.
-
-* Natural rights.
-
-Authors often claim a special connection with programs they have
-written, and go on to assert that, as a result, their desires and
-interests concerning the program simply outweigh those of anyone
-else--or even those of the whole rest of the world.  (Typically
-companies, not authors, hold the copyrights on software, but we are
-expected to ignore this discrepancy.)
-
-To those who propose this as an ethical axiom--the author is more
-important than you--I can only say that I, a notable software author
-myself, call it bunk.
-
-But people in general are only likely to feel any sympathy with the
-natural rights claims for two reasons.
-
-One reason is an overstretched analogy with material objects.  When I
-cook spaghetti, I do object if someone else takes it and stops me from
-eating it.  In this case, that person and I have the same material
-interests at stake, and it's a zero-sum game.  The smallest
-distinction between us is enough to tip the ethical balance.
-
-But whether you run or change a program I wrote affects you directly
-and me only indirectly.  Whether you give a copy to your friend
-affects you and your friend much more than it affects me.  I shouldn't
-have the power to tell you not to do these things.  No one should.
-
-The second reason is that people have been told that natural rights
-for authors is the accepted and unquestioned tradition of our society.
-
-As a matter of history, the opposite is true.  The idea of natural
-rights of authors was proposed and decisively rejected when the US
-Constitution was drawn up.  That's why the Constitution only *permits*
-a system of copyright and does not *require* one; that's why it says
-that copyright must be temporary.  It also states that the purpose of
-copyright is to promote progress--not to reward authors.  Copyright
-does reward authors somewhat, and publishers more, but that is
-intended as a means of modifying their behavior.
-
-The real established tradition of our society is that copyright cuts
-into the natural rights of the public--and that this can only be
-justified for the public's sake.
-
-* Economics.
-
-The final argument made for having owners of software is that this
-leads to production of more software.
-
-Unlike the others, this argument at least takes a legitimate approach
-to the subject.  It is based on a valid goal--satisfying the users of
-software.  And it is empirically clear that people will produce more of
-something if they are well paid for doing so.
-
-But the economic argument has a flaw: it is based on the assumption
-that the difference is only a matter of how much money we have to pay.
-It assumes that "production of software" is what we want, whether the
-software has owners or not.
-
-People readily accept this assumption because it accords with our
-experiences with material objects.  Consider a sandwich, for instance.
-You might well be able to get an equivalent sandwich either free or
-for a price.  If so, the amount you pay is the only difference.
-Whether or not you have to buy it, the sandwich has the same taste,
-the same nutritional value, and in either case you can only eat it
-once.  Whether you get the sandwich from an owner or not cannot
-directly affect anything but the amount of money you have afterwards.
-
-This is true for any kind of material object--whether or not it has an
-owner does not directly affect what it *is*, or what you can do with
-it if you acquire it.
-
-But if a program has an owner, this very much affects what it is, and
-what you can do with a copy if you buy one.  The difference is not
-just a matter of money.  The system of owners of software encourages
-software owners to produce something--but not what society really
-needs.  And it causes intangible ethical pollution that affects us
-all.
-
-What does society need?  It needs information that is truly available
-to its citizens--for example, programs that people can read, fix,
-adapt, and improve, not just operate.  But what software owners
-typically deliver is a black box that we can't study or change.
-
-Society also needs freedom.  When a program has an owner, the users
-lose freedom to control part of their own lives.
-
-And above all society needs to encourage the spirit of voluntary
-cooperation in its citizens.  When software owners tell us that
-helping our neighbors in a natural way is "piracy", they pollute our
-society's civic spirit.
-
-This is why we say that free software is a matter of freedom, not
-price.
-
-The economic argument for owners is erroneous, but the economic issue
-is real.  Some people write useful software for the pleasure of
-writing it or for admiration and love; but if we want more software
-than those people write, we need to raise funds.
-
-For ten years now, free software developers have tried various methods
-of finding funds, with some success.  There's no need to make anyone
-rich; the median US family income, around $35k, proves to be enough
-incentive for many jobs that are less satisfying than programming.
-
-For years, until a fellowship made it unnecessary, I made a living
-from custom enhancements of the free software I had written.  Each
-enhancement was added to the standard released version and thus
-eventually became available to the general public.  Clients paid me so
-that I would work on the enhancements they wanted, rather than on the
-features I would otherwise have considered highest priority.
-
-The Free Software Foundation, a tax-exempt charity for free software
-development, raises funds by selling CD-ROMs, tapes and manuals (all
-of which users are free to copy and change), as well as from
-donations.  It now has a staff of five programmers, plus three
-employees who handle mail orders.
-
-Some free software developers make money by selling support services.
-Cygnus Support, with around 50 employees, estimates that about 15 per
-cent of its staff activity is free software development--a respectable
-percentage for a software company.
-
-Companies including Intel, Motorola, Texas Instruments and Analog
-Devices have combined to fund the continued development of the free
-GNU compiler for the language C.  Meanwhile, the GNU compiler for the
-Ada language is being funded by the US Air Force, which believes this
-is the most cost-effective way to get a high quality compiler.
-
-All these examples are small; the free software movement is still
-small, and still young.  But the example of listener-supported radio
-in this country shows it's possible to support a large activity
-without forcing each user to pay.
-
-As a computer user today, you may find yourself using a proprietary
-program.  If your friend asks to make a copy, it would be wrong to
-refuse.  Cooperation is more important than copyright.  But
-underground, closet cooperation does not make for a good society.  A
-person should aspire to live an upright life openly with pride, and
-this means saying "No" to proprietary software.
-
-You deserve to be able to cooperate openly and freely with other
-people who use software.  You deserve to be able to learn how the
-software works, and to teach your students with it.  You deserve to be
-able to hire your favorite programmer to fix it when it breaks.
-
-You deserve free software.
-
-
-Copyright 1994 Richard Stallman
-Verbatim copying and redistribution is permitted
-without royalty as long as this notice is preserved;
-alteration is not permitted.
+<http://www.gnu.org/philosophy/why-free.html>
index 94a060234f5a393ed2762571c8ba1f0b55606cdc..ee786cff76eb0a9ff2392ce658b3510e7ae5b2d6 100644 (file)
@@ -79,7 +79,7 @@ set $yfile_buffers_only = 0
 
 define ygetptr
   set $ptr = $arg0
-  set $ptr = ((CHECK_LISP_OBJECT_TYPE ? $ptr.i : $ptr) & VALMASK) | DATA_SEG_BITS
+  set $ptr = (CHECK_LISP_OBJECT_TYPE ? $ptr.i : $ptr) & VALMASK
 end
 
 define ybuffer-list
index 6f6dae057813237ad0a9dc2dc44e6202bd98182d..7036ce45b34a4743e144b6034743648ddd9cbc42 100644 (file)
@@ -35,7 +35,18 @@ Used and created by Tassilo Horn.")
  '(dired-directory ((t (:inherit font-lock-function-name-face :weight bold))))
  '(gnus-button ((t (:inherit button))))
  '(gnus-header-name ((t (:box (:line-width 1 :style released-button) :weight bold))))
- '(header-line ((t (:inherit mode-line :inverse-video t))))
+ '(gnus-group-mail-1 ((t (:inherit gnus-group-mail-1-empty :weight bold))))
+ '(gnus-group-mail-1-empty ((t (:foreground "DodgerBlue4"))))
+ '(gnus-group-mail-2 ((t (:inherit gnus-group-mail-2-empty :weight bold))))
+ '(gnus-group-mail-2-empty ((t (:foreground "DodgerBlue3"))))
+ '(gnus-group-mail-3 ((t (:inherit gnus-group-mail-3-empty :weight bold))))
+ '(gnus-group-mail-3-empty ((t (:foreground "DodgerBlue2"))))
+ '(gnus-group-news-1 ((t (:inherit gnus-group-news-1-empty :weight bold))))
+ '(gnus-group-news-1-empty ((t (:foreground "tomato4"))))
+ '(gnus-group-news-2 ((t (:inherit gnus-group-news-2-empty :weight bold))))
+ '(gnus-group-news-2-empty ((t (:foreground "tomato3"))))
+ '(gnus-group-news-3 ((t (:inherit gnus-group-news-3-empty :weight bold))))
+ '(gnus-group-news-3-empty ((t (:foreground "tomato2")))) '(header-line ((t (:inherit mode-line :inverse-video t))))
  '(hl-line ((t (:background "grey95"))))
  '(minibuffer-prompt ((t (:background "yellow" :foreground "medium blue" :box (:line-width -1 :color "red" :style released-button) :weight bold))))
  '(mode-line ((t (:background "wheat" :foreground "black" :box (:line-width 1 :color "tan") :family "DejaVu Sans"))))
index 73dee39661821b404bac781819c98a1cfbc381c0..ac698f63e713bbc7aa5374198fab9d899f2994ef 100644 (file)
@@ -1,3 +1,22 @@
+2014-06-10  Glenn Morris  <rgm@gnu.org>
+
+       Use GNU Make features to simplify and parallelize.
+       * Makefile.in (CHINESE_TIT, TIT_SOURCES, MISC_SOURCES, changed.tit)
+       (changed.misc): Remove.
+       (${leimdir}/quail, ${leimdir}/ja-dic): Create using order-only prereq.
+       (misc_convert): New.
+       (${leimdir}/quail/%.el, ${leimdir}/quail/CT%.el)
+       (${leimdir}/quail/PY.el, ${leimdir}/quail/ZIRANMA.el)
+       (${leimdir}/quail/tsang-%.el, ${leimdir}/quail/quick-%.el):
+       Use pattern rules.
+       (${leimdir}/leim-list.el, ${leimdir}/ja-dic/ja-dic.el):
+       Use automatic variables.
+       (bootstrap-clean): No changed.* files to delete any more.
+
+2014-04-11  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (EMACSDATA, EMACSDOC, EMACSPATH): Unexport.
+
 2014-01-20  Paul Eggert  <eggert@cs.ucla.edu>
 
        Revert some of the CANNOT_DUMP fix (Bug#16494).
index 6bfc3ae70487c5bceba970fe604310a4bc6da85c..16f3917c61ca8b6119853015fedfc503a3404917 100644 (file)
@@ -29,6 +29,9 @@ srcdir=@srcdir@
 # Where the generated files go.
 leimdir = ${srcdir}/../lisp/leim
 
+# Prevent any settings in the user environment causing problems.
+unexport EMACSDATA EMACSDOC EMACSPATH
+
 # Which Emacs to use to convert TIT files to Emacs Lisp files,
 # and generate the file leim-list.el.
 EMACS = ../src/emacs
@@ -58,8 +61,6 @@ TIT_BIG5=\
        ${leimdir}/quail/QJ-b5.el       \
        ${leimdir}/quail/ZOZY.el
 
-CHINESE_TIT=${TIT_GB} ${TIT_BIG5}
-
 MISC= \
        ${leimdir}/quail/tsang-b5.el    \
        ${leimdir}/quail/quick-b5.el    \
@@ -70,80 +71,66 @@ MISC= \
        ${leimdir}/quail/CTLau.el       \
        ${leimdir}/quail/CTLau-b5.el
 
-## The generated .el files.
-TIT_MISC=${CHINESE_TIT} ${MISC}
+## All the generated .el files.
+TIT_MISC = ${TIT_GB} ${TIT_BIG5} ${MISC}
+
 
 all: ${leimdir}/leim-list.el ${leimdir}/ja-dic/ja-dic.el
 .PHONY: all
 
-TIT_SOURCES= \
-       ${srcdir}/CXTERM-DIC/4Corner.tit \
-       ${srcdir}/CXTERM-DIC/ARRAY30.tit \
-       ${srcdir}/CXTERM-DIC/CCDOSPY.tit \
-       ${srcdir}/CXTERM-DIC/ECDICT.tit \
-       ${srcdir}/CXTERM-DIC/ETZY.tit \
-       ${srcdir}/CXTERM-DIC/PY-b5.tit \
-       ${srcdir}/CXTERM-DIC/Punct-b5.tit \
-       ${srcdir}/CXTERM-DIC/Punct.tit \
-       ${srcdir}/CXTERM-DIC/QJ-b5.tit \
-       ${srcdir}/CXTERM-DIC/QJ.tit \
-       ${srcdir}/CXTERM-DIC/SW.tit \
-       ${srcdir}/CXTERM-DIC/TONEPY.tit \
-       ${srcdir}/CXTERM-DIC/ZOZY.tit
-
-${CHINESE_TIT}: changed.tit
-       @true
-
-## The changed.* files act to serialize this part of the build.
-## A single Emacs invocation creates all the CHINESE_TIT files.
-## Otherwise in a parallel build multiple Emacs instances could
-## interfere with each other.  If we used GNU make we could probably
-## parallelize this without the need for an explicit rule for each
-## file.  Something like the pattern rule:
-## quail/%.el: CXTERM-DIC/%.tit
-## It doesn't seem possible to do this with VPATH and suffix rules.
-changed.tit: ${TIT_SOURCES}
-       @${MKDIR_P} ${leimdir}/quail
-       ${RUN_EMACS} -l titdic-cnv \
-         -f batch-titdic-convert -dir ${leimdir}/quail ${srcdir}/CXTERM-DIC
-       echo "changed" > $@
-
-MISC_SOURCES= \
-       ${srcdir}/MISC-DIC/CTLau-b5.html \
-       ${srcdir}/MISC-DIC/CTLau.html \
-       ${srcdir}/MISC-DIC/cangjie-table.b5 \
-       ${srcdir}/MISC-DIC/cangjie-table.cns \
-       ${srcdir}/MISC-DIC/pinyin.map \
-       ${srcdir}/MISC-DIC/ziranma.cin
-
-${MISC}: changed.misc
-       @true
-
-changed.misc: ${MISC_SOURCES}
-       @${MKDIR_P} ${leimdir}/quail
+
+## Ensure the output directory exists.
+${TIT_MISC}: | ${leimdir}/quail
+
+${leimdir}/quail ${leimdir}/ja-dic:
+       ${MKDIR_P} $@
+
+
+## All of TIT_GB and TIT_BIG5.
+${leimdir}/quail/%.el: ${srcdir}/CXTERM-DIC/%.tit
        ${RUN_EMACS} -l titdic-cnv \
-         -f batch-miscdic-convert -dir ${leimdir}/quail ${srcdir}/MISC-DIC
-       echo "changed" > $@
+         -f batch-titdic-convert -dir ${leimdir}/quail $<
+
+
+misc_convert = ${RUN_EMACS} -l titdic-cnv -f batch-miscdic-convert -dir ${leimdir}/quail
+
+## CTLau.el, CTLau-b5.el.
+${leimdir}/quail/CT%.el: ${srcdir}/MISC-DIC/CT%.html
+       ${misc_convert} $<
+
+${leimdir}/quail/PY.el: ${srcdir}/MISC-DIC/pinyin.map
+       ${misc_convert} $<
+
+${leimdir}/quail/ZIRANMA.el: ${srcdir}/MISC-DIC/ziranma.cin
+       ${misc_convert} $<
+
+## Processing cangjie-table.b5 and cangjie-table.cns generates two files
+## in each case.
+${leimdir}/quail/tsang-%.el ${leimdir}/quail/quick-%.el: ${srcdir}/MISC-DIC/cangjie-table.%
+       ${misc_convert} $<
+
 
 .PHONY: leim-list.el
 leim-list.el: ${leimdir}/leim-list.el
 
-${leimdir}/leim-list.el: ${TIT_MISC} ${srcdir}/leim-ext.el
+${leimdir}/leim-list.el: ${srcdir}/leim-ext.el ${TIT_MISC}
        rm -f $@
        ${RUN_EMACS} -l international/quail \
          --eval "(update-leim-list-file (unmsys--file-name \"${leimdir}\"))"
-       sed -n -e '/^[^;]/p' -e 's/^;\(;*\)inc /;\1 /p' < ${srcdir}/leim-ext.el >> $@
+       sed -n -e '/^[^;]/p' -e 's/^;\(;*\)inc /;\1 /p' < $< >> $@
+
+
+${leimdir}/ja-dic/ja-dic.el: | $(leimdir)/ja-dic
 
 ${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L
-       @$(MKDIR_P) $(leimdir)/ja-dic
        $(RUN_EMACS) -batch -l ja-dic-cnv \
-         -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" \
-         "$(srcdir)/SKK-DIC/SKK-JISYO.L"
+         -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" "$<"
+
 
 .PHONY: bootstrap-clean distclean maintainer-clean extraclean
 
 bootstrap-clean:
-       rm -f ${TIT_MISC} ${leimdir}/leim-list.el changed.tit changed.misc
+       rm -f ${TIT_MISC} ${leimdir}/leim-list.el
 
 distclean:
        rm -f Makefile
@@ -152,8 +139,6 @@ maintainer-clean: distclean bootstrap-clean
 
 ## We do not delete ja-dic, even in a bootstrap, because it rarely
 ## changes and is slow to regenerate.
-## TODO? Could consider doing the same with TIT_MISC, though those
-## are much faster to generate.
 extraclean:
        rm -rf ${leimdir}/ja-dic
 
index f204ab517e28b56b1b5c64ef16dc302ab12dd92e..199d46f49849e8dc62bd8603013013a3422f1357 100644 (file)
@@ -1,8 +1,82 @@
+2014-07-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use "b" flag more consistently; avoid "t" (Bug#18006).
+       * make-docfile.c (READ_TEXT): Remove; all uses replaced by "r".
+       (READ_BINARY): Remove; all uses replaced by "rb".
+
+2014-07-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use binary-io module, O_BINARY, and "b" flag (Bug#18006).
+       * etags.c, hexl.c, make-docfile.c:
+       Include binary-io.h instead of fcntl.h and/or io.h.
+       (main): Use set_binary_mode or SET_BINARY
+       in place of handcrafted code.
+       * etags.c (main) [DOS_NT]:
+       * movemail.c (main) [WINDOWSNT]:
+       Don't mess with _fmode.
+       * etags.c (main, process_file_name, analyse_regex):
+       Use fopen/popen's "b" flag instead.
+       * movemail.c (main, popmail): Use open/lk_open/mkostemp's O_BINARY
+       instead.
+
+2014-07-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * make-docfile.c: Simplify a bit, to simplify further refactoring.
+       (outfile): Remove static var.  All uses changed to use stdout,
+       since it's always stdout anyway.  While we're at it, prefer
+       putchar/puts/fputs to printf when there are no format strings.
+       (main): Use freopen rather than fopen, so that stdout is reused.
+       Move O_BINARY stuff after the freopen, so it affects the
+       reopened file.
+       (write_c_args): Omit first arg, since it's always stdout now.
+       All uses changed.
+
 2014-07-12  Paul Eggert  <eggert@cs.ucla.edu>
 
        * etags.c (Lisp_functions): Also record cl-defun etc. (Bug#17965)
 
-2014-05-20  Paul Eggert  <eggert@cs.ucla.edu>
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (blessmail): Depend on lisp/mail/blessmail.el.
+       Use $<, $@.
+       (regex.o, etags${EXEEXT}, ctags${EXEEXT}, ebrowse${EXEEXT})
+       (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
+       (pop.o, emacsclient${EXEEXT}, emacsclientw${EXEEXT}, ntlib.o)
+       (hexl${EXEEXT}, update-game-score${EXEEXT}, emacsclient.res): Use $<.
+       (ctags${EXEEXT}): Add $srcdir to dependency rather than using VPATH.
+
+2014-06-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Omit redundant extern decls.
+       * emacsclient.c (getenv): Remove decl.
+       * make-docfile.c (write_globals): Add ATTRIBUTE_CONST for
+       Fbyteorder, Ftool_bar_height, Fmax_char, Fidentity.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (LDFLAGS): Explicitly set via configure.
+
+2014-06-15  Eli Zaretskii  <eliz@gnu.org>
+
+       * Makefile.in (CPPFLAGS): Define.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (../lib/libgnu.a):
+       Use `make -C' rather than `cd && make'.
+
+       * Makefile.in (bootstrap-clean): New.
+
+2014-06-13  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (../lib/libgnu.a):
+       GNU make automatically passes command-line arguments to sub-makes.
+
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
+
+       * ntlib.h (lseek): Don't redirect to _lseek.
+
+2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix rcs2log problems with CVS.
        Problem reported by Glenn Morris in
        (logdir, llogdir): Work even if TMPDIR begins with '-' or has spaces.
        (output_authors, main awk script): Parse more-recent CVS output format.
 
-2014-05-03  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Remove dependencies on getline and getdelim.
+       Also, remove update-game-scores's limits on game scores and
+       simplify its file-locking code.
+       * update-game-score.c (struct score_entry): Unify the username and
+       data members to a single user_data member, since they don't need to be
+       changed independently and getdelim and getline aren't helpful.
+       Make the score member char *, not intmax_t, so that scores are not
+       limited to intmax_t.  All uses changed.
+       (lose_syserr): A zero errno stands for invalid data in score file.
+       (normalize_integer): New function.
+       (main): Use it.  Check for invalid scores.  Omit redundant stat check.
+       (read_score): First arg is now a string, not a FILE *.  All uses
+       changed.  Do not use getdelim or getline; that's way simpler.
+       (read_scores): Read the whole file, and let read_score handle each
+       line.
+       (score_compare): Compare strings representing integers, not integers.
+       (write_scores) [DOS_NT]: Eliminate unnecessary chmod.
+       (lock_file): Simplify locking code, eliminating goto.
+       Check for unlink failure.
+
+2014-05-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port ctags+etags build to Sun C 5.12.
+       * Makefile.in (etags_args): Remove, replacing with ...
+       (etags_cflags, etags_libs): New macros.  All uses changed.
+       (ctags${EXEEXT}): Don't compile etags.c, as compiling etags.c in
+       parallel (once for ctags, once for etags) breaks parallel makes
+       with compilers that use the source file name to name temporaries,
+       such as Sun C 5.12.  Instead, compile ctags.c.
+       * ctags.c: New file.
+
+2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        Handle systems without WCONTINUED consistently.  (Bug#15110, 17339)
        * emacsclient.c (WCONTINUED): Move to ../src/syswait.h.
 
-2014-04-29  Glenn Morris  <rgm@gnu.org>
+2014-04-30  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in ($(DESTDIR)${archlibdir}):
        Avoid non-portable "`\" nesting.  (Bug#17339)
        * update-game-score.c (write_scores): Condition fchmod call on
        DOS_NT, not WINDOWSNT.
 
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (etags_deps, etags_args): New, to reduce duplication.
+       (etags${EXEEXT}, ctags${EXEEXT}): Use etags_deps, etags_args.
+
+       * Makefile.in (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT})
+       (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
+       (emacsclient${EXEEXT}, emacsclientw${EXEEXT}, hexl${EXEEXT})
+       (update-game-score${EXEEXT}, emacsclient.res): Use $@.
+
+       * Makefile.in (../lib/libgnu.a): Explicitly pass MFLAGS.
+
+       * Makefile.in (DONT_INSTALL): Remove test-distrib.
+       (test-distrib${EXEEXT}): Remove rule.
+
+       * test-distrib.c, testfile: Remove.
+
 2014-03-10  Juanma Barranquero  <lekktu@gmail.com>
 
        * emacsclient.c (main): #ifdef out previous change on Windows.
index 4d9fdba7726383093eb28409c82ccb8c9c45bffe..7eb13f667ec05b8a23f697d7f647bc8363e2d4f5 100644 (file)
@@ -1,7 +1,7 @@
 ### @configure_input@
 
-# Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2014 Free Software
-# Foundation, Inc.
+# Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2014
+#   Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -28,6 +28,9 @@ EMACSOPT = -batch --no-site-file --no-site-lisp
 
 CC=@CC@
 CFLAGS=@CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+
 version=@version@
 ## Used in $archlibdir.
 configuration=@configuration@
@@ -128,7 +131,7 @@ INSTALLABLE_SCRIPTS = grep-changelog
 UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \
             update-game-score${EXEEXT}
 
-DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
+DONT_INSTALL= make-docfile${EXEEXT}
 
 # Like UTILITIES, but they're not system-dependent, and should not be
 #  deleted by the distclean target.
@@ -192,6 +195,7 @@ BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
              -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
 
 ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
+## Unused.
 LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
 CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
 
@@ -207,9 +211,9 @@ $(EXE_FILES): ../lib/libgnu.a
 
 ## Only used if we need blessmail, but no harm in always defining.
 ## This makes the actual blessmail executable.
-blessmail:
-       $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
-       chmod +x blessmail
+blessmail: $(srcdir)/../lisp/mail/blessmail.el
+       $(EMACS) $(EMACSOPT) -l $<
+       chmod +x $@
 
 ## This checks if we need to run blessmail.
 ## Do not charge ahead and do it!  Let the installer decide.
@@ -255,7 +259,7 @@ $(DESTDIR)${archlibdir}: all
        fi
 
 .PHONY: install uninstall mostlyclean clean distclean maintainer-clean
-.PHONY: extraclean check tags
+.PHONY: bootstrap-clean extraclean check tags
 
 install: $(DESTDIR)${archlibdir}
        @echo
@@ -289,7 +293,7 @@ distclean: clean
        -rm -f TAGS
        -rm -f Makefile blessmail
 
-maintainer-clean: distclean
+bootstrap-clean maintainer-clean: distclean
        true
 
 extraclean: maintainer-clean
@@ -303,61 +307,55 @@ tags: TAGS
 TAGS: etags${EXEEXT}
        etags *.[ch]
 
-## This verifies that the non-ASCII characters in the file \`testfile\'
-## have not been clobbered by whatever means were used to copy and
-## distribute Emacs.  If they were clobbered, all the .elc files were
-## clobbered too.
-test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
-       $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c
-       ./test-distrib ${srcdir}/testfile
-
 ../lib/libgnu.a: $(config_h)
-       cd ../lib && $(MAKE) libgnu.a
+       $(MAKE) -C ../lib libgnu.a
 
 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
-       ${CC} -c ${CPP_CFLAGS} ${srcdir}/../src/regex.c
+       ${CC} -c ${CPP_CFLAGS} $<
+
+
+etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
+etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@
+etags_libs = regex.o $(LOADLIBES) $(NTLIB)
 
-etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
-       $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
-         -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-         regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT}
+etags${EXEEXT}: ${etags_deps}
+       $(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
+
+## ctags.c is distinct from etags.c so that parallel makes do not write two
+## etags.o files on top of each other.
+## FIXME?
+## Can't we use a wrapper that calls 'etags --ctags'?
+ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps}
+       $(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
 
 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
                    $(config_h)
        $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
-         ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT}
-
-## We depend on etags to assure that parallel makes do not write two
-## etags.o files on top of each other.
-ctags${EXEEXT}: etags${EXEEXT}
-       $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
-         -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-         regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT}
+         $< $(LOADLIBES) $(NTLIB) -o $@
 
 profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
-       $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
-         $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT}
+       $(CC) ${ALL_CFLAGS} $< \
+         $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@
 
 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
-       $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \
-         -o make-docfile${EXEEXT}
+       $(CC) ${ALL_CFLAGS} $< $(LOADLIBES) $(NTLIB) -o $@
 
 movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
-       $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
-         $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT}
+       $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} $< pop.o \
+         $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o $@
 
 pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
-       $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
+       $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} $<
 
 emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
-       $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
+       $(CC) ${ALL_CFLAGS} $< \
           -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \
-          $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT}
+          $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
 
 emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
-       $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \
+       $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \
           -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \
-          $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT}
+          $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
 
 NTINC = ${srcdir}/../nt/inc
 NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
@@ -367,18 +365,16 @@ NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
 # The dependency on $(NTDEPS) is a trick intended to cause recompile of
 # programs on MinGW whenever some private header in nt/inc is modified.
 ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS)
-       $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c
+       $(CC) -c ${CPP_CFLAGS} $<
 
 hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
-       $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
+       $(CC) ${ALL_CFLAGS} $< $(LOADLIBES) -o $@
 
 update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
        $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
-         ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \
-         -o update-game-score${EXEEXT}
+         $< $(LOADLIBES) $(NTLIB) -o $@
 
 emacsclient.res: $(NTINC)/../emacsclient.rc
-       $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o emacsclient.res \
-         $(NTINC)/../emacsclient.rc
+       $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $<
 
 ## Makefile ends here.
diff --git a/lib-src/ctags.c b/lib-src/ctags.c
new file mode 100644 (file)
index 0000000..0a6838a
--- /dev/null
@@ -0,0 +1,2 @@
+#define CTAGS 1
+#include "etags.c"
index a1177f54576df8086f5143a25c5a718b099c1ab3..ddc1b6de5e3a4a13d0e59bdc2255b97e0bcfe200 100644 (file)
@@ -82,10 +82,6 @@ char *w32_getenv (char *);
 #include <signal.h>
 #include <errno.h>
 
-
-\f
-char *getenv (const char *);
-
 #ifndef VERSION
 #define VERSION "unspecified"
 #endif
index 5f1f99c46776aea9304c01211c61b021b164f79b..ae5491a82040e39f525d958a5ce2f055aa5c71c5 100644 (file)
@@ -105,17 +105,13 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
 #ifdef MSDOS
 # undef MSDOS
 # define MSDOS true
-# include <fcntl.h>
 # include <sys/param.h>
-# include <io.h>
 #else
 # define MSDOS false
 #endif /* MSDOS */
 
 #ifdef WINDOWSNT
-# include <fcntl.h>
 # include <direct.h>
-# include <io.h>
 # define MAXPATHLEN _MAX_PATH
 # undef HAVE_NTGUI
 # undef  DOS_NT
@@ -131,6 +127,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <binary-io.h>
 #include <c-strcase.h>
 
 #include <assert.h>
@@ -1002,13 +999,8 @@ main (int argc, char **argv)
   linebuffer filename_lb;
   bool help_asked = false;
   ptrdiff_t len;
- char *optstring;
- int opt;
-
-
-#ifdef DOS_NT
-  _fmode = O_BINARY;   /* all of files are treated as binary files */
-#endif /* DOS_NT */
+  char *optstring;
+  int opt;
 
   progname = argv[0];
   nincluded_files = 0;
@@ -1195,15 +1187,10 @@ main (int argc, char **argv)
       if (streq (tagfile, "-"))
        {
          tagf = stdout;
-#ifdef DOS_NT
-         /* Switch redirected `stdout' to binary mode (setting `_fmode'
-            doesn't take effect until after `stdout' is already open). */
-         if (!isatty (fileno (stdout)))
-           setmode (fileno (stdout), O_BINARY);
-#endif /* DOS_NT */
+         SET_BINARY (fileno (stdout));
        }
       else
-       tagf = fopen (tagfile, append_to_tagfile ? "a" : "w");
+       tagf = fopen (tagfile, append_to_tagfile ? "ab" : "wb");
       if (tagf == NULL)
        pfatal (tagfile);
     }
@@ -1306,7 +1293,7 @@ main (int argc, char **argv)
       append_to_tagfile = true;
     }
 
-  tagf = fopen (tagfile, append_to_tagfile ? "a" : "w");
+  tagf = fopen (tagfile, append_to_tagfile ? "ab" : "wb");
   if (tagf == NULL)
     pfatal (tagfile);
   put_entries (nodehead);      /* write all the tags (CTAGS) */
@@ -1547,11 +1534,11 @@ process_file_name (char *file, language *lang)
   if (real_name == compressed_name)
     {
       char *cmd = concat (compr->command, " ", real_name);
-      inf = (FILE *) popen (cmd, "r");
+      inf = popen (cmd, "rb");
       free (cmd);
     }
   else
-    inf = fopen (real_name, "r");
+    inf = fopen (real_name, "rb");
   if (inf == NULL)
     {
       perror (real_name);
@@ -5614,7 +5601,7 @@ analyse_regex (char *regex_arg)
        char *regexfile = regex_arg + 1;
 
        /* regexfile is a file containing regexps, one per line. */
-       regexfp = fopen (regexfile, "r");
+       regexfp = fopen (regexfile, "rb");
        if (regexfp == NULL)
          pfatal (regexfile);
        linebuffer_init (&regexbuf);
index 9e21ddf9de639aef1a0f0a7db83fdc1df0ca8d8f..51744ab08a2b2e552379f480fb504e7c9a80ac04 100644 (file)
@@ -24,15 +24,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
 #include <ctype.h>
-#ifdef DOS_NT
-#include <fcntl.h>
-#if __DJGPP__ >= 2
-#include <io.h>
-#endif
-#endif
-#ifdef WINDOWSNT
-#include <io.h>
-#endif
+
+#include <binary-io.h>
 
 #define DEFAULT_GROUPING       0x01
 #define DEFAULT_BASE           16
@@ -155,20 +148,12 @@ main (int argc, char **argv)
 
       if (un_flag)
        {
-         char buf[18];
-
-#ifdef DOS_NT
-#if (__DJGPP__ >= 2) || (defined WINDOWSNT)
-          if (!isatty (fileno (stdout)))
-           setmode (fileno (stdout), O_BINARY);
-#else
-         (stdout)->_flag &= ~_IOTEXT; /* print binary */
-         _setmode (fileno (stdout), O_BINARY);
-#endif
-#endif
+         SET_BINARY (fileno (stdout));
+
          for (;;)
            {
-             register int i, c = 0, d;
+             int i, c = 0, d;
+             char buf[18];
 
 #define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10)
 
@@ -210,15 +195,7 @@ main (int argc, char **argv)
        }
       else
        {
-#ifdef DOS_NT
-#if (__DJGPP__ >= 2) || (defined WINDOWSNT)
-          if (!isatty (fileno (fp)))
-           setmode (fileno (fp), O_BINARY);
-#else
-         (fp)->_flag &= ~_IOTEXT; /* read binary */
-         _setmode (fileno (fp), O_BINARY);
-#endif
-#endif
+         SET_BINARY (fileno (fp));
          address = 0;
          string[0] = ' ';
          string[17] = '\0';
index 2eb2413815e695de2b300f41a0f6d5305f18424f..884b6c1001e42a0e2cdd7d2d97291d5521a54595 100644 (file)
@@ -38,17 +38,16 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
 #include <stdlib.h>   /* config.h unconditionally includes this anyway */
-#ifdef MSDOS
-#include <fcntl.h>
-#endif /* MSDOS */
+
 #ifdef WINDOWSNT
 /* Defined to be sys_fopen in ms-w32.h, but only #ifdef emacs, so this
    is really just insurance.  */
 #undef fopen
-#include <fcntl.h>
 #include <direct.h>
 #endif /* WINDOWSNT */
 
+#include <binary-io.h>
+
 #ifdef DOS_NT
 /* Defined to be sys_chdir in ms-w32.h, but only #ifdef emacs, so this
    is really just insurance.
@@ -56,12 +55,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    Similarly, msdos defines this as sys_chdir, but we're not linking with the
    file where that function is defined.  */
 #undef chdir
-#define READ_TEXT "rt"
-#define READ_BINARY "rb"
 #define IS_SLASH(c)  ((c) == '/' || (c) == '\\' || (c) == ':')
 #else  /* not DOS_NT */
-#define READ_TEXT "r"
-#define READ_BINARY "r"
 #define IS_SLASH(c)  ((c) == '/')
 #endif /* not DOS_NT */
 
@@ -73,9 +68,6 @@ static void write_globals (void);
 
 #include <unistd.h>
 
-/* Stdio stream for output to the DOC file.  */
-FILE *outfile;
-
 /* Name this program was invoked with.  */
 char *progname;
 
@@ -135,33 +127,24 @@ main (int argc, char **argv)
 
   progname = argv[0];
 
-  outfile = stdout;
-
-  /* Don't put CRs in the DOC file.  */
-#ifdef MSDOS
-  _fmode = O_BINARY;
-#if 0  /* Suspicion is that this causes hanging.
-         So instead we require people to use -o on MSDOS.  */
-  (stdout)->_flag &= ~_IOTEXT;
-  _setmode (fileno (stdout), O_BINARY);
-#endif
-  outfile = 0;
-#endif /* MSDOS */
-#ifdef WINDOWSNT
-  _fmode = O_BINARY;
-  _setmode (fileno (stdout), O_BINARY);
-#endif /* WINDOWSNT */
-
   /* If first two args are -o FILE, output to FILE.  */
   i = 1;
   if (argc > i + 1 && !strcmp (argv[i], "-o"))
     {
-      outfile = fopen (argv[i + 1], "w");
+      if (! freopen (argv[i + 1], "w", stdout))
+       {
+         perror (argv[i + 1]);
+         return EXIT_FAILURE;
+       }
       i += 2;
     }
   if (argc > i + 1 && !strcmp (argv[i], "-a"))
     {
-      outfile = fopen (argv[i + 1], "a");
+      if (! freopen (argv[i + 1], "a", stdout))
+       {
+         perror (argv[i + 1]);
+         return EXIT_FAILURE;
+       }
       i += 2;
     }
   if (argc > i + 1 && !strcmp (argv[i], "-d"))
@@ -179,8 +162,7 @@ main (int argc, char **argv)
       ++i;
     }
 
-  if (outfile == 0)
-    fatal ("No output file specified", "");
+  set_binary_mode (fileno (stdout), O_BINARY);
 
   if (generate_globals)
     start_globals ();
@@ -215,13 +197,11 @@ put_filename (char *filename)
        filename = tmp + 1;
     }
 
-  putc (037, outfile);
-  putc ('S', outfile);
-  fprintf (outfile, "%s\n", filename);
+  printf ("\037S%s\n", filename);
 }
 
-/* Read file FILENAME and output its doc strings to outfile.  */
-/* Return 1 if file is not found, 0 if it is found.  */
+/* Read file FILENAME and output its doc strings to stdout.
+   Return 1 if file is not found, 0 if it is found.  */
 
 static int
 scan_file (char *filename)
@@ -232,19 +212,19 @@ scan_file (char *filename)
   if (!generate_globals)
     put_filename (filename);
   if (len > 4 && !strcmp (filename + len - 4, ".elc"))
-    return scan_lisp_file (filename, READ_BINARY);
+    return scan_lisp_file (filename, "rb");
   else if (len > 3 && !strcmp (filename + len - 3, ".el"))
-    return scan_lisp_file (filename, READ_TEXT);
+    return scan_lisp_file (filename, "r");
   else
-    return scan_c_file (filename, READ_TEXT);
+    return scan_c_file (filename, "r");
 }
 
 static void
 start_globals (void)
 {
-  fprintf (outfile, "/* This file was auto-generated by make-docfile.  */\n");
-  fprintf (outfile, "/* DO NOT EDIT.  */\n");
-  fprintf (outfile, "struct emacs_globals {\n");
+  puts ("/* This file was auto-generated by make-docfile.  */");
+  puts ("/* DO NOT EDIT.  */");
+  puts ("struct emacs_globals {");
 }
 \f
 static char input_buffer[128];
@@ -373,7 +353,7 @@ scan_keyword_or_put_char (int ch, struct rcsoc_state *state)
 
 /* Skip a C string or C-style comment from INFILE, and return the
    character that follows.  COMMENT non-zero means skip a comment.  If
-   PRINTFLAG is positive, output string contents to outfile.  If it is
+   PRINTFLAG is positive, output string contents to stdout.  If it is
    negative, store contents in buf.  Convert escape sequences \n and
    \t to newline and tab; discard \ followed by newline.
    If SAW_USAGE is non-zero, then any occurrences of the string `usage:'
@@ -388,7 +368,7 @@ read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usa
 
   state.in_file = infile;
   state.buf_ptr = (printflag < 0 ? input_buffer : 0);
-  state.out_file = (printflag > 0 ? outfile : 0);
+  state.out_file = (printflag > 0 ? stdout : 0);
   state.pending_spaces = 0;
   state.pending_newlines = 0;
   state.keyword = (saw_usage ? "usage:" : 0);
@@ -465,18 +445,18 @@ read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usa
 
 
 \f
-/* Write to file OUT the argument names of function FUNC, whose text is in BUF.
+/* Write to stdout the argument names of function FUNC, whose text is in BUF.
    MINARGS and MAXARGS are the minimum and maximum number of arguments.  */
 
 static void
-write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
+write_c_args (char *func, char *buf, int minargs, int maxargs)
 {
   register char *p;
   int in_ident = 0;
   char *ident_start IF_LINT (= NULL);
   size_t ident_length = 0;
 
-  fprintf (out, "(fn");
+  fputs ("(fn", stdout);
 
   if (*buf == '(')
     ++buf;
@@ -517,10 +497,10 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
          if (strncmp (ident_start, "void", ident_length) == 0)
            continue;
 
-         putc (' ', out);
+         putchar (' ');
 
          if (minargs == 0 && maxargs > 0)
-           fprintf (out, "&optional ");
+           fputs ("&optional ", stdout);
 
          minargs--;
          maxargs--;
@@ -528,7 +508,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
          /* In C code, `default' is a reserved word, so we spell it
             `defalt'; demangle that here.  */
          if (ident_length == 6 && memcmp (ident_start, "defalt", 6) == 0)
-           fprintf (out, "DEFAULT");
+           fputs ("DEFAULT", stdout);
          else
            while (ident_length-- > 0)
              {
@@ -539,12 +519,12 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
                else if (c == '_')
                  /* Print underscore as hyphen.  */
                  c = '-';
-               putc (c, out);
+               putchar (c);
              }
        }
     }
 
-  putc (')', out);
+  putchar (')');
 }
 \f
 /* The types of globals.  These are sorted roughly in decreasing alignment
@@ -613,8 +593,8 @@ compare_globals (const void *a, const void *b)
 static void
 close_emacs_globals (void)
 {
-  fprintf (outfile, "};\n");
-  fprintf (outfile, "extern struct emacs_globals globals;\n");
+  puts ("};");
+  puts ("extern struct emacs_globals globals;");
 }
 
 static void
@@ -641,7 +621,7 @@ write_globals (void)
          if (!seen_defun)
            {
              close_emacs_globals ();
-             fprintf (outfile, "\n");
+             putchar ('\n');
              seen_defun = 1;
            }
          break;
@@ -651,9 +631,9 @@ write_globals (void)
 
       if (type)
        {
-         fprintf (outfile, "  %s f_%s;\n", type, globals[i].name);
-         fprintf (outfile, "#define %s globals.f_%s\n",
-                  globals[i].name, globals[i].name);
+         printf ("  %s f_%s;\n", type, globals[i].name);
+         printf ("#define %s globals.f_%s\n",
+                 globals[i].name, globals[i].name);
        }
       else
        {
@@ -664,15 +644,26 @@ write_globals (void)
              || strcmp (globals[i].name, "Fkill_emacs") == 0
              || strcmp (globals[i].name, "Fexit_recursive_edit") == 0
              || strcmp (globals[i].name, "Fabort_recursive_edit") == 0)
-           fprintf (outfile, "_Noreturn ");
-         fprintf (outfile, "EXFUN (%s, ", globals[i].name);
+           fputs ("_Noreturn ", stdout);
+
+         printf ("EXFUN (%s, ", globals[i].name);
          if (globals[i].value == -1)
-           fprintf (outfile, "MANY");
+           fputs ("MANY", stdout);
          else if (globals[i].value == -2)
-           fprintf (outfile, "UNEVALLED");
+           fputs ("UNEVALLED", stdout);
          else
-           fprintf (outfile, "%d", globals[i].value);
-         fprintf (outfile, ");\n");
+           printf ("%d", globals[i].value);
+         putchar (')');
+
+         /* It would be nice to have a cleaner way to deal with these
+            special hacks, too.  */
+         if (strcmp (globals[i].name, "Fbyteorder") == 0
+             || strcmp (globals[i].name, "Ftool_bar_height") == 0
+             || strcmp (globals[i].name, "Fmax_char") == 0
+             || strcmp (globals[i].name, "Fidentity") == 0)
+           fputs (" ATTRIBUTE_CONST", stdout);
+
+         puts (";");
        }
 
       while (i + 1 < num_globals
@@ -941,9 +932,7 @@ scan_c_file (char *filename, const char *mode)
          int comment = c != '"';
          int saw_usage;
 
-         putc (037, outfile);
-         putc (defvarflag ? 'V' : 'F', outfile);
-         fprintf (outfile, "%s\n", input_buffer);
+         printf ("\037%c%s\n", defvarflag ? 'V' : 'F', input_buffer);
 
          if (comment)
            getc (infile);      /* Skip past `*'.  */
@@ -985,8 +974,8 @@ scan_c_file (char *filename, const char *mode)
              while (c != ')');
              *p = '\0';
              /* Output them.  */
-             fprintf (outfile, "\n\n");
-             write_c_args (outfile, input_buffer, argbuf, minargs, maxargs);
+             fputs ("\n\n", stdout);
+             write_c_args (input_buffer, argbuf, minargs, maxargs);
            }
          else if (defunflag && maxargs == -1 && !saw_usage)
            /* The DOC should provide the usage form.  */
@@ -1422,12 +1411,10 @@ scan_lisp_file (const char *filename, const char *mode)
         In the latter case, the opening quote (and leading backslash-newline)
         have already been read.  */
 
-      putc (037, outfile);
-      putc (type, outfile);
-      fprintf (outfile, "%s\n", buffer);
+      printf ("\037%c%s\n", type, buffer);
       if (saved_string)
        {
-         fputs (saved_string, outfile);
+         fputs (saved_string, stdout);
          /* Don't use one dynamic doc string twice.  */
          free (saved_string);
          saved_string = 0;
index d0d00fcf4cc089c34cfd10442d88b527f9c15c9e..c600fc0ea536428792fdf6f24af1698193abb626 100644 (file)
@@ -191,11 +191,6 @@ main (int argc, char **argv)
   uid_t real_gid = getgid ();
   uid_t priv_gid = getegid ();
 
-#ifdef WINDOWSNT
-  /* Ensure all file i/o is in binary mode. */
-  _fmode = _O_BINARY;
-#endif
-
   delete_lockname = 0;
 
   while ((c = getopt (argc, argv, ARGSTR)) != EOF)
@@ -304,7 +299,7 @@ main (int argc, char **argv)
 
          memcpy (tempname, inname, inname_dirlen);
          strcpy (tempname + inname_dirlen, "EXXXXXX");
-         desc = mkostemp (tempname, 0);
+         desc = mkostemp (tempname, O_BINARY);
          if (desc < 0)
            {
              int mkostemp_errno = errno;
@@ -358,12 +353,12 @@ main (int argc, char **argv)
 
 #ifndef MAIL_USE_MMDF
 #ifdef MAIL_USE_SYSTEM_LOCK
-      indesc = open (inname, O_RDWR);
+      indesc = open (inname, O_RDWR | O_BINARY);
 #else  /* if not MAIL_USE_SYSTEM_LOCK */
-      indesc = open (inname, O_RDONLY);
+      indesc = open (inname, O_RDONLY | O_BINARY);
 #endif /* not MAIL_USE_SYSTEM_LOCK */
 #else  /* MAIL_USE_MMDF */
-      indesc = lk_open (inname, O_RDONLY, 0, 0, 10);
+      indesc = lk_open (inname, O_RDONLY | O_BINARY, 0, 0, 10);
 #endif /* MAIL_USE_MMDF */
 
       if (indesc < 0)
@@ -372,7 +367,7 @@ main (int argc, char **argv)
       /* Make sure the user can read the output file.  */
       umask (umask (0) & 0377);
 
-      outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666);
+      outdesc = open (outname, O_WRONLY | O_BINARY | O_CREAT | O_EXCL, 0666);
       if (outdesc < 0)
        pfatal_with_name (outname);
 
@@ -675,7 +670,7 @@ popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse
       return EXIT_SUCCESS;
     }
 
-  mbfi = open (outfile, O_WRONLY | O_CREAT | O_EXCL, 0666);
+  mbfi = open (outfile, O_WRONLY | O_BINARY | O_CREAT | O_EXCL, 0666);
   if (mbfi < 0)
     {
       pop_close (server);
index dbb0195a30b137eeb48464fd0d1c13bc17480626..40ef9fa982d4d054f27533f7ed80eb0184864530 100644 (file)
@@ -90,7 +90,6 @@ int mkostemp (char * template, int flags);
 #define locking   _locking
 #define logb      _logb
 #define _longjmp  longjmp
-#define lseek     _lseek
 #define popen     _popen
 #define pclose    _pclose
 #define umask    _umask
diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c
deleted file mode 100644 (file)
index 88b95db..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* test-distrib.c --- testing distribution of nonprinting chars
-
-Copyright (C) 1987, 1993-1995, 1999, 2001-2014 Free Software Foundation,
-Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
-
-
-#include <config.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-/* Break string in two parts to avoid buggy C compilers that ignore characters
-   after nulls in strings.  */
-
-static char string1[] = "Testing distribution of nonprinting chars:\n\
-Should be 0177: \177 Should be 0377: \377 Should be 0212: \212.\n\
-Should be 0000: ";
-
-static char string2[] = ".\n\
-This file is read by the `test-distribution' program.\n\
-If you change it, you will make that program fail.\n";
-
-/* Like `read' but keeps trying until it gets SIZE bytes or reaches eof.  */
-static int
-cool_read (int fd, char *buf, size_t size)
-{
-  ssize_t num;
-  ssize_t sofar = 0;
-
-  while (1)
-    {
-      if ((num = read (fd, buf + sofar, size - sofar)) == 0)
-       return sofar;
-      else if (num < 0)
-       return num;
-      sofar += num;
-    }
-}
-
-int
-main (int argc, char **argv)
-{
-  int fd;
-  char buf[300];
-
-  if (argc != 2)
-    {
-      fprintf (stderr, "Usage: %s testfile\n", argv[0]);
-      exit (EXIT_FAILURE);
-    }
-  fd = open (argv[1], O_RDONLY);
-  if (fd < 0)
-    {
-      perror (argv[1]);
-      exit (EXIT_FAILURE);
-    }
-  if (cool_read (fd, buf, sizeof string1) != sizeof string1 ||
-      strcmp (buf, string1) ||
-      cool_read (fd, buf, sizeof string2) != sizeof string2 - 1 ||
-      strncmp (buf, string2, sizeof string2 - 1))
-    {
-      fprintf (stderr, "Data in file `%s' has been damaged.\n\
-Most likely this means that many nonprinting characters\n\
-have been corrupted in the files of Emacs, and it will not work.\n",
-              argv[1]);
-      exit (EXIT_FAILURE);
-    }
-  close (fd);
-  return EXIT_SUCCESS;
-}
-
-
-/* test-distrib.c ends here */
diff --git a/lib-src/testfile b/lib-src/testfile
deleted file mode 100644 (file)
index 8230c35..0000000
Binary files a/lib-src/testfile and /dev/null differ
index cb6fdf7359034d876b2513d83ddd31e63c589508..7a64cd04f479da1f23ab807cb298266b69b2037d 100644 (file)
@@ -76,9 +76,8 @@ static int unlock_file (const char *filename, void *state);
 
 struct score_entry
 {
-  intmax_t score;
-  char *username;
-  char *data;
+  char *score;
+  char *user_data;
 };
 
 #define MAX_SCORES min (PTRDIFF_MAX, SIZE_MAX / sizeof (struct score_entry))
@@ -102,7 +101,8 @@ lose (const char *msg)
 static _Noreturn void
 lose_syserr (const char *msg)
 {
-  fprintf (stderr, "%s: %s\n", msg, strerror (errno));
+  fprintf (stderr, "%s: %s\n", msg,
+          errno ? strerror (errno) : "Invalid data in score file");
   exit (EXIT_FAILURE);
 }
 
@@ -137,6 +137,38 @@ get_prefix (bool running_suid, const char *user_prefix)
   return user_prefix;
 }
 
+static char *
+normalize_integer (char *num)
+{
+  bool neg;
+  char *p;
+  while (*num != '\n' && isspace (*num))
+    num++;
+  neg = *num == '-';
+  num += neg || *num == '-';
+
+  if (*num == '0')
+    {
+      while (*++num == '0')
+       continue;
+      neg &= !!*num;
+      num -= !*num;
+    }
+
+  for (p = num; '0' <= *p && *p <= '9'; p++)
+    continue;
+
+  if (*p || p == num)
+    {
+      errno = 0;
+      return 0;
+    }
+
+  if (neg)
+    *--num = '-';
+  return num;
+}
+
 int
 main (int argc, char **argv)
 {
@@ -144,9 +176,8 @@ main (int argc, char **argv)
   bool running_suid;
   void *lockstate;
   char *scorefile;
-  char *nl;
+  char *end, *nl, *user, *data;
   const char *prefix, *user_prefix = NULL;
-  struct stat buf;
   struct score_entry *scores;
   struct score_entry newscore;
   bool reverse = false;
@@ -169,8 +200,8 @@ main (int argc, char **argv)
        break;
       case 'm':
        {
-         intmax_t m = strtoimax (optarg, 0, 10);
-         if (m < 0)
+         intmax_t m = strtoimax (optarg, &end, 10);
+         if (optarg == end || *end || m < 0)
            usage (EXIT_FAILURE);
          max_scores = min (m, MAX_SCORES);
        }
@@ -194,21 +225,26 @@ main (int argc, char **argv)
   strcat (scorefile, "/");
   strcat (scorefile, argv[optind]);
 
-  newscore.score = strtoimax (argv[optind + 1], 0, 10);
+  newscore.score = normalize_integer (argv[optind + 1]);
+  if (! newscore.score)
+    {
+      fprintf (stderr, "%s: Invalid score\n", argv[optind + 1]);
+      return EXIT_FAILURE;
+    }
 
-  newscore.data = argv[optind + 2];
-  if (strlen (newscore.data) > MAX_DATA_LEN)
-    newscore.data[MAX_DATA_LEN] = '\0';
-  nl = strchr (newscore.data, '\n');
+  user = get_user_id ();
+  if (! user)
+    lose_syserr ("Couldn't determine user id");
+  data = argv[optind + 2];
+  if (strlen (data) > MAX_DATA_LEN)
+    data[MAX_DATA_LEN] = '\0';
+  nl = strchr (data, '\n');
   if (nl)
     *nl = '\0';
-
-  newscore.username = get_user_id ();
-  if (! newscore.username)
-    lose_syserr ("Couldn't determine user id");
-
-  if (stat (scorefile, &buf) < 0)
-    lose_syserr ("Failed to access scores file");
+  newscore.user_data = malloc (strlen (user) + 1 + strlen (data) + 1);
+  if (! newscore.user_data
+      || sprintf (newscore.user_data, "%s %s", user, data) < 0)
+    lose_syserr ("Memory exhausted");
 
   if (lock_file (scorefile, &lockstate) < 0)
     lose_syserr ("Failed to lock scores file");
@@ -244,137 +280,75 @@ main (int argc, char **argv)
   exit (EXIT_SUCCESS);
 }
 
-static int
-read_score (FILE *f, struct score_entry *score)
+static char *
+read_score (char *p, struct score_entry *score)
 {
-  int c;
-  if ((c = getc (f)) != EOF)
-    ungetc (c, f);
-  if (feof (f))
-    return 1;
-  for (score->score = 0; (c = getc (f)) != EOF && isdigit (c); )
-    {
-      if (INTMAX_MAX / 10 < score->score)
-       return -1;
-      score->score *= 10;
-      if (INTMAX_MAX - (c - '0') < score->score)
-       return -1;
-      score->score += c - '0';
-    }
-  while ((c = getc (f)) != EOF
-        && isspace (c))
-    ;
-  if (c == EOF)
-    return -1;
-  ungetc (c, f);
-#ifdef HAVE_GETDELIM
-  {
-    size_t count = 0;
-    score->username = 0;
-    if (getdelim (&score->username, &count, ' ', f) < 1
-       || score->username == NULL)
-      return -1;
-    /* Trim the space */
-    score->username[strlen (score->username)-1] = '\0';
-  }
-#else
-  {
-    ptrdiff_t unameread = 0;
-    ptrdiff_t unamelen = 30;
-    char *username = malloc (unamelen);
-    if (!username)
-      return -1;
-
-    while ((c = getc (f)) != EOF && c != ' ')
-      {
-       if (unameread >= unamelen - 1)
-         {
-           ptrdiff_t unamelen_max = min (PTRDIFF_MAX, SIZE_MAX);
-           if (unamelen <= unamelen_max / 2)
-             unamelen *= 2;
-           else if (unamelen < unamelen_max)
-             unamelen = unamelen_max;
-           else
-             {
-               errno = ENOMEM;
-               return -1;
-             }
-           username = realloc (username, unamelen);
-           if (!username)
-             return -1;
-         }
-       username[unameread] = c;
-       unameread++;
-      }
-    if (c == EOF)
-      return -1;
-    username[unameread] = '\0';
-    score->username = username;
-  }
-#endif
-#ifdef HAVE_GETLINE
-  score->data = NULL;
-  errno = 0;
-  {
-    size_t len;
-    if (getline (&score->data, &len, f) < 0)
-      return -1;
-    score->data[strlen (score->data)-1] = '\0';
-  }
-#else
-  {
-    ptrdiff_t cur = 0;
-    ptrdiff_t len = 16;
-    char *buf = malloc (len);
-    if (!buf)
-      return -1;
-    while ((c = getc (f)) != EOF
-          && c != '\n')
-      {
-       if (cur >= len-1)
-         {
-           if (min (PTRDIFF_MAX, SIZE_MAX) / 2 < len)
-             {
-               errno = ENOMEM;
-               return -1;
-             }
-           if (!(buf = realloc (buf, len *= 2)))
-             return -1;
-         }
-       buf[cur] = c;
-       cur++;
-      }
-    score->data = buf;
-    score->data[cur] = '\0';
-  }
-#endif
-  return 0;
+  score->score = p;
+  p = strchr (p, ' ');
+  if (!p)
+    return p;
+  *p++ = 0;
+  score->user_data = p;
+  p = strchr (p, '\n');
+  if (!p)
+    return p;
+  *p++ = 0;
+  return p;
 }
 
 static int
 read_scores (const char *filename, struct score_entry **scores,
             ptrdiff_t *count, ptrdiff_t *alloc)
 {
-  int readval = -1;
-  ptrdiff_t scorecount = 0;
-  ptrdiff_t cursize = 0;
-  struct score_entry *ret = 0;
-  struct score_entry entry;
+  char *p, *filedata;
+  ptrdiff_t filesize, nread;
+  struct stat st;
   FILE *f = fopen (filename, "r");
-  int retval = -1;
   if (!f)
     return -1;
-  while ((readval = read_score (f, &entry)) == 0)
-    if (push_score (&ret, &scorecount, &cursize, &entry) < 0)
+  if (fstat (fileno (f), &st) != 0)
+    return -1;
+  if (! (0 <= st.st_size && st.st_size < min (PTRDIFF_MAX, SIZE_MAX)))
+    {
+      errno = EOVERFLOW;
+      return -1;
+    }
+  filesize = st.st_size;
+  filedata = malloc (filesize + 1);
+  if (! filedata)
+    return -1;
+  nread = fread (filedata, 1, filesize + 1, f);
+  if (filesize < nread)
+    {
+      errno = 0;
       return -1;
-  if (readval > 0 && fclose (f) == 0)
+    }
+  if (nread < filesize)
+    filesize = nread;
+  if (ferror (f) || fclose (f) != 0)
+    return -1;
+  filedata[filesize] = 0;
+  if (strlen (filedata) != filesize)
     {
-      *count = scorecount;
-      *alloc = cursize;
-      *scores = ret;
-      retval = 0;
+      errno = 0;
+      return -1;
     }
-  return retval;
+
+  *scores = 0;
+  *count = *alloc = 0;
+  for (p = filedata; p < filedata + filesize; )
+    {
+      struct score_entry entry;
+      p = read_score (p, &entry);
+      if (!p)
+       {
+         errno = 0;
+         return -1;
+       }
+      if (push_score (scores, count, alloc, &entry) < 0)
+       return -1;
+    }
+  return 0;
 }
 
 static int
@@ -382,7 +356,25 @@ score_compare (const void *a, const void *b)
 {
   const struct score_entry *sa = (const struct score_entry *) a;
   const struct score_entry *sb = (const struct score_entry *) b;
-  return (sb->score > sa->score) - (sb->score < sa->score);
+  char *sca = sa->score;
+  char *scb = sb->score;
+  size_t lena, lenb;
+  bool nega = *sca == '-';
+  bool negb = *scb == '-';
+  int diff = nega - negb;
+  if (diff)
+    return diff;
+  if (nega)
+    {
+      char *tmp = sca;
+      sca = scb + 1;
+      scb = tmp + 1;
+    }
+  lena = strlen (sca);
+  lenb = strlen (scb);
+  if (lena != lenb)
+    return lenb < lena ? -1 : 1;
+  return strcmp (scb, sca);
 }
 
 static int
@@ -451,18 +443,12 @@ write_scores (const char *filename, const struct score_entry *scores,
   if (! f)
     return -1;
   for (i = 0; i < count; i++)
-    if (fprintf (f, "%"PRIdMAX" %s %s\n",
-                scores[i].score, scores[i].username, scores[i].data)
-       < 0)
+    if (fprintf (f, "%s %s\n", scores[i].score, scores[i].user_data) < 0)
       return -1;
   if (fclose (f) != 0)
     return -1;
   if (rename (tempfile, filename) != 0)
     return -1;
-#ifdef DOS_NT
-  if (chmod (filename, 0644) < 0)
-    return -1;
-#endif
   return 0;
 }
 
@@ -479,30 +465,27 @@ lock_file (const char *filename, void **state)
   strcpy (lockpath, filename);
   strcat (lockpath, lockext);
   *state = lockpath;
- trylock:
-  attempts++;
-  /* If the lock is over an hour old, delete it.  */
-  if (stat (lockpath, &buf) == 0
-      && 60 * 60 < time (0) - buf.st_ctime)
-    unlink (lockpath);
-  fd = open (lockpath, O_CREAT | O_EXCL, 0600);
-  if (fd < 0)
+
+  while ((fd = open (lockpath, O_CREAT | O_EXCL, 0600)) < 0)
     {
-      if (errno == EEXIST)
+      if (errno != EEXIST)
+       return -1;
+      attempts++;
+
+      /* Break the lock if it is over an hour old, or if we've tried
+        more than MAX_ATTEMPTS times.  We won't corrupt the file, but
+        we might lose some scores. */
+      if (MAX_ATTEMPTS < attempts
+         || (stat (lockpath, &buf) == 0 && 60 * 60 < time (0) - buf.st_ctime))
        {
-         /* Break the lock; we won't corrupt the file, but we might
-            lose some scores. */
-         if (attempts > MAX_ATTEMPTS)
-           {
-             unlink (lockpath);
-             attempts = 0;
-           }
-         sleep ((rand () % 2)+1);
-         goto trylock;
+         if (unlink (lockpath) != 0 && errno != ENOENT)
+           return -1;
+         attempts = 0;
        }
-      else
-       return -1;
+
+      sleep ((rand () & 1) + 1);
     }
+
   close (fd);
   return 0;
 }
index f76d0d3928d28261a3fed159f1ad37aa88947168..cda96811ebc587f95c10ab9fa7e388785a51dcfd 100644 (file)
@@ -16,3 +16,7 @@ include gnulib.mk
 
 libgnu_a_SOURCES += openat-die.c save-cwd.c
 endif
+
+.PHONY: bootstrap-clean
+
+bootstrap-clean: maintainer-clean
index fdffe6484901c735d7e47ad11e23a0d94ea5813b..b2380068de752600f4decfc8e04d08116100f003 100644 (file)
@@ -174,14 +174,14 @@ extern int acl_access_nontrivial (acl_t);
 
 /* Return 1 if the given ACL is non-trivial.
    Return 0 if it is trivial, i.e. equivalent to a simple stat() mode.  */
-extern int acl_nontrivial (int count, aclent_t *entries);
+extern int acl_nontrivial (int count, aclent_t *entries) _GL_ATTRIBUTE_PURE;
 
 #  ifdef ACE_GETACL /* Solaris 10 */
 
 /* Test an ACL retrieved with ACE_GETACL.
    Return 1 if the given ACL, consisting of COUNT entries, is non-trivial.
    Return 0 if it is trivial, i.e. equivalent to a simple stat() mode.  */
-extern int acl_ace_nontrivial (int count, ace_t *entries);
+extern int acl_ace_nontrivial (int count, ace_t *entries) _GL_ATTRIBUTE_PURE;
 
 /* Definitions for when the built executable is executed on Solaris 10
    (newer version) or Solaris 11.  */
index d024f74ba67021725c11d1017558cc7deccd3daf..f67e350df057450bde9a357323c3dfc1dc1bfab2 100644 (file)
--- a/lib/acl.h
+++ b/lib/acl.h
@@ -17,6 +17,9 @@
 
    Written by Paul Eggert.  */
 
+#ifndef _GL_ACL_H
+#define _GL_ACL_H 1
+
 #include <stdbool.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -28,3 +31,5 @@ int set_acl (char const *, int, mode_t);
 int qcopy_acl (char const *, int, char const *, int, mode_t);
 int copy_acl (char const *, int, char const *, int, mode_t);
 int chmod_or_fchmod (char const *, int, mode_t);
+
+#endif
index e219292aa3435683b35f1f88c62e8ae3b790406c..231b38dbf03f0cf14bcb1306632dbe1201d8bfc8 100644 (file)
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv update-copyright utimens warnings
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv update-copyright utimens warnings
 
 
 MOSTLYCLEANFILES += core *.stackdump
@@ -900,57 +900,6 @@ EXTRA_DIST += stdalign.in.h
 
 ## end   gnulib module stdalign
 
-## begin gnulib module stdarg
-
-BUILT_SOURCES += $(STDARG_H)
-
-# We need the following in order to create <stdarg.h> when the system
-# doesn't have one that works with the given compiler.
-if GL_GENERATE_STDARG_H
-stdarg.h: stdarg.in.h $(top_builddir)/config.status
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
-             < $(srcdir)/stdarg.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-else
-stdarg.h: $(top_builddir)/config.status
-       rm -f $@
-endif
-MOSTLYCLEANFILES += stdarg.h stdarg.h-t
-
-EXTRA_DIST += stdarg.in.h
-
-## end   gnulib module stdarg
-
-## begin gnulib module stdbool
-
-BUILT_SOURCES += $(STDBOOL_H)
-
-# We need the following in order to create <stdbool.h> when the system
-# doesn't have one that works.
-if GL_GENERATE_STDBOOL_H
-stdbool.h: stdbool.in.h $(top_builddir)/config.status
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-else
-stdbool.h: $(top_builddir)/config.status
-       rm -f $@
-endif
-MOSTLYCLEANFILES += stdbool.h stdbool.h-t
-
-EXTRA_DIST += stdbool.in.h
-
-## end   gnulib module stdbool
-
 ## begin gnulib module stddef
 
 BUILT_SOURCES += $(STDDEF_H)
index 29438237760fa7067350dfc2270df52cad3da11c..48b3a40f9c73ee0c6f626f0278dba12ec86c4947 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <string.h>            /* For the real memcpy prototype.  */
 
-#if DEBUG
+#if defined DEBUG && DEBUG
 # include <stdio.h>
 # include <stdlib.h>
 /* Make it work even if the system's libc has its own mktime routine.  */
@@ -600,7 +600,7 @@ libc_hidden_def (mktime)
 libc_hidden_weak (timelocal)
 #endif
 \f
-#if DEBUG
+#if defined DEBUG && DEBUG
 
 static int
 not_equal_tm (const struct tm *a, const struct tm *b)
index 6a4f6ad1cf1e36b4b5c798abe1c11fbd0ad1ba4f..7b40bb8f059a7c98071d1780e9b31e87c51bfa71 100644 (file)
 
 #include "intprops.h"
 
-/* The results of open() in this file are not used with fchdir,
-   and we do not leak fds to any single-threaded code that could use stdio,
-   therefore save some unnecessary work in fchdir.c.
-   FIXME - if the kernel ever adds support for multi-thread safety for
-   avoiding standard fds, then we should use open_safer.  */
-#undef open
-#undef close
-
 #define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/%s"
 
 #define PROC_SELF_FD_NAME_SIZE_BOUND(len) \
diff --git a/lib/stdarg.in.h b/lib/stdarg.in.h
deleted file mode 100644 (file)
index 5b37dd3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Substitute for and wrapper around <stdarg.h>.
-   Copyright (C) 2008-2014 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef _@GUARD_PREFIX@_STDARG_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-/* The include_next requires a split double-inclusion guard.  */
-#@INCLUDE_NEXT@ @NEXT_STDARG_H@
-
-#ifndef _@GUARD_PREFIX@_STDARG_H
-#define _@GUARD_PREFIX@_STDARG_H
-
-#ifndef va_copy
-# define va_copy(a,b) ((a) = (b))
-#endif
-
-#endif /* _@GUARD_PREFIX@_STDARG_H */
-#endif /* _@GUARD_PREFIX@_STDARG_H */
diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h
deleted file mode 100644 (file)
index 651e8df..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Copyright (C) 2001-2003, 2006-2014 Free Software Foundation, Inc.
-   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef _GL_STDBOOL_H
-#define _GL_STDBOOL_H
-
-/* ISO C 99 <stdbool.h> for platforms that lack it.  */
-
-/* Usage suggestions:
-
-   Programs that use <stdbool.h> should be aware of some limitations
-   and standards compliance issues.
-
-   Standards compliance:
-
-       - <stdbool.h> must be #included before 'bool', 'false', 'true'
-         can be used.
-
-       - You cannot assume that sizeof (bool) == 1.
-
-       - Programs should not undefine the macros bool, true, and false,
-         as C99 lists that as an "obsolescent feature".
-
-   Limitations of this substitute, when used in a C89 environment:
-
-       - <stdbool.h> must be #included before the '_Bool' type can be used.
-
-       - You cannot assume that _Bool is a typedef; it might be a macro.
-
-       - Bit-fields of type 'bool' are not supported.  Portable code
-         should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
-
-       - In C99, casts and automatic conversions to '_Bool' or 'bool' are
-         performed in such a way that every nonzero value gets converted
-         to 'true', and zero gets converted to 'false'.  This doesn't work
-         with this substitute.  With this substitute, only the values 0 and 1
-         give the expected result when converted to _Bool' or 'bool'.
-
-       - C99 allows the use of (_Bool)0.0 in constant expressions, but
-         this substitute cannot always provide this property.
-
-   Also, it is suggested that programs use 'bool' rather than '_Bool';
-   this isn't required, but 'bool' is more common.  */
-
-
-/* 7.16. Boolean type and values */
-
-/* BeOS <sys/socket.h> already #defines false 0, true 1.  We use the same
-   definitions below, but temporarily we have to #undef them.  */
-#if defined __BEOS__ && !defined __HAIKU__
-# include <OS.h> /* defines bool but not _Bool */
-# undef false
-# undef true
-#endif
-
-#ifdef __cplusplus
-# define _Bool bool
-# define bool bool
-#else
-# if defined __BEOS__ && !defined __HAIKU__
-  /* A compiler known to have 'bool'.  */
-  /* If the compiler already has both 'bool' and '_Bool', we can assume they
-     are the same types.  */
-#  if !@HAVE__BOOL@
-typedef bool _Bool;
-#  endif
-# else
-#  if !defined __GNUC__
-   /* If @HAVE__BOOL@:
-        Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
-        the built-in _Bool type is used.  See
-          http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-          http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-          http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-        Similar bugs are likely with other compilers as well; this file
-        wouldn't be used if <stdbool.h> was working.
-        So we override the _Bool type.
-      If !@HAVE__BOOL@:
-        Need to define _Bool ourselves. As 'signed char' or as an enum type?
-        Use of a typedef, with SunPRO C, leads to a stupid
-          "warning: _Bool is a keyword in ISO C99".
-        Use of an enum type, with IRIX cc, leads to a stupid
-          "warning(1185): enumerated type mixed with another type".
-        Even the existence of an enum type, without a typedef,
-          "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
-        The only benefit of the enum, debuggability, is not important
-        with these compilers.  So use 'signed char' and no enum.  */
-#   define _Bool signed char
-#  else
-   /* With this compiler, trust the _Bool type if the compiler has it.  */
-#   if !@HAVE__BOOL@
-   /* For the sake of symbolic names in gdb, define true and false as
-      enum constants, not only as macros.
-      It is tempting to write
-         typedef enum { false = 0, true = 1 } _Bool;
-      so that gdb prints values of type 'bool' symbolically.  But then
-      values of type '_Bool' might promote to 'int' or 'unsigned int'
-      (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
-      (see ISO C 99 6.3.1.1.(2)).  So add a negative value to the
-      enum; this ensures that '_Bool' promotes to 'int'.  */
-typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
-#   endif
-#  endif
-# endif
-# define bool _Bool
-#endif
-
-/* The other macros must be usable in preprocessor directives.  */
-#ifdef __cplusplus
-# define false false
-# define true true
-#else
-# define false 0
-# define true 1
-#endif
-
-#define __bool_true_false_are_defined 1
-
-#endif /* _GL_STDBOOL_H */
index 3e5042a0f91c37352a30660863a765ffcd7de830..47f41a68cd0c9f8356de42031ca93c04a8806524 100644 (file)
@@ -3,32 +3,61 @@
        * tutorial.el (tutorial--display-changes): Accept punctuation
        characters before the key binding.  (Bug#18146)
 
-2014-07-28  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-31  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
-       * doc-view.el (doc-view-open-text): Don't require that the
-       document is saved in a file (e.g., email attachment).
+       * progmodes/python.el: Shell output capture enhancements.
+       (python-shell-accept-process-output): New function.
+       (inferior-python-mode)
+       (python-shell-send-setup-code): Use it.
 
-2014-07-27  Eli Zaretskii  <eliz@gnu.org>
+2014-07-30  Christophe Deleuze  <christophe.deleuze@free.fr>  (tiny change)
+
+       * calendar/icalendar.el (icalendar--decode-isodatetime): Use
+       actual current-time-zone when converting to local time. (Bug#15408)
+
+2014-07-29  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.el (window--state-put-2): Handle horizontal scroll
+       bars, if present.
+
+2014-07-29  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
+
+       * menu-bar.el (menu-bar-update-buffers): Update item list format
+       in `buffers-menu' to confirm with changes to `get_keyelt'
+       (r117463).  (Bug#18016)
+
+2014-07-28  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * progmodes/python.el (inferior-python-mode): Make input prompts
+       read-only.
+
+2014-07-28  Emilio C. Lopes  <eclig@gmx.net>
+
+       * net/tramp-sh.el (tramp-get-remote-python): Also search for
+       executables named "python2" or "python3".
+       (tramp-get-remote-uid-with-python): Use parentheses around
+       arguments to `print' to make it compatible with Python 3.
+       (tramp-get-remote-gid-with-python): Ditto.  (Bug#18118)
+
+2014-07-28  Eli Zaretskii  <eliz@gnu.org>
 
        * window.el (window--pixel-to-total): Use FRAME's root window, not
        that of the selected frame.  (Bug#18112, Bug#16674)
 
-2014-07-27  Andreas Schwab  <schwab@linux-m68k.org>
+2014-07-28  Andreas Schwab  <schwab@linux-m68k.org>
 
        * textmodes/tex-mode.el (tex-font-lock-verb): Doc fix.
        (Bug#18117)
 
-2014-07-27  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+2014-07-28  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        * progmodes/python.el (inferior-python-mode): Doc fix.
 
-2014-07-25  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-28  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el (todo-edit-item--next-key): If next key is
        not a character, ignore it instead of raising an error.
 
-2014-07-25  Stephen Berman  <stephen.berman@gmx.net>
-
        * calendar/todo-mode.el: Fix handling of marked items and make
        minor code improvements.
        (todo-edit-item): If there are marked items, ensure user can only
@@ -42,7 +71,7 @@
        (todo-edit-item--header, todo-edit-item--diary-inclusion)
        (todo-item-done): Use it.
 
-2014-07-25  Glenn Morris  <rgm@gnu.org>
+2014-07-28  Glenn Morris  <rgm@gnu.org>
 
        * files.el (toggle-read-only): Re-add basic doc-string.
        * vc/vc-hooks.el (vc-toggle-read-only): Tweak obsolescence mesage.
        Replace missing `switch-to-prolog' with `run-prolog'.
        (switch-to-prolog): Define as (obsolete) alias, as in 23.4.
 
-2014-07-22  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-28  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el (todo-set-top-priorities): Fix overwriting
        of file-wide setting when changing category-wide setting.
 
+2014-07-28  Stephen Berman  <stephen.berman@gmx.net>
+
+       * doc-view.el (doc-view-open-text): Don't require that the
+       document is saved in a file (e.g., email attachment).
+
+2014-07-28  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       Parse completion input in a iPython friendly way.  (Bug#18084)
+       * progmodes/python.el
+       (python-shell-completion-at-point): Rename from
+       python-shell-completion-complete-at-point.
+       (inferior-python-mode): Use it.
+       (python-completion-at-point): Rename from
+       python-completion-complete-at-point.  Parse input up to first
+       backward occurrence of whitespace, open-paren, close-paren or
+       string delimiter.
+       (python-mode): Use it.
+
+2014-07-28  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       Prevent Python process shell buffer to pop twice.
+       * progmodes/python.el (python-shell-switch-to-shell): Do not call
+       pop-to-buffer.
+
+2014-07-28  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * progmodes/python.el
+       (python-shell-with-shell-buffer): New macro.
+       (python-shell-font-lock-get-or-create-buffer)
+       (python-shell-font-lock-kill-buffer)
+       (python-shell-font-lock-with-font-lock-buffer)
+       (python-shell-font-lock-cleanup-buffer)
+       (python-shell-font-lock-toggle): Use it.
+       (python-shell-font-lock-turn-on)
+       (python-shell-font-lock-turn-off): Use it.  Make command.
+
+2014-07-28  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       Grab all Python process output before inferior-python-mode hooks.
+       * progmodes/python.el (inferior-python-mode): Call
+       accept-process-output and sit-for to ensure all output for process
+       has been received before running hooks.
+       (python-shell-internal-get-or-create-process): Cleanup
+       accept-process-output and sit-for calls.
+
+2014-07-28  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       More robust shell startup and code setup.
+       * progmodes/python.el (python-shell-make-comint): Remove
+       accept-process-output call.
+       (python-shell-get-buffer): Return current buffer if major-mode is
+       inferior-python-mode.
+       (python-shell-get-or-create-process): Use it.
+       (python-shell-send-setup-code): Send all setup code in one string,
+       output success message and accept-process-output.
+
+2014-07-27  Eli Zaretskii  <eliz@gnu.org>
+
+       * scroll-bar.el (scroll-bar-toolkit-horizontal-scroll): Add
+       rudimentary support for bidirectional text.
+
+2014-07-27  Martin Rudalics  <rudalics@gmx.at>
+
+       * frame.el (frame-notice-user-settings): Rewrite using
+       frame-initial-frame-tool-bar-height.
+       * menu-bar.el (menu-bar-horizontal-scroll-bar)
+       (menu-bar-no-horizontal-scroll-bar): New functions.
+       (menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
+       scroll bars.
+       * scroll-bar.el (scroll-bar-lines)
+       (set-horizontal-scroll-bar-mode)
+       (get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
+       (scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
+       (scroll-bar-toolkit-horizontal-scroll): New functions.
+       (horizontal-scroll-bar-mode)
+       (previous-horizontal-scroll-bar-mode)
+       (horizontal-scroll-bar-mode-explicit): New variables.
+       (horizontal-scroll-bar-mode): New option.
+       (toggle-horizontal-scroll-bar): Do something.
+       (top-level): Bind horizontal-scroll-bar mouse-1.
+       * startup.el (tool-bar-originally-present): Remove variable.
+       (command-line): Don't set tool-bar-originally-present.
+       * window.el (window-min-height): Update doc-string.
+       (window--dump-frame): Dump horizontal scroll bar values.
+       (window--min-size-1): Handle minibuffer window separately.
+       Count in margins and horizontal scroll bar.  Return safe value
+       iff IGNORE equals 'safe.
+       (frame-windows-min-size): New function (used by frame resizing
+       routines).
+       (fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
+       scroll bars.
+       (window--sanitize-window-sizes): New function.
+       (window-split-min-size): Remove.
+       (split-window): Count divider-width.  Don't use
+       `window-split-min-size' any more.  Reword error messages.
+       Sanitize windows sizes after splitting.
+
+2014-07-27  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       Use `defvar-local' more.
+       * progmodes/hideshow.el
+       (hs-c-start-regexp, hs-block-start-regexp)
+       (hs-block-start-mdata-select, hs-block-end-regexp)
+       (hs-forward-sexp-func, hs-adjust-block-beginning): ...here;
+       remove corresponding `make-variable-buffer-local' top-level calls.
+
+2014-07-27  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       Cleanup error signals.  (Bug#18067)
+       * progmodes/python.el
+       (python-indent-shift-left): Use user-error instead.
+       (python-shell-prompt-detect): Use lwarn with python group.
+       (python-completion-complete-at-point)
+       (python-eldoc--get-doc-at-point): Don't signal error.
+
+2014-07-27  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       Support for packages in Python shell.  (Bug#13570)
+       * progmodes/python.el (python-shell--package-depth): New var.
+       (python-shell-package-enable): New command.
+       (python-util-list-directories, python-util-list-files)
+       (python-util-list-packages): New functions.
+
+2014-07-27  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       Faster comint output.  (Bug#16875)
+       * progmodes/python.el:
+       (python-comint-output-filter-function): Make obsolete.
+       (python-comint-postoutput-scroll-to-bottom): New function.
+       (inferior-python-mode): Set comint-output-filter-functions to a
+       minimum.
+
+2014-07-27  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * progmodes/python.el (python-shell-font-lock-post-command-hook):
+       Safeguard current point and undo history.
+
+2014-07-26  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       Robust shell syntax highlighting.  (Bug#18084, Bug#16875)
+       * progmodes/python.el:
+       (python-shell-prompt-input-regexps): Add iPython block prompt.
+       (python-shell-output-syntax-table): Delete var.
+       (python-shell-font-lock-with-font-lock-buffer): New macro.
+       (python-shell-font-lock-get-or-create-buffer)
+       (python-shell-font-lock-kill-buffer)
+       (python-shell-font-lock-cleanup-buffer)
+       (python-shell-font-lock-post-command-hook)
+       (python-shell-font-lock-turn-off): New functions.
+       (python-shell-font-lock-turn-on): New function.
+       (inferior-python-mode): Use it.
+       (python-shell-font-lock-toggle): New command.
+       (python-shell-font-lock-enable): Rename from
+       python-shell-enable-font-lock.
+       (run-python-internal): Use it.
+       (python-shell-font-lock-comint-output-filter-function): New function.
+       (python-shell-comint-end-of-output-p): New function.
+       (python-shell-output-filter): Use it.
+       (python-util-comint-last-prompt): New function.
+       (python-util-text-properties-replace-name): New function.
+
+2014-07-25  Glenn Morris  <rgm@gnu.org>
+
+       * vc/ediff-init.el (ediff-toggle-read-only-function):
+       * vc/ediff-util.el (ediff-toggle-read-only):
+       Replace obsolete toggle-read-only with read-only-mode.
+
+2014-07-24  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-cache.el (tramp-flush-file-function): Wrap the code
+       with `save-match-data'.  (Bug#18095)
+
+2014-07-21  Vincent Belaïche  <vincentb1@users.sourceforge.net>
+
+       * ses.el (ses-truncate-cell): Use cl-progv instead of eval in
+       order to ensure that row and col are lexically bound inside the
+       evaluated sexp.
+
 2014-07-21  Glenn Morris  <rgm@gnu.org>
 
        * progmodes/hideif.el (hide-ifdef-mode-submap):
        * progmodes/hideif.el (hide-ifdef-toggle-outside-read-only):
        Doc fixes re toggle-read-only.
 
-2014-07-20  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+2014-07-21  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        * progmodes/python.el: Add comment about pipe buffering and
        solutions for missing/delayed output in inferior Python shells.
        (Bug#17304)
 
-2014-07-20  Fabián Ezequiel Gallina  <fgallina@gnu.org>
-
        * progmodes/python.el (python-mode): Don't set
        mode-require-final-newline.  (Bug#17990)
 
-2014-07-20  Fabián Ezequiel Gallina  <fgallina@gnu.org>
-
        Make python.el work with IPython automatically.  (Bug#15510)
        * progmodes/python.el:
        (python-shell-completion-setup-code): New value supporting iPython.
        (python-shell-prompt-output-regexps): Add safeguard for ipdb.
        (python-shell-output-filter): Fix comment typo.
 
-2014-07-19  Fabián Ezequiel Gallina  <fgallina@gnu.org>
-
        Fix Python shell prompts detection for remote hosts.
        * progmodes/python.el (python-shell-prompt-detect): Replace
        call-process with process-file and make it more robust.
 
-2014-07-17  Fabián Ezequiel Gallina  <fgallina@gnu.org>
-
        Autodetect Python shell prompts.  (Bug#17370)
        * progmodes/python.el:
        (python-shell-interpreter-interactive-arg)
        (python-shell-prompt-detect)
        (python-shell-prompt-validate-regexps): New functions.
        (python-shell-prompt-set-calculated-regexps): New function.
-       (inferior-python-mode): Use it.  Also honor overridden
+       (inferior-python-mode): Use it.  Also honor overriden
        python-shell-interpreter and python-shell-interpreter-args.
-       (python-shell-make-comint): Honor overridden
+       (python-shell-make-comint): Honor overriden
        python-shell-interpreter and python-shell-interpreter-args.
        (python-shell-get-or-create-process): Make it testable by allowing
        to call run-python non-interactively.
        (python-shell-prompt-output-regexp)
        (python-shell-prompt-pdb-regexp): Use it as defcustom :safe.
 
+2014-07-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/smie.el (smie-config--guess-1): Split from
+       smie-config--guess.
+       (smie-config--guess): Use it.
+
+       * emacs-lisp/edebug.el: Use nadvice.
+       (edebug-original-read): Remove.
+       (edebug--read): Rename from edebug-read and add `orig' arg.
+       (edebug-uninstall-read-eval-functions)
+       (edebug-install-read-eval-functions): Use nadvice.
+       (edebug-read-sexp, edebug-read-storing-offsets, edebug-read-symbol)
+       (edebug-read-and-maybe-wrap-form1, edebug-instrument-callee)
+       (edebug-read-string, edebug-read-function): Use just `read'.
+       (edebug-original-debug-on-entry): Remove.
+       (edebug--debug-on-entry): Rename from edebug-debug-on-entry and add
+       `orig' arg.
+       (debug-on-entry): Override with nadvice.
+
+       * mouse.el (tear-off-window): Rename from mouse-tear-off-window since
+       it also makes sense to bind it to a non-mouse event.
+
+       * vc/vc-bzr.el (vc-bzr-shelve): Make it operate on fileset.
+
+2014-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xt-mouse.el (xterm-mouse-event): Don't assume last-click is non-nil
+       (bug#18015).
+
+       * rect.el (rectangle--string-preview): Don't assume there
+       a non-nil default (bug#17984).
+
 2014-07-16  Glenn Morris  <rgm@gnu.org>
 
        * desktop.el (after-init-hook): Disable startup frame restoration
        in non-graphical situations.  (Bug#17693)
 
-2014-07-14  Glenn Morris  <rgm@gnu.org>
-
        * vc/vc-dispatcher.el (vc-log-edit): Do set up the log buffer
        if it was "empty", or used for a different set of files.  (Bug#17884)
 
-2014-07-13  Eli Zaretskii  <eliz@gnu.org>
+2014-07-16  Eli Zaretskii  <eliz@gnu.org>
 
        * bindings.el (mode-line-remote): If default-directory is not a
        string, don't call file-remote-p on it; instead state in the
        help-echo that it is nil.  (Bug#17986)
 
+2014-07-14  Daniel Colascione  <dancol@dancol.org>
+
+       * progmodes/cc-langs.el: Change comments from `cl-macroexpand-all'
+       to `macroexpand-all'
+
+       * progmodes/cc-defs.el (c-lang-defconst-eval-immediately):
+       Use `macroexpand-all' instead of `cl-macroexpand-all'.
+
 2014-07-12  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix bug: C-x v v discarded existing log message (Bug#17884).
        * vc/vc-dispatcher.el (vc-log-edit):
        Don't clobber an already-existing log message.
 
-2014-07-10  Glenn Morris  <rgm@gnu.org>
+2014-07-12  Glenn Morris  <rgm@gnu.org>
 
        * vc/log-edit.el (log-edit-changelog-entries):
        Check for a visited-but-never-saved ChangeLog.
 
-2014-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * vc/log-edit.el (log-edit-changelog-entries): Don't both visiting
        a non-existing file (bug#17970).
        * faces.el (face-name): Undo last change.
        (x-resolve-font-name): Don't call face-name (bug#17956).
 
-2014-07-09  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+2014-07-12  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        Fix dedenters and electric colon handling. (Bug#15163)
-
        * progmodes/python.el
        (python-rx-constituents): Add dedenter and block-ender.
        (python-indent-dedenters, python-indent-block-enders): Delete.
        (python-info-dedenter-opening-block-positions)
        (python-info-dedenter-statement-p): New functions.
 
-2014-07-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * files.el (out-of-memory-warning-percentage): New defcustom.
+       (warn-maybe-out-of-memory): Use it.
+
+2014-07-11  Michael Albinus  <michael.albinus@gmx.de>
+
+       * subr.el (read-passwd): Use `read-hide-char' if non-nil.  Bind it
+       when calling `read-string'.  (Bug#17839)
+
+2014-07-10  Eli Zaretskii  <eliz@gnu.org>
+
+       * files.el (warn-maybe-out-of-memory): Fix the wording of the
+       warning.
+
+2014-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * files.el (warn-maybe-out-of-memory): New function.
+       (find-file-noselect): Use it.
+
+2014-07-09  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/cperl-mode.el (cperl-block-p): Treat the perl keyword
+       `constant' like `bless', `return' &c
+
+2014-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * rect.el (apply-on-rectangle): Check forward-line really moved to the
+       next line.
+
+2014-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in
        the middle of a line (bug#17896).
 
-2014-07-08  Juri Linkov  <juri@jurta.org>
+2014-07-09  Juri Linkov  <juri@jurta.org>
 
        * startup.el (command-line): Append displaying the warning about
        the errors in the init file to the end of `after-init-hook'.
        (Bug#17927)
 
-2014-07-08  Juri Linkov  <juri@jurta.org>
-
-       * faces.el (face-name): Return input arg `face' as is
+       * faces.el (face-name): Return input arg `face' as-is
        when it's not a symbol.
        (x-resolve-font-name): Don't check if the face is a symbol.
        (Bug#17956)
 
-2014-07-08  Juri Linkov  <juri@jurta.org>
-
        * facemenu.el (list-colors-print): In help-echo format use %.2f
        instead of %d because now HSV values are floating-point components
        between 0.0 and 1.0.
 
-2014-07-06  Glenn Morris  <rgm@gnu.org>
+2014-07-09  Glenn Morris  <rgm@gnu.org>
 
        * emulation/cua-rect.el (cua--activate-rectangle):
        Avoid setting cua--rectangle to nil.  (Bug#17877)
 
-2014-07-06  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-09  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el: Fix wrong-type-argument error when
        marking multiple consecutive items.
        (todo-mark-category): Don't try to mark the empty line between the
        todo and done items sections.
 
-2014-07-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/edebug.el (edebug-eval-defun): Print result using
        proper Lisp quoting (bug#17934).
        * progmodes/ruby-mode.el (ruby-mode-variables): Don't meddle with
        require-final-newline since prog-mode already took care of it (bug#17947).
 
-2014-07-04  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-09  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el: Fix two bugs.  Shorten Commentary and
        refer to the Todo mode Info manual.  Update the comment on
        (todo-filter-items): Reorder a let-bound variable to avoid a
        wrong-type-argument error on canceling the file choice dialog.
 
-2014-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/octave.el (inferior-octave-mode):
        Set comint-input-ring-size to a number (bug#17912).
 
-2014-07-03  Juri Linkov  <juri@jurta.org>
+2014-07-09  Juri Linkov  <juri@jurta.org>
 
        * desktop.el (desktop-minor-mode-table): Add `defining-kbd-macro'
        and `isearch-mode' associated with nil.  (Bug#17849)
 
-2014-07-02  Juri Linkov  <juri@jurta.org>
+2014-07-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * linum.el (linum--face-height): New function (bug#17813).
+       (linum-update-window): Use it to adjust margin to linum's width.
+
+       * leim/quail/sisheng.el (sisheng-list): Don't bother with-case-table.
+       * eshell/em-smart.el (eshell-smart-scroll-window): Use
+       with-selected-window.
+
+       * xt-mouse.el (xterm-mouse-translate-1): Intern drag event (bug#17894).
+       Remove also pointless window&mark manipulation.
+
+       * progmodes/perl-mode.el: Use syntax-ppss; fix one indentation case.
+       (perl-indent-line): Use syntax-ppss to detect we're in a doc-section.
+       (perl-continuation-line-p): Don't skip over anything else than labels.
+       Return the previous char.
+       (perl-calculate-indent): Use syntax-ppss instead of parse-start
+       and update callers accordingly.  For continuation lines, check the
+       the case of array hashes.
+       (perl-backward-to-noncomment): Make it non-interactive.
+       (perl-backward-to-start-of-continued-exp): Rewrite.
+
+2014-07-08  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/inf-lisp.el (lisp-eval-paragraph, lisp-eval-form-and-next):
+       New user commands.
+
+2014-07-08  Juri Linkov  <juri@jurta.org>
+
+       * vc/vc-annotate.el (vc-annotate-background-mode): New defcustom.
+       (vc-annotate-color-map): Use less saturated colors (20%) for
+       background-mode.
+       (vc-annotate-very-old-color): Add default value for background-mode.
+       (vc-annotate-background): Set default value to nil since now text on
+       the default backgrounds should be legible in light and dark modes.
+       (vc-annotate-lines): Use `vc-annotate-background-mode'.  Doc fix.
+       (Bug#17808)
+
+2014-07-08  Juri Linkov  <juri@jurta.org>
+
+       * simple.el (transpose-chars): Don't move point into read-only area.
+       (Bug#17829)
+
+2014-07-08  Juri Linkov  <juri@jurta.org>
+
+       * window.el (with-displayed-buffer-window): New macro.
+       (with-temp-buffer-window, with-current-buffer-window):
+       Use `macroexp-let2' to evaluate and bind variables
+       in the same order as macro arguments.
+       (display-buffer--action-function-custom-type):
+       Add `display-buffer-below-selected' and `display-buffer-at-bottom'.
+
+       * minibuffer.el (minibuffer-completion-help): Replace
+       `with-output-to-temp-buffer' with `with-displayed-buffer-window'
+       with actions that display *Completions* at-bottom when called
+       from the minibuffer, or below-selected in a normal buffer.
+       Associate `window-height' with `fit-window-to-buffer'.
+       Let-bind `pop-up-windows' to nil.
+
+       * dired.el (dired-mark-pop-up): Use `with-displayed-buffer-window'
+       instead of `with-current-buffer-window'.  (Bug#17809)
+
+2014-07-07  Luke Lee  <luke.yx.lee@gmail.com>
+
+       * progmodes/hideif.el (hide-ifdef-env): Change to global.
+       (hide-ifdef-env-backup): New variable.
+       (hide-ifdef-expand-reinclusion-protection, hide-ifdef-header-regexp):
+       New customizable variables.
+       (hif-clear-all-ifdef-defined): New defun.
+       (hif-merge-ifdef-region, hide-ifdef-region-internal, hide-ifdef-region)
+       (hif-show-ifdef-region): Merge hidden regions to prevent continuous "...".
+       (hif-tokenize): Fix for MS-DOS/Win EOL style.
+       (hif-endif-to-ifdef, hif-make-range, hif-find-range, hif-possibly-hide):
+       Fix bug to hide the correct #elif region(s).
+       (hif-range-elif): New defun.
+       (hif-recurse-level): New var.
+       (hif-evaluate-region, hif-evaluate-macro): New defun.
+       (hide-ifdef-guts): Prevent reinclusion protected C/C++ headers from
+       fully hidden.
+       (hide-ifdef-define, hide-ifdefs, hide-ifdef-block, show-ifdef-block):
+       Better interaction.
+
+2014-07-04  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/dbus.el (dbus-peer-handler): New defun.
+       (dbus-register-service): Register it.  (Bug#17858)
+       (dbus-managed-objects-handler): Fix docstring.
+
+2014-07-04  Phil Sainty  <psainty@orcon.net.nz>  (tiny change)
+
+       * emacs-lisp/lisp.el (narrow-to-defun-include-comments): New var.
+       (narrow-to-defun): New arg include-comments, defaulting to it
+       (bug#16328).
+
+2014-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * rect.el (rectangle--highlight-for-redisplay): Don't pass `orig' with
+       different calling convention to rectangle--unhighlight-for-redisplay.
+
+2014-07-03  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-call-process): Handle error strings.
+
+       * net/tramp-adb.el (tramp-adb-sh-fix-ls-output): Use `bolp'.
+
+       * net/tramp-sh.el (tramp-sh-handle-set-visited-file-modtime)
+       (tramp-sh-handle-verify-visited-file-modtime): Use `point-at-eol'.
+
+       * net/trampver.el: Update release number.
+
+2014-07-03  Juri Linkov  <juri@jurta.org>
 
        * desktop.el (desktop-save): Rename arg `auto-save' to
        `only-if-changed'.  Doc fix.  (Bug#17873)
 
-2014-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * mouse.el (mouse-yank-primary, mouse-yank-secondary):
        Use insert-for-yank (bug#17271).
 
-2014-07-02  Leo Liu  <sdl.web@gmail.com>
+2014-07-03  Leo Liu  <sdl.web@gmail.com>
 
        * emacs-lisp/pp.el (pp-eval-expression, pp-eval-last-sexp):
        Support lexical-binding.
 
-2014-07-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * vc/log-edit.el (log-edit-goto-eoh): New function.
        (log-edit--match-first-line): Use it (bug#17861).
 
-2014-07-01  Glenn Morris  <rgm@gnu.org>
+2014-07-03  Glenn Morris  <rgm@gnu.org>
 
        * vc/log-edit.el (log-edit-hook): Add missing :version.
 
-2014-07-01  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+2014-07-03  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        * progmodes/python.el (python-indent-post-self-insert-function):
        Enhancements to electric indentation behavior inside
        parens. (Bug#17658)
 
-2014-07-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * ps-def.el (ps-generate-postscript-with-faces1): Don't mess with
        buffer-invisibility-spec (bug#17867).
 
-2014-06-29  Andreas Schwab  <schwab@linux-m68k.org>
+2014-07-03  Andreas Schwab  <schwab@linux-m68k.org>
 
        * vc/vc-git.el (vc-git-checkin): When operating on the whole tree
        pass "-a".
 
-2014-06-29  Glenn Morris  <rgm@gnu.org>
+2014-07-03  Glenn Morris  <rgm@gnu.org>
 
        * cus-edit.el (help):
        * finder.el (finder-known-keywords):
        * progmodes/idlwave.el (idlwave): Update url-link for custom group.
        (idlwave-mode): Doc URL update.
 
-2014-06-27  Stephen Berman  <stephen.berman@gmx.net>
+2014-07-01  Juri Linkov  <juri@jurta.org>
+
+       * man.el: Display man pages immediately and use process-filter
+       to format them asynchronously.
+       (Man-width): Doc fix.
+       (man): Doc fix.
+       (Man-start-calling): Use `with-selected-window' to get
+       `frame-width' and `window-width'.
+       (Man-getpage-in-background): Call `Man-notify-when-ready'
+       immediately after creating a new buffer.  Call `Man-mode' and set
+       `mode-line-process' in the created buffer.  Set process-filter to
+       `Man-bgproc-filter' in start-process branch.  In call-process branch
+       call either `Man-fontify-manpage' or `Man-cleanup-manpage'.
+       Use `Man-start-calling' inside `with-current-buffer'.
+       (Man-fontify-manpage): Don't print messages.  Fix boundary condition.
+       (Man-cleanup-manpage): Don't print messages.
+       (Man-bgproc-filter): New function.
+       (Man-bgproc-sentinel): Add `save-excursion' to keep point when
+       user moved it during asynchronous formatting.  Move calls of
+       `Man-fontify-manpage' and `Man-cleanup-manpage' to
+       `Man-bgproc-filter'.  Move the call of `Man-mode' to
+       `Man-getpage-in-background'.  Use `quit-restore-window'
+       instead of `kill-buffer'.  Use `message' instead of `error'
+       because errors are caught by process sentinel.
+       (Man-mode): Move calls of `Man-build-page-list',
+       `Man-strip-page-headers', `Man-unindent', `Man-goto-page' to
+       `Man-bgproc-sentinel'.  Doc fix.  (Bug#2588, bug#5054, bug#9084, bug#17831)
+
+       * man.el (Man-bgproc-sentinel): Use `Man-page-from-arguments'
+       for the message about the man page cleaned up.
+
+2014-07-01  Mario Lang  <mlang@delysid.org>
+
+       * net/gnutls.el (gnutls-negotiate): Prevent destructive modification of
+       cosutomization option `gnutls-verify-error'.
+
+2014-07-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * simple.el (deactivate-mark, set-mark-command, handle-shift-selection):
+       Don't keep transient-mark-mode buffer-local when not needed (bug#6316).
+
+       * xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
+       (turn-off-xterm-mouse-tracking-on-terminal): Don't burp if the terminal
+       is suspended (bug#17857).
+
+2014-07-01  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
+       Prefer utf-8 coding.  (Bug#17859)
+
+2014-06-30  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * emacs-lisp/subr-x.el (string-reverse): Define as obsolete alias
+       for `reverse'.
+
+2014-06-30  Glenn Morris  <rgm@gnu.org>
+
+       * emacs-lisp/autoload.el (autoload-ensure-writable): New variable.
+       (autoload-ensure-default-file): Maybe make existing output writable.
+       * Makefile.in (AUTOGEN_VCS): Remove.
+       (autoloads): Use autoload-ensure-writable rather than AUTOGEN_VCS.
+
+2014-06-30  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * emacs-lisp/subr-x.el (string-reverse): Use `reverse'.
+
+2014-06-30  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       New if-let, when-let, thread-first and thread-last macros.
+
+       * emacs-lisp/subr-x.el
+       (internal--listify, internal--check-binding)
+       (internal--build-binding-value-form, internal--build-binding)
+       (internal--build-bindings): New functions.
+       (internal--thread-argument, thread-first, thread-last)
+       (if-let, when-let): New macros.
+
+2014-06-30  Grégoire Jadi  <daimrod@gmail.com>
+
+       * net/rcirc.el (rcirc-buffer-process): Restore previous
+       behaviour.  (Bug#17772)
+
+2014-06-29  Alan Mackenzie  <acm@muc.de>
+
+       Don't call c-parse-state when c++-template-syntax-table is active.
+       * progmodes/cc-engine.el (c-guess-continued-construct CASE G)
+       (c-guess-basic-syntax CASE 5D.3): Rearrange so that
+       c-syntactic-skip-backwards isn't called with the pertinent syntax table.
+
+2014-06-28  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el (todo-set-top-priorities): Fix logic to
        account for file-wide setting of todo-top-priorities-overrides.
        Make code a bit cleaner.
 
-2014-06-27  Leo Liu  <sdl.web@gmail.com>
-
-       * calc/calc.el (math-bignum): Handle most-negative-fixnum.  (Bug#17556)
-
-2014-06-27  Glenn Morris  <rgm@gnu.org>
+2014-06-28  Glenn Morris  <rgm@gnu.org>
 
        * net/eww.el (eww-mode) <eww-current-title>: Make local.  (Bug#17860)
 
-2014-06-26  Stephen Berman  <stephen.berman@gmx.net>
+2014-06-28  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el (todo-prefix-overlays): If there is no
        category-wide setting of todo-top-priorities-overrides, check for
        a file-wide setting and fontify accordingly.
 
-2014-06-26  Glenn Morris  <rgm@gnu.org>
+2014-06-28  Glenn Morris  <rgm@gnu.org>
 
        * subr.el (read-passwd): Warn about batch mode.  (Bug#17839)
 
+2014-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/hideif.el: Use lexical-binding.  Fix up cl-lib usage.
+
+2014-06-28  K. Handa  <handa@gnu.org>
+
+       Fix Bug#17739.
+
+       * composite.el: Setup composition-function-table for dotted circle.
+       (compose-gstring-for-dotted-circle): New function.
+
+       * international/characters.el: Add category "^" to all
+       non-spacing characters.
+
+2014-06-28  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (doit): Remove force rule.
+       (custom-deps, finder-data, autoloads, update-subdirs)
+       (compile-one-process): PHONY targets do not need force rules.
+
+       * Makefile.in (compile-main, compile, compile-always):
+       No need to explicitly pass variables to ourself in recursive calls.
+
+2014-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (minibuffer-with-setup-hook): Evaluate the first arg eagerly.
+
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (update-authors): Update for moved authors.el.
+
+2014-06-26  Leo Liu  <sdl.web@gmail.com>
+
+       * skeleton.el (skeleton-end-hook): Default to nil and move the
+       work to skeleton-insert.  (Bug#17850)
+
+2014-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * calc/calc-alg.el (math-beforep):
+       * progmodes/cc-guess.el (c-guess-view-reorder-offsets-alist-in-style):
+       Simplify because string-lessp can accept symbols as args.
+
 2014-06-26  Daiki Ueno  <ueno@gnu.org>
 
        * emacs-lisp/package.el (package--check-signature):
        If package-check-signature is allow-unsigned, don't signal error when
        we can't verify signature because of missing public key
-       (backport for bug#17625).
+       (bug#17625).
 
 2014-06-26  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/authors.el (authors-valid-file-names)
        (authors-renamed-files-alist): Additions.
 
-2014-06-25  Leo Liu  <sdl.web@gmail.com>
+2014-06-26  Leo Liu  <sdl.web@gmail.com>
 
        * textmodes/picture.el (picture-set-tab-stops):
        * ruler-mode.el (ruler-mode-mouse-add-tab-stop)
 
        * indent.el (indent-accumulate-tab-stops): New function.
 
-2014-06-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/package.el (package-list-unsigned): New var (bug#17625).
        (package-desc-status): Obey it.
 
-2014-06-25  Stephen Berman  <stephen.berman@gmx.net>
+2014-06-26  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el: Fix two bugs.
        (todo-insert-item--basic): If user cancels item insertion to
        (todo-set-item-priority): After selecting category, instead of
        moving point to top, which extends an active region, restore it.
 
-2014-06-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * help-fns.el (describe-function-1): Check file-name is a string before
        calling help-fns--autoloaded-p (bug#17564).
 
-2014-06-24  Juri Linkov  <juri@jurta.org>
+2014-06-26  Juri Linkov  <juri@jurta.org>
 
        * desktop.el (desktop-auto-save-enable)
        (desktop-auto-save-disable): New functions.
        (desktop-read): Disable the autosave before loading the desktop,
        and enable afterwards.  (Bug#17351)
 
-2014-06-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        Fix some indentation problem with \; and pipes (bug#17842).
        * progmodes/sh-script.el (sh-mode-syntax-table): Set syntax of ;|&.
        (sh-smie-rc-forward-token, sh-smie-rc-backward-token): Use them.
        (sh-smie-sh-rules): Fix indentation of a pipe at BOL.
 
-2014-06-24  Eli Zaretskii  <eliz@gnu.org>
+2014-06-26  Glenn Morris  <rgm@gnu.org>
 
-       * international/fontset.el (script-representative-chars):
-       Add representative characters for scripts added in Unicode 7.0.
-       (otf-script-alist): Synchronize with the latest registry of OTF
-       script tags.
+       * emacs-lisp/find-func.el (find-function-C-source-directory):
+       Use file-accessible-directory-p.
+
+       * ps-samp.el: Make it slightly less awful.
+       (ps-rmail-mode-hook, ps-gnus-article-prepare-hook, ps-vm-mode-hook):
+       (ps-gnus-summary-setup, ps-info-mode-hook): Use [print] key.
+       Only set local values.
+       (ps-article-subject, ps-article-author): Use standard functions
+       like mail-fetch-field.
+       (ps-info-file, ps-info-node): Use match-string.
+       (ps-jts-ps-setup, ps-jack-setup): Remove, merging into...
+       (ps-samp-ps-setup): ... new function.
+
+       * progmodes/idlw-shell.el (idlwave-shell-make-temp-file):
+       Optimize away code unneeded on any modern Emacs.
+
+       * emacs-lisp/authors.el: Move to ../admin.
+
+       * emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): New.
+
+2014-06-26  Luke Lee  <luke.yx.lee@gmail.com>
+
+       * progmodes/hideif.el (hif-string-to-number): Fix return value bug.
+       (hif-simple-token-only, hif-tokenize): Comment in detail mainly for
+       performance enhancements.
+       (hif-parse-if-exp): Rename to `hif-parse-exp'.  Enhance for macro
+       expansion.
+       (hif-factor, hif-string-concatenation, intern-safe): Support string
+       concatenation and argumented macro expansion.
+       (hif-if-valid-identifier-p, hif-define-operator, hif-flatten)
+       (hif-expand-token-list, hif-get-argument-list, hif-define-macro)
+       (hif-delimit, hif-macro-supply-arguments, hif-invoke, hif-canonicalize)
+       (hif-canonicalize-tokens, hif-place-macro-invocation)
+       (hif-parse-macro-arglist): Mostly new functions for supporting
+       argumented macro expansion.
+       (hif-string-concatenation, hif-stringify, hif-token-concat)
+       (hif-token-stringification, hif-token-concatenation):
+       Stringification and concatenation.
+       (hif-find-next-relevant): Fix comments.
+       (hif-ifdef-to-endif, hif-looking-at-elif, hif-hide-line): Bug fix for
+       some cases involving #elif.
+       (hif-find-define, hif-add-new-defines): New functions for automatically
+       scanning of defined symbols.
+       (hide-ifdef-guts): Fix for defined symbol auto scanning.
+       (hide-ifdef-undef): Fix behavior to match CPP.
+
+2014-06-25  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in ($(lisp)/progmodes/cc-defs.elc)
+       ($(lisp)/progmodes/cc-fonts.elc, $(lisp)/progmodes/cc-langs.elc)
+       ($(lisp)/progmodes/cc-vars.elc): Drop hand-written deps on non-cc
+       files.  They are not relevant to the original issue (bug#1004),
+       and cause unnecessary recompilation (bug#2151).
 
-       * international/characters.el (char-script-table): Update for
-       scripts added and codepoint ranges changed in Unicode 7.0.
+2014-06-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-2014-06-23  Leo Liu  <sdl.web@gmail.com>
+       * play/landmark.el: Use lexical-binding and avoid `intangible'.
+       (landmark--last-pos): New var.
+       (landmark--intangible-chars): New const.
+       (landmark--intangible): New function.
+       (landmark-mode, landmark-move): Use it.
+       (landmark-mode): Remove properties.
+       (landmark-plot-square, landmark-point-square, landmark-goto-xy)
+       (landmark-cross-qtuple):
+       Don't worry about `intangible' any more.
+       (landmark-click, landmark-point-y): Same; and don't assume point-min==1.
+       (landmark-init-display): Don't set `intangible' and `point-entered'.
+       (square): Remove.  Inline it instead.
+       (landmark--distance): Rename from `distance'.
+       (landmark-calc-distance-of-robot-from): Rename from
+       calc-distance-of-robot-from.
+       (landmark-calc-smell-internal): Rename from calc-smell-internal.
+
+2014-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * files.el (dir-locals-find-file, file-relative-name):
+       * info.el (Info-complete-menu-item):
+       * minibuffer.el (completion-table-subvert): Prefer string-prefix-p
+       to compare-strings to avoid out-of-range errors.
+       * subr.el (string-prefix-p): Adjust to match strict range
+       checking in compare-strings.
+
+2014-06-24  Leonard Randall  <leonard.a.randall@gmail.com>  (tiny change)
+
+       * textmodes/reftex-parse.el (reftex-using-biblatex-p): Make search
+       for comment lines non-greedy and stopping at newlines to fix stack
+       overflows with large files.
+
+2014-06-24  Eli Barzilay  <eli@barzilay.org>
+
+       * calculator.el (calculator-last-input): Drop 'ascii-character property
+       lookup.
+
+2014-06-24  Leo Liu  <sdl.web@gmail.com>
 
        * align.el (align-adjust-col-for-rule): Unbreak due to defaulting
        tab-stop-list to nil.  (Bug#16381)
        (indent-rigidly-right-to-tab-stop, tab-to-tab-stop)
        (move-to-tab-stop): Change callers.
 
-2014-06-22  Eli Zaretskii  <eliz@gnu.org>
+2014-06-24  Eli Zaretskii  <eliz@gnu.org>
 
        * skeleton.el (skeleton-insert): Yet another fix of the doc string
        wrt behavior of \n as the first/last element of a skeleton.
 
-2014-06-22  Michael Albinus  <michael.albinus@gmx.de>
+2014-06-24  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-adb.el (tramp-adb-handle-process-file):
        * net/tramp-sh.el (tramp-sh-handle-process-file):
        * net/tramp-smb.el (tramp-smb-handle-process-file): Do not raise
        the output buffer when DISPLAY is non-nil.  (Bug#17815)
 
-2014-06-21  Glenn Morris  <rgm@gnu.org>
+2014-06-24  Glenn Morris  <rgm@gnu.org>
 
        * play/landmark.el (landmark-move-down, landmark-move-up):
        Fix 2007-10-20 change - preserve horizontal position.
 
+2014-06-23  Sam Steingold  <sds@gnu.org>
+
+       * simple.el (kill-append): Remove undo boundary depending on ...
+       (kill-append-merge-undo): New user option.
+
+2014-06-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * simple.el (handle-shift-selection, exchange-point-and-mark)
+       (activate-mark): Set transient-mark-mode buffer-locally (bug#6316).
+       (transient-mark-mode): Use&set the global value.
+       * mouse.el (mouse-set-region-1, mouse-drag-track): Idem.
+       * emulation/edt.el (edt-emulation-off): Save&restore the global
+       transient-mark-mode setting.
+       * obsolete/pc-select.el (pc-selection-mode): Use the
+       transient-mark-mode function.
+
+2014-06-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * international/fontset.el (script-representative-chars):
+       Add representative characters for scripts added in Unicode 7.0.
+       (otf-script-alist): Synchronize with the latest registry of OTF
+       script tags.
+
+       * international/characters.el (char-script-table): Update for
+       scripts added and codepoint ranges changed in Unicode 7.0.
+
+2014-06-23  Eli Barzilay  <eli@barzilay.org>
+
+       * calculator.el (calculator-standard-displayer): Fix bug in use of
+       `calculator-groupize-number'.
+       (calculator-funcall): Fix broken `cl-flet' use by moving it into the
+       `eval' code, so it works in v24.3.1 too.
+       (calculator-last-input): Comment to clarify purpose.
+
+2014-06-22  Mario Lang  <mlang@delysid.org>
+
+       * textmodes/rst.el (rst-comment-region): From from -> from.
+
+       * net/tramp-adb.el (tramp-adb-send-command-and-check): And and -> and.
+
+2013-06-22  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * electric.el (electric-layout-post-self-insert-function):
+       * emacs-lisp/ert.el (ert--insert-infos):
+       * obsolete/vi.el (vi-set-mark):
+       * term.el (term-handle-scroll):
+       * textmodes/bibtex.el (bibtex-fill-field, bibtex-fill-entry):
+       * wid-edit.el (widget-editable-list-value-create):
+       Prefer point-marker to copy-marker of point.
+
 2014-06-21  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        Fix completion retrieval parsing (bug#17209).
 
        * skeleton.el (skeleton-insert): Doc fix.
 
-2014-06-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/smie.el (smie-config--guess): Fix typo.
        (smie-config-guess): Use smie-config-local so the rules are obeyed
        * mouse.el (mouse-drag-line): Don't re-add to unread-comment-events,
        since it's already done inside the loop (bug#17819).
 
-2014-06-20  Martin Rudalics  <rudalics@gmx.at>
+2014-06-21  Martin Rudalics  <rudalics@gmx.at>
 
        * mouse.el (mouse-drag-line): Re-remove code initially removed
        on 2013-03-09 and inadvertently reintroduced on 2013-11-30
        (Bug#17819).
 
-2014-06-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/sh-script.el (sh-smie-sh-rules): For { after &&, don't
        align with the surrounding parent (bug#17721).
 
-2014-06-20  Eli Zaretskii  <eliz@gnu.org>
+2014-06-21  Eli Zaretskii  <eliz@gnu.org>
 
        * textmodes/texinfo.el (texinfo-mode): Set skeleton-end-newline
        locally to nil.
        local setting of skeleton-end-newline by adding an explicit \n to
        the skeletons where appropriate.  (Bug#17801)
 
-2014-06-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/smie.el (smie--hanging-eolp-function): New var.
        (smie-indent--hanging-p): Use it.
        * progmodes/sh-script.el (sh-set-shell): Set it (bug#17621).
 
-2014-06-20  Leo Liu  <sdl.web@gmail.com>
+2014-06-21  Leo Liu  <sdl.web@gmail.com>
 
        * simple.el (read-quoted-char): Don't let help chars pop up help
        buffer.  (Bug#16617)
 
-2014-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as
        for | (bug#17621).
 
-2014-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+       * xt-mouse.el (xterm-mouse--read-event-sequence-1000):
+       Drop unknown events instead of burping.
 
-       * xt-mouse.el (xterm-mouse-translate-1): Fix last change (bug#17776).
-       (xterm-mouse--read-event-sequence-1000): Drop unknown events instead of
-       burping.
-
-2014-06-18  Eli Zaretskii  <eliz@gnu.org>
+2014-06-21  Eli Zaretskii  <eliz@gnu.org>
 
        * term/w32-win.el (dynamic-library-alist): Support giflib 5.1.0
        and later.  (Bug#17790)
 
-2014-06-18  Juri Linkov  <juri@jurta.org>
+2014-06-21  Juri Linkov  <juri@jurta.org>
 
        * dired.el (dired-mark-pop-up): Let-bind display-buffer-mark-dedicated
        to `soft'.  (Bug#17554)
 
-2014-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * delsel.el (electric-newline-and-maybe-indent): Mark it as well
        (bug#17737).
 
-2014-06-16  Dmitry Gutov  <dgutov@yandex.ru>
+2014-06-21  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't fontify
        `!' in `!~' with `font-lock-negation-char-face'.  (Bug#17732)
 
-2014-06-15  Michael Albinus  <michael.albinus@gmx.de>
+2014-06-21  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/dbus.el (dbus-call-method): Push only non D-Bus events into
        `unread-command-events'.
 
-2014-06-14  Glenn Morris  <rgm@gnu.org>
+2014-06-19  William Xu  <william.xwl@gmail.com>
+
+       * progmodes/hideif.el (hif-string-to-number): Don't return float for
+       hex integer constants (bug#17807).
+
+2014-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * international/mule-util.el (truncate-string-ellipsis): New var.
+       (truncate-string-to-width): Use it.
+
+2014-06-19  Robert Brown  <robert.brown@gmail.com>  (tiny change)
+
+       * emacs-lisp/lisp-mode.el (lisp-string-after-doc-keyword-p): New fun.
+       (lisp-string-in-doc-position-p): New function, extracted from
+       lisp-font-lock-syntactic-face-function.
+       (lisp-font-lock-syntactic-face-function): Use them (bug#9130).
+
+2014-06-19  Grégoire Jadi  <daimrod@gmail.com>
+
+       * net/rcirc.el (rcirc-omit-mode): Fix recenter error.  (Bug#17769)
+
+2014-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * play/bubbles.el (bubbles--initialize, bubbles--show-scores)
+       (bubbles--game-over): Don't add `intangible' properties since they
+       didn't work anyway.
+
+2014-06-18  Juri Linkov  <juri@jurta.org>
+
+       * vc/ediff-init.el (ediff-current-diff-Ancestor)
+       (ediff-fine-diff-Ancestor, ediff-even-diff-A, ediff-even-diff-B)
+       (ediff-even-diff-C, ediff-even-diff-Ancestor, ediff-odd-diff-A)
+       (ediff-odd-diff-B, ediff-odd-diff-C, ediff-odd-diff-Ancestor):
+       Add `min-colors 88' version with removed black/white foregrounds.
+       (Bug#10181)
+
+2014-06-18  Juri Linkov  <juri@jurta.org>
+
+       * vc/diff-mode.el (diff-changed): Empty face definition to use
+       `diff-removed' and `diff-added' on tty as well.  (Bug#10181)
+       (diff-context): Use darker color on light background and
+       lighter color on dark background.
+
+2014-06-18  Juri Linkov  <juri@jurta.org>
+
+       * vc/diff-mode.el (diff-refine-changed): Rename from
+       `diff-refine-change' for consistency with `diff-changed'.
+       (diff-refine-change): Add obsolete face alias.  (Bug#10181)
+
+       * vc/smerge-mode.el (smerge-refined-changed): Rename from
+       `smerge-refined-change'.
+       (smerge-refined-change): Add obsolete face alias.
+
+2014-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * rect.el (rectangle-preview): New custom.
+       (rectangle): New group.
+       (rectangle--pos-cols): Add `window' argument.
+       (rectangle--string-preview-state, rectangle--string-preview-window):
+       New vars.
+       (rectangle--string-flush-preview, rectangle--string-erase-preview)
+       (rectangle--space-to, rectangle--string-preview): New functions.
+       (string-rectangle): Use them.
+       (rectangle--inhibit-region-highlight): New var.
+       (rectangle--highlight-for-redisplay): Obey it.  Make sure
+       `apply-on-region' uses the point-crutches of the right window.
+       Use :align-to rather than multiple spaces.
+
+2014-06-16  Andrea Rossetti  <andrea.rossetti@gmail.com>  (tiny change)
+
+       * ruler-mode.el (ruler-mode-window-col)
+       (ruler-mode-mouse-set-left-margin)
+       (ruler-mode-mouse-set-right-margin): Fix calculation of column
+       from mouse position (Bug#17768).
+
+2014-06-16  Ron Schnell  <ronnie@driver-aces.com>
+
+       * play/dunnet.el (dun-doassign): Fix bug where UNIX variable assignment
+       without varname or rhs causes crash.
+       (dun-ftp): Fix bug where blank ftp password is allowed, making it
+       impossible to win endgame.
+       (dun-unix-verbs): Add ssh as alias to rlogin, because nobody knows what
+       rlogin is anymore.
+       (dun-help): Bump version number; update contact info.
+
+2014-06-15  Eli Barzilay  <eli@barzilay.org>
+
+       * calculator.el (calculator-prompt, calculator-remove-zeros)
+       (calculator-mode-hook, calculator-operators, calculator-stack)
+       (calculator-mode): Tweak docstring.
+       (calculator-user-operators): Tweak docstring, fix a bug in the last
+       example.
+       (calculator-displayer): `std' case has an optional boolean.
+       (calculator-displayers): Use the new boolean to group in decimal mode.
+       (calculator-mode-map, calculator, calculator-message)
+       (calculator-op-arity, calculator-add-operators)
+       (calculator-string-to-number, calculator-displayer-prev)
+       (calculator-displayer-next, calculator-remove-zeros)
+       (calculator-eng-display, calculator-number-to-string)
+       (calculator-update-display, calculator-last-input)
+       (calculator-clear-fragile, calculator-digit, calculator-decimal)
+       (calculator-exp, calculator-saved-move, calculator-clear)
+       (calculator-copy, calculator-put-value, calculator-help)
+       (calculator-expt, calculator-truncate): Minor code improvements.
+       (calculator-need-3-lines): New function pulling out code from
+       `calculator'.
+       (calculator-get-display): Rename from `calculator-get-prompt', and
+       improved.
+       (calculator-push-curnum): Rename from `calculator-curnum-value', and
+       extended for all uses of it.  All callers changed.
+       (calculator-groupize-number): New utility for splitting a number into
+       groups.
+       (calculator-standard-displayer): Improve code, new optional argument to
+       use comma-split groups, make second argument optional too to use with
+       'left/'right inputs.  All callers changed.
+       (calculator-reduce-stack-once): New utility, doing the meat of what
+       `calculator-reduce-stack' used to do, much improved (mostly using
+       `pcase' for conciseness and clarity).
+       (calculator-reduce-stack): Now doing just the reduction loop using
+       `calculator-reduce-stack-once'.
+       (calculator-funcall): Improve code, make it work in v24.3.1 too.
+       (calculator-last-input): Improve code, remove some old cruft.
+       (calculator-quit): Kill `calculator-buffer' in electric mode too.
+       (calculator-integer-p): Remove.
+       (calculator-fact): Improve code, make it work on non-integer values
+       too (using truncated numbers).
+
+2014-06-15  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.2.10.
+
+       * net/tramp.el (tramp-methods): Tweak docstring.
+       (tramp-handle-file-accessible-directory-p): Check for
+       `file-readable-p' instead of `file-executable-p'.
+       (tramp-check-cached-permissions):
+       Use `tramp-compat-file-attributes'.
+       (tramp-call-process): Add new argument VEC.  Adapt callees in all
+       tramp*.el files.
+
+       * net/tramp-adb.el (tramp-adb-handle-write-region): Improve messages.
+       (tramp-adb-maybe-open-connection): Don't set
+       `tramp-current-*' variables.
+
+       * net/tramp-cache.el (tramp-flush-file-function): Do not flush
+       file properties of temporary buffers.
+
+       * net/tramp-ftp.el (top): Remove special handling for URL syntax.
+
+       * net/tramp-gvfs.el (tramp-gvfs-methods) <sftp>: Add.
+       (tramp-gvfs-handle-delete-file): Flush file
+       properties, not directory properties.
+       (tramp-gvfs-handle-file-attributes): Use `string-to-number' when
+       reading "unix::mode".
+       (tramp-gvfs-handle-file-name-all-completions):
+       Use "-h" option for "gvfs-ls".
+       (tramp-gvfs-url-file-name): `user' and `localname' could be nil.
+       (tramp-gvfs-send-command): Simplify traces.
+
+       * net/tramp-sh.el (vc-handled-backends, vc-bzr-program)
+       (vc-git-program, vc-hg-program): Declare.
+       (tramp-methods) <sftp>: Remove.  It has never worked satisfactorily.
+       (tramp-methods) <nc>: Add new method.
+       (tramp-methods) <telnet>: Redirect stderr to "/dev/null".
+       (tramp-methods) <plink, plinkx, pscp, psftp>: Improve
+       `tramp-login-args'.
+       (tramp-default-user-alist): Add "nc".
+       (top): Remove completion function for "sftp".  Add completion
+       functions for "nc" and "psftp".
+       (tramp-do-copy-or-rename-file-out-of-band): Tweak docstring.
+       Implement support for "nc" method.
+       (tramp-sh-handle-expand-file-name, tramp-local-coding-commands)
+       (tramp-remote-coding-commands, tramp-call-local-coding-command):
+       Tweak docstring.
+       (tramp-sh-handle-write-region): Tweak error message.
+       (tramp-sh-handle-vc-registered): Remove backends when the remote
+       binary does not exist.
+       (tramp-find-inline-encoding): Do not raise an error.
+       (tramp-make-copy-program-file-name): Tweak docstring.  Handle also
+       the "nc" case.  Quote result also locally.
+
+       * net/tramp-smb.el (tramp-smb-handle-copy-directory)
+       (tramp-smb-handle-set-file-acl): Use `start-process'.
+       (tramp-smb-handle-insert-directory): Use progress reporter.
+       (tramp-smb-handle-rename-file): Flush also file properties of
+       FILENAME.
+
+       * net/trampver.el: Update release number.
+
+2014-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * ses.el: Miscellaneous cleanups; use lexical-binding; avoid
+       add-to-list.
+       (ses-localvars): Remove ses--local-printer-list, unused.
+       (ses--metaprogramming): New macro.  Use it to defvar variables.
+       (ses-set-localvars): Simplify.
+       (ses--locprn, ses-cell): Use defstruct.  Change ses-cell's
+       property-list into an alist.
+       (ses-locprn-get-compiled, ses-locprn-compiled-aset)
+       (ses-locprn-get-def, ses-locprn-def-aset, ses-locprn-get-number):
+       Remove; use defstruct accessors/setters instead.
+       (ses-cell-formula-aset, ses-cell-printer-aset)
+       (ses-cell-references-aset): Remove, use setf instead.
+       (ses--alist-get): New function.
+       (ses-cell-property): Rename from ses-cell-property-get and rewrite.
+       Use an alist instead of a plist and don't do move-to-front since the
+       list is always short.
+       (ses-cell-property-get-fun, ses-cell-property-delq-fun)
+       (ses-cell-property-set-fun, ses-cell-property-set)
+       (ses-cell-property-pop-fun, ses-cell-property-get-handle)
+       (ses-cell-property-handle-car, ses-cell-property-handle-setcar): Remove.
+       (ses--letref): New macro.
+       (ses-cell-property-pop): Rewrite.
+       (ses--cell): Rename from ses-cell and make it into a function.
+       Make `formula' fallback on `value' if nil.
+       (ses--local-printer): Rename from ses-local-printer and make it into
+       a function.
+       (ses-set-cell): Turn it into a macro so finding the accessor from the
+       field name is done at compile time.
+       (ses-repair-cell-reference-all): Test presence of `sym' rather than
+       `ref' before adding `sym' to :ses-repair-reference.
+       (ses-calculate-cell): Use ses--letref rather than
+       ses-cell-property-get-handle.
+       (ses-write-cells): Use a single prin1-to-string.
+       (ses-setter-with-undo): New function.
+       (ses-aset-with-undo, ses-set-with-undo): Rewrite using it.
+       (ses-unset-with-undo): Remove.
+       (ses-load): Prefer apply' over `eval'.
+       (ses-read-printer, ses-set-column-width): Use standard "(default
+       foo)" format.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (leim, semantic): Use `make -C' rather than `cd && make'.
 
        * progmodes/cc-langs.el: Require cl-lib.  (Bug#17463)
        Replace delete-duplicates and mapcan by cl- versions throughout.
        And cl-macroexpand-all by macroexpand-all.
        (delete-duplicates, mapcan, cl-macroexpand-all): No need to declare.
 
-2014-06-14  Eli Zaretskii  <eliz@gnu.org>
+2014-06-15  Eli Zaretskii  <eliz@gnu.org>
 
        * subr.el (posn-col-row): Doc fix.  (Bug#17768)
 
-2014-06-14  Juri Linkov  <juri@jurta.org>
+2014-06-15  Juri Linkov  <juri@jurta.org>
 
        * bindings.el: Put `ascii-character' property on keypad keys
        mapped to characters.  (Bug#17759)
 
-2014-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/smie.el (smie-next-sexp): Fix up "other-end" info when
        bumping forward into a closing paren (bug#17761).
        * term/xterm.el (xterm--version-handler): Work around for OSX
        Terminal.app (bug#17607).
 
+2014-06-14  Ron Schnell  <ronnie@driver-aces.com>
+
+       * play/dunnet.el (dun-describe-room, dun-mode):
+       If a lamp is in the room, you won't be eaten by a grue.
+
+2014-06-13  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in ($(lisp)/cus-load.el, $(lisp)/finder-inf.el)
+       (autoloads, $(lisp)/subdirs.el, compile-main, leim, semantic, compile)
+       (compile-always): GNU make automatically passes
+       command-line arguments to sub-makes.
+
+       * calendar/calendar.el (calendar-generate-window):
+       Remove pointless call to font-lock-fontify-buffer.
+
+2014-06-13  Matthias Meulien  <orontee@gmail.com>
+
+       * simple.el (completion-list-mode-map): Navigate with tab and backtab
+       (bug#17767).
+
+2014-06-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * simple.el (set-mark-command): Simplify a bit.
+
+2014-06-12  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
+
+       * help.el (help--key-binding-keymap): New function.
+       (help--binding-locus): New function.
+       (describe-key): Mention the keymap in which the binding was
+       found. (bug#13948)
+
+2014-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * hippie-exp.el (he--all-buffers): New function.
+       (try-expand-line-all-buffers, try-expand-list-all-buffers)
+       (try-expand-dabbrev-all-buffers): Use it.
+
+2014-06-12  Emilio C. Lopes  <eclig@gmx.net>
+
+       * hippie-exp.el (try-expand-line-all-buffers)
+       (try-expand-list-all-buffers, try-expand-dabbrev-all-buffers):
+       Read hippie-expand-only-buffers and hippie-expand-ignore-buffers in the
+       original buffer, in case they're buffer-local.
+
+2014-06-12  Vincent Belaïche  <vincentb1@users.sourceforge.net>
+
+       * ses.el (ses-initial-global-parameters-re): New defconst, a
+       specific regexp is needed now that ses.el can handle both
+       file-format 2 --- ie. no local printers --- and 3 --- i.e. may have
+       local printers.
+       (ses-localvars): Add local variables needed for local printer handling.
+       (ses-set-localvars): Handle hashmap initialisation.
+       (ses-paramlines-plist): Add param-line for number of local printers.
+       (ses-paramfmt-plist): New defconst, needed for code factorization
+       between functions `ses-set-parameter' and
+       `ses-file-format-extend-paramter-list'
+       (ses-make-local-printer-info): New defsubst.
+       (ses-locprn-get-compiled, ses-locprn-compiled-aset)
+       (ses-locprn-get-def, ses-locprn-def-aset, ses-locprn-get-number)
+       (ses-cell-printer-aset): New defmacro.
+       (ses-local-printer-compile): New defun.
+       (ses-local-printer): New defmacro.
+       (ses-printer-validate, ses-call-printer): Add support for local
+       printer functions.
+       (ses-file-format-extend-paramter-list): New defun.
+       (ses-set-parameter): Use const `ses-paramfmt-plist' for code
+       factorization.
+       (ses-load): Add support for local printer functions.
+       (ses-read-printer): Update docstring and add support for local printer
+       functions.
+       (ses-refresh-local-printer, ses-define-local-printer): New defun.
+       (ses-safe-printer): Add support for local printer functions.
+
+2014-06-12  Ivan Andrus  <darthandrus@gmail.com>
+
+       * ffap.el (ffap-lax-url): New var (bug#17723).
+       (ffap-url-at-point): Use it.
+       (ffap-file-at-point): Avoid returning just "/".
+
+2014-06-12  Matthias Meulien  <orontee@gmail.com>
+
+       * progmodes/python.el (import skeleton): New skeleton (bug#17672).
+       (python-mode-map): Bind it.
+
+       * progmodes/python.el (class skeleton): Don't erase last char of class
+       name (bug#17683).
+
+2014-06-12  Cameron Desautels  <camdez@gmail.com>  (tiny change)
+
+       * help.el (where-is): Use `default' arg of completing-read (bug#17705).
+
+2014-06-12  Kevin Ryde  <user42_kevin@yahoo.com.au>
+
+       * files.el (auto-mode-alist): Map .ad files to xdefaults-mode
+       (bug#17745).
+
+2014-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * international/mule-cmds.el: Use lexical-binding.
+       (ucs-names): Simplify.
+
+2014-05-18  Eric Hanchrow  <eric.hanchrow@gmail.com>
+
+       * progmodes/python.el (run-python): Use read-shell-command.
+
+2014-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * rect.el: Make it possible to move bounds past EOL or into TABs.
+       (operate-on-rectangle): Use apply-on-rectangle.
+       (rectangle--mark-crutches): New var.
+       (rectangle--pos-cols, rectangle--col-pos, rectangle--point-col)
+       (rectangle--crutches, rectangle--reset-crutches): New functions.
+       (apply-on-rectangle): Obey crutches.  Avoid setq.
+       Fix missing final iteration if end is at EOB&BOL.
+       (rectangle-mark-mode-map): Add remap bindings for
+       exchange-point-and-mark and char/line movements.
+       (rectangle--*-char): New function.
+       (rectangle-exchange-point-and-mark, rectangle-right-char)
+       (rectangle-left-char, rectangle-forward-char)
+       (rectangle-backward-char, rectangle-next-line)
+       (rectangle-previous-line): New commands.
+       (rectangle--place-cursor): New function.
+       (rectangle--highlight-for-redisplay): Use it.  Use apply-on-rectangle.
+
 2014-06-08  Glenn Morris  <rgm@gnu.org>
 
        * startup.el (initial-buffer-choice): Doc fix.
        * bookmark.el (bookmark-load):
        * uniquify.el (uniquify-buffer-name-style): Doc fixes.
 
-2014-06-06  Juri Linkov  <juri@jurta.org>
+2014-06-08  Juri Linkov  <juri@jurta.org>
 
        * desktop.el: Activate auto-saving on window configuration changes.
        (desktop-save-mode, desktop-auto-save-timeout): Add/remove
-       `desktop-auto-save-set-timer' to/from `window-configuration-change-hook'.
+       `desktop-auto-save-set-timer' to/from
+       `window-configuration-change-hook'.
        (desktop-auto-save-set-timer): Change REPEAT arg of
        `run-with-idle-timer' from t to nil.
        http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00147.html
 
-2014-06-06  Santiago Payà i Miralta  <santiagopim@gmail.com>
+2014-06-08  Santiago Payà i Miralta  <santiagopim@gmail.com>
 
        * vc/vc-hg.el (vc-hg-working-revision): Use "hg parent" and
        vc-hg-command (bug#17570).
 
-2014-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * international/mule-cmds.el (ucs-names): Add special entry for BEL
        (bug#17702).
 
-2014-06-06  Glenn Morris  <rgm@gnu.org>
+2014-06-08  Glenn Morris  <rgm@gnu.org>
 
        * startup.el (window-setup-hook): Doc fix.
 
-2014-06-05  Glenn Morris  <rgm@gnu.org>
-
        * emacs-lisp/package.el (package-check-signature)
        (package-unsigned-archives): Doc fixes.
 
-2014-06-03  Martin Rudalics  <rudalics@gmx.at>
+2014-06-08  Martin Rudalics  <rudalics@gmx.at>
 
        * window.el (display-buffer-use-some-window): Don't make window
        used smaller than it was before (Bug#17671).
 
-2014-06-03  Eli Zaretskii  <eliz@gnu.org>
+2014-06-08  Eli Zaretskii  <eliz@gnu.org>
 
        * menu-bar.el (menu-bar-open): Fix last change: use the PC
        'redisplay' instead of '(sit-for 0)'.
 
-2014-06-03  Michael Albinus  <michael.albinus@gmx.de>
+2014-06-08  Michael Albinus  <michael.albinus@gmx.de>
 
-       * net/tramp.el (tramp-ssh-controlmaster-options): Improve search
-       regexp.  (Bug#17653)
+       * net/tramp.el (tramp-ssh-controlmaster-options):
+       Improve search regexp.  (Bug#17653)
 
-2014-06-03  Glenn Morris  <rgm@gnu.org>
+2014-06-08  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/package.el (package-pinned-packages): Doc fix.
 
-2014-06-02  Eli Zaretskii  <eliz@gnu.org>
+2014-06-08  Eli Zaretskii  <eliz@gnu.org>
 
        * menu-bar.el (menu-bar-open): Fix invocation via M-x.
 
-2014-06-01  Eli Zaretskii  <eliz@gnu.org>
+2014-06-06  Santiago Payà i Miralta  <santiagopim@gmail.com>
+
+       * vc/vc-hg.el (vc-hg-create-tag, vc-hg-retrieve-tag): New functions
+       (bug#17586).
+
+       * vc/vc-hg.el (vc-hg-log-graph): New var.
+       (vc-hg-print-log): Use it.
+       (vc-hg-root-log-format): Include branch name and bookmarks; ignore
+       graph output (bug#17515).
+
+2014-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mouse.el (mouse-posn-property): Ignore buffer position info when the
+       even happened elsewhere.
+
+2014-06-06  Mario Lang  <mlang@delysid.org>
+
+       * emacs-lisp/tabulated-list.el (tabulated-list-print): Only call
+       `recenter' if `current-buffer' is equal to `window-buffer'.
+
+2014-06-05  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/cl-macs.el (cl-macrolet): Avoid excessive progn's.
+
+2014-06-05  Michal Nazarewicz  <mina86@mina86.com>
+
+       * textmodes/tildify.el (tildify-foreach-region-outside-env):
+       New function which calls a callback on portions of the buffer that are
+       outside of ignored environments.
+       (tildify-build-regexp): Remove function since it is now
+       incorporated in `tildify-foreach-region-outside-env' where it is
+       optimised and simplified by the use of `mapconcat'.
+       (tildify-tildify): Return number of substitutions made so that…
+       (tildify-count): …can be removed.
+       (tildify-find-env): Accept a new PAIRS argument which was
+       previously looked up in `tildify-ignored-environments-alist' each
+       time the function was called.  With this change, the lookup is
+       performed only once in `tildify-foreach-region-outside-env'.
+       (tildify-region): Greatly simplify the function since now most of
+       the work is done by `tildify-foreach-region-outside-env'.
+       (tildify-mode-alist): Simplify slightly by avoiding if and setq
+       and instead using or.
+
+       * textmodes/tildify.el (tildify-ignored-environments-alist):
+       Optimise environments regexes
+
+       Each time beginning of an environment to ignore is found,
+       `tildify-find-env' needs to identify regexp for the ending
+       of the environment.  This is done by trying all the opening
+       regexes on matched text in a loop, so to speed that up, this
+       loop should have fewer things to match, which can be done by
+       using alternatives in the opening regexes.
+
+       Coincidentally, this should make matching of the opening
+       regexp faster as well thanks to the use of `regexp-opt' and
+       having common prefix pulled from many regexes.
+
+       * textmodes/tildify.el (tildify-string-alist)
+       (tildify-ignored-environments-alist): Add `nxml-mode' to the list
+       of supported modes since `xml-mode' is no longer a thing but just
+       an alias to the former.  Also include comments and insides of tags
+       in `tildify-ignored-environments-alist' for XML modes.  Finally,
+       since XML does not define “&nbsp;”[1], use a numeric reference for
+       a no-break space (namely “&#160;”)
+
+       [1] XML specification defines only a handful of predefined entities.
+           The list is at <http://www.w3.org/TR/REC-xml/#sec-predefined-ent>
+           and includes only &lt;, &gt;, &amp;, &apos; and &quot; (meaning <,
+           >, &, ' and " respectively).  This is in contrast to HTML and even
+           XHTML which defined a whole bunch of entities including “&nbsp;”.
+
+       * textmodes/tildify.el (tildify-pattern-alist)
+       (tildify-string-alist, tildify-ignored-environments-alist):
+       Improve defcustom's types by adding more tags explaining what each
+       value means and replace “sexp” used in
+       `tildify-ignored-environments-alist' with a full type declaration.
+
+       * textmodes/tildify.el (tildify-find-env): Fix matched group
+       indexes in end-regex building
+
+       When looking for a start of an ignore-environment, the regex is built
+       by concatenating regexes of all the environments configured in
+       `tildify-ignored-environments-alist'.  So for example, the following
+       list could be used to match TeX's \verb and \verb* commands:
+
+           (("\\\\verb\\(.\\)" . (1))
+            ("\\\\verb\\*\\(.\\)" . (1)))
+
+       This would result in the following regex being used to find the start
+       of any of the variants of the \verb command:
+
+           \\\\verb\\(.\\)\\|\\\\verb\\*\\(.\\)
+
+       But now, if “\\\\verb\\*\\(.\\)” matches, the first capture group
+       won't match anything, and thus (match-string 1) will be nil, which
+       will cause building of the end-matching regex to fail.
+
+       Fix this by using capture groups from the time when the opening
+       regexes are matched individually.
+
+       * textmodes/tildify.el (tildify-find-env): Fix end-regex building
+       in `tildify-find-env'
+
+       The `tildify-ignored-environments-alist' allows the end-regex to
+       be provided not as a static string but mix of strings and indexes
+       of groups matched the begin-regex.  For example, the “\verb!…!”
+       TeX-command (where “!” is an arbitrary character) is handled
+       using:
+
+           ("\\\\verb\\*?\\(.\\)" . (1))
+
+       In the same way, the following should be supported as well:
+
+           ("open-\\(.\\)" . ("end-" 1))
+
+       However the tildify-find-env function fails at
+
+           (concat result
+                   (if (stringp (setq aux (car expression)))
+                        expression  ; BUG: expression is a list
+                      (regexp-quote (match-string aux))))
+
+       where the string part is handled incorrectly.
+
+       The most trivial fix would be to replace `expression' in the
+       true-part of the if-statement with `aux', but instead, this commit
+       optimises `tildify-find-env' by changing it to use `mapconcat'
+       rather than open-coded while-loop.
+
+2014-06-05  Mario Lang  <mlang@delysid.org>
+
+       * woman.el (woman-mapcan): Remove.
+       (woman-parse-colon-path): Use cl-mapcan instead.
+
+2014-06-03  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
+
+       * register.el: Add link to Emacs manual in Commentary.
+
+2014-06-02  Sam Steingold  <sds@gnu.org>
+
+       * menu-bar.el (lookup-key-ignore-too-long): Extract from...
+       (popup-menu): ...here.
+       (menu-bar-open): Use it to avoid an error when `lookup-key'
+       returns a number.
+
+2014-06-02  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-call-process): Add traces.
+       (tramp-handle-unhandled-file-name-directory): Return "/".
+
+2014-06-02  Wilson Snyder  <wsnyder@wsnyder.org>
+
+       Sync with upstream verilog-mode revision 3cd8144.
+       * progmodes/verilog-mode.el (verilog-mode-version): Bump.
+       (verilog-auto-arg-format): New option, to support newlines in AUTOARG.
+       (verilog-type-font-keywords): Add nor.
+       (verilog-batch-execute-func): Force reading of Local Variables.
+       Fix printing "no changes to be saved" with verilog-batch.
+       (verilog-auto-arg-ports): Doc fix.
+       Add verilog-auto-arg-format to support newlines in AUTOARG.
+       (verilog-auto-arg): Doc fix.
+
+2014-06-02  Glenn Morris  <rgm@gnu.org>
+
+       * emulation/crisp.el, emulation/tpu-edt.el, emulation/tpu-extras.el:
+       * emulation/tpu-mapper.el, emulation/vi.el, emulation/vip.el:
+       * emulation/ws-mode.el: Move to obsolete/.
+       * Makefile.in (AUTOGEN_VCS): Update for moved tpu-edu.el.
+
+2014-06-02  Eli Zaretskii  <eliz@gnu.org>
 
        * simple.el (keyboard-quit): Force update of mode lines, to remove
        the "Def" indicator, if we were defining a macro.  (Bug#17615)
 
-2014-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el (minibuffer-force-complete-and-exit):
        Obey minibuffer-default (bug#17545).
        * progmodes/js.el (js-indent-line): Don't mix columns and chars
        (bug#17619).
 
-2014-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
-
        * subr.el (set-transient-map): Don't wait for some "nested"
        transient-map to finish if we're only supposed to be active for
        the next command (bug#17642).
 
-2014-05-31  Leo Liu  <sdl.web@gmail.com>
+2014-06-02  Leo Liu  <sdl.web@gmail.com>
 
        * emacs-lisp/gv.el (window-buffer, window-display-table)
        (window-dedicated-p, window-hscroll, window-point, window-start):
        Fix gv-expander.  (Bug#17630)
 
-2014-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * mouse.el (mouse-posn-property): Ignore posn-point for mode-line
        clicks (bug#17633).
        for the single comma, since ", " is *very* common in normal French text
        (bug#17643).
 
-2014-05-30  Glenn Morris  <rgm@gnu.org>
+2014-06-02  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/package.el (package-check-signature)
        (package-unsigned-archives): Fix :version.
 
-2014-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * subr.el (sit-for): Don't run input-methods (bug#15614).
 
-2014-05-28  Glenn Morris  <rgm@gnu.org>
+2014-06-02  Glenn Morris  <rgm@gnu.org>
 
        * cus-start.el: Fix some :version numbers.
 
-2014-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * simple.el (deactivate-mark): Set mark-active to nil even if
        deactivation is done via setting transient-mark-mode to nil,
        * emacs-lisp/byte-opt.el (byte-optimize-binary-predicate): Don't assume
        there can't be more than 2 arguments (bug#17584).
 
-2014-05-27  Glenn Morris  <rgm@gnu.org>
+2014-06-02  Glenn Morris  <rgm@gnu.org>
 
        * simple.el (filter-buffer-substring-functions)
        (filter-buffer-substring-function, buffer-substring-filters)
        * abbrev.el (abbrev-expand-functions, abbrev-expand-function)
        (expand-abbrev, abbrev--default-expand): Doc fixes.
 
-2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
+2014-06-02  Paul Eggert  <eggert@cs.ucla.edu>
 
        Include sources used to create macuvs.h.
        * international/README: Refer to the Unicode Terms of Use rather
        than copying it bodily here, as that simplifies maintenance.
 
-2014-05-25  Andreas Schwab  <schwab@linux-m68k.org>
+2014-06-01  Glenn Morris  <rgm@gnu.org>
+
+       * loadup.el (load-prefer-newer): Set non-nil when dumping.  (Bug#17629)
+
+2014-05-31  Glenn Morris  <rgm@gnu.org>
+
+       * files.el (locate-dominating-file): Expand file argument.  (Bug#17641)
+
+2014-05-30  Glenn Morris  <rgm@gnu.org>
+
+       * loadup.el: Treat `command-line-args' more flexibly.
+
+2014-05-30  Alan Mackenzie  <acm@muc.de>
+
+       Guard (looking-at "\\s!") from XEmacs.
+       * progmodes/cc-engine.el (c-state-pp-to-literal): add guard form.
+
+2014-05-30    Ken Olum  <kdo@cosmos.phy.tufts.edu>  (tiny change)
+
+       * mail/rmail.el (rmail-delete-forward, rmail-delete-backward):
+       The argument COUNT is now optional, to be more backward-compatible.
+       Doc fix.  (Bug#17560)
+
+2014-05-29  Reuben Thomas  <rrt@sc3d.org>
+
+       * whitespace.el (whitespace-report-region):
+       Simplify documentation.
+       (whitespace-report-region): Allow report-if-bogus to take the
+       value `never', for non-interactive use.
+       (whitespace-report): Refer to whitespace-report-region's
+       documentation.
+
+2014-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * whitespace.el: Use font-lock-flush.  Minimize refontifications.
+       Side benefit: it works without jit-lock.
+       (whitespace-point--used): New buffer-local var.
+       (whitespace-color-on): Initialize it and flush it.  Use font-lock-flush.
+       (whitespace-color-off): Use font-lock-flush.
+       (whitespace-point--used, whitespace-point--flush-used): New functions.
+       (whitespace-trailing-regexp, whitespace-empty-at-bob-regexp)
+       (whitespace-empty-at-eob-regexp): Use them.
+       (whitespace-post-command-hook): Rewrite.
+
+       * font-lock.el (font-lock-flush, font-lock-ensure): New functions.
+       (font-lock-fontify-buffer): Mark interactive-only.
+       (font-lock-multiline, font-lock-fontified, font-lock-set-defaults):
+       Make buffer-local.
+       (font-lock-specified-p): Remove redundant boundp check.
+       (font-lock-flush-function, font-lock-ensure-function): New vars.
+       (font-lock-turn-on-thing-lock): Set them.
+       (font-lock-default-fontify-buffer): Obey font-lock-dont-widen.
+       (font-lock-after-change-function): Make `old-len' optional.
+       (font-lock-set-defaults): Remove redundant `set' of font-lock-defaults.
+       Call font-lock-flush, just in case.
+       * progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in
+       recent Emacsen.
+       * progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete.
+       (vera-mode-map, vera-mode-menu): Remove bindings to it.
+       * progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure
+       and with-syntax-table.
+       * textmodes/conf-mode.el (conf-quote-normal):
+       * progmodes/sh-script.el (sh-set-shell):
+       * progmodes/prog-mode.el (prettify-symbols-mode):
+       * progmodes/f90.el (f90-font-lock-n):
+       * progmodes/cwarn.el (cwarn-mode):
+       * nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display):
+       * progmodes/compile.el (compilation-setup, compilation--unsetup):
+       * hi-lock.el (hi-lock-mode, hi-lock-unface-buffer)
+       (hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush.
+       * mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of
+       font-lock-fontify-buffer-function and
+       font-lock-unfontify-buffer-function.
+       (rmail-unfontify-buffer-function, rmail-fontify-message):
+       Use with-silent-modifications.
+       * htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now
+       and font-lock-ensure.
+       * bs.el (bs-show-in-buffer): Use font-lock-ensure.
+
+2014-05-28  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       * emacs-lisp/package.el (package-generate-autoloads):
+       Inhibit backup files.
+
+2014-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/hideshow.el (hs-hide-all): Call syntax-propertize
+       (bug#17608).
+
+2014-05-21  Michal Nazarewicz  <mina86@mina86.com>
+
+       * textmodes/tildify.el (tildify-buffer, tildify-region):
+       Add dont-ask option.
+
+2014-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * subr.el (zerop): Move from C.  Add compiler-macro (bug#17475).
+       * emacs-lisp/byte-opt.el (byte-optimize-zerop): Remove.
+
+       * subr.el (internal--funcall-interactively): New.
+       (internal--call-interactively): Remove.
+       (called-interactively-p): Detect funcall-interactively instead of
+       call-interactively.
+       * simple.el (repeat-complex-command): Use funcall-interactively.
+       (repeat-complex-command--called-interactively-skip): Remove.
+
+2014-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * register.el (register-read-with-preview): Don't burp on
+       frame switches (e.g. due to the frame we just popped).
+
+       * mouse.el (mouse-set-region): Handle spurious drag events (bug#17562).
+       (mouse-drag-track): Annotate `mouse-drag-start' so we know we moved.
+
+2014-05-26  Andreas Schwab  <schwab@linux-m68k.org>
 
        * cus-face.el (custom-face-attributes): Add :distant-foreground.
 
-2014-05-25  Martin Rudalics  <rudalics@gmx.at>
+2014-05-26  Martin Rudalics  <rudalics@gmx.at>
 
-       * window.el (window--dump-frame): Remove interactive
-       specification.
+       * window.el (window--dump-frame): Remove interactive specification.
 
-2014-05-23  Glenn Morris  <rgm@gnu.org>
+2014-05-26  Glenn Morris  <rgm@gnu.org>
 
        * hippie-exp.el (he-line-search-regexp):
        Handle comint-prompt-regexp containing subgroups.  (Bug#17529)
 
-2014-05-23  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-26  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el: Remove dependence on auto-mode-alist,
        to avoid errors when trying to create or visit a file foo.todo
        (auto-mode-alist): Remove add-to-list calls making Todo file
        extensions unrestrictedly tied to Todo modes.
 
-2014-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/nadvice.el (advice--member-p): Change second arg.
        (advice-function-member-p): Tell it to check both names and functions
        (bug#17531).
        (advice--add-function): Adjust call accordingly.
 
-2014-05-23  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-26  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el: Miscellaneous bug fixes.
        (todo-delete-file): When deleting an archive but not its todo
        (todo-reset-highlight-item): Also reset in filtered items files.
        Fix incorrect variable reference in document string.
 
-2014-05-22  Glenn Morris  <rgm@gnu.org>
+2014-05-26  Glenn Morris  <rgm@gnu.org>
 
        * window.el (window--dump-frame): Avoid error in --without-x builds.
 
-2014-05-21  Glenn Morris  <rgm@gnu.org>
+2014-05-26  Glenn Morris  <rgm@gnu.org>
 
        * nxml/nxml-mode.el (xml-mode): Only define this alias once.
 
-2014-05-21  Eli Zaretskii  <eliz@gnu.org>
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        * frame.el (set-frame-font): Doc fix.
 
        * menu-bar.el (menu-set-font): Doc fix.  (Bug#17532)
 
-2014-05-21  Dmitry Gutov  <dgutov@yandex.ru>
+2014-05-26  Dmitry Gutov  <dgutov@yandex.ru>
 
        * emacs-lisp/package.el (package--download-one-archive):
        Use `write-region' instead of `save-buffer' to avoid running various
        (describe-package-1): Same.  Insert newline at the end of the
        buffer if appropriate.
 
-2014-05-20  Juri Linkov  <juri@jurta.org>
+2014-05-26  Juri Linkov  <juri@jurta.org>
 
        * avoid.el (mouse-avoidance-set-mouse-position): Don't raise frame.
        (mouse-avoidance-ignore-p): Remove `switch-frame', add `focus-out'.
        * avoid.el (mouse-avoidance-banish-position): Fix defcustom :options
        to allow changing its value with `set-variable'.
 
-2014-05-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/scheme.el (scheme-mode-syntax-table): Remove hack for
        #; comments.
 
        * emacs-lisp/lisp.el (end-of-defun): Ensure we move (bug#17274).
 
-2014-05-18  Stefan Monnier  <monnier@iro.umontreal.ca>
-
        * emacs-lisp/timer.el (timer-event-handler): Don't run if canceled
        (bug#17392).
 
-2014-05-17  Michael Albinus  <michael.albinus@gmx.de>
+2014-05-26  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-find-inline-encoding): Do not match "%%t"
        for a temporary file name.
 
-2014-05-17  Eli Zaretskii  <eliz@gnu.org>
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        * simple.el (line-move-ignore-invisible): Doc fix.  (Bug#17511)
 
-2014-05-16  Michael Albinus  <michael.albinus@gmx.de>
+2014-05-26  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/dbus.el (dbus-init-bus, dbus-call-method)
        (dbus-call-method-asynchronously, dbus-send-signal)
        (dbus-method-return-internal, dbus-method-error-internal):
        Check, whether Emacs has been compiled with D-Bus support.  (Bug#17508)
 
-2014-05-14  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
+2014-05-26  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
 
        * emacs-lisp/eieio-opt.el (eieio-help-class): Correctly deal with
        methods which do not have a doc string.  (Bug#17490)
 
+2014-05-25  Tassilo Horn  <tsdh@gnu.org>
+
+       * textmodes/reftex-ref.el (reftex-format-special): Make it work
+       also for AMS Math's \eqref macro.
+
+2014-05-25  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       Arrange to never byte-compile the generated -pkg.el file.
+
+       * emacs-lisp/package.el (package-generate-description-file):
+       Output first-line comment to set buffer-local var `no-byte-compile'.
+       Suggested by Dmitry Gutov:
+       <http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00401.html>.
+
+2014-05-25  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       Fix bug: Properly quote args to generated -pkg.el `define-package'.
+
+       * emacs-lisp/package.el (package-generate-description-file):
+       Inline `package--alist-to-plist'; rewrite to selectively
+       quote alist values that are not self-quoting.
+       (package--alist-to-plist): Delete func.
+
+2014-05-25  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * term/xterm.el (xterm-function-map): Add mapping for shifted
+       keypad keys.
+
+2014-05-24  Daniel Colascione  <dancol@dancol.org>
+
+       * progmodes/subword.el (subword-find-word-boundary): Move point to
+       correct spot before search. (Bug#17580)
+
+       * emacs-lisp/nadvice.el (defun): Write in eval-and-compile to avoid
+       breaking the build.
+
+2014-05-24  Leo Liu  <sdl.web@gmail.com>
+
+       * calc/calc.el (math-bignum): Handle most-negative-fixnum.  (Bug#17556)
+
+2014-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuffer.el (completion--sreverse): Remove.
+       (completion--common-suffix): Use `reverse' instead.
+       * emacs-lisp/regexp-opt.el (regexp-opt-group): Use `reverse' on strings.
+
+2014-05-22  Glenn Morris  <rgm@gnu.org>
+
+       * shell.el (shell-mode) <shell-dirstack-query>: Bypass bash aliases.
+
+2014-05-21  Daniel Colascione  <dancol@dancol.org>
+
+       * files.el (interpreter-mode-alist): Add mksh.
+
+       * progmodes/sh-script.el (sh-ancestor-alist): Add mksh, a pdksh
+       derivative.
+       (sh-alias-alist): Alias /system/bin/sh (Android's system shell) to
+       mksh. Improve custom spec; allow regular expressions.
+       (sh-shell): Delegate name splitting to `sh-canonicalize-shell'.
+       (sh-after-hack-local-variables): New function.
+       (sh-mode): Use it; respect file-local `sh-shell' variable. (bug#17333)
+       (sh-set-shell): Use `sh-canonicalize-shell' instead of open-coding
+       the normalization.
+       (sh-canonicalize-shell): Rewrite to support regexes.
+
+2014-05-21  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/cl-lib.el (cl-endp): Fix last change.
+
+2014-05-19  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/cl-lib.el (cl-endp): Conform to CL's semantics.
+
+2014-05-18  Glenn Morris  <rgm@gnu.org>
+
+       * loadup.el:
+       * play/gametree.el: `track-mouse' is always defined since 2012-11-24.
+
+2014-05-14  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/python.el (python-shell-get-or-create-process):
+       Do not bind `current-prefix-arg' so that C-c C-z does not talk
+       back unless requested.
+
+2014-05-14  Glenn Morris  <rgm@gnu.org>
+
+       * subr.el (with-file-modes): New macro.
+       * printing.el (pr-save-file-modes): Make obsolete.
+       * eshell/esh-util.el (eshell-with-file-modes): Make obsolete.
+       * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
+       Add with-file-modes.
+       * doc-view.el (doc-view-make-safe-dir):
+       * epg.el (epg--start):
+       * files.el (locate-user-emacs-file, make-temp-file)
+       (backup-buffer-copy, move-file-to-trash):
+       * printing.el (pr-despool-print, pr-call-process, pr-text2ps):
+       * eshell/esh-util.el (eshell-with-private-file-modes)
+       (eshell-make-private-directory):
+       * net/browse-url.el (browse-url-mosaic):
+       * obsolete/mailpost.el (post-mail-send-it):
+       * obsolete/pgg-pgp.el (pgg-pgp-verify-region):
+       * obsolete/pgg-pgp5.el (pgg-pgp5-verify-region):
+       Use with-file-modes.
+
+       * vc/emerge.el (emerge-make-temp-file): Simplify.
+
 2014-05-14  Stephen Berman <stephen.berman@gmx.net>
             Stefan Monnier  <monnier@iro.umontreal.ca>
 
        Make pointless option obsolete.
        (emerge-temp-file-mode): Make non-functional option obsolete.
 
-2014-05-13  Michael Albinus  <michael.albinus@gmx.de>
+2014-05-14  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/browse-url.el (browse-url):
        Use `unhandled-file-name-directory' when setting `default-directory',
        in order to circumvent stalled remote connections.  (Bug#17425)
 
+2014-05-14  Glenn Morris  <rgm@gnu.org>
+
+       * printing.el (subst-char-in-string, make-temp-file, pr-get-symbol):
+       Optimize on Emacs, which has the relevant functions for ages.
+
+2014-05-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * simple.el (undo-make-selective-list): Obey undo-no-redo.
+
+2014-05-12  Sam Steingold  <sds@gnu.org>
+
+       * calendar/time-date.el (seconds-to-string): New function to
+       pretty print time delay in seconds.
+
 2014-05-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * mpc.el (mpc-format): Trim Date to the year.
+       (mpc-songs-hashcons): Shorten the Date field.
+
        * emacs-lisp/nadvice.el (advice--interactive-form): Don't get fooled
        into autoloading just because of a silly indirection.
 
-2014-05-11  Santiago Payà i Miralta  <santiagopim@gmail.com>  (tiny change)
+2014-05-12  Santiago Payà i Miralta  <santiagopim@gmail.com>
 
        * vc/vc-hg.el (vc-hg-unregister): New function.  (Bug#17454)
 
-2014-05-11  Glenn Morris  <rgm@gnu.org>
+2014-05-12  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/find-gc.el: Move to ../admin.
 
-2014-05-10  Glenn Morris  <rgm@gnu.org>
-
        * printing.el (pr-version):
        * ps-print.el (ps-print-version): Also mention bug-gnu-emacs.
 
        * net/browse-url.el (browse-url-mosaic):
        Create /tmp/Mosaic.PID as a private file.
 
-2014-05-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/nadvice.el: Support adding a given function multiple times.
        (advice--member-p): If name is given, only compare the name.
        (advice--add-function): Pass the name, if any, to
        advice--remove-function.
 
-2014-05-09  Philipp Rumpf  <prumpf@gmail.com>  (tiny change)
+2014-05-12  Philipp Rumpf  <prumpf@gmail.com>  (tiny change)
 
        * electric.el (electric-indent-post-self-insert-function): Don't use
        `pos' after modifying the buffer (bug#17449).
 
-2014-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-       * subr.el (function-put): Add function.
-
-2014-05-09  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-12  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el (todo-insert-item-from-calendar):
        Correct argument list to conform to todo-insert-item--basic.
 
-2014-05-09  Glenn Morris  <rgm@gnu.org>
+2014-05-12  Glenn Morris  <rgm@gnu.org>
 
        * files.el (cd-absolute): Test if directory is accessible
        rather than executable.  (Bug#17330)
        * progmodes/compile.el (recompile):
        Handle C-u M-x recompile from a non-compilation buffer.  (Bug#17444)
 
-2014-05-08  Juri Linkov  <juri@jurta.org>
-
-       * dired.el (dired-check-switches, dired-switches-recursive-p):
-       New functions.  (Bug#17218)
-       (dired-switches-escape-p, dired-move-to-end-of-filename):
-       Use `dired-check-switches'.
-       (dired-insert-old-subdirs, dired-build-subdir-alist)
-       (dired-sort-R-check): Use `dired-switches-recursive-p'.
-
-2014-05-08  Glenn Morris  <rgm@gnu.org>
-
        * net/browse-url.el (browse-url-mosaic):
        Be careful when writing /tmp/Mosaic.PID.  (Bug#17428)
        This is CVE-2014-3423.
 
+2014-05-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mouse.el: Use the normal toplevel loop while dragging.
+       (mouse-set-point): Handle multi-clicks.
+       (mouse-set-region): Handle multi-clicks for drags.
+       (mouse-drag-region): Update call accordingly.
+       (mouse-drag-track): Remove `do-mouse-drag-region-post-process' hack.
+       Use the normal event loop instead of a local while/read-event loop.
+       (global-map): Remove redundant bindings for double/triple-mouse-1.
+       * xt-mouse.el (xterm-mouse-translate-1): Only process one event at a time.
+       Generate synthetic down events when the protocol only sends up events.
+       (xterm-mouse-last): Remove.
+       (xterm-mouse--read-event-sequence-1000): Use xterm-mouse-last-down
+       terminal parameter instead.
+       (xterm-mouse--set-click-count): New function.
+       (xterm-mouse-event): Detect/generate double/triple clicks.
+       * reveal.el (reveal-close-old-overlays): Don't close while dragging.
+
+       * info.el (Info-quoted): New face.
+       (Info-mode-font-lock-keywords): New var.
+       (Info-mode): Use it.
+
+       * emacs-lisp/lisp-mode.el (preceding-sexp): Exclude leading "," which
+       are a hindrance for C-x C-e.
+
+2014-05-11  Leo Liu  <sdl.web@gmail.com>
+
+       * net/rcirc.el (rcirc-sentinel): Fix last change.
+
+2014-05-08  Sam Steingold  <sds@gnu.org>
+
+       * net/rcirc.el (rcirc-reconnect-delay): New user option.
+       (rcirc-sentinel): Auto-reconnect to the server if
+       `rcirc-reconnect-delay' is non-0 (but not more often than its
+       value in case the host is off-line).
+
+2014-05-09  Eli Zaretskii  <eliz@gnu.org>
+
+       * progmodes/grep.el (lgrep): Fix a typo in last commit.
+
+2014-05-09  Glenn Morris  <rgm@gnu.org>
+
+       * files.el (file-expand-wildcards):
+       * man.el (Man-support-local-filenames):
+       * printing.el (pr-i-directory, pr-interface-directory):
+       * progmodes/grep.el (lgrep, rgrep):
+       * textmodes/ispell.el (ispell-call-process)
+       (ispell-call-process-region, ispell-start-process)
+       (ispell-init-process): Use file-accessible-directory-p.
+
 2014-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * xt-mouse.el: Drop spurious/oddly shaped events (bug#17378).
        (xterm-mouse-event): Propagate it.
        (xterm-mouse-translate-1): Handle it.
 
-2014-05-07  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-08  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el (todo-insert-item--apply-args): When all
        four slots of the parameter list are filled, make sure to pass it
        to the argument list of todo-insert-item--basic.
 
-2014-05-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/package.el (package-compute-transaction): Topological sort.
        Add optional `seen' argument to detect and break infinite loops.
 
-2014-05-06  Eli Zaretskii  <eliz@gnu.org>
+2014-05-08  Eli Zaretskii  <eliz@gnu.org>
 
        * emacs-lisp/find-gc.el (find-gc-unsafe, find-unsafe-funcs)
        (trace-unsafe, trace-use-tree): Make parentheses style be
        according to Emacs style.
 
-2014-05-06  Michael Albinus  <michael.albinus@gmx.de>
+2014-05-08  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-remote-process-environment):
        Remove HISTFILE and HISTSIZE; it's too late to set them here.
        name.  (Bug#17415)
        This is CVE-2014-3424.
 
-2014-05-06  Glenn Morris  <rgm@gnu.org>
+2014-05-08  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/find-gc.el (find-gc-source-directory): Give it a value.
        (find-gc-source-files): Update some names.
        Avoid predictable temp-file names.  (http://bugs.debian.org/747100)
        This is CVE-2014-3422.
 
-2014-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el (completion--try-word-completion): Revert fix for
        Bug#15980 (bug#17375).
        Don't burp is xterm-mouse-last is not set as expected.
        Never return negative indices.
 
-2014-05-05  Dmitry Gutov  <dgutov@yandex.ru>
+2014-05-08  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-syntax-propertize-function):
        Backtrack one char if the global/char-literal var matcher hits
        inside a string.  The next char could be the beginning of an
        expression expansion.
 
-2014-05-05  Glenn Morris  <rgm@gnu.org>
+2014-05-08  Glenn Morris  <rgm@gnu.org>
 
        * help-fns.el (describe-function-1): Test for an autoload before a
        macro, since `macrop' works on autoloads.  (Bug#17410)
 
-2014-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * electric.el (electric-indent-functions-without-reindent): Add yaml.
 
        * minibuffer.el (completion-table-with-quoting) <completion--unquote>:
        Make sure the new point we return is within the new string (bug#17239).
 
-2014-05-03  Eli Zaretskii  <eliz@gnu.org>
+2014-05-05  Daniel Colascione  <dancol@dancol.org>
+
+       * progmodes/compile.el (compilation-error-regexp-alist-alist):
+       Port `gnu' pattern to rx.
+
+2014-05-05  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+
+       Remove unneeded prompt when closing a buffer with active
+       emacsclient ("Buffer ... still has clients"), #16548.
+       * server.el (server-start): Remove the only call to:
+       (server-kill-buffer-query-function): Remove.
+
+2014-05-04  Leo Liu  <sdl.web@gmail.com>
+
+       * calendar/diary-lib.el (calendar-chinese-month-name-array):
+       Defvar to pacify compiler.
+
+2014-05-04  Eli Zaretskii  <eliz@gnu.org>
 
        * mail/rmailsum.el (rmail-new-summary-1): Fix a typo in a comment.
 
-2014-05-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * vc/ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer):
        Use nil rather than `default' for the "default" appearance (bug#17388).
        * vc/ediff-init.el (ediff-set-overlay-face): Don't set help-echo if the
        overlay is not visible.
 
-2014-05-02  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-04  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el (todo-edit-file): Use display-warning.
        (todo-menu): Uncomment and update.
 
-2014-05-02  Stephen Berman  <stephen.berman@gmx.net>
+2014-05-04  Stephen Berman  <stephen.berman@gmx.net>
 
        * calendar/todo-mode.el: Reimplement item editing to have the same
        basic user interface as item insertion, and make small UI and
        (todo-key-bindings-t): Bind "e" to todo-edit-item.
        Remove bindings of deleted commands.
 
-2014-05-02  Leo Liu  <sdl.web@gmail.com>
+2014-05-04  Leo Liu  <sdl.web@gmail.com>
 
        * emacs-lisp/cl-macs.el (cl-deftype): Fix indentation.
 
-2014-05-01  Glenn Morris  <rgm@gnu.org>
+2014-05-04  Glenn Morris  <rgm@gnu.org>
 
        * allout-widgets.el (allout-widgets-tally)
        (allout-decorate-item-guides):
        * textmodes/reftex-parse.el (reftex-using-biblatex-p):
        Doc fixes (replace `iff').
 
+2014-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mpc.el (mpc-volume-mouse-set): Don't burp at the boundaries.
+
+2014-05-04  Leo Liu  <sdl.web@gmail.com>
+
+       Support Chinese diary entries in calendar and diary.  (Bug#17393)
+       * calendar/cal-china.el (calendar-chinese-month-name-array): New var.
+       (calendar-chinese-from-absolute-for-diary)
+       (calendar-chinese-to-absolute-for-diary)
+       (calendar-chinese-mark-date-pattern, diary-chinese-mark-entries)
+       (diary-chinese-list-entries): New functions to list and mark
+       Chinese diary entries in the calendar window.
+       (diary-chinese-anniversary)
+       (diary-chinese-insert-anniversary-entry)
+       (diary-chinese-insert-entry, diary-chinese-insert-monthly-entry)
+       (diary-chinese-insert-yearly-entry): New commands to insert
+       Chinese diary entries.
+
+       * calendar/diary-lib.el (diary-font-lock-keywords):
+       Support font-locking Chinese dates.
+
+       * calendar/cal-menu.el (cal-menu-diary-menu): Add entries for
+       inserting Chinese diary entries.
+
+       * calendar/calendar.el (diary-chinese-entry-symbol):
+       New customizable variable.
+       (calendar-mode-map): Add bindings for inserting Chinese diary
+       entries.
+
+2014-05-03  Juri Linkov  <juri@jurta.org>
+
+       * dired.el (dired-check-switches, dired-switches-recursive-p):
+       New functions.  (Bug#17218)
+       (dired-switches-escape-p, dired-move-to-end-of-filename):
+       Use `dired-check-switches'.
+       (dired-insert-old-subdirs, dired-build-subdir-alist)
+       (dired-sort-R-check): Use `dired-switches-recursive-p'.
+
+2014-05-01  Barry O'Reilly  <gundaetiapo@gmail.com>
+
+       * simple.el (undo-make-selective-list): New algorithm fixes
+       incorrectness of position adjustments when undoing in region.
+       (Bug#17235)
+       (undo-elt-crosses-region): Make obsolete.
+       (undo-adjust-elt, undo-adjust-beg-end, undo-adjust-pos):
+       New functions to adjust positions using undo-deltas.
+
 2014-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * mpc.el (mpc-volume-mouse-set): Don't burp at the boundaries.
+       * emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): Only highlight past
+       the last consecutive closing paren (bug#17345).
+
+2014-04-30  Reuben Thomas  <rrt@sc3d.org>
+
+       * dired.el (dired-mode): make terminology for eXpunge command
+       consistent.  (Bug#17276)
 
 2014-04-30  Eli Zaretskii  <eliz@gnu.org>
 
        * dired.el (dired-initial-position-hook, dired-initial-position):
        Doc string fixes.
 
-2014-04-29  Glenn Morris  <rgm@gnu.org>
+2014-04-30  Glenn Morris  <rgm@gnu.org>
 
        * mail/rmail.el (rmail-quit): Handle killed summaries.  (Bug#17283)
 
-2014-04-27  Matthias Dahl  <matthias.dahl@binary-island.eu>
+2014-04-30  Matthias Dahl  <matthias.dahl@binary-island.eu>
 
        * faces.el (face-spec-recalc): Apply X resources only after the
        defface spec has been applied. Thus, X resources are no longer
-       overridden by the defface spec which also fixes issues on win32 where
+       overriden by the defface spec which also fixes issues on win32 where
        the toolbar coloring was wrong because it is set through X resources
-       and was (wrongfully) overridden.  (Bug#16694)
+       and was (wrongfully) overriden.  (Bug#16694)
 
-2014-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * textmodes/rst.el (electric-pair-pairs): Declare.
        (rst-mode): Set it (bug#17131).
 
-2014-04-27  Juri Linkov  <juri@jurta.org>
+2014-04-30  Juri Linkov  <juri@jurta.org>
 
        * desktop.el (desktop-value-to-string): Let-bind `print-length'
        and `print-level' to nil.  (Bug#17351)
 
-2014-04-25  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
+2014-04-30  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
 
        * battery.el (battery-update): Handle the case where battery
        status is "N/A" (bug#17319).
 
-2014-04-24  Eli Zaretskii  <eliz@gnu.org>
+2014-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/ps-mode.el: Use SMIE.  Move string and comment recognition
+       to syntax-propertize.
+       (ps-mode-auto-indent): Mark as obsolete.
+       (ps-mode-font-lock-keywords-1): Remove string-or-comment handling.
+       (ps-mode-font-lock-keywords-3): Use symbol regexp operators instead of
+       word regexp operators.
+       (ps-mode-map): Move initialization into declaration.  Remove binding
+       for TAB, RET, >, ], and }.
+       (ps-mode-syntax-table): Move initialization into declaration.
+       Don't give word syntax to non-word chars.
+       (ps-run-mode-map): Move initialization into declaration.
+       (ps-mode-menu-main): Remove auto-indent entry.
+       (ps-mode-smie-rules): New function.
+       (ps-mode): Setup smie, syntax-propertize, and electric-indent-mode.
+       (ps-mode-looking-at-nested, ps-mode-match-string-or-comment): Remove.
+       (ps-mode--string-syntax-table): New const.
+       (ps-mode--syntax-propertize-special, ps-mode-syntax-propertize):
+       New functions.
+       (ps-mode-newline, ps-mode-tabkey, ps-mode-r-brace, ps-mode-r-angle)
+       (ps-mode-r-gt, ps-mode-r-balance): Remove functions.
+
+2014-04-27  Daniel Colascione  <dancol@dancol.org>
+
+       * term/xterm.el (xterm-paste): Use large finite timeout when
+       reading event to avoid putting keys in this-command-keys.
+
+2014-04-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/perl-mode.el (perl--syntax-exp-intro-regexp): New var.
+       (perl-syntax-propertize-function): Use it.  Extend handling of
+       here-docs to the unquoted case.
+
+2014-04-25  Eli Zaretskii  <eliz@gnu.org>
 
        * tooltip.el (tooltip-show-help-non-mode, tooltip-show-help):
        Use equal-including-properties to compare help-echo strings (bug#17331).
 
-2014-04-24  Leo Liu  <sdl.web@gmail.com>
+2014-04-25  Leo Liu  <sdl.web@gmail.com>
 
        * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table):
        Fix syntax for @.  (Bug#17325)
 
-2014-04-24  Daniel Colascione  <dancol@dancol.org>
+2014-04-25  Daniel Colascione  <dancol@dancol.org>
 
        * emacs-lisp/cl.el (gv): Require gv early to break eager
        macro-expansion cycles.
 
-2014-04-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * simple.el (region-active-p): Check there's a mark (bug#17324).
 
        * progmodes/perl-mode.el (perl-syntax-propertize-function): Slash after
        &, |, +, - and * can't be a division (bug#17317).
 
-2014-04-22  Stefan Monnier  <monnier@iro.umontreal.ca>
-
        * term/xterm.el (xterm--version-handler): Don't use modern xterm
        features on gnome-terminal (bug#16988).
 
+2014-04-25  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       Improve Scheme font-locking for (define ((foo ...) ...) ...).
+
+       * progmodes/scheme.el (scheme-font-lock-keywords-1): To find
+       the declared object, ignore zero or more parens, not zero or one.
+
+2014-04-24  Leo Liu  <sdl.web@gmail.com>
+
+       * progmodes/xscheme.el (xscheme-expressions-ring)
+       (xscheme-expressions-ring-yank-pointer, xscheme-running-p)
+       (xscheme-control-g-disabled-p, xscheme-process-filter-state)
+       (xscheme-allow-output-p, xscheme-prompt)
+       (xscheme-string-accumulator, xscheme-mode-string): Use defvar-local.
+
+       * progmodes/scheme.el (would-be-symbol, next-sexp-as-string):
+       Comment out unused functions.
+
+2014-04-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * info.el: Use lexical-binding and cl-lib.
+       Use defvar-local and setq-local instead of make-local-variable.
+       (Info-apropos-matches): Avoid add-to-list.
+       (Info-edit-mode-map): Fix obsolescence call to Info-edit-map.
+
+2014-04-24  Daniel Colascione  <dancol@dancol.org>
+
+       * progmodes/sh-script.el (sh-builtins): Add coproc to list of bash builtins.
+
+2014-04-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/cl-macs.el (cl--loop-let): Fix last merge.
+
 2014-04-22  Michael Heerdegen  <michael_heerdegen@web.de>
 
        * dired.el (dired-insert-set-properties): Do not consider
        (tramp-do-copy-or-rename-file-out-of-band): Do not quote `source'
        and `target' twice.
 
-2014-04-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * dframe.el (dframe-get-focus): Remove `hook' argument (bug#17311).
        * speedbar.el (speedbar-get-focus): Run the "hook" afterwards instead.
 
        * emacs-lisp/cl-macs.el (cl--loop-let): Avoid `nil' as var name.
 
-2014-04-21  Michael Albinus  <michael.albinus@gmx.de>
+2014-04-22  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions):
        Set "IFS=" when using read builtin, in order to preserve spaces in
        the file name.  Add test messages for hunting a bug on hydra.
        (tramp-get-ls-command): Undo using "-b" argument.  It doesn't help.
 
-2014-04-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/prog-mode.el (prettify-symbols--compose-symbol):
        Don't prettify a word within a symbol.
 
-2014-04-20  Michael Albinus  <michael.albinus@gmx.de>
+2014-04-22  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-get-ls-command): Use "-b" argument if
        possible.
 
+2014-04-22  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/byte-run.el (function-put): Unbreak build: don't
+       use defun to define `function-put'.
+
+2014-04-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function.
+       (lisp-el-font-lock-keywords-2, lisp-cl-font-lock-keywords-2): Use it.
+       (lisp-mode-variables): Set font-lock-extra-managed-props.
+
+       * emacs-lisp/byte-run.el (function-put): New function.
+       (defun-declarations-alist): Use it.  Add `pure' and `side-effect-free'.
+       * emacs-lisp/cl-macs.el (cl-defstruct, cl-struct-sequence-type)
+       (cl-struct-slot-info, cl-struct-slot-offset, cl-struct-slot-value):
+       Use them.
+
+2014-04-22  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/macroexp.el (internal-macroexpand-for-load):
+       Add `full-p' parameter; when nil, call `macroexpand' instead of
+       `macroexpand-all'.
+
+       * emacs-lisp/byte-run.el (eval-when-compile, eval-and-compile):
+       Improve docstrings.
+
+       * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
+       Use lambda function values, not quoted lambdas.
+       (byte-compile-recurse-toplevel): Remove extraneous &optional.
+
+       * emacs-lisp/cl-macs.el
+       (cl-struct-sequence-type, cl-struct-slot-info): Declare pure.
+       (cl-struct-slot-value): Conditionally use aref or nth so that the
+       compiler produces optimal code.
+
+2014-04-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/cl-macs.el (cl-struct-slot-offset): Mark as pure.
+       (inline): Don't inline cl--set-elt.
+       (cl-struct-slot-value): Remove explicit gv-setter and compiler-macro.
+       Define as inlinable instead.
+       (cl-struct-set-slot-value): Remove.
+
+       * emacs-lisp/cl-lib.el (cl--set-elt): Remove.
+       * emacs-lisp/cl-seq.el (cl-replace, cl-substitute, cl-nsubstitute):
+       Use setf instead.
+
+2014-04-21  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/cl-macs.el (cl--const-expr-val): We didn't need the
+       last two parameters after all.
+       (cl--expr-contains,cl--compiler-macro-typep,cl--compiler-macro-member)
+       (cl--compiler-macro-assoc,cl-struct-slot-value)
+       (cl-struct-set-slot-value): Stop using them.
+
+(2014-04-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * image-mode.el (image-mode-window-put): Don't assume there's a `t'
+       entry in image-mode-winprops-alist.
+
+2014-04-21  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/bytecomp.el (byte-compile-recurse-toplevel): New function.
+       (byte-compile-recurse-toplevel, byte-compile-initial-macro-environment)
+       (byte-compile-toplevel-file-form): Use it.
+
+       * emacs-lisp/cl-macs.el:
+       (cl--loop-let): Properly destructure `while' clauses.
+
+2014-04-20  Daniel Colascione  <dancol@dancol.org>
+
+       * vc/vc.el (vc-root-dir): New public autoloaded function for
+       generically finding the current VC root.
+       * vc/vc-hooks.el (vc-not-supported): New error.
+       (vc-call-backend): Signal `vc-not-supported' instead of generic error.
+
+2014-04-20  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/cl-macs.el (cl-the): Make `cl-the' assert its type
+       argument.
+       (cl--const-expr-val): cl--const-expr-val should macroexpand its
+       argument in case we're inside a symbol-macrolet.
+       (cl--do-arglist, cl--compiler-macro-typep)
+       (cl--compiler-macro-member, cl--compiler-macro-assoc): Pass macro
+       environment to `cl--const-expr-val'.
+       (cl-struct-sequence-type,cl-struct-slot-info)
+       (cl-struct-slot-offset, cl-struct-slot-value)
+       (cl-struct-set-slot-value): New functions.
+
 2014-04-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable
 
        * net/tramp-compat.el (tramp-unload-hook): Unload `tramp-loaddefs'.
 
-2014-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-17  Daniel Colascione  <dancol@dancol.org>
+
+       Add support for bracketed paste mode; add infrastructure for
+       managing terminal mode enabling and disabling automatically.
+
+       * xt-mouse.el:
+       (xterm-mouse-mode): Simplify.
+       (xterm-mouse-tracking-enable-sequence)
+       (xterm-mouse-tracking-disable-sequence): New constants.
+       (turn-on-xterm-mouse-tracking-on-terminal)
+       (turn-off-xterm-mouse-tracking-on-terminal):
+       Use tty-mode-set-strings and tty-mode-reset-strings terminal
+       parameters instead of random hooks.
+       (turn-on-xterm-mouse-tracking)
+       (turn-off-xterm-mouse-tracking): Delete.
+
+       * term/xterm.el (xterm-extra-capabilities): Fix bitrotted comment.
+       (xterm-paste-ending-sequence): New constant.
+       (xterm-paste): New command used for bracketed paste support.
+
+       (xterm-modify-other-keys-terminal-list): Delete obsolete variable.
+       (terminal-init-xterm-bracketed-paste-mode): New function.
+       (terminal-init-xterm): Call it.
+       (terminal-init-xterm-modify-other-keys): Use tty-mode-set-strings
+       and tty-mode-reset-strings instead of random hooks.
+       (xterm-turn-on-modify-other-keys)
+       (xterm-turn-off-modify-other-keys)
+       (xterm-remove-modify-other-keys): Delete obsolete functions.
+
+       * term/screen.el: Rewrite to just use the xterm code.
+       Add copyright notice.  Mention tmux.
+
+2014-04-17  Ian D  <dunni@gnu.org>  (tiny change)
+
+       * image-mode.el (image-mode-window-put): Also update the property of
+       the "default window".
+       * doc-view.el (doc-view-new-window-function): If no window
+       exists, move to the last known page.
 
-       * nxml/nxml-mode.el (nxml-fontify-matcher): Make sure propertization
-       was done (bug#17264).
-       * nxml/xmltok.el (xmltok-scan-after-comment-open): Extend unclosed
-       comment to EOB.
+2014-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/perl-mode.el (perl-calculate-indent): Don't auto-indent in
        here-documents (bug#17262).
        * term/pc-win.el (x-list-fonts, x-get-selection-value):
        Provide doc strings, as required by snarf-documentation.
 
-2014-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * ps-def.el (ps-generate-postscript-with-faces1): Use the new `sorted'
        arg of overlays-at.  Use `invisible-p'.
        overlays-at.
        (hfy-fontify-buffer): Remove unused var `orig-ovls'.
 
-2014-04-14  João Távora  <joaotavora@gmail.com>
+2014-04-16  João Távora  <joaotavora@gmail.com>
 
        * net/shr.el (shr-expand-url): Use `expand-file-name' for relative
        links.  (Bug#17217).
 
-2014-04-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+2014-04-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * vc/ediff-diff.el (ediff-set-fine-diff-properties-in-one-buffer):
        Use mapc to loop over a vector.  (Bug#17257).
 
-2014-04-13  Michael Albinus  <michael.albinus@gmx.de>
+2014-04-16  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-sh-handle-file-truename): Revert previous
        patch, there are new problems with file names containing spaces.
        Get rid of backticks.  (Bug#17238)
 
-2014-04-13  João Távora  <joaotavora@gmail.com>
+2014-04-16  João Távora  <joaotavora@gmail.com>
 
        * elec-pair.el (electric-pair--syntax-ppss): Simplify and fix
        possible bug.
 
-2014-04-13  Eli Zaretskii  <eliz@gnu.org>
+2014-04-16  Eli Zaretskii  <eliz@gnu.org>
 
        * frame.el (blink-cursor-blinks, blink-cursor-blinks-done): Doc fixes.
        (blink-cursor-mode): Mention customization variables and the
        effect of 'blink-cursor-blinks'.
 
-2014-04-12  Barry O'Reilly  <gundaetiapo@gmail.com>
+2014-04-16  Barry O'Reilly  <gundaetiapo@gmail.com>
 
        * simple.el (undo): Prevent insertion of identity mapping into
        undo-equiv-table so as undo-only does not inf loop in the presence
        of consecutive nils in undo list.
 
-2014-04-12  Matthias Dahl  <matthias.dahl@binary-island.eu>
+2014-04-16  Matthias Dahl  <matthias.dahl@binary-island.eu>
 
        * faces.el (make-face): Deprecate optional argument as it is no
        longer needed/used since the conditional X resources handling
        has been pushed down to make-face-x-resource-internal itself.
        (make-empty-face): Don't pass optional argument to make-face.
 
+2014-04-16  Karl Fogel  <kfogel@red-bean.com>
+
+       * savehist.el (savehist-save): Remove workaround for a read-passwd
+       bug that was fixed before 24.3.  Thanks to Juanma Barranquero for
+       noticing that the shim was still present.
+
+2014-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * doc-view.el (doc-view-set-doc-type): Ignore file name case; add .pps.
+
+2014-04-14  Juanma Barranquero  <lekktu@gmail.com>
+
+       * faces.el (face-set-after-frame-default): Remove unused local variable.
+
+2014-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/grep.el: Use lexical-binding.
+       (grep-expand-template): Pass explicit lexical env to `eval'.
+       (zrgrep): Let-bind grep-find-template explicitly.
+
+       * emacs-lisp/cl-lib.el (current-case-table): Remove setter.
+       * leim/quail/sisheng.el (sisheng-list): Use with-case-table.
+
 2014-04-12  Eli Zaretskii  <eliz@gnu.org>
 
        * international/characters.el <standard-case-table>: Add entries
 
 2014-04-12  Leo Liu  <sdl.web@gmail.com>
 
-       * progmodes/octave.el (completion-table-with-cache): Define if not
-       available.
-       (octave-goto-function-definition)
-       (octave-sync-function-file-names)
-       (octave-find-definition-default-filename): Backquote upattern for
-       compatibility.
+       * progmodes/octave.el (completion-table-with-cache):
+       Define if not available.
+       (octave-goto-function-definition, octave-sync-function-file-names)
+       (octave-find-definition-default-filename):
+       Backquote upattern for compatibility.
 
-2014-04-11  Michael Albinus  <michael.albinus@gmx.de>
+2014-04-12  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-sh-handle-file-truename): Quote the file
        name twice due to backticks.  (Bug#17238)
 
-2014-04-11  Glenn Morris  <rgm@gnu.org>
+2014-04-12  Glenn Morris  <rgm@gnu.org>
 
        * term/w32-win.el (x-win-suspend-error):
        * term/x-win.el (x-win-suspend-error): Sync docs.
 
-2014-04-10  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-12  Matthias Dahl  <matthias.dahl@binary-island.eu>
+
+       * faces.el (make-face): Remove deprecated optional argument.
+       The conditional application of X resources is handled directly by
+       make-face-x-resource-internal since Emacs 24.4.
+       (make-empty-face): Don't pass optional argument to make-face.
+
+2014-04-11  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (EMACSDATA, EMACSDOC, EMACSPATH): Unexport.  (Bug#16429)
+
+2014-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        Ediff's overlay priorities cause more trouble than they solve.
        * vc/ediff-init.el (ediff-shadow-overlay-priority): Remove variable.
        (ediff-set-fine-diff-properties-in-one-buffer): Don't mess with
        overlay priorities.
 
-2014-04-10  Feng Li  <fengli@gmail.com>  (tiny change)
+2014-04-11  Feng Li  <fengli@gmail.com>  (tiny change)
 
        * progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format
        entry; use symbol boundaries to avoid mis-matches.
 
-2014-04-10  Michael Albinus  <michael.albinus@gmx.de>
+2014-04-11  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-file-name-handler)
        (tramp-completion-file-name-handler): Avoid recursive loading.
        * net/tramp-sh.el (tramp-make-copy-program-file-name):
        Quote result also locally.
 
+2014-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emulation/cua-base.el (<toplevel>, cua--pre-command-handler-1):
+       Remove left-over code.
+
+       * newcomment.el (comment-indent-new-line): Sink code where it's used.
+       Reuse the previous comment's indentation unconditionally if it's on its
+       own line.
+
+2014-04-09  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/lisp.el (backward-up-list): Add `escape-strings',
+       `no-syntax-crossing' arguments.  Forward to `up-list'.
+       (up-list): Add `escape-strings', `no-syntax-crossing' arguments.
+       Implement logic for escaping from strings.  Use narrowing to deal
+       with corner cases.
+
+2014-04-09  Leo Liu  <sdl.web@gmail.com>
+
+       * net/rcirc.el (rcirc-connection-info): New variable.
+       (rcirc-connect): Use it to store connection info.
+       (rcirc-buffer-process): Avoid get-buffer-process which returns nil
+       for killed process.
+       (rcirc-cmd-reconnect): New command.  (Bug#17045)
+       (rcirc-mode, set-rcirc-encode-coding-system)
+       (set-rcirc-decode-coding-system, rcirc-connect): Use setq-local.
+
+2014-04-09  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/cl-indent.el: Add comment claiming
+       facility is also good for elisp.
+       (lisp-indent-find-method): New function.
+       (common-lisp-indent-function): Recognize cl-loop.
+       (common-lisp-indent-function-1): Recognize cl constructs; use
+       `lisp-indent-find-method' instead of `get' directly.
+       (if): Use else-body style for elisp.
+
 2014-04-09  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight more
        Module methods.  (Bug#17216)
 
-2014-04-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * help.el (describe-bindings): Fix buffer handling (bug#17210).
        (describe-bindings-internal): Mark obsolete.
 
+2014-04-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * subr.el (with-silent-modifications): Don't bind deactivate-mark,
+       buffer-file-name, and buffer-file-truename any more.
+
+2014-04-08  Leo Liu  <sdl.web@gmail.com>
+
+       Use lexical-binding and require cl-lib.
+       * net/rcirc.el (rcirc, rcirc-handler-ctcp-KEEPALIVE)
+       (rcirc-handler-generic, rcirc-fill-paragraph)
+       (rcirc-format-response-string, rcirc-target-buffer)
+       (rcirc-last-line, rcirc-record-activity, rcirc-split-activity)
+       (rcirc-activity-string, rcirc-make-trees, rcirc-cmd-ctcp)
+       (rcirc-ctcp-sender-PING, rcirc-browse-url)
+       (rcirc-markup-timestamp, rcirc-markup-attributes)
+       (rcirc-markup-my-nick, rcirc-markup-urls)
+       (rcirc-markup-bright-nicks, rcirc-markup-fill)
+       (rcirc-check-auth-status, rcirc-handler-WALLOPS)
+       (rcirc-handler-JOIN, rcirc-handler-PART-or-KICK)
+       (rcirc-handler-PART, rcirc-handler-KICK, rcirc-handler-QUIT)
+       (rcirc-handler-NICK, rcirc-handler-PING, rcirc-handler-PONG)
+       (rcirc-handler-TOPIC, rcirc-handler-301, rcirc-handler-317)
+       (rcirc-handler-332, rcirc-handler-333, rcirc-handler-477)
+       (rcirc-handler-MODE, rcirc-handler-353, rcirc-handler-366)
+       (rcirc-authenticate, rcirc-handler-INVITE, rcirc-handler-ERROR)
+       (rcirc-handler-ctcp-VERSION, rcirc-handler-ctcp-TIME)
+       (rcirc-handler-CTCP-response): Fix unused arguments warnings and
+       use cl-lib.
+
 2014-04-07  João Távora  <joaotavora@gmail.com>
 
-       * elec-pair.el:
-       (electric-pair--syntax-ppss): When inside comments parse from
-       comment beginning.
+       * elec-pair.el (electric-pair--syntax-ppss):
+       When inside comments parse from comment beginning.
        (electric-pair--balance-info): Fix typo in comment.
        (electric-pair--in-unterminated-string-p): Delete.
        (electric-pair--unbalanced-strings-p): New function.
        (electric-pair-inhibit-if-helps-balance): Decide quote pairing
        according to `electric-pair--in-unterminated-string-p'
 
-2014-04-07  João Távora  <joaotavora@gmail.com>
-
        * elec-pair.el (electric-pair-inhibit-if-helps-balance):
        Inhibit quote pairing if point-max is inside an unterminated string.
        (electric-pair--looking-at-unterminated-string-p): Delete.
        * shell.el (shell-directory-tracker):
        Go back to just ignoring failures.  (Bug#17159)
 
-2014-04-06  João Távora  <joaotavora@gmail.com>
+2014-04-07  João Távora  <joaotavora@gmail.com>
 
        Fix `electric-pair-delete-adjacent-pairs' in modes binding
        backspace. (bug#16981)
        a new `electric-pair-delete-pair' command.
        (electric-pair-delete-pair): New command.
 
-2014-04-06  João Távora  <joaotavora@gmail.com>
-
        * progmodes/python.el (python-electric-pair-string-delimiter):
        Fix triple-quoting electricity.  (Bug#17192)
 
-2014-04-06  João Távora  <joaotavora@gmail.com>
-
        * elec-pair.el (electric-pair-post-self-insert-function):
        Don't skip whitespace when `electric-pair-text-pairs' and
        `electric-pair-pairs' were used. syntax to
        electric-pair--skip-whitespace.  (Bug#17183)
 
-2014-04-06  Eli Zaretskii  <eliz@gnu.org>
+2014-04-07  Eli Zaretskii  <eliz@gnu.org>
 
        * leim/quail/ipa.el (ipa-x-sampa): Fix the character produced for
        "<F>".  (Bug#17199)
 
-2014-04-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * mpc.el (mpc--status-timer-run): Disable timer if not displayed.
        (mpc--status-idle-timer-run): Use mpc--status-timer-run.
 
-2014-04-05  Glenn Morris  <rgm@gnu.org>
+2014-04-07  Glenn Morris  <rgm@gnu.org>
 
        * help.el (view-lossage): Doc tweak.
 
-2014-04-05  Matthias Dahl  <matthias.dahl@binary-island.eu>
+2014-04-07  Matthias Dahl  <ml_emacs-lists@binary-island.eu>
 
        * faces.el (face-spec-recalc): Call make-face-x-resource-internal
        only when inhibit-x-resources is nil, and do that earlier in the
        (face-set-after-frame-default): Don't call
        make-face-x-resource-internal here.  (Bug#16434)
 
-2014-04-04  Tassilo Horn  <tsdh@gnu.org>
+2014-04-07  Tassilo Horn  <tsdh@gnu.org>
 
        * doc-view.el (doc-view-bookmark-jump):
        Use `bookmark-after-jump-hook' to jump to the right page after the
        buffer is shown in a window.  (bug#16090)
 
-2014-04-04  Eli Zaretskii  <eliz@gnu.org>
+2014-04-07  Eli Zaretskii  <eliz@gnu.org>
 
        * international/characters.el (mirroring): Fix last change:
        instead of loading uni-mirrored.el explicitly, do that implicitly
        by creating the 'mirroring' uniprop table.  This avoids announcing
        the loading of uni-mirrored.el.
 
-2014-04-04  Glenn Morris  <rgm@gnu.org>
+2014-04-07  Glenn Morris  <rgm@gnu.org>
 
        * files.el (buffer-stale--default-function)
        (buffer-stale-function, revert-buffer--default):
        * autorevert.el (auto-revert-buffers): Doc tweaks.
 
-2014-04-03  Eli Zaretskii  <eliz@gnu.org>
+2014-04-07  Eli Zaretskii  <eliz@gnu.org>
 
        * international/characters.el: Preload uni-mirrored.el.  (Bug#17169)
 
-2014-04-03  Glenn Morris  <rgm@gnu.org>
+2014-04-07  Glenn Morris  <rgm@gnu.org>
 
        * files.el (make-backup-file-name-function)
        (make-backup-file-name, make-backup-file-name--default-function)
        (make-backup-file-name-function): Bump :version.
        Restore nil as a valid but deprecated custom type.
 
-2014-04-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $'
-       used as a variable (bug#17174).
-
-2014-04-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+       * progmodes/perl-mode.el (perl-syntax-propertize-function):
+       Handle $' used as a variable (bug#17174).
 
        * progmodes/perl-mode.el (perl-indent-new-calculate):
        Handle forward-sexp failure (bug#16985).
        (perl-syntax-propertize-function): Add "foreach" and "for" statement
        modifiers introducing expressions (bug#17116).
 
+2014-04-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * dired-aux.el (dired-file-set-difference): Use lexical-scoping.
+
+2014-04-05  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
+       Add define-compilation-mode.
+
+2014-04-04  João Távora  <joaotavora@gmail.com>
+
+       * elec-pair.el (electric-pair--syntax-ppss): When inside comments
+       parse from comment beginning.
+       (electric-pair--balance-info): Fix typo in comment.
+       (electric-pair--in-unterminated-string-p): Delete.
+       (electric-pair--unbalanced-strings-p): New function.
+       (electric-pair-string-bound-function): New var.
+       (electric-pair-inhibit-if-helps-balance): Decide quote pairing
+       according to `electric-pair--in-unterminated-string-p'.
+
+2014-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * textmodes/reftex-parse.el (reftex--index-tags): Rename `index-tags'.
+       Move declaration before first use.
+       (reftex-move-to-next-arg): Silence compiler warning.
+
+2014-04-04  Joost Kremers  <joostkremers@fastmail.fm>  (tiny change)
+
+       * textmodes/reftex-toc.el (reftex-toc, reftex-re-enlarge):
+       Use `window-total-width' instead of `window-width'.
+
+2014-04-03  Daniel Colascione  <dancol@dancol.org>
+
+       * subr.el (set-transient-map): Remove rms's workaround entirely;
+       use new `suspicious-object' subr to mark our lambda for closer
+       scrutiny during gc.
+
+2014-04-02  Richard Stallman  <rms@gnu.org>
+
+       * subr.el (set-transient-map): Comment out previous change.
+
 2014-04-02  Glenn Morris  <rgm@gnu.org>
 
        * menu-bar.el (menu-bar-file-menu):
 
        * simple.el (command-execute): Respect nil disabled-command-function.
 
-2014-04-01  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
+2014-04-02  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
 
        * simple.el (command-execute): Do not execute the command when it
        is disabled; fixes thinko in 2013-02-20 conversion from C.  (Bug#17151)
 
-2014-03-29  Juri Linkov  <juri@jurta.org>
+2014-04-02  Juri Linkov  <juri@jurta.org>
 
        * dired-aux.el (dired-compress-file): Don't use string-match-p
        because its match data is used afterwards.
 
-2014-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/package.el (package-built-in-p): Treat a min-version of
        0 like nil.
 
+2014-04-02  João Távora  <joaotavora@gmail.com>
+
+       * elec-pair.el (electric-pair-inhibit-if-helps-balance):
+       Inhibit quote pairing if point-max is inside an unterminated string.
+       (electric-pair--looking-at-unterminated-string-p):
+       Delete.
+       (electric-pair--in-unterminated-string-p): New function.
+
+2014-04-01  Daniel Colascione  <dancol@dancol.org>
+
+       * minibuffer.el (minibuffer-complete): Prevent assertion failure
+       when trying to complete the prompt.
+
+2014-03-31  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/eldoc.el (eldoc-print-current-symbol-info):
+       Refactor out eldoc-documentation-function-default.
+       (eldoc-documentation-function-default): New function.
+       (eldoc-documentation-function): Change value.
+
+2014-03-31  Glenn Morris  <rgm@gnu.org>
+
+       * simple.el (cycle-spacing--context, cycle-spacing): Doc tweaks.
+
+       * progmodes/vhdl-mode.el (vhdl-speedbar-select-mra)
+       (vhdl-compose-components-package, vhdl-compose-configuration):
+       Abbreviate default-directory (missing from some previous upstream sync).
+
+2014-03-31  Reto Zimmermann  <reto@gnu.org>
+
+       Sync with upstream vhdl mode v3.35.2.
+       * progmodes/vhdl-mode.el (vhdl-version, vhdl-time-stamp): Update.
+       (top-level): No longer require assoc.
+       (vhdl-asort, vhdl-anot-head-p, vhdl-aput, vhdl-adelete, vhdl-aget):
+       New functions.  Use throughout to replace aget etc.
+       (vhdl-aput-delete-if-nil): Rename from vhdl-aput.
+       (vhdl-update-file-contents): Update for vhdl-aput-delete-if-nil rename.
+       (vhdl-template-replace-header-keywords): Fix bug for "<title string>".
+       (vhdl-compile-init): Do not initialize regexps for Emacs 22+.
+       (vhdl-error-regexp-emacs-alist): Remove regexps from all compilers
+       except `vhdl-compiler'.
+       (vhdl-error-regexp-add-emacs): Remove all other compilers,
+       when appropriate.
+
+2014-03-31  Glenn Morris  <rgm@gnu.org>
+
+       * progmodes/vhdl-mode.el (vhdl-expand-abbrev, vhdl-expand-paren):
+       Revert 2014-03-26 merge goof; go back to using defalias.
+
+2014-03-30  Daniel Colascione  <dancol@dancol.org>
+
+       * comint.el (comint-send-input):
+       Deactivate completion-in-region-mode before we send comint input.
+       (Bug#17139).
+
+       * simple.el (keyboard-quit): Deactivate completion-in-region-mode
+       on keyboard-quit.
+
+2014-03-29  Glenn Morris  <rgm@gnu.org>
+
+       * textmodes/reftex.el: Manage most autoloads automatically.
+       * textmodes/reftex-auc.el, textmodes/reftex-cite.el:
+       * textmodes/reftex-dcr.el, textmodes/reftex-global.el:
+       * textmodes/reftex-index.el, textmodes/reftex-parse.el:
+       * textmodes/reftex-ref.el, textmodes/reftex-sel.el:
+       * textmodes/reftex-toc.el: Set generated-autoload-file,
+       and add autoload cookies for reftex.el.
+       * Makefile.in (AUTOGEN_VCS): Add textmodes/reftex.el.
+
+2014-03-28  Glenn Morris  <rgm@gnu.org>
+
+       * cus-start.el (report-emacs-bug-address): Set custom properties.
+       * mail/emacsbug.el (report-emacs-bug-address):
+       Variable is now defined in emacs.c.
+
+       * mail/emacsbug.el (report-emacs-bug):
+       Include system-configuration-features.
+
+2014-03-28  Michal Nazarewicz  <mina86@mina86.com>
+
+       * simple.el (cycle-spacing): Never delete spaces on first run by
+       default, but do so in a new 'fast mode and if there are already
+       N spaces (the previous behavior).
+       Compare N with its value in previous invocation so that changing
+       prefix argument restarts `cycle-spacing' sequence.
+       The idea is that with this change, binding M-SPC to
+       `cycle-spacing' should not introduce any changes in behavior of
+       the binding so long as users do not type M-SPC twice in a raw with
+       the same prefix argument or lack thereof.
+
+2014-03-28  Glenn Morris  <rgm@gnu.org>
+
+       * faces.el (term-file-aliases): New variable.
+       (tty-run-terminal-initialization): Respect term-file-aliases.
+       * term/apollo.el, term/vt102.el, term/vt125.el, term/vt201.el:
+       * term/vt220.el, term/vt240.el, term/vt300.el, term/vt320.el:
+       * term/vt400.el, term/vt420.el: Remove files, replaced by aliases.
+
+2014-03-27  Glenn Morris  <rgm@gnu.org>
+
+       * startup.el (inhibit-startup-hooks): Doc tweak.
+       (normal-top-level): Simplify running of hooks.
+       For window-setup-hook, respect inhibit-startup-hooks.
+       (command-line-1): Don't set window-setup-hook to nil.
+
+       Allow selective autoloading from obsolete/ directory.
+       * Makefile.in (obsolete-autoloads): New rule.
+       (autoloads): Run obsolete-autoloads.
+       * obsolete/iswitchb.el (iswitchb-mode): Use obsolete-autoload.
+       * simple.el (iswitchb-mode): Remove hand-written autoloads.
+
 2014-03-27  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-font-lock-keywords):
        * emacs-lisp/package-x.el (package--archive-contents-from-url):
        Use url-insert-file-contents; package-handle-response no longer exists.
 
+2014-03-26  Daniel Colascione  <dancol@dancol.org>
+
+       * simple.el (process-menu-mode-map): New variable.
+       (process-menu-delete-process): New command.
+
 2014-03-26  Juanma Barranquero  <lekktu@gmail.com>
 
        * emacs-lisp/package.el: Fix bug#16733 (again).
        dynamic binding of `buffer'.
        (describe-package-1): Do not decode readme-string.
 
-2014-03-25  Barry O'Reilly  <gundaetiapo@gmail.com>
-
-       * simple.el (primitive-undo): Correction to 2014-03-24 change.
-
-2014-03-25  Michael Albinus  <michael.albinus@gmx.de>
+2014-03-26  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-methods, tramp-connection-timeout): Fix docstring.
 
        (tramp-do-copy-or-rename-file-directly): In the `rename' case,
        check whether source directory has set the sticky bit.
 
-2014-03-24  Barry O'Reilly  <gundaetiapo@gmail.com>
+2014-03-26  Barry O'Reilly  <gundaetiapo@gmail.com>
 
        * simple.el (primitive-undo): Only process marker adjustments
        validated against their corresponding (TEXT . POS).  Issue warning
        (undo-elt-in-region): Return nil when passed a marker adjustment
        and explain in function doc.
 
-2014-03-24  Dmitry Gutov  <dgutov@yandex.ru>
-
-       * emacs-lisp/package.el (package--add-to-archive-contents):
-       Include already installed and built-in packages in
-       `package-archive-contents'.
-       (package-install): Don't include already installed packages in the
-       options during interactive invocation.  (Bug#16762)
-
-2014-03-24  Daniel Colascione  <dancol@dancol.org>
-
-       * emacs-lisp/cl-macs.el (cl--do-arglist): Use `plist-member'
-       instead of cl-loop search function.
-
-2014-03-24  Juanma Barranquero  <lekktu@gmail.com>
-
-       * frameset.el (frameset--initial-params): Fix typo in parameter name.
-
-2014-03-24  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
+2014-03-26  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
 
        * align.el (align-region): Do not fail when end-mark is nil (bug#17088).
 
-2014-03-24  Dmitry Gutov  <dgutov@yandex.ru>
+2014-03-26  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-expression-expansion-re):
        Match special global variables without curlies, too.
        variables.  Don't require a non-word character after the variable.
        (Bug#17057)
 
-2014-03-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-03-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * simple.el (redisplay-highlight-region-function): Increase priority of
        overlay to make sure boundaries are visible (bug#15899).
 
-2014-03-23  Juanma Barranquero  <lekktu@gmail.com>
+2014-03-26  Juanma Barranquero  <lekktu@gmail.com>
 
-       * frameset.el (frameset-restore): Compare display strings with equal.
+       * frameset.el (frameset--initial-params): Fix typo in parameter name.
+       (frameset-restore): Compare display strings with equal.
 
        * frame.el (make-frame): Don't quote display name in error message,
        it is already a string.
 
-2014-03-23  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
+2014-03-26  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
 
        * net/tramp.el (tramp-read-passwd): Suspend the timers while reading
        the password.
 
-2014-03-23  Dmitry Gutov  <dgutov@yandex.ru>
+2014-03-26  Dmitry Gutov  <dgutov@yandex.ru>
 
-       * emacs-lisp/package.el (package-show-package-list): If the buffer
-       is already displayed in another window, switch to that window.
+       * emacs-lisp/package.el (package--add-to-archive-contents):
+       Include already installed and built-in packages in
+       `package-archive-contents'.
+       (package-install): Don't include already installed packages in the
+       options during interactive invocation.  (Bug#16762)
+       (package-show-package-list): If the buffer is already displayed in
+       another window, switch to that window.
+
+2014-03-26  Reto Zimmermann  <reto@gnu.org>
+
+       Sync with upstream vhdl mode v3.35.1.
+       * progmodes/vhdl-mode.el (vhdl-version, vhdl-time-stamp): Update.
+       (vhdl-compiler-alist): Doc fix.
+       (vhdl-goto-line): Remove.
+       (vhdl-mode-abbrev-table-init): Add XEmacs compat.
+       (vhdl-mode) <paragraph-start>: Fix value.
+       (vhdl-fix-statement-region): Not `for' in wait-statement.
+       (vhdl-beautify-region): Also (un)tabify.
+       (vhdl-get-visible-signals):
+       Scan declarative part of generate statements.
+       (vhdl-template-record): Fix indentation for record type declaration.
+       (vhdl-expand-abbrev, vhdl-expand-paren):
+       Revert to using fset again rather than defalias.
+       (vhdl-scan-directory-contents): Tweak.
+       (vhdl-speedbar-find-file, vhdl-speedbar-port-copy)
+       (vhdl-compose-components-package):
+       Replace vhdl-goto-line with forward-line.
+       (top-level): Tweak speedbar frame selection.
+       (vhdl-generate-makefile-1): Support for compilers with no
+       unit-to-file name mapping (create directory with dummy files).
+
+2014-03-26  Wilson Snyder  <wsnyder@wsnyder.org>
+
+       Sync with upstream verilog-mode revision 702457d.
+       * progmodes/verilog-mode.el (verilog-mode-version): Update.
+       (create-lockfiles): Declare.
+       (verilog-read-decls): Fix module header imports, bug709.
+       Reported by Victor Lau.
+       Fix parsing 'var' in AUTOs, msg1294.  Reported by Dominique Chen.
+       (verilog-auto-inout-module): Fix AUTOINOUTMODULE not inserting
+       interface-only modules, bug721.  Reported by Dean Hoyt.
 
-2014-03-21  Daniel Colascione  <dancol@dancol.org>
+2014-03-26  Glenn Morris  <rgm@gnu.org>
 
-       * mail/emacsbug.el (report-emacs-bug): Include memory usage
-       information in bug reports.
+       * obsolete/gulp.el: Move here from emacs-lisp/.
+
+       * files.el (lock-buffer, unlock-buffer, file-locked-p):
+       Remove fallback aliases, since they are always defined now.
+
+2014-03-24  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs-lisp/cl-macs.el (cl--do-arglist): Use `plist-member'
+       instead of cl-loop search function.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * calendar/parse-time.el (parse-time-iso8601-regexp)
+       (parse-iso8601-time-string): Copied from `url-dav' so that we can use
+       it more generally.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * net/dns.el (network-interface-list): Define for XEmacs.
+
+2014-03-23  Magnus Henoch  <magnus.henoch@gmail.com>
+
+       * net/dns.el (dns-servers-up-to-date-p): New function to see whether
+       the network interfaces changed.
+       (dns-query): Use it to flush the data.
+
+2014-03-23  Juanma Barranquero  <lekktu@gmail.com>
+
+       * vc/vc.el (vc-rollback): Use set-buffer-modified-p.
+
+2014-03-23  Daniel Colascione  <dancol@dancol.org>
+
+       Change subword-mode to use `find-word-boundary-function-table' and
+       replace `capitalized-words-mode'.  Also, convert to lexical
+       binding.
+
+       * progmodes/cap-words.el: Delete now-obsolete file.
+       * progmodes/subword.el: Reimplement using
+       `find-word-boundary-function-table'.
+       (subword-mode-map): Hollow out.
+       (capitalized-words-mode): Define as obsolete alias for
+       `subword-mode'.
+       (subword-mode, superword-mode): Tweak documentation to reflect new
+       implementation; call `subword-setup-buffer'.
+       (subword-forward, subword-capitalize): Add underscore to indicate
+       unused variable.
+       (subword-find-word-boundary-function-table): New constant.
+       (subword-empty-char-table): New constant.
+       (subword-setup-buffer): New function.
+       (subword-find-word-boundary): New function.
 
 2014-03-23  Daniel Colascione  <dancol@dancol.org>
 
        (Bug#3647) --- unfortunately, only for freshly-compiled code.
        Please make bootstrap.
 
-2014-03-23  Richard Stallman  <rms@gnu.org>
-
-       * battery.el (battery-linux-sysfs): Search for each field
-       from the beginning of the buffer.
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * dired.el (dired-read-regexp): Make obsolete.
+       (dired-mark-files-regexp, dired-mark-files-containing-regexp)
+       (dired-flag-files-regexp):
+       * dired-aux.el (dired-mark-read-regexp):
+       * dired-x.el (dired-mark-unmarked-files): Use read-regexp directly.
+
+       * startup.el (fancy-startup-text):
+       * help.el (describe-gnu-project): Visit online info about GNU project.
+
+       * help-fns.el (help-fns--interactive-only): New function.
+       (help-fns-describe-function-functions): Add the above function.
+       * simple.el (beginning-of-buffer, end-of-buffer, insert-buffer)
+       (next-line, previous-line): Remove hand-written interactive-only
+       information from doc strings, it is auto-generated now.
+       * bookmark.el (bookmark-write):
+       * epa-mail.el (epa-mail-decrypt, epa-mail-verify, epa-mail-sign)
+       (epa-mail-import-keys): Mark interactive-only,
+       and remove hand-written interactive-only information from doc strings.
+       * epa.el (epa-decrypt-armor-in-region, epa-verify-region)
+       (epa-verify-cleartext-in-region, epa-sign-region, epa-encrypt-region):
+       * files.el (not-modified):
+       * simple.el (mark-whole-buffer): Mark interactive-only.
+
+       * emacs-lisp/byte-run.el (defun-declarations-alist):
+       Add interactive-only.  Doc tweak.
+       (macro-declarations-alist): Doc tweak.
+       * subr.el (declare): Doc tweak (add xref to manual).
+       * comint.el (comint-run):
+       * files.el (insert-file-literally, insert-file):
+       * replace.el (replace-string, replace-regexp):
+       * simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char)
+       (delete-forward-char, goto-line, insert-buffer, next-line)
+       (previous-line): Set interactive-only via declare.
 
 2014-03-22  Dmitry Gutov  <dgutov@yandex.ru>
 
        * w32-common-fns.el (x-selection-owner-p): Add empty docstring for the
        benefit of doc.c; change parameter profile to match the X function.
 
+2014-03-22  Leo Liu  <sdl.web@gmail.com>
+
+       * help.el (temp-buffer-setup-hook): Remove help-mode-setup.
+       (temp-buffer-show-hook): Remove help-mode-finish.  (Bug#16038)
+
+2014-03-21  Richard Stallman  <rms@gnu.org>
+
+       * battery.el (battery-linux-sysfs): Search for each field
+       from the beginning of the buffer.
+
+       * subr.el (set-transient-map): Clear out function and value
+       of the temporary symbol when we're done with it.
+
+       * mail/rmailsum.el (rmail-summary-delete-forward):
+       Optimize case of reaching end and handling count.
+       (rmail-summary-mark-deleted): Optimize when N is current msg.
+       Don't create new summary line.
+       (rmail-summary-undelete): Pass arg to rmail-undelete-previous-message.
+       (rmail-summary-undelete-many): Rewrite for speed.
+       (rmail-summary-msg-number): New function.
+
+       * mail/rmail.el (rmail-delete-message): Update summary.
+       (rmail-undelete-previous-message): Handle repeat count arg.
+       (rmail-delete-backward, rmail-delete-forward): Likewise.
+
+2014-03-21  Daniel Colascione  <dancol@dancol.org>
+
+       * mail/emacsbug.el (report-emacs-bug): Include memory usage
+       information in bug reports.
+
 2014-03-21  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-methods): Add docstring for `tramp-login-env'
        (tty-color-approximate, tty-color-by-index, tty-color-values)
        (tty-color-desc): Remove superfluous backslashes.
 
+2014-03-21  Glenn Morris  <rgm@gnu.org>
+
+       * cus-start.el (history-length): Bump :version.
+
+       * Makefile.in ($(MH_E_DIR)/mh-loaddefs.el)
+       ($(TRAMP_DIR)/tramp-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el)
+       ($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el):
+       Don't set `make-backup-files'.
+
+       * info.el (info--prettify-description): New function,
+       to give info-finder descriptions consistent case, punctuation.
+       (Info-finder-find-node): Use it.  Sort packages.
+       Refer to "description" rather than "commentary".
+
+2014-03-21  Juanma Barranquero  <lekktu@gmail.com>
+
+       * frameset.el (frameset--print-register): New function.
+       (frameset-to-register): Use it.
+
+2014-03-20  Juanma Barranquero  <lekktu@gmail.com>
+
+       * progmodes/hideif.el (hif-string-to-number): New function.
+       (hif-tokenize): Use it to understand non-decimal floats.
+
+       * emacs-lisp/cl-extra.el (cl--map-overlays): Remove obsolete code.
+
+       * skeleton.el (skeleton-autowrap): Mark as obsolete.  Doc fix.
+
 2014-03-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * electric.el (electric-newline-and-maybe-indent): New command.
 2014-03-10  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
-       Do not add `nil' to the environment, when there's no remote `locale'.
+       Do not add nil to the environment, when there's no remote `locale'.
        (tramp-find-inline-encoding): Check, that the remote host has
        installed perl, before sending scripts.
 
 
        * rect.el (rectangle-mark-mode): Rename from rectangle-mark.
        Make it into a proper minor mode.
-       (rectangle--region): (implicitly) rename to rectangle-mark-mode.
+       (rectangle--region): (Implicitly) rename to rectangle-mark-mode.
        (rectangle-mark-mode-map): New keymap.
        (rectangle--highlight-for-redisplay): Fix some corner cases (bug#15796).
 
 
 2013-10-28  Daiki Ueno  <ueno@gnu.org>
 
-       * epa-file.el
-       (epa-file-cache-passphrase-for-symmetric-encryption):
+       * epa-file.el (epa-file-cache-passphrase-for-symmetric-encryption):
        Document that this option has no effect with GnuPG 2.0 (bug#15552).
 
 2013-10-27  Xue Fuqiao  <xfq.free@gmail.com>
        * textmodes/reftex-vars.el (reftex-ref-style-alist):
        Add cleveref macros.
 
-       * textmodes/reftex-parse.el
-       (reftex-locate-bibliography-files): Accept options for
-       bibliography commands.
+       * textmodes/reftex-parse.el (reftex-locate-bibliography-files):
+       Accept options for bibliography commands.
        * textmodes/reftex-vars.el (reftex-bibliography-commands):
        Add addbibresource.  Basic Biblatex support.
 
 2013-04-19  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        New faster Imenu implementation (bug#14058).
-       * progmodes/python.el:
-       (python-imenu-prev-index-position):
+       * progmodes/python.el (python-imenu-prev-index-position)
        (python-imenu-format-item-label-function)
        (python-imenu-format-parent-item-label-function)
        (python-imenu-format-parent-item-jump-label-function):
index a1cd6d19ce87885513393052f11e72915c50ff66..eba63666ddbe5a911194e0cd8f81034d0990a547 100644 (file)
@@ -70,17 +70,6 @@ AUTOGENEL = loaddefs.el \
        cedet/srecode/loaddefs.el \
        org/org-loaddefs.el
 
-# Versioned files that are the value of someone's `generated-autoload-file'.
-# Note that update_loaddefs parses this.
-AUTOGEN_VCS = \
-       ps-print.el \
-       emulation/tpu-edt.el \
-       mail/rmail.el \
-       dired.el \
-       ibuffer.el \
-       htmlfontify.el \
-       emacs-lisp/eieio.el
-
 # Value of max-lisp-eval-depth when compiling initially.
 # During bootstrapping the byte-compiler is run interpreted when compiling
 # itself, and uses more stack than usual.
@@ -106,6 +95,9 @@ COMPILE_FIRST = \
        $(lisp)/emacs-lisp/bytecomp.elc \
        $(lisp)/emacs-lisp/autoload.elc
 
+# Prevent any settings in the user environment causing problems.
+unexport EMACSDATA EMACSDOC EMACSPATH
+
 # The actual Emacs command run in the targets below.
 # Prevent any setting of EMACSLOADPATH in user environment causing problems.
 emacs = EMACSLOADPATH= '$(EMACS)' $(EMACSOPT)
@@ -145,9 +137,7 @@ setwins_for_subdirs=for file in `find ${srcdir} -type d -print`; do \
 # we add them here to make sure they get built.
 all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el
 
-doit:
-
-.PHONY: all doit custom-deps finder-data autoloads update-subdirs
+.PHONY: all custom-deps finder-data autoloads update-subdirs
 
 # custom-deps and finder-data both used to scan _all_ the *.el files.
 # This could lead to problems in parallel builds if automatically
@@ -164,8 +154,8 @@ doit:
 # since they will never contain any useful information
 # (see finder-no-scan-regexp and custom-dependencies-no-scan-regexp).
 $(lisp)/cus-load.el:
-       $(MAKE) $(MFLAGS) custom-deps
-custom-deps: doit
+       $(MAKE) custom-deps
+custom-deps:
        $(setwins_almost); \
        echo Directories: $$wins; \
        $(emacs) -l cus-dep \
@@ -173,35 +163,45 @@ custom-deps: doit
          -f custom-make-dependencies $$wins
 
 $(lisp)/finder-inf.el:
-       $(MAKE) $(MFLAGS) finder-data
-finder-data: doit
+       $(MAKE) finder-data
+finder-data:
        $(setwins_finder); \
        echo Directories: $$wins; \
        $(emacs) -l finder \
          --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \
          -f finder-compile-keywords-make-dist $$wins
 
-# The chmod +w is to handle env var CVSREAD=1.
 # Use expand-file-name rather than $abs_scrdir so that Emacs does not
 # get confused when it compares file-names for equality.
 #
 # Note that we set no-update-autoloads in _generated_ leim files.
 # If you want to allow autoloads in such files, remove that,
 # and make this depend on leim.
-autoloads: $(LOADDEFS) doit
-       cd $(lisp) && chmod +w $(AUTOGEN_VCS)
+autoloads: $(LOADDEFS)
        $(setwins_almost); \
        echo Directories: $$wins; \
        $(emacs) -l autoload \
+           --eval '(setq autoload-ensure-writable t)' \
            --eval '(setq autoload-builtin-package-versions t)' \
            --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$(srcdir)/loaddefs.el")))' \
            -f batch-update-autoloads $$wins
+       $(MAKE) obsolete-autoloads
+
+# The obsolete/ subdirectory is normally not scanned for autoloads.
+# Sometimes we still want to autoload something from that directory,
+# eg iswitchb.
+.PHONY: obsolete-autoloads
+obsolete-autoloads: ${lisp}/obsolete/*.el
+       $(emacs) -l autoload \
+           --eval '(setq generate-autoload-cookie ";;;###obsolete-autoload")' \
+           --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$(srcdir)/loaddefs.el")))' \
+           -f batch-update-autoloads ${lisp}/obsolete
 
 # This is required by the bootstrap-emacs target in ../src/Makefile, so
 # we know that if we have an emacs executable, we also have a subdirs.el.
 $(lisp)/subdirs.el:
-       $(MAKE) $(MFLAGS) update-subdirs
-update-subdirs: doit
+       $(MAKE) update-subdirs
+update-subdirs:
        $(setwins_for_subdirs); \
        for file in $$wins; do \
           $(srcdir)/../build-aux/update-subdirs $$file; \
@@ -223,7 +223,8 @@ bzr-update: compile finder-data custom-deps
 # Update the AUTHORS file.
 
 update-authors:
-       $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir)
+       $(emacs) -L "$(top_srcdir)/admin" -l authors \
+         -f batch-update-authors "$(top_srcdir)/etc/AUTHORS" "$(top_srcdir)"
 
 
 ETAGS = ../lib-src/etags
@@ -292,7 +293,7 @@ compile-onefile:
 compile-first: $(COMPILE_FIRST)
 
 # In `compile-main' we could directly do
-#    ... | xargs $(MAKE) $(MFLAGS) EMACS="$(EMACS)"
+#    ... | xargs $(MAKE)
 # and it works, but it generates a lot of messages like
 #    make[2]: gnus/gnus-mlspl.elc is up to date.
 # so instead, we use "xargs echo" to split the list of file into manageable
@@ -316,7 +317,7 @@ compile-main: leim semantic compile-clean
          echo "$${el}c"; \
        done | xargs $(XARGS_LIMIT) echo) | \
        while read chunk; do \
-         $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
+         $(MAKE) compile-targets TARGETS="$$chunk"; \
        done
 
 .PHONY: compile-clean
@@ -333,7 +334,7 @@ compile-clean:
 
 .PHONY: leim semantic
 leim:
-       cd ../leim && $(MAKE) $(MFLAGS) all EMACS="$(EMACS)"
+       $(MAKE) -C ../leim all EMACS="$(EMACS)"
 
 # FIXME.  Yuck.
 semantic:
@@ -341,23 +342,21 @@ semantic:
          .*) EMACS="../${EMACS}" ;; \
           *) EMACS="${EMACS}" ;; \
        esac; \
-       cd ../admin/grammars && $(MAKE) $(MFLAGS) all EMACS="$${EMACS}"
+       $(MAKE) -C ../admin/grammars all EMACS="$${EMACS}"
 
 # Compile all Lisp files, but don't recompile those that are up to
 # date.  Some .el files don't get compiled because they set the
 # local variable no-byte-compile.
 # Calling make recursively because suffix rule cannot have prerequisites.
-# Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those
-# sub-makes that run rules that use it, for the sake of some non-GNU makes.
 compile: $(LOADDEFS) autoloads compile-first
-       $(MAKE) $(MFLAGS) compile-main EMACS="$(EMACS)"
+       $(MAKE) compile-main
 
 # Compile all Lisp files.  This is like `compile' but compiles files
 # unconditionally.  Some files don't actually get compiled because they
 # set the local variable no-byte-compile.
-compile-always: doit
+compile-always:
        cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
-       $(MAKE) $(MFLAGS) compile EMACS="$(EMACS)"
+       $(MAKE) compile
 
 .PHONY: backup-compiled-files compile-after-backup
 
@@ -388,7 +387,7 @@ compile-after-backup: backup-compiled-files compile-always
 # There is no reason to use this rule unless you only have a single
 # core and CPU time is an issue.
 .PHONY: compile-one-process
-compile-one-process: doit $(LOADDEFS) compile-first $(lisp)/progmodes/cc-mode.elc
+compile-one-process: $(LOADDEFS) compile-first $(lisp)/progmodes/cc-mode.elc
        $(emacs) $(BYTE_COMPILE_FLAGS) \
            --eval "(batch-byte-recompile-directory 0)" $(lisp)
 
@@ -416,7 +415,6 @@ $(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(MH_E_DIR)
 
 # Update TRAMP internal autoloads. Maybe we could move tramp*.el into
@@ -434,7 +432,6 @@ $(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(TRAMP_DIR)
 
 CAL_DIR = $(lisp)/calendar
@@ -456,21 +453,18 @@ $(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(CAL_DIR)
 
 $(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(CAL_DIR)
 
 $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(CAL_DIR)
 
 .PHONY: bootstrap-clean distclean maintainer-clean
@@ -509,28 +503,22 @@ $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\
  $(lisp)/progmodes/cc-vars.elc: \
    $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
 
-$(lisp)/progmodes/cc-align.elc: \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-cmds.elc: \
+$(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-cmds.elc: \
    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
 
 $(lisp)/progmodes/cc-compat.elc: \
    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \
    $(lisp)/progmodes/cc-engine.elc
 
-$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \
-   $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc
+$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc
 
 $(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \
    $(lisp)/progmodes/cc-vars.elc
 
 $(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
-   $(lisp)/font-lock.elc
+   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
 
-$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \
-   $(lisp)/emacs-lisp/cl.elc
+$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc
 
 $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
@@ -540,6 +528,4 @@ $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
 $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
    $(lisp)/progmodes/cc-align.elc
 
-$(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
-
 # Makefile ends here.
index eab2ea7144fba55f4d33617f2a26d8c14962624f..7ea54a8e2b4d3fc84d6475fb4d0f8c9ebaa51394 100644 (file)
@@ -1298,8 +1298,8 @@ is greater than `bookmark-alist-modification-count'."
 
 ;;;###autoload
 (defun bookmark-write ()
-  "Write bookmarks to a file (reading the file name with the minibuffer).
-Don't use this in Lisp programs; use `bookmark-save' instead."
+  "Write bookmarks to a file (reading the file name with the minibuffer)."
+  (declare (interactive-only bookmark-save))
   (interactive)
   (bookmark-maybe-load-default-file)
   (bookmark-save t))
index 0348b95a1ef9542e84d71ae0f880517fe6c53ae0..5e9c6908f28b792e6051d6f0582a252cf457a69f 100644 (file)
@@ -1143,7 +1143,7 @@ and move point to current buffer."
     (delete-char -1)
     (bs--set-window-height)
     (bs--goto-current-buffer)
-    (font-lock-fontify-buffer)
+    (font-lock-ensure)
     (bs-apply-sort-faces)
     (set-buffer-modified-p nil)))
 
index 4bd37a4982df2455bd2c19ce4e53bfe693115800..c26b007bb96c17f81944b27686e03cc006f8d6e5 100644 (file)
         (Math-objectp a))
        ((eq (car a) 'var)
         (if (eq (car b) 'var)
-            (string-lessp (symbol-name (nth 1 a)) (symbol-name (nth 1 b)))
+            (string-lessp (nth 1 a) (nth 1 b))
           (not (Math-numberp b))))
        ((eq (car b) 'var) (Math-numberp a))
        ((eq (car a) (car b))
         (and b
              (or (null a)
                  (math-beforep (car a) (car b)))))
-       (t (string-lessp (symbol-name (car a)) (symbol-name (car b))))))
+       (t (string-lessp (car a) (car b)))))
 
 
 (defsubst math-simplify-extended (a)
index d6eb892f7fb2cf3dec56e212ae2062212bcabf96..ad7a7f4c92a3beeefcf48e6cddd37e00a6df5a10 100644 (file)
@@ -1,4 +1,4 @@
-;;; calculator.el --- a [not so] simple calculator for Emacs  -*- lexical-binding: t -*-
+;;; calculator.el --- a calculator for Emacs  -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1998, 2000-2014 Free Software Foundation, Inc.
 
 ;;     "Run the Emacs calculator." t)
 ;;   (global-set-key [(control return)] 'calculator)
 ;;
-;; Written by Eli Barzilay: Maze is Life!  eli@barzilay.org
-;;                                         http://www.barzilay.org/
+;; Written by Eli Barzilay, eli@barzilay.org
 ;;
-;; For latest version, check
-;;     http://www.barzilay.org/misc/calculator.el
-;;
-
-;;; History:
-;; I hate history.
 
 ;;;=====================================================================
 ;;; Customization:
@@ -79,7 +72,7 @@ This determines the default behavior of unary operators."
 
 (defcustom calculator-prompt "Calc=%s> "
   "The prompt used by the Emacs calculator.
-It should contain a \"%s\" somewhere that will indicate the i/o radices;
+It should contain a \"%s\" somewhere that will indicate the i/o radixes;
 this will be a two-character string as described in the documentation
 for `calculator-mode'."
   :type  'string
@@ -115,8 +108,8 @@ See `calculator-radix-grouping-mode'."
 
 (defcustom calculator-remove-zeros t
   "Non-nil value means delete all redundant zero decimal digits.
-If this value is not t, and not nil, redundant zeros are removed except
-for one and if it is nil, nothing is removed.
+If this value is not t and not nil, redundant zeros are removed except
+for one.
 Used by the `calculator-remove-zeros' function."
   :type  '(choice (const t) (const leave-decimal) (const nil))
   :group 'calculator)
@@ -136,23 +129,27 @@ should be able to handle special symbol arguments, currently `left' and
 associated with the displayer function (for example to change the number
 of digits displayed).
 
-An exception to the above is the case of the list (std C) where C is a
-character, in this case the `calculator-standard-displayer' function
-will be used with this character for a format string."
-  :type '(choice (function) (string) (list (const std) character) (sexp))
+An exception to the above is the case of the list (std C [G]) where C is
+a character and G is an optional boolean, in this case the
+`calculator-standard-displayer' function will be used with these as
+arguments."
+  :type '(choice (function) (string) (sexp)
+                 (list (const std) character)
+                 (list (const std) character boolean))
   :group 'calculator)
 
 (defcustom calculator-displayers
   '(((std ?n) "Standard display, decimal point or scientific")
     (calculator-eng-display "Eng display")
-    ((std ?f) "Standard display, decimal point")
+    ((std ?f t) "Standard display, decimal point with grouping")
     ((std ?e) "Standard display, scientific")
     ("%S"     "Emacs printer"))
   "A list of displayers.
 Each element is a list of a displayer and a description string.  The
-first element is the one which is currently used, this is for the display
-of result values not values in expressions.  A displayer specification
-is the same as the values that can be stored in `calculator-displayer'.
+first element is the one which is currently used, this is for the
+display of result values not values in expressions.  A displayer
+specification is the same as the values that can be stored in
+`calculator-displayer'.
 
 `calculator-rotate-displayer' rotates this list."
   :type  'sexp
@@ -182,7 +179,7 @@ Otherwise show as a negative number."
 (defcustom calculator-mode-hook nil
   "List of hook functions for `calculator-mode' to run.
 Note: if `calculator-electric-mode' is on, then this hook will get
-activated in the minibuffer - in that case it should not do much more
+activated in the minibuffer -- in that case it should not do much more
 than local key settings and other effects that will change things
 outside the scope of calculator related code."
   :type  'hook
@@ -224,15 +221,14 @@ Examples:
           (\"tF\" mt-to-ft (/ X 0.3048)         1)
           (\"tM\" ft-to-mt (* X 0.3048)         1)))
 
-* Using a function-like form is very simple, X for an argument (Y the
-  second in case of a binary operator), TX is a truncated version of X
-  and F does a recursive call, Here is a [very inefficient] Fibonacci
-  number calculation:
+* Using a function-like form is very simple: use `X' for the argument
+  (`Y' for the second in case of a binary operator), `TX' is a truncated
+  version of `X' and `F' for a recursive call.  Here is a [very
+  inefficient] Fibonacci number calculation:
 
   (add-to-list 'calculator-user-operators
-               '(\"F\" fib (if (<= TX 1)
-                         1
-                         (+ (F (- TX 1)) (F (- TX 2)))) 0))
+               '(\"F\" fib
+                 (if (<= TX 1) 1 (+ (F (- TX 1)) (F (- TX 2))))))
 
   Note that this will be either postfix or prefix, according to
   `calculator-unary-style'."
@@ -248,7 +244,7 @@ Examples:
 ;;; Variables
 
 (defvar calculator-initial-operators
-  '(;; "+"/"-" have keybindings of themselves, not calculator-ops
+  '(;; "+"/"-" have keybindings of their own, not calculator-ops
     ("=" =     identity        1 -1)
     (nobind "+" +  +           2  4)
     (nobind "-" -  -           2  4)
@@ -303,26 +299,27 @@ user-defined operators, use `calculator-user-operators' instead.")
    versions), `DX' (converted to radians if degrees mode is on), `D'
    (function for converting radians to degrees if deg mode is on), `L'
    (list of saved values), `F' (function for recursive iteration calls)
-   and evaluates to the function value - these variables are capital;
+   and evaluates to the function value -- these variables are capital;
 
 4. The function's arity, optional, one of: 2 => binary, -1 => prefix
-   unary, +1 => postfix unary, 0 => a 0-arg operator func, non-number =>
-   postfix/prefix as determined by `calculator-unary-style' (the
-   default);
+   unary, +1 => postfix unary, 0 => a 0-arg operator func (note that
+   using such a function replaces the currently entered number, if any),
+   non-number (the default) => postfix or prefix as determined by
+   `calculator-unary-style';
 
-5. The function's precedence - should be in the range of 1 (lowest) to
+5. The function's precedence -- should be in the range of 1 (lowest) to
    9 (highest) (optional, defaults to 1);
 
 It it possible have a unary prefix version of a binary operator if it
 comes later in this list.  If the list begins with the symbol 'nobind,
-then no key binding will take place - this is only useful for predefined
+then no key binding will take place -- this is only useful for predefined
 keys.
 
 Use `calculator-user-operators' to add operators to this list, see its
 documentation for an example.")
 
 (defvar calculator-stack nil
-  "Stack contents - operations and operands.")
+  "Stack contents -- operations and operands.")
 
 (defvar calculator-curnum nil
   "Current number being entered (as a string).")
@@ -427,9 +424,9 @@ Used for repeating operations in calculator-repR/L.")
              (calculator-backspace     [backspace])
              )))
       (while p
-        ;; reverse the keys so first defs come last - makes the more
-        ;; sensible bindings visible in the menu
-        (let ((func (car (car p))) (keys (reverse (cdr (car p)))))
+        ;; reverse the keys so earlier definitions come last -- makes
+        ;; the more sensible bindings visible in the menu
+        (let ((func (caar p)) (keys (reverse (cdar p))))
           (while keys
             (define-key map (car keys) func)
             (setq keys (cdr keys))))
@@ -441,7 +438,7 @@ Used for repeating operations in calculator-repR/L.")
     ;; make C-h work in text-mode
     (or window-system (define-key map [?\C-h] 'calculator-backspace))
     ;; set up a menu
-    (if (and calculator-use-menu (not (boundp 'calculator-menu)))
+    (when (and calculator-use-menu (not (boundp 'calculator-menu)))
       (let ((radix-selectors
              (mapcar (lambda (x)
                        `([,(nth 0 x)
@@ -580,7 +577,7 @@ Used for repeating operations in calculator-repR/L.")
   "A [not so] simple calculator for Emacs.
 
 This calculator is used in the same way as other popular calculators
-like xcalc or calc.exe - but using an Emacs interface.
+like xcalc or calc.exe -- but using an Emacs interface.
 
 Expressions are entered using normal infix notation, parens are used as
 normal.  Unary functions are usually postfix, but some depends on the
@@ -589,8 +586,7 @@ specified, then it is fixed, otherwise it depends on this variable).
 `+' and `-' can be used as either binary operators or prefix unary
 operators.  Numbers can be entered with exponential notation using `e',
 except when using a non-decimal radix mode for input (in this case `e'
-will be the hexadecimal digit).  If the result of a calculation is too
-large (out of range for Emacs), the value of \"inf\" is returned.
+will be the hexadecimal digit).
 
 Here are the editing keys:
 * `RET' `='      evaluate the current expression
@@ -609,8 +605,8 @@ These operators are pre-defined:
 * `_' `;'         postfix unary negation and reciprocal
 * `^' `L'         binary operators for x^y and log(x) in base y
 * `Q' `!'         unary square root and factorial
-* `S' `C' `T'     unary trigonometric operators - sin, cos and tan
-* `|' `#' `&' `~' bitwise operators - or, xor, and, not
+* `S' `C' `T'     unary trigonometric operators: sin, cos and tan
+* `|' `#' `&' `~' bitwise operators: or, xor, and, not
 
 The trigonometric functions can be inverted if prefixed with an `I', see
 below for the way to use degrees instead of the default radians.
@@ -636,9 +632,9 @@ The prompt indicates the current modes:
 
 Also, the quote key can be used to switch display modes for decimal
 numbers (double-quote rotates back), and the two brace characters
-\(\"{\" and \"}\" change display parameters that these displayers use (if
-they handle such).  If output is using any radix mode, then these keys
-toggle digit grouping mode and the chunk size.
+\(\"{\" and \"}\" change display parameters that these displayers use,
+if they handle such).  If output is using any radix mode, then these
+keys toggle digit grouping mode and the chunk size.
 
 Values can be saved for future reference in either a list of saved
 values, or in registers.
@@ -680,19 +676,21 @@ more information.
   "Run the Emacs calculator.
 See the documentation for `calculator-mode' for more information."
   (interactive)
-  (if calculator-restart-other-mode
+  (when calculator-restart-other-mode
     (setq calculator-electric-mode (not calculator-electric-mode)))
-  (if calculator-initial-operators
-    (progn (calculator-add-operators calculator-initial-operators)
-           (setq calculator-initial-operators nil)
-           ;; don't change this since it is a customization variable,
-           ;; its set function will add any new operators
-           (calculator-add-operators calculator-user-operators)))
+  (when calculator-initial-operators
+    (calculator-add-operators calculator-initial-operators)
+    (setq calculator-initial-operators nil)
+    ;; don't change this since it is a customization variable,
+    ;; its set function will add any new operators
+    (calculator-add-operators calculator-user-operators))
   (setq calculator-buffer (get-buffer-create "*calculator*"))
   (if calculator-electric-mode
     (save-window-excursion
-      (progn (require 'electric) (message nil)) ; hide load message
-      (let (old-g-map old-l-map (echo-keystrokes 0)
+      (require 'electric) (message nil) ; hide load message
+      (let (old-g-map old-l-map
+            (old-buf (window-buffer (minibuffer-window)))
+            (echo-keystrokes 0)
             (garbage-collection-messages nil)) ; no gc msg when electric
         (set-window-buffer (minibuffer-window) calculator-buffer)
         (select-window (minibuffer-window))
@@ -712,8 +710,8 @@ See the documentation for `calculator-mode' for more information."
                (lambda () 'noprompt)
                nil
                (lambda (_x _y) (calculator-update-display))))
-          (and calculator-buffer
-               (catch 'calculator-done (calculator-quit)))
+          (set-window-buffer (minibuffer-window) old-buf)
+          (kill-buffer calculator-buffer)
           (use-local-map old-l-map)
           (use-global-map old-g-map))))
     (progn
@@ -722,45 +720,8 @@ See the documentation for `calculator-mode' for more information."
          (let ((window-min-height 2))
            ;; maybe leave two lines for our window because of the
            ;; normal `raised' mode line
-           (select-window
-            (split-window-below
-             ;; If the mode line might interfere with the calculator
-             ;; buffer, use 3 lines instead.
-             (if (and (fboundp 'face-attr-construct)
-                      (let* ((dh (plist-get (face-attr-construct 'default) :height))
-                             (mf (face-attr-construct 'mode-line))
-                             (mh (plist-get mf :height)))
-                        ;; If the mode line is shorter than the default,
-                        ;; stick with 2 lines.  (It may be necessary to
-                        ;; check how much shorter.)
-                        (and
-                         (not
-                          (or (and (integerp dh)
-                                   (integerp mh)
-                                   (< mh dh))
-                              (and (numberp mh)
-                                   (not (integerp mh))
-                                   (< mh 1))))
-                         (or
-                          ;; If the mode line is taller than the default,
-                          ;; use 3 lines.
-                          (and (integerp dh)
-                               (integerp mh)
-                               (> mh dh))
-                          (and (numberp mh)
-                               (not (integerp mh))
-                               (> mh 1))
-                          ;; If the mode line has a box with non-negative line-width,
-                          ;; use 3 lines.
-                          (let* ((bx (plist-get mf :box))
-                                 (lh (plist-get bx :line-width)))
-                            (and bx
-                                 (or
-                                  (not lh)
-                                  (> lh 0))))
-                          ;; If the mode line has an overline, use 3 lines.
-                          (plist-get (face-attr-construct 'mode-line) :overline)))))
-               -3 -2)))
+           (select-window (split-window-below
+                           (if (calculator-need-3-lines) -3 -2)))
            (switch-to-buffer calculator-buffer)))
         ((not (eq (current-buffer) calculator-buffer))
          (select-window (get-buffer-window calculator-buffer))))
@@ -768,24 +729,46 @@ See the documentation for `calculator-mode' for more information."
       (setq buffer-read-only t)
       (calculator-reset)
       (message "Hit `?' For a quick help screen.")))
-  (if (and calculator-restart-other-mode calculator-electric-mode)
+  (when (and calculator-restart-other-mode calculator-electric-mode)
     (calculator)))
 
+(defun calculator-need-3-lines ()
+  ;; If the mode line might interfere with the calculator buffer, use 3
+  ;; lines instead.
+  (let* ((dh (face-attribute 'default :height))
+         (mh (face-attribute 'mode-line :height)))
+    ;; if the mode line is shorter than the default, stick with 2 lines
+    ;; (it may be necessary to check how much shorter)
+    (and (not (or (and (integerp dh) (integerp mh) (< mh dh))
+                  (and (numberp mh) (not (integerp mh)) (< mh 1))))
+         (or ;; if the mode line is taller than the default, use 3 lines
+             (and (integerp dh) (integerp mh) (> mh dh))
+             (and (numberp mh) (not (integerp mh)) (> mh 1))
+             ;; if the mode line has a box with non-negative line-width,
+             ;; use 3 lines
+             (let* ((bx (face-attribute 'mode-line :box))
+                    (lh (plist-get bx :line-width)))
+               (and bx (or (not lh) (> lh 0))))
+             ;; if the mode line has an overline, use 3 lines
+             (not (memq (face-attribute 'mode-line :overline)
+                        '(nil unspecified)))))))
+
 (defun calculator-message (string &rest arguments)
-  "Same as `message', but special handle of electric mode."
+  "Same as `message', but also handle electric mode."
   (apply 'message string arguments)
-  (if calculator-electric-mode
-    (progn (sit-for 1) (message nil))))
+  (when calculator-electric-mode (sit-for 1) (message nil)))
 
 ;;;---------------------------------------------------------------------
 ;;; Operators
 
 (defun calculator-op-arity (op)
-  "Return OP's arity, 2, +1 or -1."
-  (let ((arity (or (nth 3 op) 'x)))
-    (if (numberp arity)
-      arity
-      (if (eq calculator-unary-style 'postfix) +1 -1))))
+  "Return OP's arity.
+Current results are one of 2 (binary), +1 (postfix), -1 (prefix), or
+0 (nullary)."
+  (let ((arity (nth 3 op)))
+    (cond ((numberp arity)                      arity)
+          ((eq calculator-unary-style 'postfix) +1)
+          (t                                    -1))))
 
 (defun calculator-op-prec (op)
   "Return OP's precedence for reducing when inserting into the stack.
@@ -798,8 +781,8 @@ Adds MORE-OPS to `calculator-operator', called initially to handle
 `calculator-initial-operators' and `calculator-user-operators'."
   (let ((added-ops nil))
     (while more-ops
-      (or (eq (car (car more-ops)) 'nobind)
-          (let ((i -1) (key (car (car more-ops))))
+      (or (eq (caar more-ops) 'nobind)
+          (let ((i -1) (key (caar more-ops)))
             ;; make sure the key is undefined, so it's easy to define
             ;; prefix keys
             (while (< (setq i (1+ i)) (length key))
@@ -811,8 +794,8 @@ Adds MORE-OPS to `calculator-operator', called initially to handle
                       calculator-mode-map (substring key 0 (1+ i)) nil)
                     (setq i (length key)))))
             (define-key calculator-mode-map key 'calculator-op)))
-      (setq added-ops (cons (if (eq (car (car more-ops)) 'nobind)
-                              (cdr (car more-ops))
+      (setq added-ops (cons (if (eq (caar more-ops) 'nobind)
+                              (cdar more-ops)
                               (car more-ops))
                             added-ops))
       (setq more-ops (cdr more-ops)))
@@ -833,50 +816,37 @@ Adds MORE-OPS to `calculator-operator', called initially to handle
   (setq calculator-restart-other-mode nil)
   (calculator-update-display))
 
-(defun calculator-get-prompt ()
+(defun calculator-get-display ()
   "Return a string to display.
-The string is set not to exceed the screen width."
-  (let* ((calculator-prompt
-          (format calculator-prompt
+The result should not exceed the screen width."
+  (let* ((in-r  (and calculator-input-radix
+                     (char-to-string
+                      (car (rassq calculator-input-radix
+                                  calculator-char-radix)))))
+         (out-r (and calculator-output-radix
+                     (char-to-string
+                      (car (rassq calculator-output-radix
+                                  calculator-char-radix)))))
+         (prompt (format calculator-prompt
+                         (cond ((or in-r out-r)
+                                (concat (or in-r "=")
+                                        (if (equal in-r out-r) "="
+                                            (or out-r "="))))
+                               (calculator-deg "D=")
+                               (t "=="))))
+         (expr
+          (concat (cdr calculator-stack-display)
                   (cond
-                    ((or calculator-output-radix calculator-input-radix)
-                     (if (eq calculator-output-radix
-                             calculator-input-radix)
-                       (concat
-                        (char-to-string
-                         (car (rassq calculator-output-radix
-                                     calculator-char-radix)))
-                        "=")
-                       (concat
-                        (if calculator-input-radix
-                          (char-to-string
-                           (car (rassq calculator-input-radix
-                                       calculator-char-radix)))
-                          "=")
-                        (char-to-string
-                         (car (rassq calculator-output-radix
-                                     calculator-char-radix))))))
-                    (calculator-deg "D=")
-                    (t "=="))))
-         (prompt
-          (concat calculator-prompt
-                  (cdr calculator-stack-display)
-                  (cond (calculator-curnum
-                         ;; number being typed
-                         (concat calculator-curnum "_"))
-                        ((and (= 1 (length calculator-stack))
-                              calculator-display-fragile)
-                         ;; only the result is shown, next number will
-                         ;; restart
-                         nil)
-                        (t
-                         ;; waiting for a number or an operator
-                         "?"))))
-         (trim (- (length prompt) (1- (window-width)))))
-    (if (<= trim 0)
-      prompt
-      (concat calculator-prompt
-              (substring prompt (+ trim (length calculator-prompt)))))))
+                    ;; entering a number
+                    (calculator-curnum (concat calculator-curnum "_"))
+                    ;; showing a result
+                    ((and (= 1 (length calculator-stack))
+                          calculator-display-fragile)
+                     nil)
+                    ;; waiting for a number or an operator
+                    (t "?"))))
+         (trim (+ (length expr) (length prompt) 1 (- (window-width)))))
+    (concat prompt (if (<= trim 0) expr (substring expr trim)))))
 
 (defun calculator-string-to-number (str)
   "Convert the given STR to a number, according to the value of
@@ -902,7 +872,7 @@ The string is set not to exceed the screen width."
                      "Warning: Ignoring bad input character `%c'." ch)
                     (sit-for 1)
                     value))))
-        (if (if (< new-value 0) (> value 0) (< value 0))
+        (when (if (< new-value 0) (> value 0) (< value 0))
           (calculator-message "Warning: Overflow in input."))
         (setq value new-value))
       value)
@@ -916,9 +886,12 @@ The string is set not to exceed the screen width."
                 ((stringp str) (concat str ".0"))
                 (t "0.0"))))))
 
-(defun calculator-curnum-value ()
-  "Get the numeric value of the displayed number string as a float."
-  (calculator-string-to-number calculator-curnum))
+(defun calculator-push-curnum ()
+  "Push the numeric value of the displayed number to the stack."
+  (when calculator-curnum
+    (push (calculator-string-to-number calculator-curnum)
+          calculator-stack)
+    (setq calculator-curnum nil)))
 
 (defun calculator-rotate-displayer (&optional new-disp)
   "Switch to the next displayer on the `calculator-displayers' list.
@@ -956,7 +929,7 @@ If radix output mode is active, toggle digit grouping."
   (calculator-rotate-displayer (car (last calculator-displayers))))
 
 (defun calculator-displayer-prev ()
-  "Send the current displayer function a 'left argument.
+  "Send the current displayer function a `left' argument.
 This is used to modify display arguments (if the current displayer
 function supports this).
 If radix output mode is active, increase the grouping size."
@@ -967,13 +940,12 @@ If radix output mode is active, increase the grouping size."
            (calculator-enter))
     (and (car calculator-displayers)
          (let ((disp (caar calculator-displayers)))
-           (cond
-             ((symbolp disp) (funcall disp 'left))
-             ((and (consp disp) (eq 'std (car disp)))
-              (calculator-standard-displayer 'left (cadr disp))))))))
+           (cond ((symbolp disp) (funcall disp 'left))
+                 ((and (consp disp) (eq 'std (car disp)))
+                  (calculator-standard-displayer 'left)))))))
 
 (defun calculator-displayer-next ()
-  "Send the current displayer function a 'right argument.
+  "Send the current displayer function a `right' argument.
 This is used to modify display arguments (if the current displayer
 function supports this).
 If radix output mode is active, decrease the grouping size."
@@ -984,44 +956,51 @@ If radix output mode is active, decrease the grouping size."
            (calculator-enter))
     (and (car calculator-displayers)
          (let ((disp (caar calculator-displayers)))
-           (cond
-             ((symbolp disp) (funcall disp 'right))
-             ((and (consp disp) (eq 'std (car disp)))
-              (calculator-standard-displayer 'right (cadr disp))))))))
+           (cond ((symbolp disp) (funcall disp 'right))
+                 ((and (consp disp) (eq 'std (car disp)))
+                  (calculator-standard-displayer 'right)))))))
 
 (defun calculator-remove-zeros (numstr)
   "Get a number string NUMSTR and remove unnecessary zeros.
 The behavior of this function is controlled by
 `calculator-remove-zeros'."
-  (cond ((and (eq calculator-remove-zeros t)
-              (string-match "\\.0+\\([eE][+-]?[0-9]*\\)?$" numstr))
-         ;; remove all redundant zeros leaving an integer
-         (if (match-beginning 1)
-           (concat (substring numstr 0 (match-beginning 0))
-                   (match-string 1 numstr))
-           (substring numstr 0 (match-beginning 0))))
-        ((and calculator-remove-zeros
-              (string-match
-               "\\..\\([0-9]*[1-9]\\)?\\(0+\\)\\([eE][+-]?[0-9]*\\)?$"
-               numstr))
-         ;; remove zeros, except for first after the "."
-         (if (match-beginning 3)
-           (concat (substring numstr 0 (match-beginning 2))
-                   (match-string 3 numstr))
-           (substring numstr 0 (match-beginning 2))))
-        (t numstr)))
-
-(defun calculator-standard-displayer (num char)
+  (let* ((s (if (not (eq calculator-remove-zeros t)) numstr
+                ;; remove all redundant zeros leaving an integer
+                (replace-regexp-in-string
+                 "\\.0+\\([eE].*\\)?$" "\\1" numstr)))
+         (s (if (not calculator-remove-zeros) s
+                ;; remove zeros, except for first after the "."
+                (replace-regexp-in-string
+                 "\\(\\..[0-9]*?\\)0+\\([eE].*\\)?$" "\\1\\2" s))))
+    s))
+
+(defun calculator-groupize-number (str n sep &optional fromleft)
+  "Return the input string STR with occurrences of SEP that separate
+every N characters starting from the right, or from the left if
+FROMLEFT is true."
+  (let* ((len (length str)) (i (/ len n)) (j (% len n))
+         (r (if (or (not fromleft) (= j 0)) '()
+                (list (substring str (- len j))))))
+    (while (> i 0)
+      (let* ((e (* i n)) (e (if fromleft e (+ e j))))
+        (push (substring str (- e n) e) r))
+      (setq i (1- i)))
+    (when (and (not fromleft) (> j 0))
+      (push (substring str 0 j) r))
+    (mapconcat 'identity r sep)))
+
+(defun calculator-standard-displayer (num &optional char group-p)
   "Standard display function, used to display NUM.
 Its behavior is determined by `calculator-number-digits' and the given
 CHAR argument (both will be used to compose a format string).  If the
 char is \"n\" then this function will choose one between %f or %e, this
 is a work around %g jumping to exponential notation too fast.
 
-The special 'left and 'right symbols will make it change the current
-number of digits displayed (`calculator-number-digits').
+It will also split digit sequences into comma-separated groups
+and/or remove redundant zeros.
 
-It will also remove redundant zeros from the result."
+The special `left' and `right' symbols will make it change the current
+number of digits displayed (`calculator-number-digits')."
   (if (symbolp num)
     (cond ((eq num 'left)
            (and (> calculator-number-digits 0)
@@ -1032,56 +1011,51 @@ It will also remove redundant zeros from the result."
            (setq calculator-number-digits
                  (1+ calculator-number-digits))
            (calculator-enter)))
-    (let ((str (if (zerop num)
-                 "0"
-                 (format
-                  (concat "%."
-                          (number-to-string calculator-number-digits)
-                          (if (eq char ?n)
-                            (let ((n (abs num)))
-                              (if (or (< n 0.001) (> n 1e8)) "e" "f"))
-                            (string char)))
-                  num))))
-      (calculator-remove-zeros str))))
+    (let* ((s (if (eq char ?n)
+                (let ((n (abs num)))
+                  (if (or (and (< 0 n) (< n 0.001)) (< 1e8 n)) ?e ?f))
+                char))
+           (s (format "%%.%s%c" calculator-number-digits s))
+           (s (calculator-remove-zeros (format s num)))
+           (s (if (or (not group-p) (string-match-p "[eE]" s)) s
+                  (replace-regexp-in-string
+                   "\\([0-9]+\\)\\(?:\\..*\\|$\\)"
+                   (lambda (_) (calculator-groupize-number
+                                (match-string 1 s) 3 ","))
+                   s nil nil 1))))
+      s)))
 
 (defun calculator-eng-display (num)
   "Display NUM in engineering notation.
 The number of decimal digits used is controlled by
 `calculator-number-digits', so to change it at runtime you have to use
-the 'left or 'right when one of the standard modes is used."
+the `left' or `right' when one of the standard modes is used."
   (if (symbolp num)
     (cond ((eq num 'left)
            (setq calculator-eng-extra
-                 (if calculator-eng-extra
-                   (1+ calculator-eng-extra)
-                   1))
+                 (if calculator-eng-extra (1+ calculator-eng-extra) 1))
            (let ((calculator-eng-tmp-show t)) (calculator-enter)))
           ((eq num 'right)
            (setq calculator-eng-extra
-                 (if calculator-eng-extra
-                   (1- calculator-eng-extra)
-                   -1))
+                 (if calculator-eng-extra (1- calculator-eng-extra) -1))
            (let ((calculator-eng-tmp-show t)) (calculator-enter))))
     (let ((exp 0))
-      (and (not (= 0 num))
-           (progn
-             (while (< (abs num) 1.0)
-               (setq num (* num 1000.0)) (setq exp (- exp 3)))
-             (while (> (abs num) 999.0)
-               (setq num (/ num 1000.0)) (setq exp (+ exp 3)))
-             (and calculator-eng-tmp-show
-                  (not (= 0 calculator-eng-extra))
-                  (let ((i calculator-eng-extra))
-                    (while (> i 0)
-                      (setq num (* num 1000.0)) (setq exp (- exp 3))
-                      (setq i (1- i)))
-                    (while (< i 0)
-                      (setq num (/ num 1000.0)) (setq exp (+ exp 3))
-                      (setq i (1+ i)))))))
+      (unless (= 0 num)
+        (while (< (abs num) 1.0)
+          (setq num (* num 1000.0)) (setq exp (- exp 3)))
+        (while (> (abs num) 999.0)
+          (setq num (/ num 1000.0)) (setq exp (+ exp 3)))
+        (when (and calculator-eng-tmp-show
+                   (not (= 0 calculator-eng-extra)))
+          (let ((i calculator-eng-extra))
+            (while (> i 0)
+              (setq num (* num 1000.0)) (setq exp (- exp 3))
+              (setq i (1- i)))
+            (while (< i 0)
+              (setq num (/ num 1000.0)) (setq exp (+ exp 3))
+              (setq i (1+ i))))))
       (or calculator-eng-tmp-show (setq calculator-eng-extra nil))
-      (let ((str (format (concat "%." (number-to-string
-                                       calculator-number-digits)
-                                 "f")
+      (let ((str (format (format "%%.%sf" calculator-number-digits)
                          num)))
         (concat (let ((calculator-remove-zeros
                        ;; make sure we don't leave integers
@@ -1092,56 +1066,48 @@ the 'left or 'right when one of the standard modes is used."
 (defun calculator-number-to-string (num)
   "Convert NUM to a displayable string."
   (cond
-    ((and (numberp num) calculator-output-radix)
-     ;; print with radix - for binary I convert the octal number
-     (let ((str (format (if (eq calculator-output-radix 'hex) "%x" "%o")
-                        (calculator-truncate
-                         (if calculator-2s-complement num (abs num))))))
-       (if (eq calculator-output-radix 'bin)
-         (let ((i -1) (s ""))
-           (while (< (setq i (1+ i)) (length str))
-             (setq s
-                   (concat s
-                           (cdr (assq (aref str i)
-                                      '((?0 . "000") (?1 . "001")
-                                        (?2 . "010") (?3 . "011")
-                                        (?4 . "100") (?5 . "101")
-                                        (?6 . "110") (?7 . "111")))))))
-           (string-match "^0*\\(.+\\)" s)
-           (setq str (match-string 1 s))))
-       (if calculator-radix-grouping-mode
-         (let ((d (/ (length str) calculator-radix-grouping-digits))
-               (r (% (length str) calculator-radix-grouping-digits)))
-           (while (>= (setq d (1- d)) (if (zerop r) 1 0))
-             (let ((i (+ r (* d calculator-radix-grouping-digits))))
-               (setq str (concat (substring str 0 i)
-                                 calculator-radix-grouping-separator
-                                 (substring str i)))))))
-       (upcase
-        (if (and (not calculator-2s-complement) (< num 0))
-          (concat "-" str)
-          str))))
-    ((and (numberp num) calculator-displayer)
-     (cond
-       ((stringp calculator-displayer)
-        (format calculator-displayer num))
-       ((symbolp calculator-displayer)
-        (funcall calculator-displayer num))
-       ((eq 'std (car-safe calculator-displayer))
-        (calculator-standard-displayer num (cadr calculator-displayer)))
-       ((listp calculator-displayer)
-        (eval calculator-displayer `((num. ,num))))
-       (t (prin1-to-string num t))))
-    ;; operators are printed here
-    (t (prin1-to-string (nth 1 num) t))))
+    ;; operators are printed here, the rest is for numbers
+    ((not (numberp num)) (prin1-to-string (nth 1 num) t))
+    ;; %f/%e handle these, but avoid them in radix or in user displayers
+    ((and (floatp num) (isnan num)) "NaN")
+    ((<= 1.0e+INF num) "Inf")
+    ((<= num -1.0e+INF) "-Inf")
+    (calculator-output-radix
+     ;; print with radix -- for binary, convert the octal number
+     (let* ((fmt (if (eq calculator-output-radix 'hex) "%x" "%o"))
+            (str (if calculator-2s-complement num (abs num)))
+            (str (format fmt (calculator-truncate str)))
+            (bins '((?0 "000") (?1 "001") (?2 "010") (?3 "011")
+                    (?4 "100") (?5 "101") (?6 "110") (?7 "111")))
+            (str (if (not (eq calculator-output-radix 'bin)) str
+                     (replace-regexp-in-string
+                      "^0+\\(.\\)" "\\1"
+                      (apply 'concat (mapcar (lambda (c)
+                                               (cadr (assq c bins)))
+                                     str)))))
+            (str (if (not calculator-radix-grouping-mode) str
+                     (calculator-groupize-number
+                      str calculator-radix-grouping-digits
+                      calculator-radix-grouping-separator))))
+       (upcase (if (or calculator-2s-complement (>= num 0)) str
+                   (concat "-" str)))))
+    ((stringp calculator-displayer) (format calculator-displayer num))
+    ((symbolp calculator-displayer) (funcall calculator-displayer num))
+    ((eq 'std (car-safe calculator-displayer))
+     (apply 'calculator-standard-displayer
+            num (cdr calculator-displayer)))
+    ((listp calculator-displayer)
+     (eval `(let ((num ',num)) ,calculator-displayer) t))
+    ;; nil (or bad) displayer
+    (t (prin1-to-string num t))))
 
 (defun calculator-update-display (&optional force)
   "Update the display.
 If optional argument FORCE is non-nil, don't use the cached string."
   (set-buffer calculator-buffer)
   ;; update calculator-stack-display
-  (if (or force
-          (not (eq (car calculator-stack-display) calculator-stack)))
+  (when (or force (not (eq (car calculator-stack-display)
+                           calculator-stack)))
     (setq calculator-stack-display
           (cons calculator-stack
                 (if calculator-stack
@@ -1170,165 +1136,99 @@ If optional argument FORCE is non-nil, don't use the cached string."
                   ""))))
   (let ((inhibit-read-only t))
     (erase-buffer)
-    (insert (calculator-get-prompt)))
+    (insert (calculator-get-display)))
   (set-buffer-modified-p nil)
-  (if calculator-display-fragile
-    (goto-char (1+ (length calculator-prompt)))
-    (goto-char (1- (point)))))
+  (goto-char (if calculator-display-fragile
+               (1+ (length calculator-prompt))
+               (1- (point)))))
 
 ;;;---------------------------------------------------------------------
 ;;; Stack computations
 
+(defun calculator-reduce-stack-once (prec)
+  "Worker for `calculator-reduce-stack'."
+  (cl-flet ((check (ar op)        (and (listp op)
+                                       (<= prec (calculator-op-prec op))
+                                       (= ar (calculator-op-arity op))))
+            (call (op &rest args) (apply 'calculator-funcall
+                                         (nth 2 op) args)))
+    (pcase calculator-stack
+      ;; reduce "... ( x )" --> "... x"
+      (`((,_ \) . ,_) ,(and X (pred numberp)) (,_ \( . ,_) . ,rest)
+       (cons X rest))
+      ;; reduce "... x op y" --> "... r", r is the result
+      (`(,(and Y (pred numberp))
+         ,(and O (pred (check 2)))
+         ,(and X (pred numberp))
+         . ,rest)
+       (cons (call O X Y) rest))
+      ;; reduce "... op x" --> "... r" for prefix op
+      (`(,(and X (pred numberp)) ,(and O (pred (check -1))) . ,rest)
+       (cons (call O X) rest))
+      ;; reduce "... x op" --> "... r" for postfix op
+      (`(,(and O (pred (check +1))) ,(and X (pred numberp)) . ,rest)
+       (cons (call O X) rest))
+      ;; reduce "... op" --> "... r" for 0-ary op
+      (`(,(and O (pred (check 0))) . ,rest)
+       (cons (call O) rest))
+      ;; reduce "... y x" --> "... x"
+      ;; (needed for 0-ary ops: replace current number with result)
+      (`(,(and X (pred numberp)) ,(and _Y (pred numberp)) . ,rest)
+       (cons X rest))
+      (_ nil)))) ; nil = done
+
 (defun calculator-reduce-stack (prec)
-  "Reduce the stack using top operator.
-PREC is a precedence - reduce everything with higher precedence."
-  (while
-      (cond
-        ((and (cdr (cdr calculator-stack))         ; have three values
-              (consp   (nth 0 calculator-stack))   ; two operators & num
-              (numberp (nth 1 calculator-stack))
-              (consp   (nth 2 calculator-stack))
-              (eq '\) (nth 1 (nth 0 calculator-stack)))
-              (eq '\( (nth 1 (nth 2 calculator-stack))))
-         ;; reduce "... ( x )" --> "... x"
-         (setq calculator-stack
-               (cons (nth 1 calculator-stack)
-                     (nthcdr 3 calculator-stack)))
-         ;; another iteration
-         t)
-        ((and (cdr (cdr calculator-stack))         ; have three values
-              (numberp (nth 0 calculator-stack))   ; two nums & operator
-              (consp   (nth 1 calculator-stack))
-              (numberp (nth 2 calculator-stack))
-              (= 2 (calculator-op-arity            ; binary operator
-                    (nth 1 calculator-stack)))
-              (<= prec                             ; with higher prec.
-                  (calculator-op-prec (nth 1 calculator-stack))))
-         ;; reduce "... x op y" --> "... r", r is the result
-         (setq calculator-stack
-               (cons (calculator-funcall
-                      (nth 2 (nth 1 calculator-stack))
-                      (nth 2 calculator-stack)
-                      (nth 0 calculator-stack))
-                     (nthcdr 3 calculator-stack)))
-         ;; another iteration
-         t)
-        ((and (>= (length calculator-stack) 2)     ; have two values
-              (numberp (nth 0 calculator-stack))   ; number & operator
-              (consp   (nth 1 calculator-stack))
-              (= -1 (calculator-op-arity           ; prefix-unary op
-                     (nth 1 calculator-stack)))
-              (<= prec                             ; with higher prec.
-                  (calculator-op-prec (nth 1 calculator-stack))))
-         ;; reduce "... op x" --> "... r" for prefix op
-         (setq calculator-stack
-               (cons (calculator-funcall
-                      (nth 2 (nth 1 calculator-stack))
-                      (nth 0 calculator-stack))
-                     (nthcdr 2 calculator-stack)))
-         ;; another iteration
-         t)
-        ((and (cdr calculator-stack)               ; have two values
-              (consp   (nth 0 calculator-stack))   ; operator & number
-              (numberp (nth 1 calculator-stack))
-              (= +1 (calculator-op-arity           ; postfix-unary op
-                     (nth 0 calculator-stack)))
-              (<= prec                             ; with higher prec.
-                  (calculator-op-prec (nth 0 calculator-stack))))
-         ;; reduce "... x op" --> "... r" for postfix op
-         (setq calculator-stack
-               (cons (calculator-funcall
-                      (nth 2 (nth 0 calculator-stack))
-                      (nth 1 calculator-stack))
-                     (nthcdr 2 calculator-stack)))
-         ;; another iteration
-         t)
-        ((and calculator-stack                     ; have one value
-              (consp (nth 0 calculator-stack))     ; an operator
-              (= 0 (calculator-op-arity            ; 0-ary op
-                    (nth 0 calculator-stack))))
-         ;; reduce "... op" --> "... r" for 0-ary op
-         (setq calculator-stack
-               (cons (calculator-funcall
-                      (nth 2 (nth 0 calculator-stack)))
-                     (nthcdr 1 calculator-stack)))
-         ;; another iteration
-         t)
-        ((and (cdr calculator-stack)               ; have two values
-              (numberp (nth 0 calculator-stack))   ; both numbers
-              (numberp (nth 1 calculator-stack)))
-         ;; get rid of redundant numbers:
-         ;;   reduce "... y x" --> "... x"
-         ;; needed for 0-ary ops that puts more values
-         (setcdr calculator-stack (cdr (cdr calculator-stack))))
-        (t ;; no more iterations
-           nil))))
+  "Reduce the stack using top operators as long as possible.
+PREC is a precedence -- reduce everything with higher precedence."
+  (let ((new nil))
+    (while (setq new (calculator-reduce-stack-once prec))
+      (setq calculator-stack new))))
 
 (defun calculator-funcall (f &optional X Y)
   "If F is a symbol, evaluate (F X Y).
 Otherwise, it should be a list, evaluate it with X, Y bound to the
 arguments."
   ;; remember binary ops for calculator-repR/L
-  (if Y (setq calculator-last-opXY (list f X Y)))
-  (condition-case nil
-      ;; there used to be code here that returns 0 if the result was
-      ;; smaller than calculator-epsilon (1e-15).  I don't think this is
-      ;; necessary now.
-      (if (symbolp f)
-          (cond ((and X Y) (funcall f X Y))
-                (X         (funcall f X))
-                (t         (funcall f)))
-        ;; f is an expression
-        (let* ((TX (calculator-truncate X))
-               (TY (and Y (calculator-truncate Y)))
-               (DX (if calculator-deg (/ (* X pi) 180) X))
-               (L  calculator-saved-list))
-          (cl-letf (((symbol-function 'F)
-                     (lambda (&optional x y) (calculator-funcall f x y)))
-                    ((symbol-function 'D)
-                     (lambda (x) (if calculator-deg (/ (* x 180) float-pi) x))))
-            (eval f `((X . ,X)
-                      (Y . ,Y)
-                      (TX . ,TX)
-                      (TY . ,TY)
-                      (DX . ,DX)
-                      (L . ,L))))))
-    (error 0)))
+  (when Y (setq calculator-last-opXY (list f X Y)))
+  (if (symbolp f)
+    (cond ((and X Y) (funcall f X Y))
+          (X         (funcall f X))
+          (t         (funcall f)))
+    ;; f is an expression
+    (let ((TX (and X (calculator-truncate X)))
+          (TY (and Y (calculator-truncate Y)))
+          (DX (if (and X calculator-deg) (/ (* X pi) 180) X))
+          (L  calculator-saved-list)
+          (fF `(calculator-funcall ',f x y))
+          (fD `(if calculator-deg (/ (* x 180) float-pi) x)))
+      (eval `(cl-flet ((F (&optional x y) ,fF) (D (x) ,fD))
+               (let ((X ,X) (Y ,Y) (DX ,DX) (TX ,TX) (TY ,TY) (L ',L))
+                 ,f))
+            t))))
 
 ;;;---------------------------------------------------------------------
 ;;; Input interaction
 
 (defun calculator-last-input (&optional keys)
   "Last char (or event or event sequence) that was read.
-Optional string argument KEYS will force using it as the keys entered."
+Use KEYS if given, otherwise use `this-command-keys'."
   (let ((inp (or keys (this-command-keys))))
     (if (or (stringp inp) (not (arrayp inp)))
       inp
-      ;; this translates kp-x to x and [tries to] create a string to
-      ;; lookup operators
-      (let* ((i -1) (converted-str (make-string (length inp) ? )) k)
-        ;; converts an array to a string the ops lookup with keypad
-        ;; input
-        (while (< (setq i (1+ i)) (length inp))
-          (setq k (aref inp i))
-          ;; if Emacs will someday have a event-key, then this would
-          ;; probably be modified anyway
-          (and (if (fboundp 'key-press-event-p) (key-press-event-p k))
-              (if (fboundp 'event-key)
-                  (and (event-key k) (setq k (event-key k)))))
-          ;; assume all symbols are translatable with an ascii-character
-          (and (symbolp k)
-               (setq k (or (get k 'ascii-character) ? )))
-          (aset converted-str i k))
-        converted-str))))
+      ;; Translates kp-x to x and [tries to] create a string to lookup
+      ;; operators; assume all symbols are translatable via
+      ;; `function-key-map'.  This is needed because we have key
+      ;; bindings for kp-* (which might be the wrong thing to do) so
+      ;; they don't get translated in `this-command-keys'.
+      (concat (mapcar (lambda (k)
+                        (if (numberp k) k (error "??bad key?? (%S)" k)))
+                      (or (lookup-key function-key-map inp) inp))))))
 
 (defun calculator-clear-fragile (&optional op)
   "Clear the fragile flag if it was set, then maybe reset all.
 OP is the operator (if any) that caused this call."
-  (if (and calculator-display-fragile
-           (or (not op)
-               (= -1 (calculator-op-arity op))
-               (= 0 (calculator-op-arity op))))
+  (when (and calculator-display-fragile
+             (or (not op) (memq (calculator-op-arity op) '(-1 0))))
     ;; reset if last calc finished, and now get a num or prefix or 0-ary
     ;; op
     (calculator-reset))
@@ -1338,53 +1238,44 @@ OP is the operator (if any) that caused this call."
   "Enter a single digit."
   (interactive)
   (let ((inp (aref (calculator-last-input) 0)))
-    (if (and (or calculator-display-fragile
-                 (not (numberp (car calculator-stack))))
-             (cond
-               ((not calculator-input-radix)     (<= inp ?9))
-               ((eq calculator-input-radix 'bin) (<= inp ?1))
-               ((eq calculator-input-radix 'oct) (<= inp ?7))
-               (t t)))
-      ;; enter digit if starting a new computation or have an op on the
-      ;; stack
-      (progn
-        (calculator-clear-fragile)
-        (let ((digit (upcase (char-to-string inp))))
-          (if (equal calculator-curnum "0")
-            (setq calculator-curnum nil))
-          (setq calculator-curnum
-                (concat (or calculator-curnum "") digit)))
-        (calculator-update-display)))))
+    (when (and (or calculator-display-fragile
+                   (not (numberp (car calculator-stack))))
+               (<= inp (pcase calculator-input-radix
+                         (`nil ?9) (`bin ?1) (`oct ?7) (_ 999))))
+      (calculator-clear-fragile)
+      (setq calculator-curnum
+            (concat (if (equal calculator-curnum "0") ""
+                        calculator-curnum)
+                    (list (upcase inp))))
+      (calculator-update-display))))
 
 (defun calculator-decimal ()
   "Enter a decimal period."
   (interactive)
-  (if (and (not calculator-input-radix)
-           (or calculator-display-fragile
-               (not (numberp (car calculator-stack))))
-           (not (and calculator-curnum
-                     (string-match-p "[.eE]" calculator-curnum))))
+  (when (and (not calculator-input-radix)
+             (or calculator-display-fragile
+                 (not (numberp (car calculator-stack))))
+             (not (and calculator-curnum
+                       (string-match-p "[.eE]" calculator-curnum))))
     ;; enter the period on the same condition as a digit, only if no
     ;; period or exponent entered yet
-    (progn
-      (calculator-clear-fragile)
-      (setq calculator-curnum (concat (or calculator-curnum "0") "."))
-      (calculator-update-display))))
+    (calculator-clear-fragile)
+    (setq calculator-curnum (concat (or calculator-curnum "0") "."))
+    (calculator-update-display)))
 
 (defun calculator-exp ()
   "Enter an `E' exponent character, or a digit in hex input mode."
   (interactive)
-  (if calculator-input-radix
-    (calculator-digit)
-    (if (and (or calculator-display-fragile
-                 (not (numberp (car calculator-stack))))
-             (not (and calculator-curnum
-                       (string-match-p "[eE]" calculator-curnum))))
-      ;; same condition as above, also no E so far
-      (progn
-        (calculator-clear-fragile)
-        (setq calculator-curnum (concat (or calculator-curnum "1") "e"))
-        (calculator-update-display)))))
+  (cond
+    (calculator-input-radix (calculator-digit))
+    ((and (or calculator-display-fragile
+              (not (numberp (car calculator-stack))))
+          (not (and calculator-curnum
+                    (string-match-p "[eE]" calculator-curnum))))
+     ;; same condition as above, also no E so far
+     (calculator-clear-fragile)
+     (setq calculator-curnum (concat (or calculator-curnum "1") "e"))
+     (calculator-update-display))))
 
 (defun calculator-op (&optional keys)
   "Enter an operator on the stack, doing all necessary reductions.
@@ -1394,42 +1285,29 @@ Optional string argument KEYS will force using it as the keys entered."
     (let* ((last-inp (calculator-last-input keys))
            (op (assoc last-inp calculator-operators)))
       (calculator-clear-fragile op)
-      (if (and calculator-curnum (/= (calculator-op-arity op) 0))
-        (setq calculator-stack
-              (cons (calculator-curnum-value) calculator-stack)))
-      (setq calculator-curnum nil)
-      (if (and (= 2 (calculator-op-arity op))
-               (not (and calculator-stack
-                         (numberp (nth 0 calculator-stack)))))
-        ;; we have a binary operator but no number - search for a prefix
-        ;; version
-        (let ((rest-ops calculator-operators))
-          (while (not (equal last-inp (car (car rest-ops))))
-            (setq rest-ops (cdr rest-ops)))
-          (setq op (assoc last-inp (cdr rest-ops)))
-          (if (not (and op (= -1 (calculator-op-arity op))))
-            ;;(error "Binary operator without a first operand")
-            (progn
-              (calculator-message
-               "Binary operator without a first operand")
-              (throw 'op-error nil)))))
+      (calculator-push-curnum)
+      (when (and (= 2 (calculator-op-arity op))
+                 (not (numberp (car calculator-stack))))
+        ;; we have a binary operator but no number -- search for a
+        ;; prefix version
+        (setq op (assoc last-inp (cdr (memq op calculator-operators))))
+        (unless (and op (= -1 (calculator-op-arity op)))
+          (calculator-message "Binary operator without a first operand")
+          (throw 'op-error nil)))
       (calculator-reduce-stack
        (cond ((eq (nth 1 op) '\() 10)
              ((eq (nth 1 op) '\)) 0)
              (t (calculator-op-prec op))))
-      (if (or (and (= -1 (calculator-op-arity op))
-                   (numberp (car calculator-stack)))
-              (and (/= (calculator-op-arity op) -1)
-                   (/= (calculator-op-arity op) 0)
-                   (not (numberp (car calculator-stack)))))
-        ;;(error "Unterminated expression")
-        (progn
-          (calculator-message "Unterminated expression")
-          (throw 'op-error nil)))
-      (setq calculator-stack (cons op calculator-stack))
+      (when (let ((hasnum (numberp (car calculator-stack))))
+              (pcase (calculator-op-arity op)
+                (-1 hasnum)
+                ((or 1 2) (not hasnum))))
+        (calculator-message "Incomplete expression")
+        (throw 'op-error nil))
+      (push op calculator-stack)
       (calculator-reduce-stack (calculator-op-prec op))
       (and (= (length calculator-stack) 1)
-           (numberp (nth 0 calculator-stack))
+           (numberp (car calculator-stack))
            ;; the display is fragile if it contains only one number
            (setq calculator-display-fragile t)
            ;; add number to the saved-list
@@ -1445,7 +1323,8 @@ Optional string argument KEYS will force using it as the keys entered."
 (defun calculator-op-or-exp ()
   "Either enter an operator or a digit.
 Used with +/- for entering them as digits in numbers like 1e-3 (there is
-no need for negative numbers since these are handled by unary operators)."
+no need for negative numbers since these are handled by unary
+operators)."
   (interactive)
   (if (and (not calculator-display-fragile)
            calculator-curnum
@@ -1459,14 +1338,11 @@ no need for negative numbers since these are handled by unary operators)."
 (defun calculator-dec/deg-mode ()
   "Set decimal mode for display & input, if decimal, toggle deg mode."
   (interactive)
-  (if calculator-curnum
-    (setq calculator-stack
-          (cons (calculator-curnum-value) calculator-stack)))
-  (setq calculator-curnum nil)
+  (calculator-push-curnum)
   (if (or calculator-input-radix calculator-output-radix)
     (progn (setq calculator-input-radix nil)
            (setq calculator-output-radix nil))
-    ;; already decimal - toggle degrees mode
+    ;; already decimal -- toggle degrees mode
     (setq calculator-deg (not calculator-deg)))
   (calculator-update-display t))
 
@@ -1481,10 +1357,7 @@ Optional string argument KEYS will force using it as the keys entered."
   "Set input radix modes.
 Optional string argument KEYS will force using it as the keys entered."
   (interactive)
-  (if calculator-curnum
-    (setq calculator-stack
-          (cons (calculator-curnum-value) calculator-stack)))
-  (setq calculator-curnum nil)
+  (calculator-push-curnum)
   (setq calculator-input-radix
         (let ((inp (calculator-last-input keys)))
           (cdr (assq (upcase (aref inp (1- (length inp))))
@@ -1495,10 +1368,7 @@ Optional string argument KEYS will force using it as the keys entered."
   "Set display radix modes.
 Optional string argument KEYS will force using it as the keys entered."
   (interactive)
-  (if calculator-curnum
-    (setq calculator-stack
-          (cons (calculator-curnum-value) calculator-stack)))
-  (setq calculator-curnum nil)
+  (calculator-push-curnum)
   (setq calculator-output-radix
         (let ((inp (calculator-last-input keys)))
           (cdr (assq (upcase (aref inp (1- (length inp))))
@@ -1524,19 +1394,18 @@ Optional string argument KEYS will force using it as the keys entered."
 (defun calculator-saved-move (n)
   "Go N elements up the list of saved values."
   (interactive)
-  (and calculator-saved-list
-       (or (null calculator-stack) calculator-display-fragile)
-       (progn
-         (setq calculator-saved-ptr
-               (max (min (+ n calculator-saved-ptr)
-                         (length calculator-saved-list))
-                    0))
-         (if (nth calculator-saved-ptr calculator-saved-list)
-           (setq calculator-stack
-                 (list (nth calculator-saved-ptr calculator-saved-list))
-                 calculator-display-fragile t)
-           (calculator-reset))
-         (calculator-update-display))))
+  (when (and calculator-saved-list
+             (or (null calculator-stack) calculator-display-fragile))
+    (setq calculator-saved-ptr
+          (max (min (+ n calculator-saved-ptr)
+                    (length calculator-saved-list))
+               0))
+    (if (nth calculator-saved-ptr calculator-saved-list)
+      (setq calculator-stack (list (nth calculator-saved-ptr
+                                        calculator-saved-list))
+            calculator-display-fragile t)
+      (calculator-reset))
+    (calculator-update-display)))
 
 (defun calculator-saved-up ()
   "Go up the list of saved values."
@@ -1583,7 +1452,7 @@ Optional string argument KEYS will force using it as the keys entered."
   (interactive)
   (setq calculator-curnum nil)
   (cond
-    ;; if the current number is from the saved-list remove it
+    ;; if the current number is from the saved-list remove it
     ((and calculator-display-fragile
           calculator-saved-list
           (= (car calculator-stack)
@@ -1592,7 +1461,7 @@ Optional string argument KEYS will force using it as the keys entered."
        (setq calculator-saved-list (cdr calculator-saved-list))
        (let ((p (nthcdr (1- calculator-saved-ptr)
                         calculator-saved-list)))
-         (setcdr p (cdr (cdr p)))
+         (setcdr p (cddr p))
          (setq calculator-saved-ptr (1- calculator-saved-ptr))))
      (if calculator-saved-list
        (setq calculator-stack
@@ -1613,15 +1482,16 @@ Optional string argument KEYS will force using it as the keys entered."
     (calculator-enter)
     ;; remove trailing spaces and an index
     (let ((s (cdr calculator-stack-display)))
-      (and s
-           (if (string-match "^\\([^ ]+\\) *\\(\\[[0-9/]+\\]\\)? *$" s)
-             (setq s (match-string 1 s)))
-           (kill-new s)))))
+      (when s
+        (kill-new (replace-regexp-in-string
+                   "^\\([^ ]+\\) *\\(\\[[0-9/]+\\]\\)? *$" "\\1" s))))))
 
-;; FIXME this should use register-read-with-preview, but it
-;; uses calculator-registers rather than register-alist.
 (defun calculator-set-register (reg)
   "Set a register value for REG."
+  ;; FIXME: this should use `register-read-with-preview', but it uses
+  ;; calculator-registers rather than `register-alist'.  (Maybe
+  ;; dynamically rebinding it will get blessed?)  Also in to
+  ;; `calculator-get-register'.
   (interactive "cRegister to store into: ")
   (let* ((as  (assq reg calculator-registers))
          (val (progn (calculator-enter) (car calculator-stack))))
@@ -1634,15 +1504,14 @@ Optional string argument KEYS will force using it as the keys entered."
 (defun calculator-put-value (val)
   "Paste VAL as if entered.
 Used by `calculator-paste' and `get-register'."
-  (if (and (numberp val)
-           ;; (not calculator-curnum)
-           (or calculator-display-fragile
-               (not (numberp (car calculator-stack)))))
-    (progn
-      (calculator-clear-fragile)
-      (setq calculator-curnum (let ((calculator-displayer "%S"))
-                                (calculator-number-to-string val)))
-      (calculator-update-display))))
+  (when (and (numberp val)
+             ;; (not calculator-curnum)
+             (or calculator-display-fragile
+                 (not (numberp (car calculator-stack)))))
+    (calculator-clear-fragile)
+    (setq calculator-curnum (let ((calculator-displayer "%S"))
+                              (calculator-number-to-string val)))
+    (calculator-update-display)))
 
 (defun calculator-paste ()
   "Paste a value from the `kill-ring'."
@@ -1662,8 +1531,6 @@ Used by `calculator-paste' and `get-register'."
                             (or (match-string 3 str) ""))))
      (ignore-errors (calculator-string-to-number str)))))
 
-;; FIXME this should use register-read-with-preview, but it
-;; uses calculator-registers rather than register-alist.
 (defun calculator-get-register (reg)
   "Get a value from a register REG."
   (interactive "cRegister to get value from: ")
@@ -1696,16 +1563,13 @@ Used by `calculator-paste' and `get-register'."
           (g-map (current-global-map))
           (win (selected-window)))
       (require 'ehelp)
-      (if calculator-electric-mode
+      (when calculator-electric-mode
         (use-global-map calculator-saved-global-map))
-      (if (or (not calculator-electric-mode)
-              ;; XEmacs has a problem with electric-describe-mode
-              (featurep 'xemacs))
-          (describe-mode)
-        (electric-describe-mode))
       (if calculator-electric-mode
-        (use-global-map g-map))
-      (select-window win) ; these are for XEmacs (also below)
+        (electric-describe-mode)
+        (describe-mode))
+      (when calculator-electric-mode (use-global-map g-map))
+      (select-window win)
       (message nil))
     (let ((one (one-window-p t))
           (win (selected-window))
@@ -1713,12 +1577,11 @@ Used by `calculator-paste' and `get-register'."
       (save-window-excursion
         (with-output-to-temp-buffer "*Help*"
           (princ (documentation 'calculator-help)))
-        (if one
-          (shrink-window-if-larger-than-buffer
-           (get-buffer-window help-buf)))
-        (message
-         "`%s' again for more help, any other key continues normally."
-         (calculator-last-input))
+        (when one (shrink-window-if-larger-than-buffer
+                   (get-buffer-window help-buf)))
+        (message "`%s' again for more help, %s."
+                 (calculator-last-input)
+                 "any other key continues normally")
         (select-window win)
         (sit-for 360))
       (select-window win))))
@@ -1731,11 +1594,12 @@ Used by `calculator-paste' and `get-register'."
   (unless calculator-electric-mode
     (ignore-errors
       (while (get-buffer-window calculator-buffer)
-       (delete-window (get-buffer-window calculator-buffer))))
-    (kill-buffer calculator-buffer))
-  (setq calculator-buffer nil)
+        (delete-window (get-buffer-window calculator-buffer)))))
+  (kill-buffer calculator-buffer)
   (message "Calculator done.")
-  (if calculator-electric-mode (throw 'calculator-done nil)))
+  (if calculator-electric-mode
+    (throw 'calculator-done nil) ; will kill the buffer
+    (setq calculator-buffer nil)))
 
 (defun calculator-save-and-quit ()
   "Quit the calculator, saving the result on the `kill-ring'."
@@ -1764,58 +1628,47 @@ To use this, apply a binary operator (evaluate it), then call this."
        (car calculator-last-opXY) (nth 1 calculator-last-opXY) x))
     x))
 
-(defun calculator-integer-p (x)
-  "Non-nil if X is equal to an integer."
-  (ignore-errors (= x (ftruncate x))))
-
 (defun calculator-expt (x y)
   "Compute X^Y, dealing with errors appropriately."
   (condition-case nil
       (expt x y)
     (domain-error 0.0e+NaN)
     (range-error
-     (cond
-      ((and (< x 1.0) (> x -1.0))
-       ;; For small x, the range error comes from large y.
-       0.0)
-      ((and (> x 0.0) (< y 0.0))
-       ;; For large positive x and negative y, the range error
-       ;; comes from large negative y.
-       0.0)
-      ((and (> x 0.0) (> y 0.0))
-       ;; For large positive x and positive y, the range error
-       ;; comes from large y.
-       1.0e+INF)
-      ;; For the rest, x must be large and negative.
-      ;; The range errors come from large integer y.
-      ((< y 0.0)
-       0.0)
-      ((eq (logand (truncate y) 1) 1)   ; expansion of cl `oddp'
-       ;; If y is odd
-       -1.0e+INF)
-      (t
-       ;;
-       1.0e+INF)))
+     (cond ((and (< x 1.0) (> x -1.0))
+            ;; For small x, the range error comes from large y.
+            0.0)
+           ((and (> x 0.0) (< y 0.0))
+            ;; For large positive x and negative y, the range error
+            ;; comes from large negative y.
+            0.0)
+           ((and (> x 0.0) (> y 0.0))
+            ;; For large positive x and positive y, the range error
+            ;; comes from large y.
+            1.0e+INF)
+           ;; For the rest, x must be large and negative.
+           ;; The range errors come from large integer y.
+           ((< y 0.0)
+            0.0)
+           ((eq (logand (truncate y) 1) 1)   ; expansion of cl `oddp'
+            ;; If y is odd
+            -1.0e+INF)
+           (t
+            ;;
+            1.0e+INF)))
     (error 0.0e+NaN)))
 
 (defun calculator-fact (x)
   "Simple factorial of X."
-  (if (and (>= x 0)
-           (calculator-integer-p x))
-      (if (= (calculator-expt (/ x 3.0) x) 1.0e+INF)
-          1.0e+INF
-        (let ((r (if (<= x 10) 1 1.0)))
-          (while (> x 0)
-            (setq r (* r (truncate x)))
-            (setq x (1- x)))
-          (+ 0.0 r)))
-    (if (= x 1.0e+INF)
-        x
-      0.0e+NaN)))
+  (cond ((>= x 1.0e+INF) x)
+        ((or (and (floatp x) (isnan x)) (< x 0)) 0.0e+NaN)
+        ((>= (calculator-expt (/ x 3.0) x) 1.0e+INF) 1.0e+INF)
+        (t (let ((x (truncate x)) (r 1.0))
+             (while (> x 0) (setq r (* r x) x (1- x)))
+             r))))
 
 (defun calculator-truncate (n)
   "Truncate N, return 0 in case of overflow."
-  (condition-case nil (truncate n) (error 0)))
+  (condition-case nil (truncate n) (range-error 0)))
 
 
 (provide 'calculator)
index 538d2320b30b18a713480412fafa1a871e4f8d2f..e266613680a54d67b153213d36e93a284719412a 100644 (file)
@@ -682,6 +682,124 @@ Echo Chinese date unless NOECHO is non-nil."
   "Chinese calendar equivalent of date diary entry."
   (format "Chinese date: %s" (calendar-chinese-date-string date)))
 
+;;;; diary support
+
+(autoload 'calendar-mark-1         "diary-lib")
+(autoload 'diary-mark-entries-1    "diary-lib")
+(autoload 'diary-list-entries-1    "diary-lib")
+(autoload 'diary-insert-entry-1    "diary-lib")
+(autoload 'diary-date-display-form "diary-lib")
+(autoload 'diary-make-date         "diary-lib")
+(autoload 'diary-ordinal-suffix    "diary-lib")
+(defvar diary-sexp-entry-symbol)
+(defvar entry)                    ;used by `diary-chinese-anniversary'
+
+(defvar calendar-chinese-month-name-array
+  ["正月" "二月" "三月" "四月" "五月" "六月"
+   "七月" "八月" "九月" "十月" "冬月" "臘月"])
+
+;;; NOTE: In the diary the cycle and year of a Chinese date is
+;;; combined using this formula: (+ (* cycle 100) year).
+;;;
+;;; These two functions convert to and back from this representation.
+(defun calendar-chinese-from-absolute-for-diary (date)
+  (pcase-let ((`(,c ,y ,m ,d) (calendar-chinese-from-absolute date)))
+    (list m d (+ (* c 100) y))))
+
+(defun calendar-chinese-to-absolute-for-diary (date)
+  (pcase-let ((`(,m ,d ,y) date))
+    (calendar-chinese-to-absolute
+     (list (floor y 100) (mod y 100) m d))))
+
+(defun calendar-chinese-mark-date-pattern (month day year &optional color)
+  (calendar-mark-1 month day year
+                   #'calendar-chinese-from-absolute-for-diary
+                   #'calendar-chinese-to-absolute-for-diary
+                   color))
+
+;;;###cal-autoload
+(defun diary-chinese-mark-entries ()
+  "Mark days in the calendar window that have Chinese date diary entries.
+Marks each entry in `diary-file' (or included files) visible in the calendar
+window.  See `diary-chinese-list-entries' for more information.
+
+This function is provided for use with `diary-nongregorian-marking-hook'."
+  (diary-mark-entries-1 #'calendar-chinese-mark-date-pattern
+                        calendar-chinese-month-name-array
+                        diary-chinese-entry-symbol
+                        #'calendar-chinese-from-absolute-for-diary))
+
+;;;###cal-autoload
+(defun diary-chinese-list-entries ()
+  "Add any Chinese date entries from the diary file to `diary-entries-list'.
+Chinese date diary entries must be prefixed by `diary-chinese-entry-symbol'
+\(normally a `C').  The same `diary-date-forms' govern the style
+of the Chinese calendar entries.  If a Chinese date diary entry begins with
+`diary-nonmarking-symbol', the entry will appear in the diary listing,
+but will not be marked in the calendar.
+
+This function is provided for use with `diary-nongregorian-listing-hook'."
+  (diary-list-entries-1 calendar-chinese-month-name-array
+                        diary-chinese-entry-symbol
+                        #'calendar-chinese-from-absolute-for-diary))
+
+;;;###cal-autoload
+(defun diary-chinese-anniversary (month day &optional year mark)
+  "Like `diary-anniversary' (which see) but accepts Chinese date."
+  (pcase-let* ((ddate (diary-make-date month day year))
+               (`(,dc ,dy ,dm ,dd)      ;diary chinese date
+                (if year
+                    (calendar-chinese-from-absolute
+                     (calendar-chinese-to-absolute-for-diary ddate))
+                  (list nil nil (calendar-extract-month ddate)
+                        (calendar-extract-day ddate))))
+               (`(,cc ,cy ,cm ,cd)      ;current chinese date
+                (calendar-chinese-from-absolute
+                 (calendar-absolute-from-gregorian date)))
+               (diff (if (and dc dy)
+                         (+ (* 60 (- cc dc)) (- cy dy))
+                       100)))
+    (and (> diff 0) (= dm cm) (= dd cd)
+         (cons mark (format entry diff (diary-ordinal-suffix diff))))))
+
+;;;###cal-autoload
+(defun diary-chinese-insert-anniversary-entry (&optional arg)
+  "Insert an anniversary diary entry for the Chinese date at point.
+Prefix argument ARG makes the entry nonmarking."
+  (interactive "P")
+  (let ((calendar-date-display-form (diary-date-display-form)))
+    (diary-make-entry
+     (format "%s(diary-chinese-anniversary %s)"
+             diary-sexp-entry-symbol
+             (calendar-date-string
+              (calendar-chinese-from-absolute-for-diary
+               (calendar-absolute-from-gregorian (calendar-cursor-to-date t)))))
+     arg)))
+
+;;;###cal-autoload
+(defun diary-chinese-insert-entry (&optional arg)
+  "Insert a diary entry for the Chinese date at point."
+  (interactive "P")
+  (diary-insert-entry-1 nil arg calendar-chinese-month-name-array
+                        diary-chinese-entry-symbol
+                        #'calendar-chinese-from-absolute-for-diary))
+
+;;;###cal-autoload
+(defun diary-chinese-insert-monthly-entry (&optional arg)
+  "Insert a monthly diary entry for the Chinese date at point."
+  (interactive "P")
+  (diary-insert-entry-1 'monthly arg calendar-chinese-month-name-array
+                        diary-chinese-entry-symbol
+                        #'calendar-chinese-from-absolute-for-diary))
+
+;;;###cal-autoload
+(defun diary-chinese-insert-yearly-entry (&optional arg)
+  "Insert a yearly diary entry for the Chinese date at point."
+  (interactive "P")
+  (diary-insert-entry-1 'yearly arg calendar-chinese-month-name-array
+                        diary-chinese-entry-symbol
+                        #'calendar-chinese-from-absolute-for-diary))
+
 (provide 'cal-china)
 
 ;;; cal-china.el ends here
index e71fccf19bca192747c1401b679e54634436426c..23e1b5e0e979ded6a61f91e810385865f364897d 100644 (file)
      ["One time" diary-bahai-insert-entry]
      ["Monthly" diary-bahai-insert-monthly-entry]
      ["Yearly" diary-bahai-insert-yearly-entry])
+    ("Insert Chinese"
+     ["One time" diary-chinese-insert-entry]
+     ["Monthly" diary-chinese-insert-monthly-entry]
+     ["Yearly" diary-chinese-insert-yearly-entry]
+     ["Anniversary" diary-chinese-insert-anniversary-entry])
     ("Insert Islamic"
      ["One time" diary-islamic-insert-entry]
      ["Monthly" diary-islamic-insert-monthly-entry]
index 57cb488a838929cf41dc10175cb5406984d5b5fd..581dd3437d9a0ce8ee8deadc14a8464c9449f081 100644 (file)
@@ -1,7 +1,6 @@
 ;;; calendar.el --- calendar functions
 
-;; Copyright (C) 1988-1995, 1997, 2000-2014 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1988-1995, 1997, 2000-2014 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
@@ -689,6 +688,12 @@ details, see the documentation for the variable `diary-list-entries-hook'."
   :type 'string
   :group 'diary)
 
+(defcustom diary-chinese-entry-symbol "C"
+  "Symbol indicating a diary entry according to the Chinese calendar."
+  :type 'string
+  :group 'diary
+  :version "24.5")
+
 (define-obsolete-variable-alias 'hebrew-diary-entry-symbol
   'diary-hebrew-entry-symbol "23.1")
 
@@ -1468,17 +1473,15 @@ Optional integers MON and YR are used instead of today's date."
        ;; combined don't fit height to that of its buffer.
        (set-window-vscroll nil 0))
       (sit-for 0))
-    (and (bound-and-true-p font-lock-mode)
-         (font-lock-fontify-buffer))
     (and calendar-mark-holidays-flag
-;;;         (calendar-date-is-valid-p today) ; useful for BC dates
+         ;; (calendar-date-is-valid-p today) ; useful for BC dates
          (calendar-mark-holidays)
          (and in-calendar-window (sit-for 0)))
     (unwind-protect
         (if calendar-mark-diary-entries-flag (diary-mark-entries))
-      (if today-visible
-          (run-hooks 'calendar-today-visible-hook)
-        (run-hooks 'calendar-today-invisible-hook)))))
+      (run-hooks (if today-visible
+                     'calendar-today-visible-hook
+                   'calendar-today-invisible-hook)))))
 
 (defun calendar-generate (month year)
   "Generate a three-month Gregorian calendar centered around MONTH, YEAR."
@@ -1709,6 +1712,10 @@ line."
     (define-key map "iBd" 'diary-bahai-insert-entry)
     (define-key map "iBm" 'diary-bahai-insert-monthly-entry)
     (define-key map "iBy" 'diary-bahai-insert-yearly-entry)
+    (define-key map "iCd" 'diary-chinese-insert-entry)
+    (define-key map "iCm" 'diary-chinese-insert-monthly-entry)
+    (define-key map "iCy" 'diary-chinese-insert-yearly-entry)
+    (define-key map "iCa" 'diary-chinese-insert-anniversary-entry)
     (define-key map "?"   'calendar-goto-info-node)
     (define-key map "Hm" 'cal-html-cursor-month)
     (define-key map "Hy" 'cal-html-cursor-year)
index c609cee7d6ff268c600eab5df123afe5f35890fd..a4e36d9abe8fb20e95eeffe3e51a8220ec773fde 100644 (file)
@@ -2374,6 +2374,7 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL."
 (defvar calendar-hebrew-month-name-array-leap-year)
 (defvar calendar-islamic-month-name-array)
 (defvar calendar-bahai-month-name-array)
+(defvar calendar-chinese-month-name-array)
 
 ;;;###cal-autoload
 (defun diary-font-lock-keywords ()
@@ -2396,6 +2397,11 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL."
                                cal-bahai
                                calendar-bahai-month-name-array
                                diary-bahai-entry-symbol)
+   (diary-font-lock-keywords-1 diary-chinese-mark-entries
+                               diary-chinese-list-entries
+                               cal-china
+                               calendar-chinese-month-name-array
+                               diary-chinese-entry-symbol)
    (list
     (cons
      (format "^%s.*$" (regexp-quote diary-include-string))
@@ -2412,7 +2418,8 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL."
              (regexp-opt (mapcar 'regexp-quote
                                  (list diary-hebrew-entry-symbol
                                        diary-islamic-entry-symbol
-                                       diary-bahai-entry-symbol))
+                                       diary-bahai-entry-symbol
+                                       diary-chinese-entry-symbol))
                          t))
      '(1 font-lock-constant-face))
     '(diary-font-lock-sexps . font-lock-keyword-face)
index 4ba4869d78854beec82bb9454658c919b4b76943..9aefcac23141ff64dbd51a0097c83168c4643d7d 100644 (file)
@@ -563,7 +563,12 @@ FIXME: multiple comma-separated values should be allowed!"
                    ;; UTC specifier present
                    (char-equal ?Z (aref isodatetimestring 15)))
           ;; if not UTC add current-time-zone offset
-          (setq second (+ (car (current-time-zone)) second)))
+          ;; current-time-zone should be called with actual UTC time
+          ;; (daylight saving at that time may differ to current one)
+          (setq second (+ (car (current-time-zone
+                                (encode-time second minute hour day month year
+                                             0)))
+                          second)))
         ;; shift if necessary
         (if day-shift
             (let ((mdy (calendar-gregorian-from-absolute
index 79569f2142c7193ce5a79505bf1ec41251bfb36e..6bfccec94c69947e760baa67c66fcec50780587e 100644 (file)
@@ -218,6 +218,68 @@ unknown are returned as nil."
                  (rplaca (nthcdr (pop slots) time) new-val))))))))
     time))
 
+(defconst parse-time-iso8601-regexp
+  (let* ((dash "-?")
+        (colon ":?")
+        (4digit "\\([0-9][0-9][0-9][0-9]\\)")
+        (2digit "\\([0-9][0-9]\\)")
+        (date-fullyear 4digit)
+        (date-month 2digit)
+        (date-mday 2digit)
+        (time-hour 2digit)
+        (time-minute 2digit)
+        (time-second 2digit)
+        (time-secfrac "\\(\\.[0-9]+\\)?")
+        (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute))
+        (time-offset (concat "Z" time-numoffset))
+        (partial-time (concat time-hour colon time-minute colon time-second
+                              time-secfrac))
+        (full-date (concat date-fullyear dash date-month dash date-mday))
+        (full-time (concat partial-time time-offset))
+        (date-time (concat full-date "T" full-time)))
+    (list (concat "^" full-date)
+         (concat "T" partial-time)
+         (concat "Z" time-numoffset)))
+  "List of regular expressions matching ISO 8601 dates.
+1st regular expression matches the date.
+2nd regular expression matches the time.
+3rd regular expression matches the (optional) timezone specification.")
+
+(defun parse-iso8601-time-string (date-string)
+  (let* ((date-re (nth 0 parse-time-iso8601-regexp))
+        (time-re (nth 1 parse-time-iso8601-regexp))
+        (tz-re (nth 2 parse-time-iso8601-regexp))
+        re-start
+        time seconds minute hour fractional-seconds
+        day month year day-of-week dst tz)
+    ;; We need to populate 'time' with
+    ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ)
+
+    ;; Nobody else handles iso8601 correctly, let's do it ourselves.
+    (when (string-match date-re date-string re-start)
+      (setq year (string-to-number (match-string 1 date-string))
+           month (string-to-number (match-string 2 date-string))
+           day (string-to-number (match-string 3 date-string))
+           re-start (match-end 0))
+      (when (string-match time-re date-string re-start)
+       (setq hour (string-to-number (match-string 1 date-string))
+             minute (string-to-number (match-string 2 date-string))
+             seconds (string-to-number (match-string 3 date-string))
+             fractional-seconds (string-to-number (or
+                                                    (match-string 4 date-string)
+                                                    "0"))
+             re-start (match-end 0))
+       (when (string-match tz-re date-string re-start)
+         (setq tz (match-string 1 date-string)))
+       (setq time (list seconds minute hour day month year day-of-week dst tz))))
+
+    ;; Fall back to having Gnus do fancy things for us.
+    (when (not time)
+      (setq time (parse-time-string date-string)))
+
+    (and time
+        (apply 'encode-time time))))
+
 (provide 'parse-time)
 
 ;;; parse-time.el ends here
index 3d62c5d789a1f1cc5a4e56b3f89b8b121fc64ce2..b04cfcd9fe41ac21d9619d1e0861d6ee0bfecb76 100644 (file)
@@ -388,6 +388,23 @@ This function does not work for SECONDS greater than `most-positive-fixnum'."
                  t t string))))))
   (replace-regexp-in-string "%%" "%" string))
 
+(defvar seconds-to-string
+  (list (list 1 "ms" 0.001)
+        (list 100 "s" 1)
+        (list (* 60 100) "m" 60.0)
+        (list (* 3600 30) "h" 3600.0)
+        (list (* 3600 24 400) "d" (* 3600.0 24.0))
+        (list nil "y" (* 365.25 24 3600)))
+  "Formatting used by the function `seconds-to-string'.")
+;;;###autoload
+(defun seconds-to-string (delay)
+  "Convert the time interval in seconds to a short string."
+  (cond ((> 0 delay) (concat "-" (seconds-to-string (- delay))))
+        ((= 0 delay) "0s")
+        (t (let ((sts seconds-to-string) here)
+             (while (and (car (setq here (pop sts)))
+                         (<= (car here) delay)))
+             (concat (format "%.2f" (/ delay (car (cddr here)))) (cadr here))))))
 
 (provide 'time-date)
 
index 750e0bca0952a9415a04316d799fddc19457091e..820e75260a9f1dfadb58f8017d32e2e6cbbb6a45 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * semantic/ia.el (semantic-ia-complete-symbol-menu): Use posn-at-point
+       instead of senator-completion-menu-point-as-event; un-comment, tho keep
+       the "no smart completion" fallback commented since it still doesn't work.
+
 2014-05-01  Glenn Morris  <rgm@gnu.org>
 
        * ede.el (ede-project-directories, ede-check-project-directory):
 
        * ede/emacs.el (ede-emacs-version): Update AC_INIT regexp.  (Bug#17160)
 
+2014-03-29  Glenn Morris  <rgm@gnu.org>
+
+       * ede/dired.el (ede-dired-minor-mode): Add autoload cookie.
+       (generated-autoload-file, generated-autoload-load-name):
+       Set file-local values.
+       * ede.el: Load ede/loaddefs at compile time too.
+       (ede-dired-minor-mode): Remove hand-written autoload.
+
 2014-03-04  Glenn Morris  <rgm@gnu.org>
 
        * semantic/util.el (semantic-complete-symbol):
index cbcc20f50397aa7ce47fa4f595b8709c6f9e6eb7..a9a53d776e2f851bcb3895aeecee029f7d5f6e87 100644 (file)
@@ -46,7 +46,8 @@
 (require 'ede/base)
 (require 'ede/auto)
 
-(load "ede/loaddefs" nil 'nomessage)
+(eval-and-compile
+  (load "ede/loaddefs" nil 'nomessage))
 
 (declare-function ede-commit-project "ede/custom")
 (declare-function ede-convert-path "ede/files")
@@ -450,8 +451,6 @@ If optional argument CURRENT is non-nil, return sub-menu code."
 \f
 ;;; Mode Declarations
 ;;
-(eval-and-compile
-  (autoload 'ede-dired-minor-mode "ede/dired" "EDE commands for dired" t))
 
 (defun ede-apply-target-options ()
   "Apply options to the current buffer for the active project/target."
index ee17dc95fbcf093a6ddf41a4e4306b9195cfce65..4c17a91a9847f8b9877af8eeef698b0749e4a26d 100644 (file)
@@ -55,6 +55,7 @@
     map)
   "Keymap used for ede dired minor mode.")
 
+;;;###autoload
 (define-minor-mode ede-dired-minor-mode
   "A minor mode that should only be activated in DIRED buffers.
 If ARG is nil or a positive number, force on, if
@@ -83,4 +84,9 @@ negative, force off."
 
 (provide 'ede/dired)
 
+;; Local variables:
+;; generated-autoload-file: "loaddefs.el"
+;; generated-autoload-load-name: "ede/dired"
+;; End:
+
 ;;; ede/dired.el ends here
index 10e84880ab62bdf560b2aba73add1edd1c818d26..8a5cbac41293b15d3b4ca1e82869b646dbf19393 100644 (file)
@@ -150,45 +150,47 @@ Completion options are calculated with `semantic-analyze-possible-completions'."
   :group 'semantic
   :type semantic-format-tag-custom-list)
 
-;; Disabled - see http://debbugs.gnu.org/14522
-;; ;;;###autoload
-;; (defun semantic-ia-complete-symbol-menu (point)
-;;   "Complete the current symbol via a menu based at POINT.
-;; Completion options are calculated with `semantic-analyze-possible-completions'."
-;;   (interactive "d")
-;;   (require 'imenu)
-;;   (let* ((a (semantic-analyze-current-context point))
-;;      (syms (semantic-analyze-possible-completions a))
-;;      )
-;;     ;; Complete this symbol.
-;;     (if (not syms)
-;;     (progn
-;;       (message "No smart completions found.  Trying Senator.")
-;;       (when (semantic-analyze-context-p a)
-;;         ;; This is a quick way of getting a nice completion list
-;;         ;; in the menu if the regular context mechanism fails.
-;;         (senator-completion-menu-popup)))
-;;
-;;       (let* ((menu
-;;           (mapcar
-;;            (lambda (tag)
-;;              (cons
-;;               (funcall semantic-ia-completion-menu-format-tag-function tag)
-;;               (vector tag)))
-;;            syms))
-;;          (ans
-;;           (imenu--mouse-menu
-;;            ;; XEmacs needs that the menu has at least 2 items.  So,
-;;            ;; include a nil item that will be ignored by imenu.
-;;            (cons nil menu)
-;;            (senator-completion-menu-point-as-event)
-;;            "Completions")))
-;;     (when ans
-;;       (if (not (semantic-tag-p ans))
-;;           (setq ans (aref (cdr ans) 0)))
-;;       (delete-region (car (oref a bounds)) (cdr (oref a bounds)))
-;;       (semantic-ia-insert-tag ans))
-;;     ))))
+;;;###autoload
+(defun semantic-ia-complete-symbol-menu (point)
+  "Complete the current symbol via a menu based at POINT.
+Completion options are calculated with `semantic-analyze-possible-completions'."
+  (interactive "d")
+  (require 'imenu)
+  (let* ((a (semantic-analyze-current-context point))
+        (syms (semantic-analyze-possible-completions a))
+        )
+    ;; Complete this symbol.
+    (if (not syms)
+       (progn
+         (message "No smart completions found.")
+          ;; Disabled - see http://debbugs.gnu.org/14522
+         ;; (message "No smart completions found.  Trying Senator.")
+         ;; (when (semantic-analyze-context-p a)
+         ;;   ;; This is a quick way of getting a nice completion list
+         ;;   ;; in the menu if the regular context mechanism fails.
+         ;;   (senator-completion-menu-popup))
+          )
+
+      (let* ((menu
+             (mapcar
+              (lambda (tag)
+                (cons
+                 (funcall semantic-ia-completion-menu-format-tag-function tag)
+                 (vector tag)))
+              syms))
+            (ans
+             (imenu--mouse-menu
+              ;; XEmacs needs that the menu has at least 2 items.  So,
+              ;; include a nil item that will be ignored by imenu.
+              (cons nil menu)
+              `(down-mouse-1 ,(posn-at-point))
+              "Completions")))
+       (when ans
+         (if (not (semantic-tag-p ans))
+             (setq ans (aref (cdr ans) 0)))
+         (delete-region (car (oref a bounds)) (cdr (oref a bounds)))
+         (semantic-ia-insert-tag ans))
+       ))))
 
 ;;; Completions Tip
 ;;
index 00e193d642e5512a5b6e65c138a9047bf9b5390a..da3782717c03c10fb9dad924d18cbcba613c633e 100644 (file)
@@ -746,11 +746,11 @@ The buffer name is made by surrounding the file name of PROGRAM with `*'s.
 The file name is used to make a symbol name, such as `comint-sh-hook', and any
 hooks on this symbol are run in the buffer.
 See `make-comint' and `comint-exec'."
+  (declare (interactive-only make-comint))
   (interactive "sRun program: ")
   (let ((name (file-name-nondirectory program)))
     (switch-to-buffer (make-comint name program))
     (run-hooks (intern-soft (concat "comint-" name "-hook")))))
-(put 'comint-run 'interactive-only 'make-comint)
 
 (defun comint-exec (buffer name command startfile switches)
   "Start up a process named NAME in buffer BUFFER for Comint modes.
@@ -1769,6 +1769,12 @@ If the Comint is Lucid Common Lisp,
 
 Similarly for Soar, Scheme, etc."
   (interactive)
+  ;; If we're currently completing, stop.  We're definitely done
+  ;; completing, and by sending the input, we might cause side effects
+  ;; that will confuse the code running in the completion
+  ;; post-command-hook.
+  (when completion-in-region-mode
+    (completion-in-region-mode -1))
   ;; Note that the input string does not include its terminal newline.
   (let ((proc (get-buffer-process (current-buffer))))
     (if (not proc) (user-error "Current buffer has no process")
index b46d41a0aa452969fed9cbaa7134a4b7bcb541ae..666d6c9dd91da6e8dd0f5c94b54e530be89eeebd 100644 (file)
@@ -671,6 +671,49 @@ All non-spacing characters have this function in
              (setq i (1+ i))))
          gstring))))))
 
+(defun compose-gstring-for-dotted-circle (gstring)
+  (let* ((dc (lgstring-glyph gstring 0)) ; glyph of dotted-circle
+        (dc-id (lglyph-code dc))
+        (fc (lgstring-glyph gstring 1)) ; glyph of the following char
+        (fc-id (lglyph-code fc))
+        (gstr (and nil (font-shape-gstring gstring))))
+    (if (and gstr
+            (or (= (lgstring-glyph-len gstr) 1)
+                (and (= (lgstring-glyph-len gstr) 2)
+                     (= (lglyph-to (lgstring-glyph gstr 0))
+                        (lglyph-to (lgstring-glyph gstr 1))))))
+       ;; It seems that font-shape-gstring has composed glyphs.
+       gstr
+      ;; Artificially compose the following glyph with the preceding
+      ;; dotted-circle.
+      (setq dc (lgstring-glyph gstring 0)
+           fc (lgstring-glyph gstring 1))
+      (let ((dc-width (lglyph-width dc))
+           (fc-width (- (lglyph-rbearing fc) (lglyph-lbearing fc)))
+           (from (lglyph-from dc))
+           (to (lglyph-to fc))
+           (xoff 0) (yoff 0) (width 0))
+       (if (and (< (lglyph-descent fc) 0)
+                (> (lglyph-ascent dc) (- (lglyph-descent fc))))
+           ;; Set YOFF so that the following glyph is put on top of
+           ;; the dotted-circle.
+           (setq yoff (- (- (lglyph-descent fc)) (lglyph-ascent dc))))
+       (if (> (lglyph-width fc) 0)
+           (setq xoff (- (lglyph-rbearing fc))))
+       (if (< dc-width fc-width)
+           ;; The following glyph is wider, but we don't know how to
+           ;; align both glyphs.  So, try the easiet method;
+           ;; i.e. align left edges of the glyphs.
+           (setq xoff (- xoff (- dc-width) (- (lglyph-lbearing fc )))
+                 width (- fc-width dc-width)))
+       (if (or (/= xoff 0) (/= yoff 0) (/= width 0) (/= (lglyph-width fc) 0))
+           (lglyph-set-adjustment fc xoff yoff width))
+       (lglyph-set-from-to dc from to)
+       (lglyph-set-from-to fc from to))
+      (if (> (lgstring-glyph-len gstring) 2)
+         (lgstring-set-glyph gstring 2 nil))
+      gstring)))
+
 ;; Allow for bootstrapping without uni-*.el.
 (when unicode-category-table
   (let ((elt `([,(purecopy "\\c.\\c^+") 1 compose-gstring-for-graphic]
@@ -679,7 +722,10 @@ All non-spacing characters have this function in
      #'(lambda (key val)
         (if (memq val '(Mn Mc Me))
             (set-char-table-range composition-function-table key elt)))
-     unicode-category-table)))
+     unicode-category-table))
+  ;; for dotted-circle
+  (aset composition-function-table #x25CC
+       `([,(purecopy ".\\c^") 0 compose-gstring-for-dotted-circle])))
 
 (defun compose-gstring-for-terminal (gstring)
   "Compose glyph-string GSTRING for terminal display.
index 2da67112bd3deced694ee5af16b9cb6bdf8801e7..b446a00bb8f2967e06b5a542f4cc25e206a1f6bc 100644 (file)
@@ -198,6 +198,8 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
 
             ;; editfns.c
             (user-full-name mail string)
+            ;; emacs.c
+            (report-emacs-bug-address emacsbug string)
             ;; eval.c
             (max-specpdl-size limits integer)
             (max-lisp-eval-depth limits integer)
@@ -317,7 +319,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
             (enable-recursive-minibuffers minibuffer boolean)
             (history-length minibuffer
                             (choice (const :tag "Infinite" t) integer)
-                            "22.1")
+                            "24.5")    ; 30 -> 100
             (history-delete-duplicates minibuffer boolean "22.1")
             (read-buffer-completion-ignore-case minibuffer boolean "23.1")
 
index b1d5f4e53b09b1e2cbd8cf806f53f2b055ed2302..bb93cce6500a04df4fcaf094e2c5076af7dc5ea7 100644 (file)
@@ -1,7 +1,7 @@
 ;;; dired-aux.el --- less commonly used parts of dired
 
-;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2014
+;;   Free Software Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>.
 ;; Maintainer: emacs-devel@gnu.org
@@ -215,19 +215,24 @@ condition.  Two file items are considered to match if they are equal
       (dolist (file1 list1)
        (unless (let ((list list2))
                  (while (and list
-                             (not (let* ((file2 (car list))
-                                         (fa1 (car (cddr file1)))
-                                         (fa2 (car (cddr file2)))
-                                         (size1 (nth 7 fa1))
-                                         (size2 (nth 7 fa2))
-                                         (mtime1 (float-time (nth 5 fa1)))
-                                         (mtime2 (float-time (nth 5 fa2))))
-                                    (and
-                                     (equal (car file1) (car file2))
-                                     (not (eval predicate))))))
+                             (let* ((file2 (car list))
+                                     (fa1 (car (cddr file1)))
+                                     (fa2 (car (cddr file2))))
+                                (or
+                                 (not (equal (car file1) (car file2)))
+                                 (eval predicate
+                                       `((fa1 . ,fa1)
+                                         (fa2 . ,fa2)
+                                         (size1 . ,(nth 7 fa1))
+                                         (size2 . ,(nth 7 fa2))
+                                         (mtime1
+                                          . ,(float-time (nth 5 fa1)))
+                                         (mtime2
+                                          . ,(float-time (nth 5 fa2)))
+                                         )))))
                    (setq list (cdr list)))
                  list)
-         (setq res (cons file1 res))))
+         (push file1 res)))
       (nreverse res))))
 
 (defun dired-files-attributes (dir)
@@ -1921,8 +1926,9 @@ Type SPC or `y' to %s one match, DEL or `n' to skip to next,
         (arg
          (if whole-name nil current-prefix-arg))
         (regexp
-         (dired-read-regexp
-          (concat (if whole-name "Abs. " "") operation " from (regexp): ")))
+         (read-regexp
+          (concat (if whole-name "Abs. " "") operation " from (regexp): ")
+          nil 'dired-regexp-history))
         (newname
          (read-string
           (concat (if whole-name "Abs. " "") operation " " regexp " to: "))))
index 947de7cd9f8d7ba5310404b3be312db488b48991..25c6f8b69af534f308259a0cfe315fa4fbd4b811 100644 (file)
@@ -1,7 +1,6 @@
 ;;; dired-x.el --- extra Dired functionality  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1993-1994, 1997, 2001-2014 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1993-1994, 1997, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
 ;;     Lawrence R. Dodd <dodd@roebling.poly.edu>
@@ -556,8 +555,9 @@ interactively, prompt for REGEXP.
 With prefix argument, unflag all those files.
 Optional fourth argument LOCALP is as in `dired-get-filename'."
   (interactive
-   (list (dired-read-regexp
-         "Mark unmarked files matching regexp (default all): ")
+   (list (read-regexp
+         "Mark unmarked files matching regexp (default all): "
+          nil 'dired-regexp-history)
         nil current-prefix-arg nil))
   (let ((dired-marker-char (if unflag-p ?\s dired-marker-char)))
     (dired-mark-if
index 60f8c1e9dfc6414c4c1efb12401de658a29878c9..4cc252c7492c45c8d559b62ff079bc853c0a1da7 100644 (file)
@@ -1,7 +1,7 @@
 ;;; dired.el --- directory-browsing commands -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1992-1997, 2000-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-1997, 2000-2014
+;;   Free Software Foundation, Inc.
 
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
 ;; Maintainer: emacs-devel@gnu.org
@@ -1912,7 +1912,7 @@ Type \\[dired-mark] to Mark a file or subdirectory for later commands.
   to see why something went wrong.
 Type \\[dired-unmark] to Unmark a file or all files of an inserted subdirectory.
 Type \\[dired-unmark-backward] to back up one line and unmark or unflag.
-Type \\[dired-do-flagged-delete] to delete (eXecute) the files flagged `D'.
+Type \\[dired-do-flagged-delete] to delete (eXpunge) the files flagged `D'.
 Type \\[dired-find-file] to Find the current line's file
   (or dired it in another buffer, if it is a directory).
 Type \\[dired-find-file-other-window] to find file or Dired directory in Other window.
@@ -3103,20 +3103,20 @@ argument or confirmation)."
          ;; Mark *Marked Files* window as softly-dedicated, to prevent
          ;; other buffers e.g. *Completions* from reusing it (bug#17554).
          (display-buffer-mark-dedicated 'soft))
-      (with-current-buffer buffer
-       (with-current-buffer-window
-        buffer
-        (cons 'display-buffer-below-selected
-              '((window-height . fit-window-to-buffer)))
-        #'(lambda (window _value)
-            (with-selected-window window
-              (unwind-protect
-                  (apply function args)
-                (when (window-live-p window)
-                  (quit-restore-window window 'kill)))))
-        ;; Handle (t FILE) just like (FILE), here.  That value is
-        ;; used (only in some cases), to mean just one file that was
-        ;; marked, rather than the current line file.
+      (with-displayed-buffer-window
+       buffer
+       (cons 'display-buffer-below-selected
+            '((window-height . fit-window-to-buffer)))
+       #'(lambda (window _value)
+          (with-selected-window window
+            (unwind-protect
+                (apply function args)
+              (when (window-live-p window)
+                (quit-restore-window window 'kill)))))
+       ;; Handle (t FILE) just like (FILE), here.  That value is
+       ;; used (only in some cases), to mean just one file that was
+       ;; marked, rather than the current line file.
+       (with-current-buffer buffer
         (dired-format-columns-of-files
          (if (eq (car files) t) (cdr files) files))
         (remove-text-properties (point-min) (point-max)
@@ -3302,6 +3302,7 @@ As always, hidden subdirs are not affected."
 
 (defun dired-read-regexp (prompt &optional default history)
   "Read a regexp using `read-regexp'."
+  (declare (obsolete read-regexp "24.5"))
   (read-regexp prompt default (or history 'dired-regexp-history)))
 
 (defun dired-mark-files-regexp (regexp &optional marker-char)
@@ -3312,8 +3313,9 @@ A prefix argument means to unmark them instead.
 REGEXP is an Emacs regexp, not a shell wildcard.  Thus, use `\\.o$' for
 object files--just `.o' will mark more than you might think."
   (interactive
-   (list (dired-read-regexp (concat (if current-prefix-arg "Unmark" "Mark")
-                                   " files (regexp): "))
+   (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark")
+                              " files (regexp): ")
+                      nil 'dired-regexp-history)
         (if current-prefix-arg ?\040)))
   (let ((dired-marker-char (or marker-char dired-marker-char)))
     (dired-mark-if
@@ -3328,8 +3330,9 @@ object files--just `.o' will mark more than you might think."
 A prefix argument means to unmark them instead.
 `.' and `..' are never marked."
   (interactive
-   (list (dired-read-regexp (concat (if current-prefix-arg "Unmark" "Mark")
-                                   " files containing (regexp): "))
+   (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark")
+                              " files containing (regexp): ")
+                      nil 'dired-regexp-history)
         (if current-prefix-arg ?\040)))
   (let ((dired-marker-char (or marker-char dired-marker-char)))
     (dired-mark-if
@@ -3359,7 +3362,8 @@ A prefix argument means to unmark them instead.
 The match is against the non-directory part of the filename.  Use `^'
   and `$' to anchor matches.  Exclude subdirs by hiding them.
 `.' and `..' are never flagged."
-  (interactive (list (dired-read-regexp "Flag for deletion (regexp): ")))
+  (interactive (list (read-regexp "Flag for deletion (regexp): "
+                                  nil 'dired-regexp-history)))
   (dired-mark-files-regexp regexp dired-del-marker))
 
 (defun dired-mark-symlinks (unflag-p)
@@ -3879,7 +3883,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
 \f
 ;;; Start of automatically extracted autoloads.
 \f
-;;;### (autoloads nil "dired-aux" "dired-aux.el" "1a8e2a4a9117ab3a2586aa001358d3fb")
+;;;### (autoloads nil "dired-aux" "dired-aux.el" "1448837b5f3e2b9ad63f723361f1e32e")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
@@ -4382,7 +4386,7 @@ instead.
 
 ;;;***
 \f
-;;;### (autoloads nil "dired-x" "dired-x.el" "291bc6e869bf72c900604c45d40f45ed")
+;;;### (autoloads nil "dired-x" "dired-x.el" "994b5d9fc38059ab641ec271c728e56f")
 ;;; Generated autoloads from dired-x.el
 
 (autoload 'dired-jump "dired-x" "\
index 7d5f1e771d59535f32d86bffad2ab68666dd6a6a..9458cace74ec9d59e606dc16388b2457d6759b13 100644 (file)
@@ -336,7 +336,7 @@ of the page moves to the previous page."
       ;; Don't do it if there's a conversion is running, since in that case, it
       ;; will be done later.
       (with-selected-window (car winprops)
-        (doc-view-goto-page 1)))))
+        (doc-view-goto-page (image-mode-window-get 'page t))))))
 
 (defvar-local doc-view--current-files nil
   "Only used internally.")
@@ -654,16 +654,10 @@ at the top edge of the page moves to the previous page."
 
 (defun doc-view-make-safe-dir (dir)
   (condition-case nil
-      (let ((umask (default-file-modes)))
-       (unwind-protect
-           (progn
-             ;; Create temp files with strict access rights.  It's easy to
-             ;; loosen them later, whereas it's impossible to close the
-             ;; time-window of loose permissions otherwise.
-             (set-default-file-modes #o0700)
-             (make-directory dir))
-         ;; Reset the umask.
-         (set-default-file-modes umask)))
+      ;; Create temp files with strict access rights.  It's easy to
+      ;; loosen them later, whereas it's impossible to close the
+      ;; time-window of loose permissions otherwise.
+      (with-file-modes #o0700 (make-directory dir))
     (file-already-exists
      (when (file-symlink-p dir)
        (error "Danger: %s points to a symbolic link" dir))
@@ -1622,24 +1616,25 @@ If BACKWARD is non-nil, jump to the previous match."
   "Figure out the current document type (`doc-view-doc-type')."
   (let ((name-types
         (when buffer-file-name
-          (cdr (assoc (file-name-extension buffer-file-name)
-                      '(
-                        ;; DVI
-                        ("dvi" dvi)
-                        ;; PDF
-                        ("pdf" pdf) ("epdf" pdf)
-                        ;; PostScript
-                        ("ps" ps) ("eps" ps)
-                        ;; DjVu
-                        ("djvu" djvu)
-                        ;; OpenDocument formats
-                        ("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf)
-                        ("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf)
-                        ("ots" odf) ("otp" odf) ("otg" odf)
-                        ;; Microsoft Office formats (also handled
-                        ;; by the odf conversion chain)
-                        ("doc" odf) ("docx" odf) ("xls" odf) ("xlsx" odf)
-                        ("ppt" odf) ("pptx" odf))))))
+          (cdr (assoc-ignore-case
+                 (file-name-extension buffer-file-name)
+                 '(
+                   ;; DVI
+                   ("dvi" dvi)
+                   ;; PDF
+                   ("pdf" pdf) ("epdf" pdf)
+                   ;; PostScript
+                   ("ps" ps) ("eps" ps)
+                   ;; DjVu
+                   ("djvu" djvu)
+                   ;; OpenDocument formats.
+                   ("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf)
+                   ("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf)
+                   ("ots" odf) ("otp" odf) ("otg" odf)
+                   ;; Microsoft Office formats (also handled by the odf
+                   ;; conversion chain).
+                   ("doc" odf) ("docx" odf) ("xls" odf) ("xlsx" odf)
+                   ("ppt" odf) ("pps" odf) ("pptx" odf))))))
        (content-types
         (save-excursion
           (goto-char (point-min))
index bf73dbb256ffed59aab58a051cd792e5133a4d0f..4bf5963e17517208a9b9cba8164f7f9cdf6810cb 100644 (file)
@@ -368,7 +368,7 @@ newline after CHAR but stay in the same place.")
                (setq pos (electric--after-char-pos))
                ;; Not in a string or comment.
                (not (nth 8 (save-excursion (syntax-ppss pos)))))
-      (let ((end (copy-marker (point)))
+      (let ((end (point-marker))
             (sym (if (functionp rule) (funcall rule) rule)))
         (set-marker-insertion-type end (not (eq sym 'after-stay)))
         (goto-char pos)
index 361e8fa7c6827f397ba8b2cd9197f606105dd15b..38956df66de4d2148ab3d7e3cfcba2657b7cd76a 100644 (file)
@@ -351,9 +351,26 @@ not be relied upon."
            ";;; " basename
            " ends here\n")))
 
+(defvar autoload-ensure-writable nil
+  "Non-nil means `autoload-ensure-default-file' makes existing file writable.")
+;; Just in case someone tries to get you to overwrite a file that you
+;; don't want to.
+;;;###autoload
+(put 'autoload-ensure-writable 'risky-local-variable t)
+
 (defun autoload-ensure-default-file (file)
-  "Make sure that the autoload file FILE exists and if not create it."
-  (unless (file-exists-p file)
+  "Make sure that the autoload file FILE exists, creating it if needed.
+If the file already exists and `autoload-ensure-writable' is non-nil,
+make it writable."
+  (if (file-exists-p file)
+      ;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile,
+      ;; which was designed to handle CVSREAD=1 and equivalent.
+      (and autoload-ensure-writable
+          (let ((modes (file-modes file)))
+            (if (zerop (logand modes #o0200))
+                ;; Ignore any errors here, and let subsequent attempts
+                ;; to write the file raise any real error.
+                (ignore-errors (set-file-modes file (logior modes #o0200))))))
     (write-region (autoload-rubric file) nil file))
   file)
 
index fe6640cc51ee34d8129a11d4dfa9eb5880b7fbf7..ee0a5a11c7b69591d304c0838af8c2fab616e5e7 100644 (file)
       form
     (nth 1 form)))
 
-(defun byte-optimize-zerop (form)
-  (cond ((numberp (nth 1 form))
-        (eval form))
-       (byte-compile-delete-errors
-        (list '= (nth 1 form) 0))
-       (form)))
-
-(put 'zerop 'byte-optimizer 'byte-optimize-zerop)
-
 (defun byte-optimize-and (form)
   ;; Simplify if less than 2 args.
   ;; if there is a literal nil in the args to `and', throw it and following
index 4b9e6d8fd231c3bf6f62495c67d0948c13fce64b..0edcf6197b4e72613b3ae8333deaa36d59edbc53 100644 (file)
 
 ;;; Code:
 
+(defalias 'function-put
+  ;; We don't want people to just use `put' because we can't conveniently
+  ;; hook into `put' to remap old properties to new ones.  But for now, there's
+  ;; no such remapping, so we just call `put'.
+  #'(lambda (f prop value) (put f prop value))
+  "Set function F's property PROP to VALUE.
+The namespace for PROP is shared with symbols.
+So far, F can only be a symbol, not a lambda expression.")
+(function-put 'defmacro 'doc-string-elt 3)
+(function-put 'defmacro 'lisp-indent-function 2)
+
 ;; `macro-declaration-function' are both obsolete (as marked at the end of this
 ;; file) but used in many .elc files.
 
@@ -69,6 +80,7 @@ The return value of this function is not used."
 ;; handle declarations in macro definitions and this is the first file
 ;; loaded by loadup.el that uses declarations in macros.
 
+;; Add any new entries to info node `(elisp)Declare Form'.
 (defvar defun-declarations-alist
   (list
    ;; We can only use backquotes inside the lambdas and not for those
@@ -81,27 +93,47 @@ The return value of this function is not used."
          #'(lambda (f _args new-name when)
              (list 'make-obsolete
                    (list 'quote f) (list 'quote new-name) (list 'quote when))))
+   (list 'interactive-only
+         #'(lambda (f _args instead)
+             (list 'function-put (list 'quote f)
+                   ''interactive-only (list 'quote instead))))
+   ;; FIXME: Merge `pure' and `side-effect-free'.
+   (list 'pure
+         #'(lambda (f _args val)
+             (list 'function-put (list 'quote f)
+                   ''pure (list 'quote val)))
+         "If non-nil, the compiler can replace calls with their return value.
+This may shift errors from run-time to compile-time.")
+   (list 'side-effect-free
+         #'(lambda (f _args val)
+             (list 'function-put (list 'quote f)
+                   ''side-effect-free (list 'quote val)))
+         "If non-nil, calls can be ignored if their value is unused.
+If `error-free', drop calls even if `byte-compile-delete-errors' is nil.")
    (list 'compiler-macro
          #'(lambda (f args compiler-function)
              `(eval-and-compile
-                (put ',f 'compiler-macro
-                     ,(if (eq (car-safe compiler-function) 'lambda)
-                          `(lambda ,(append (cadr compiler-function) args)
-                             ,@(cddr compiler-function))
-                        `#',compiler-function)))))
+                (function-put ',f 'compiler-macro
+                              ,(if (eq (car-safe compiler-function) 'lambda)
+                                   `(lambda ,(append (cadr compiler-function) args)
+                                      ,@(cddr compiler-function))
+                                 `#',compiler-function)))))
    (list 'doc-string
          #'(lambda (f _args pos)
-             (list 'put (list 'quote f) ''doc-string-elt (list 'quote pos))))
+             (list 'function-put (list 'quote f)
+                   ''doc-string-elt (list 'quote pos))))
    (list 'indent
          #'(lambda (f _args val)
-             (list 'put (list 'quote f)
+             (list 'function-put (list 'quote f)
                    ''lisp-indent-function (list 'quote val)))))
   "List associating function properties to their macro expansion.
 Each element of the list takes the form (PROP FUN) where FUN is
 a function.  For each (PROP . VALUES) in a function's declaration,
 the FUN corresponding to PROP is called with the function name,
 the function's arglist, and the VALUES and should return the code to use
-to set this property.")
+to set this property.
+
+This is used by `declare'.")
 
 (defvar macro-declarations-alist
   (cons
@@ -115,10 +147,10 @@ to set this property.")
 Each element of the list takes the form (PROP FUN) where FUN is a function.
 For each (PROP . VALUES) in a macro's declaration, the FUN corresponding
 to PROP is called with the macro name, the macro's arglist, and the VALUES
-and should return the code to use to set this property.")
+and should return the code to use to set this property.
+
+This is used by `declare'.")
 
-(put 'defmacro 'doc-string-elt 3)
-(put 'defmacro 'lisp-indent-function 2)
 (defalias 'defmacro
   (cons
    'macro
@@ -218,7 +250,8 @@ The return value is undefined.
                                  (cons arglist body))))))
       (if declarations
           (cons 'prog1 (cons def declarations))
-        def))))
+          def))))
+
 \f
 ;; Redefined in byte-optimize.el.
 ;; This is not documented--it's not clear that we should promote it.
@@ -389,13 +422,20 @@ If you think you need this, you're probably making a mistake somewhere."
 
 (defmacro eval-when-compile (&rest body)
   "Like `progn', but evaluates the body at compile time if you're compiling.
-Thus, the result of the body appears to the compiler as a quoted constant.
-In interpreted code, this is entirely equivalent to `progn'."
+Thus, the result of the body appears to the compiler as a quoted
+constant.  In interpreted code, this is entirely equivalent to
+`progn', except that the value of the expression may be (but is
+not necessarily) computed at load time if eager macro expansion
+is enabled."
   (declare (debug (&rest def-form)) (indent 0))
   (list 'quote (eval (cons 'progn body) lexical-binding)))
 
 (defmacro eval-and-compile (&rest body)
-  "Like `progn', but evaluates the body at compile time and at load time."
+  "Like `progn', but evaluates the body at compile time and at
+load time.  In interpreted code, this is entirely equivalent to
+`progn', except that the value of the expression may be (but is
+not necessarily) computed at load time if eager macro expansion
+is enabled."
   (declare (debug t) (indent 0))
   ;; When the byte-compiler expands code, this macro is not used, so we're
   ;; either about to run `body' (plain interpretation) or we're doing eager
index e5f8a8cc22ab4ec2e8a058358191e240e08f0946..9c52cc44eb4d6151c44b0eaa1d6a59fadcefe853 100644 (file)
@@ -421,31 +421,46 @@ Filled in `cconv-analyse-form' but initialized and consulted here.")
 
 (defvar byte-compiler-error-flag)
 
+(defun byte-compile-recurse-toplevel (form non-toplevel-case)
+  "Implement `eval-when-compile' and `eval-and-compile'.
+Return the compile-time value of FORM."
+  ;; Macroexpand (not macroexpand-all!) form at toplevel in case it
+  ;; expands into a toplevel-equivalent `progn'.  See CLHS section
+  ;; 3.2.3.1, "Processing of Top Level Forms".  The semantics are very
+  ;; subtle: see test/automated/bytecomp-tests.el for interesting
+  ;; cases.
+  (setf form (macroexpand form byte-compile-macro-environment))
+  (if (eq (car-safe form) 'progn)
+      (cons 'progn
+            (mapcar (lambda (subform)
+                      (byte-compile-recurse-toplevel
+                       subform non-toplevel-case))
+                    (cdr form)))
+    (funcall non-toplevel-case form)))
+
 (defconst byte-compile-initial-macro-environment
-  '(
+  `(
     ;; (byte-compiler-options . (lambda (&rest forms)
     ;;                        (apply 'byte-compiler-options-handler forms)))
     (declare-function . byte-compile-macroexpand-declare-function)
-    (eval-when-compile . (lambda (&rest body)
-                          (list
-                           'quote
-                           (byte-compile-eval
-                             (byte-compile-top-level
-                              (byte-compile-preprocess (cons 'progn body)))))))
-    (eval-and-compile . (lambda (&rest body)
-                          ;; Byte compile before running it.  Do it piece by
-                          ;; piece, in case further expressions need earlier
-                          ;; ones to be evaluated already, as is the case in
-                          ;; eieio.el.
-                          `(progn
-                             ,@(mapcar (lambda (exp)
-                                         (let ((cexp
-                                                (byte-compile-top-level
-                                                 (byte-compile-preprocess
-                                                  exp))))
-                                           (eval cexp)
-                                           cexp))
-                                       body)))))
+    (eval-when-compile . ,(lambda (&rest body)
+                                  (let ((result nil))
+                                    (byte-compile-recurse-toplevel
+                                     (cons 'progn body)
+                                     (lambda (form)
+                                       (setf result
+                                             (byte-compile-eval
+                                              (byte-compile-top-level
+                                               (byte-compile-preprocess form))))))
+                                    (list 'quote result))))
+    (eval-and-compile . ,(lambda (&rest body)
+                                 (byte-compile-recurse-toplevel
+                                  (cons 'progn body)
+                                  (lambda (form)
+                                    (let ((compiled (byte-compile-top-level
+                                                     (byte-compile-preprocess form))))
+                                      (eval compiled lexical-binding)
+                                      compiled))))))
   "The default macro-environment passed to macroexpand by the compiler.
 Placing a macro here will cause a macro to have different semantics when
 expanded by the compiler as when expanded by the interpreter.")
@@ -2198,9 +2213,12 @@ list that represents a doc string reference.
    (t form)))
 
 ;; byte-hunk-handlers cannot call this!
-(defun byte-compile-toplevel-file-form (form)
-  (let ((byte-compile-current-form nil))       ; close over this for warnings.
-    (byte-compile-file-form (byte-compile-preprocess form t))))
+(defun byte-compile-toplevel-file-form (top-level-form)
+  (byte-compile-recurse-toplevel
+   top-level-form
+   (lambda (form)
+     (let ((byte-compile-current-form nil)) ; close over this for warnings.
+       (byte-compile-file-form (byte-compile-preprocess form t))))))
 
 ;; byte-hunk-handlers can call this.
 (defun byte-compile-file-form (form)
@@ -2942,8 +2960,11 @@ for symbols generated by the byte compiler itself."
                                            interactive-only))
                                   (t "."))))
         (if (eq (car-safe (symbol-function (car form))) 'macro)
-            (byte-compile-log-warning
-             (format "Forgot to expand macro %s" (car form)) nil :error))
+            (progn
+              (debug)
+              (byte-compile-log-warning
+               (format "Forgot to expand macro %s in %S" (car form) form)
+               nil :error)))
         (if (and handler
                  ;; Make sure that function exists.
                  (and (functionp handler)
index 9b28289e0b92aee5d21f9e9af436f05ad27543b3..3761d04c2c2ff06ec6e4b47e26d171054964bbf9 100644 (file)
@@ -269,43 +269,20 @@ If so, return the true (non-nil) value returned by PREDICATE.
 ;;;###autoload
 (defun cl--map-overlays (cl-func &optional cl-buffer cl-start cl-end cl-arg)
   (or cl-buffer (setq cl-buffer (current-buffer)))
-  (if (fboundp 'overlay-lists)
-
-      ;; This is the preferred algorithm, though overlay-lists is undocumented.
-      (let (cl-ovl)
-       (with-current-buffer cl-buffer
-         (setq cl-ovl (overlay-lists))
-         (if cl-start (setq cl-start (copy-marker cl-start)))
-         (if cl-end (setq cl-end (copy-marker cl-end))))
-       (setq cl-ovl (nconc (car cl-ovl) (cdr cl-ovl)))
-       (while (and cl-ovl
-                   (or (not (overlay-start (car cl-ovl)))
-                       (and cl-end (>= (overlay-start (car cl-ovl)) cl-end))
-                       (and cl-start (<= (overlay-end (car cl-ovl)) cl-start))
-                       (not (funcall cl-func (car cl-ovl) cl-arg))))
-         (setq cl-ovl (cdr cl-ovl)))
-       (if cl-start (set-marker cl-start nil))
-       (if cl-end (set-marker cl-end nil)))
-
-    ;; This alternate algorithm fails to find zero-length overlays.
-    (let ((cl-mark (with-current-buffer cl-buffer
-                    (copy-marker (or cl-start (point-min)))))
-         (cl-mark2 (and cl-end (with-current-buffer cl-buffer
-                                 (copy-marker cl-end))))
-         cl-pos cl-ovl)
-      (while (save-excursion
-              (and (setq cl-pos (marker-position cl-mark))
-                   (< cl-pos (or cl-mark2 (point-max)))
-                   (progn
-                     (set-buffer cl-buffer)
-                     (setq cl-ovl (overlays-at cl-pos))
-                     (set-marker cl-mark (next-overlay-change cl-pos)))))
-       (while (and cl-ovl
-                   (or (/= (overlay-start (car cl-ovl)) cl-pos)
-                       (not (and (funcall cl-func (car cl-ovl) cl-arg)
-                                 (set-marker cl-mark nil)))))
-         (setq cl-ovl (cdr cl-ovl))))
-      (set-marker cl-mark nil) (if cl-mark2 (set-marker cl-mark2 nil)))))
+  (let (cl-ovl)
+    (with-current-buffer cl-buffer
+      (setq cl-ovl (overlay-lists))
+      (if cl-start (setq cl-start (copy-marker cl-start)))
+      (if cl-end (setq cl-end (copy-marker cl-end))))
+    (setq cl-ovl (nconc (car cl-ovl) (cdr cl-ovl)))
+    (while (and cl-ovl
+               (or (not (overlay-start (car cl-ovl)))
+                   (and cl-end (>= (overlay-start (car cl-ovl)) cl-end))
+                   (and cl-start (<= (overlay-end (car cl-ovl)) cl-start))
+                   (not (funcall cl-func (car cl-ovl) cl-arg))))
+      (setq cl-ovl (cdr cl-ovl)))
+    (if cl-start (set-marker cl-start nil))
+    (if cl-end (set-marker cl-end nil))))
 
 ;;; Support for `setf'.
 ;;;###autoload
index 6c62ce5c8309b9c10ae34d5b2140c4ac2e6cceae..2d8a1c4c1c25b2ece44309709f2fd3638e99839d 100644 (file)
@@ -27,6 +27,8 @@
 
 ;; This package supplies a single entry point, common-lisp-indent-function,
 ;; which performs indentation in the preferred style for Common Lisp code.
+;; It is also a suitable function for indenting Emacs lisp code.
+;;
 ;; To enable it:
 ;;
 ;; (setq lisp-indent-function 'common-lisp-indent-function)
@@ -154,6 +156,15 @@ is set to `defun'.")
        (looking-at "\\sw"))
     (error t)))
 
+(defun lisp-indent-find-method (symbol &optional no-compat)
+  "Find the lisp indentation function for SYMBOL.
+If NO-COMPAT is non-nil, do not retrieve indenters intended for
+the standard lisp indent package."
+  (or (and (derived-mode-p 'emacs-lisp-mode)
+           (get symbol 'common-lisp-indent-function-for-elisp))
+      (get symbol 'common-lisp-indent-function)
+      (and (not no-compat)
+           (get symbol 'lisp-indent-function))))
 
 (defun common-lisp-loop-part-indentation (indent-point state)
   "Compute the indentation of loop form constituents."
@@ -245,9 +256,17 @@ For example, the function `case' has an indent property
   * indent the first argument by 4.
   * arguments after the first should be lists, and there may be any number
     of them.  The first list element has an offset of 2, all the rest
-    have an offset of 2+1=3."
+    have an offset of 2+1=3.
+
+If the current mode is actually `emacs-lisp-mode', look for a
+`common-lisp-indent-function-for-elisp' property before looking
+at `common-lisp-indent-function' and, if set, use its value
+instead."
+  ;; FIXME: why do we need to special-case loop?
   (if (save-excursion (goto-char (elt state 1))
-                     (looking-at "([Ll][Oo][Oo][Pp]"))
+                     (looking-at (if (derived-mode-p 'emacs-lisp-mode)
+                                      "(\\(cl-\\)?[Ll][Oo][Oo][Pp]"
+                                    "([Ll][Oo][Oo][Pp]")))
       (common-lisp-loop-part-indentation indent-point state)
     (common-lisp-indent-function-1 indent-point state)))
 
@@ -291,18 +310,29 @@ For example, the function `case' has an indent property
               (setq function (downcase (buffer-substring-no-properties
                                         tem (point))))
               (goto-char tem)
+              ;; Elisp generally provides CL functionality with a CL
+              ;; prefix, so if we have a special indenter for the
+              ;; unprefixed version, prefer it over whatever's defined
+              ;; for the cl- version.  Users can override this
+              ;; heuristic by defining a
+              ;; common-lisp-indent-function-for-elisp property on the
+              ;; cl- version.
+              (when (and (derived-mode-p 'emacs-lisp-mode)
+                         (not (lisp-indent-find-method
+                               (intern-soft function) t))
+                         (string-match "\\`cl-" function)
+                         (setf tem (intern-soft
+                                    (substring function (match-end 0))))
+                         (lisp-indent-find-method tem t))
+                (setf function (symbol-name tem)))
               (setq tem (intern-soft function)
-                    method (get tem 'common-lisp-indent-function))
-              (cond ((and (null method)
-                          (string-match ":[^:]+" function))
-                     ;; The pleblisp package feature
-                     (setq function (substring function
-                                               (1+ (match-beginning 0)))
-                           method (get (intern-soft function)
-                                       'common-lisp-indent-function)))
-                    ((and (null method))
-                     ;; backwards compatibility
-                     (setq method (get tem 'lisp-indent-function)))))
+                    method (lisp-indent-find-method tem))
+              ;; The pleblisp package feature
+              (when (and (null tem)
+                         (string-match ":[^:]+" function))
+                (setq function (substring function (1+ (match-beginning 0)))
+                      tem (intern-soft function)
+                      method (lisp-indent-find-method tem))))
             (let ((n 0))
               ;; How far into the containing form is the current form?
               (if (< (point) indent-point)
@@ -764,7 +794,11 @@ optional\\|rest\\|key\\|allow-other-keys\\|aux\\|whole\\|body\\|environment\
     (put (car el) 'common-lisp-indent-function
          (if (symbolp (cdr el))
              (get (cdr el) 'common-lisp-indent-function)
-             (car (cdr el))))))
+           (car (cdr el))))))
+
+;; In elisp, the else part of `if' is in an implicit progn, so indent
+;; it more.
+(put 'if 'common-lisp-indent-function-for-elisp 2)
 
 \f
 ;(defun foo (x)
index 219d76f85d1493a7a7a6cdf71384c6c0c0f6f306..c4b9673aa2a5c49eecf76f246fa2fc701c4a3f30 100644 (file)
@@ -152,9 +152,6 @@ an element already on the list.
        `(setq ,place (cl-adjoin ,x ,place ,@keys)))
     `(cl-callf2 cl-adjoin ,x ,place ,@keys)))
 
-(defun cl--set-elt (seq n val)
-  (if (listp seq) (setcar (nthcdr n seq) val) (aset seq n val)))
-
 (defun cl--set-buffer-substring (start end val)
   (save-excursion (delete-region start end)
                  (goto-char start)
@@ -361,7 +358,13 @@ SEQ, this is like `mapcar'.  With several, it is like the Common Lisp
 (cl--defalias 'cl-first 'car)
 (cl--defalias 'cl-second 'cadr)
 (cl--defalias 'cl-rest 'cdr)
-(cl--defalias 'cl-endp 'null)
+
+(defun cl-endp (x)
+  "Return true if X is the empty list; false if it is a cons.
+Signal an error if X is not a list."
+  (if (listp x)
+      (null x)
+    (signal 'wrong-type-argument (list 'listp x 'x))))
 
 (cl--defalias 'cl-third 'cl-caddr "Return the third element of the list X.")
 (cl--defalias 'cl-fourth 'cl-cadddr "Return the fourth element of the list X.")
@@ -625,7 +628,6 @@ If ALIST is non-nil, the new pairs are prepended to it."
   `(insert (prog1 ,store (erase-buffer))))
 (gv-define-simple-setter buffer-substring cl--set-buffer-substring)
 (gv-define-simple-setter current-buffer set-buffer)
-(gv-define-simple-setter current-case-table set-case-table)
 (gv-define-simple-setter current-column move-to-column t)
 (gv-define-simple-setter current-global-map use-global-map t)
 (gv-define-setter current-input-mode (store)
index e45efa328ee82c4330ecaa5e862e04ed0802f3db..e4a73d1a4de2071587fa0dca2f9f892d2ffcd875 100644 (file)
        (t t)))
 
 (defun cl--const-expr-val (x)
-  (and (macroexp-const-p x) (if (consp x) (nth 1 x) x)))
+  "Return the value of X known at compile-time.
+If X is not known at compile time, return nil.  Before testing
+whether X is known at compile time, macroexpand it completely in
+`macroexpand-all-environment'."
+  (let ((x (macroexpand-all x macroexpand-all-environment)))
+    (if (macroexp-const-p x)
+        (if (consp x) (nth 1 x) x))))
 
 (defun cl--expr-contains (x y)
   "Count number of times X refers to Y.  Return nil for 0 times."
@@ -1540,7 +1546,7 @@ If BODY is `setq', then use SPECS for assignments rather than for bindings."
               (if (and (cl--unused-var-p temp) (null expr))
                   nil ;; Don't bother declaring/setting `temp' since it won't
                      ;; be used when `expr' is nil, anyway.
-                (when (or (null temp)
+               (when (or (null temp)
                           (and (eq body 'setq) (cl--unused-var-p temp)))
                   ;; Prefer a fresh uninterned symbol over "_to", to avoid
                   ;; warnings that we set an unused variable.
@@ -1878,13 +1884,13 @@ This is like `cl-flet', but for macros instead of functions.
              cl-declarations body)))
   (if (cdr bindings)
       `(cl-macrolet (,(car bindings)) (cl-macrolet ,(cdr bindings) ,@body))
-    (if (null bindings) (cons 'progn body)
+    (if (null bindings) (macroexp-progn body)
       (let* ((name (caar bindings))
             (res (cl--transform-lambda (cdar bindings) name)))
        (eval (car res))
-       (macroexpand-all (cons 'progn body)
-                         (cons (cons name `(lambda ,@(cdr res)))
-                               macroexpand-all-environment))))))
+       (macroexpand-all (macroexp-progn body)
+                        (cons (cons name `(lambda ,@(cdr res)))
+                              macroexpand-all-environment))))))
 
 (defconst cl--old-macroexpand
   (if (and (boundp 'cl--old-macroexpand)
@@ -2057,10 +2063,21 @@ values.  For compatibility, (cl-values A B C) is a synonym for (list A B C).
   (declare (debug t))
   (cons 'progn body))
 ;;;###autoload
-(defmacro cl-the (_type form)
-  "At present this ignores TYPE and is simply equivalent to FORM."
+(defmacro cl-the (type form)
+  "Return FORM.  If type-checking is enabled, assert that it is of TYPE."
   (declare (indent 1) (debug (cl-type-spec form)))
-  form)
+  (if (not (or (not (cl--compiling-file))
+               (< cl--optimize-speed 3)
+               (= cl--optimize-safety 3)))
+      form
+    (let* ((temp (if (cl--simple-expr-p form 3)
+                     form (make-symbol "--cl-var--")))
+           (body `(progn (unless ,(cl--make-type-test temp type)
+                           (signal 'wrong-type-argument
+                                   (list ',type ,temp ',form)))
+                         ,temp)))
+      (if (eq temp form) body
+        `(let ((,temp ,form)) ,body)))))
 
 (defvar cl--proclaim-history t)    ; for future compilers
 (defvar cl--declare-stack t)       ; for future compilers
@@ -2497,7 +2514,8 @@ non-nil value, that slot cannot be set via `setf'.
                                                 ',accessor ',name))))
                        ,(if (eq type 'vector) `(aref cl-x ,pos)
                           (if (= pos 0) '(car cl-x)
-                            `(nth ,pos cl-x)))) forms)
+                            `(nth ,pos cl-x))))
+                    forms)
              (push (cons accessor t) side-eff)
               (if (cadr (memq :read-only (cddr desc)))
                   (push `(gv-define-expander ,accessor
@@ -2572,21 +2590,38 @@ non-nil value, that slot cannot be set via `setf'.
              (put ',name 'cl-struct-include ',include)
              (put ',name 'cl-struct-print ,print-auto)
              ,@(mapcar (lambda (x)
-                         `(put ',(car x) 'side-effect-free ',(cdr x)))
+                         `(function-put ',(car x) 'side-effect-free ',(cdr x)))
                        side-eff))
           forms)
     `(progn ,@(nreverse (cons `',name forms)))))
 
-;;; Types and assertions.
-
-;;;###autoload
-(defmacro cl-deftype (name arglist &rest body)
-  "Define NAME as a new data type.
-The type name can then be used in `cl-typecase', `cl-check-type', etc."
-  (declare (debug cl-defmacro) (doc-string 3) (indent 2))
-  `(cl-eval-when (compile load eval)
-     (put ',name 'cl-deftype-handler
-          (cl-function (lambda (&cl-defs '('*) ,@arglist) ,@body)))))
+(defun cl-struct-sequence-type (struct-type)
+  "Return the sequence used to build STRUCT-TYPE.
+STRUCT-TYPE is a symbol naming a struct type.  Return 'vector or
+'list, or nil if STRUCT-TYPE is not a struct type. "
+  (declare (side-effect-free t) (pure t))
+  (car (get struct-type 'cl-struct-type)))
+
+(defun cl-struct-slot-info (struct-type)
+  "Return a list of slot names of struct STRUCT-TYPE.
+Each entry is a list (SLOT-NAME . OPTS), where SLOT-NAME is a
+slot name symbol and OPTS is a list of slot options given to
+`cl-defstruct'.  Dummy slots that represent the struct name and
+slots skipped by :initial-offset may appear in the list."
+  (declare (side-effect-free t) (pure t))
+  (get struct-type 'cl-struct-slots))
+
+(defun cl-struct-slot-offset (struct-type slot-name)
+  "Return the offset of slot SLOT-NAME in STRUCT-TYPE.
+The returned zero-based slot index is relative to the start of
+the structure data type and is adjusted for any structure name
+and :initial-offset slots.  Signal error if struct STRUCT-TYPE
+does not contain SLOT-NAME."
+  (declare (side-effect-free t) (pure t))
+  (or (cl-position slot-name
+                   (cl-struct-slot-info struct-type)
+                   :key #'car :test #'eq)
+      (error "struct %s has no slot %s" struct-type slot-name)))
 
 (defvar byte-compile-function-environment)
 (defvar byte-compile-macro-environment)
@@ -2873,19 +2908,47 @@ The function's arguments should be treated as immutable.
 
 ;;; Things that are inline.
 (cl-proclaim '(inline cl-acons cl-map cl-concatenate cl-notany
-               cl-notevery cl--set-elt cl-revappend cl-nreconc gethash))
+               cl-notevery cl-revappend cl-nreconc gethash))
 
 ;;; Things that are side-effect-free.
-(mapc (lambda (x) (put x 'side-effect-free t))
+(mapc (lambda (x) (function-put x 'side-effect-free t))
       '(cl-oddp cl-evenp cl-signum last butlast cl-ldiff cl-pairlis cl-gcd
         cl-lcm cl-isqrt cl-floor cl-ceiling cl-truncate cl-round cl-mod cl-rem
         cl-subseq cl-list-length cl-get cl-getf))
 
 ;;; Things that are side-effect-and-error-free.
-(mapc (lambda (x) (put x 'side-effect-free 'error-free))
+(mapc (lambda (x) (function-put x 'side-effect-free 'error-free))
       '(eql cl-list* cl-subst cl-acons cl-equalp
         cl-random-state-p copy-tree cl-sublis))
 
+;;; Types and assertions.
+
+;;;###autoload
+(defmacro cl-deftype (name arglist &rest body)
+  "Define NAME as a new data type.
+The type name can then be used in `cl-typecase', `cl-check-type', etc."
+  (declare (debug cl-defmacro) (doc-string 3) (indent 2))
+  `(cl-eval-when (compile load eval)
+     (put ',name 'cl-deftype-handler
+          (cl-function (lambda (&cl-defs '('*) ,@arglist) ,@body)))))
+
+;;; Additional functions that we can now define because we've defined
+;;; `cl-defsubst' and `cl-typep'.
+
+(cl-defsubst cl-struct-slot-value (struct-type slot-name inst)
+  ;; The use of `cl-defsubst' here gives us both a compiler-macro
+  ;; and a gv-expander "for free".
+  "Return the value of slot SLOT-NAME in INST of STRUCT-TYPE.
+STRUCT and SLOT-NAME are symbols.  INST is a structure instance."
+  (declare (side-effect-free t))
+  (unless (cl-typep inst struct-type)
+    (signal 'wrong-type-argument (list struct-type inst)))
+  ;; We could use `elt', but since the byte compiler will resolve the
+  ;; branch below at compile time, it's more efficient to use the
+  ;; type-specific accessor.
+  (if (eq (cl-struct-sequence-type struct-type) 'vector)
+      (aref inst (cl-struct-slot-offset struct-type slot-name))
+    (nth (cl-struct-slot-offset struct-type slot-name) inst)))
 
 (run-hooks 'cl-macs-load-hook)
 
index aa88264c4abeff3c23d9ab12252b41f6c57c4817..a707832874851ca96d1136772cff11bb76937829 100644 (file)
@@ -166,7 +166,7 @@ SEQ1 is destructively modified, then returned.
                   (cl-n (min (- (or cl-end1 cl-len) cl-start1)
                              (- (or cl-end2 cl-len) cl-start2))))
              (while (>= (setq cl-n (1- cl-n)) 0)
-               (cl--set-elt cl-seq1 (+ cl-start1 cl-n)
+               (setf (elt cl-seq1 (+ cl-start1 cl-n))
                            (elt cl-seq2 (+ cl-start2 cl-n))))))
       (if (listp cl-seq1)
          (let ((cl-p1 (nthcdr cl-start1 cl-seq1))
@@ -392,7 +392,7 @@ to avoid corrupting the original SEQ.
            cl-seq
          (setq cl-seq (copy-sequence cl-seq))
          (or cl-from-end
-             (progn (cl--set-elt cl-seq cl-i cl-new)
+             (progn (setf (elt cl-seq cl-i) cl-new)
                     (setq cl-i (1+ cl-i) cl-count (1- cl-count))))
          (apply 'cl-nsubstitute cl-new cl-old cl-seq :count cl-count
                 :start cl-i cl-keys))))))
@@ -439,7 +439,7 @@ This is a destructive function; it reuses the storage of SEQ whenever possible.
                (setq cl-end (1- cl-end))
                (if (cl--check-test cl-old (elt cl-seq cl-end))
                    (progn
-                     (cl--set-elt cl-seq cl-end cl-new)
+                     (setf (elt cl-seq cl-end) cl-new)
                      (setq cl-count (1- cl-count)))))
            (while (and (< cl-start cl-end) (> cl-count 0))
              (if (cl--check-test cl-old (aref cl-seq cl-start))
index 892fa7f2d372608c961f69d3bba20774839628d7..785050896b87f520bebe24b28b6eaab36be4e067 100644 (file)
@@ -410,12 +410,7 @@ Return the result of the last expression in BODY."
 ;; read is redefined to maybe instrument forms.
 ;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs.
 
-;; Save the original read function
-(defalias 'edebug-original-read
-  (symbol-function (if (fboundp 'edebug-original-read)
-                       'edebug-original-read 'read)))
-
-(defun edebug-read (&optional stream)
+(defun edebug--read (orig &optional stream)
   "Read one Lisp expression as text from STREAM, return as Lisp object.
 If STREAM is nil, use the value of `standard-input' (which see).
 STREAM or the value of `standard-input' may be:
@@ -433,10 +428,7 @@ the option `edebug-all-forms'."
   (or stream (setq stream standard-input))
   (if (eq stream (current-buffer))
       (edebug-read-and-maybe-wrap-form)
-    (edebug-original-read stream)))
-
-(or (fboundp 'edebug-original-eval-defun)
-    (defalias 'edebug-original-eval-defun (symbol-function 'eval-defun)))
+    (funcall (or orig #'read) stream)))
 
 (defvar edebug-result) ; The result of the function call returned by body.
 
@@ -567,16 +559,13 @@ already is one.)"
 
 (defun edebug-install-read-eval-functions ()
   (interactive)
-  ;; Don't install if already installed.
-  (unless load-read-function
-    (setq load-read-function 'edebug-read)
-    (defalias 'eval-defun 'edebug-eval-defun)))
+  (add-function :around load-read-function #'edebug--read)
+  (advice-add 'eval-defun :override 'edebug-eval-defun))
 
 (defun edebug-uninstall-read-eval-functions ()
   (interactive)
-  (setq load-read-function nil)
-  (defalias 'eval-defun (symbol-function 'edebug-original-eval-defun)))
-
+  (remove-function load-read-function #'edebug--read)
+  (advice-remove 'eval-defun 'edebug-eval-defun))
 
 ;;; Edebug internal data
 
@@ -721,8 +710,8 @@ Maybe clear the markers and delete the symbol's edebug property?"
     (cond
      ;; read goes one too far if a (possibly quoted) string or symbol
      ;; is immediately followed by non-whitespace.
-     ((eq class 'symbol) (edebug-original-read (current-buffer)))
-     ((eq class 'string) (edebug-original-read (current-buffer)))
+     ((eq class 'symbol) (read (current-buffer)))
+     ((eq class 'string) (read (current-buffer)))
      ((eq class 'quote) (forward-char 1)
       (list 'quote (edebug-read-sexp)))
      ((eq class 'backquote)
@@ -730,7 +719,7 @@ Maybe clear the markers and delete the symbol's edebug property?"
      ((eq class 'comma)
       (list '\, (edebug-read-sexp)))
      (t ; anything else, just read it.
-      (edebug-original-read (current-buffer))))))
+      (read (current-buffer))))))
 
 ;;; Offsets for reader
 
@@ -826,14 +815,11 @@ Maybe clear the markers and delete the symbol's edebug property?"
       (funcall
        (or (cdr (assq (edebug-next-token-class) edebug-read-alist))
           ;; anything else, just read it.
-          'edebug-original-read)
+          #'read)
        stream))))
 
-(defun edebug-read-symbol (stream)
-  (edebug-original-read stream))
-
-(defun edebug-read-string (stream)
-  (edebug-original-read stream))
+(defalias 'edebug-read-symbol #'read)
+(defalias 'edebug-read-string #'read)
 
 (defun edebug-read-quote (stream)
   ;; Turn 'thing into (quote thing)
@@ -877,7 +863,7 @@ Maybe clear the markers and delete the symbol's edebug property?"
        ((memq (following-char) '(?: ?B ?O ?X ?b ?o ?x ?1 ?2 ?3 ?4 ?5 ?6
                                  ?7 ?8 ?9 ?0))
         (backward-char 1)
-        (edebug-original-read stream))
+        (read stream))
        (t (edebug-syntax-error "Bad char after #"))))
 
 (defun edebug-read-list (stream)
@@ -1048,16 +1034,15 @@ Maybe clear the markers and delete the symbol's edebug property?"
        edebug-gate
        edebug-best-error
        edebug-error-point
-       no-match
        ;; Do this once here instead of several times.
        (max-lisp-eval-depth (+ 800 max-lisp-eval-depth))
        (max-specpdl-size (+ 2000 max-specpdl-size)))
-    (setq no-match
-         (catch 'no-match
-           (setq result (edebug-read-and-maybe-wrap-form1))
-           nil))
-    (if no-match
-       (apply 'edebug-syntax-error no-match))
+    (let ((no-match
+           (catch 'no-match
+             (setq result (edebug-read-and-maybe-wrap-form1))
+             nil)))
+      (if no-match
+          (apply 'edebug-syntax-error no-match)))
     result))
 
 
@@ -1076,7 +1061,7 @@ Maybe clear the markers and delete the symbol's edebug property?"
       (if (and (eq 'lparen (edebug-next-token-class))
               (eq 'symbol (progn (forward-char 1) (edebug-next-token-class))))
          ;; Find out if this is a defining form from first symbol
-         (setq def-kind (edebug-original-read (current-buffer))
+         (setq def-kind (read (current-buffer))
                spec (and (symbolp def-kind) (get-edebug-spec def-kind))
                defining-form-p (and (listp spec)
                                     (eq '&define (car spec)))
@@ -1084,7 +1069,7 @@ Maybe clear the markers and delete the symbol's edebug property?"
                def-name (if (and defining-form-p
                                  (eq 'name (car (cdr spec)))
                                  (eq 'symbol (edebug-next-token-class)))
-                            (edebug-original-read (current-buffer))))))
+                            (read (current-buffer))))))
 ;;;(message "all defs: %s   all forms: %s"  edebug-all-defs edebug-all-forms)
     (cond
      (defining-form-p
@@ -3209,7 +3194,7 @@ function or macro is called, Edebug will be called there as well."
             (if (looking-at "\(")
                 (edebug--form-data-name
                  (edebug-get-form-data-entry (point)))
-              (edebug-original-read (current-buffer))))))
+              (read (current-buffer))))))
       (edebug-instrument-function func))))
 
 
@@ -3237,25 +3222,14 @@ canceled the first time the function is entered."
   (put function 'edebug-on-entry nil))
 
 
-(if (not (fboundp 'edebug-original-debug-on-entry))
-    (fset 'edebug-original-debug-on-entry (symbol-function 'debug-on-entry)))
-'(fset 'debug-on-entry 'edebug-debug-on-entry)  ;; Should we do this?
+'(advice-add 'debug-on-entry :around 'edebug--debug-on-entry)  ;; Should we do this?
 ;; Also need edebug-cancel-debug-on-entry
 
-'(defun edebug-debug-on-entry (function)
-  "Request FUNCTION to invoke debugger each time it is called.
-If the user continues, FUNCTION's execution proceeds.
-Works by modifying the definition of FUNCTION,
-which must be written in Lisp, not predefined.
-Use `cancel-debug-on-entry' to cancel the effect of this command.
-Redefining FUNCTION also does that.
-
-This version is from Edebug.  If the function is instrumented for
-Edebug, it calls `edebug-on-entry'."
-  (interactive "aDebug on entry (to function): ")
+'(defun edebug--debug-on-entry (orig function)
+  "If the function is instrumented for Edebug, call `edebug-on-entry'."
   (let ((func-data (get function 'edebug)))
     (if (or (null func-data) (markerp func-data))
-       (edebug-original-debug-on-entry function)
+       (funcall orig function)
       (edebug-on-entry function))))
 
 
@@ -4136,9 +4110,8 @@ With prefix argument, make it a temporary breakpoint."
                'edebug--called-interactively-skip)
   (remove-hook 'cl-read-load-hooks 'edebug--require-cl-read)
   (edebug-uninstall-read-eval-functions)
-  ;; continue standard unloading
+  ;; Continue standard unloading.
   nil)
 
 (provide 'edebug)
-
 ;;; edebug.el ends here
index c64ec52decb5341c0cb9aa2abe186ea14112ff66..7102b5549eb52201476e34f3db316af3c56a8127 100644 (file)
@@ -298,8 +298,8 @@ Otherwise work like `message'."
 
 \f
 ;;;###autoload
-(defvar eldoc-documentation-function nil
-  "If non-nil, function to call to return doc string.
+(defvar eldoc-documentation-function #'eldoc-documentation-function-default
+  "Function to call to return doc string.
 The function of no args should return a one-line string for displaying
 doc about a function etc. appropriate to the context around point.
 It should return nil if there's no doc appropriate for the context.
@@ -323,22 +323,20 @@ Emacs Lisp mode) that support ElDoc.")
              (when eldoc-last-message
                (eldoc-message nil)
                nil))
-        (if eldoc-documentation-function
-            (eldoc-message (funcall eldoc-documentation-function))
-          (let* ((current-symbol (eldoc-current-symbol))
-                 (current-fnsym  (eldoc-fnsym-in-current-sexp))
-                 (doc (cond
-                       ((null current-fnsym)
-                        nil)
-                       ((eq current-symbol (car current-fnsym))
-                        (or (apply 'eldoc-get-fnsym-args-string
-                                   current-fnsym)
-                            (eldoc-get-var-docstring current-symbol)))
-                       (t
-                        (or (eldoc-get-var-docstring current-symbol)
-                            (apply 'eldoc-get-fnsym-args-string
-                                   current-fnsym))))))
-            (eldoc-message doc))))))
+        (eldoc-message (funcall eldoc-documentation-function)))))
+
+(defun eldoc-documentation-function-default ()
+  "Default value for `eldoc-documentation-function' (which see)."
+  (let ((current-symbol (eldoc-current-symbol))
+       (current-fnsym  (eldoc-fnsym-in-current-sexp)))
+    (cond ((null current-fnsym)
+          nil)
+         ((eq current-symbol (car current-fnsym))
+          (or (apply #'eldoc-get-fnsym-args-string current-fnsym)
+              (eldoc-get-var-docstring current-symbol)))
+         (t
+          (or (eldoc-get-var-docstring current-symbol)
+              (apply #'eldoc-get-fnsym-args-string current-fnsym))))))
 
 (defun eldoc-get-fnsym-args-string (sym &optional index)
   "Return a string containing the parameter list of the function SYM.
index 34041aab9a8ca37e29a9a62d78ab172cbaeaee33..024110b93e037fd92932d8d34c809a1d38defd46 100644 (file)
@@ -1320,7 +1320,7 @@ RESULT must be an `ert-test-result-with-condition'."
         (unwind-protect
             (progn
               (insert message "\n")
-              (setq end (copy-marker (point)))
+              (setq end (point-marker))
               (goto-char begin)
               (insert "    " prefix)
               (forward-line 1)
@@ -1463,6 +1463,65 @@ the tests)."
       (kill-emacs 2))))
 
 
+(defun ert-summarize-tests-batch-and-exit ()
+  "Summarize the results of testing.
+Expects to be called in batch mode, with logfiles as command-line arguments.
+The logfiles should have the `ert-run-tests-batch' format.  When finished,
+this exits Emacs, with status as per `ert-run-tests-batch-and-exit'."
+  (or noninteractive
+      (user-error "This function is only for use in batch mode"))
+  (let ((nlogs (length command-line-args-left))
+        (ntests 0) (nrun 0) (nexpected 0) (nunexpected 0) (nskipped 0)
+        nnotrun logfile notests badtests unexpected)
+    (with-temp-buffer
+      (while (setq logfile (pop command-line-args-left))
+        (erase-buffer)
+        (insert-file-contents logfile)
+        (if (not (re-search-forward "^Running \\([0-9]+\\) tests" nil t))
+            (push logfile notests)
+          (setq ntests (+ ntests (string-to-number (match-string 1))))
+          (if (not (re-search-forward "^\\(Aborted: \\)?\
+Ran \\([0-9]+\\) tests, \\([0-9]+\\) results as expected\
+\\(?:, \\([0-9]+\\) unexpected\\)?\
+\\(?:, \\([0-9]+\\) skipped\\)?" nil t))
+              (push logfile badtests)
+            (if (match-string 1) (push logfile badtests))
+            (setq nrun (+ nrun (string-to-number (match-string 2)))
+                  nexpected (+ nexpected (string-to-number (match-string 3))))
+            (when (match-string 4)
+              (push logfile unexpected)
+              (setq nunexpected (+ nunexpected
+                                   (string-to-number (match-string 4)))))
+            (if (match-string 5)
+                (setq nskipped (+ nskipped
+                                  (string-to-number (match-string 5)))))))))
+    (setq nnotrun (- ntests nrun))
+    (message "\nSUMMARY OF TEST RESULTS")
+    (message "-----------------------")
+    (message "Files examined: %d" nlogs)
+    (message "Ran %d tests%s, %d results as expected%s%s"
+             nrun
+             (if (zerop nnotrun) "" (format ", %d failed to run" nnotrun))
+             nexpected
+             (if (zerop nunexpected)
+                 ""
+               (format ", %d unexpected" nunexpected))
+             (if (zerop nskipped)
+                 ""
+               (format ", %d skipped" nskipped)))
+    (when notests
+      (message "%d files did not contain any tests:" (length notests))
+      (mapc (lambda (l) (message "  %s" l)) notests))
+    (when badtests
+      (message "%d files did not finish:" (length badtests))
+      (mapc (lambda (l) (message "  %s" l)) badtests))
+    (when unexpected
+      (message "%d files contained unexpected results:" (length unexpected))
+      (mapc (lambda (l) (message "  %s" l)) unexpected))
+    (kill-emacs (cond ((or notests badtests (not (zerop nnotrun))) 2)
+                      (unexpected 1)
+                      (t 0)))))
+
 ;;; Utility functions for load/unload actions.
 
 (defun ert--activate-font-lock-keywords ()
index 5c404ce04684fe85768fb0139131f5a86e38fa60..c372117b1043772353f5544f2d4cd6f9785b139e 100644 (file)
@@ -178,8 +178,7 @@ LIBRARY should be a string (the name of the library)."
 
 (defvar find-function-C-source-directory
   (let ((dir (expand-file-name "src" source-directory)))
-    (when (and (file-directory-p dir) (file-readable-p dir))
-      dir))
+    (if (file-accessible-directory-p dir) dir))
   "Directory where the C source files of Emacs can be found.
 If nil, do not try to find the source code of functions and variables
 defined in C.")
index 1cdba5b371af1b276d351999d6fec61f86e8f4f3..31df353321a5486f80eca515d4617ba3ccaf9e74 100644 (file)
@@ -104,7 +104,8 @@ It has `lisp-mode-abbrev-table' as its parent."
                             (regexp-opt
                              '("defun" "defun*" "defsubst" "defmacro"
                                "defadvice" "define-skeleton"
-                               "define-minor-mode" "define-global-minor-mode"
+                               "define-compilation-mode" "define-minor-mode"
+                               "define-global-minor-mode"
                                "define-globalized-minor-mode"
                                "define-derived-mode" "define-generic-mode"
                                "define-compiler-macro" "define-modify-macro"
@@ -156,6 +157,24 @@ It has `lisp-mode-abbrev-table' as its parent."
 
 ;;;; Font-lock support.
 
+(defun lisp--match-hidden-arg (limit)
+  (let ((res nil))
+    (while
+        (let ((ppss (parse-partial-sexp (line-beginning-position)
+                                        (line-end-position)
+                                        -1)))
+          (skip-syntax-forward " )")
+          (if (or (>= (car ppss) 0)
+                  (looking-at ";\\|$"))
+              (progn
+                (forward-line 1)
+                (< (point) limit))
+            (looking-at ".*")           ;Set the match-data.
+           (forward-line 1)
+            (setq res (point))
+            nil)))
+    res))
+
 (pcase-let
     ((`(,vdefs ,tdefs
         ,el-defs-re ,cl-defs-re
@@ -189,6 +208,7 @@ It has `lisp-mode-abbrev-table' as its parent."
                        "with-category-table" "with-coding-priority"
                        "with-current-buffer" "with-demoted-errors"
                        "with-electric-help" "with-eval-after-load"
+                       "with-file-modes"
                        "with-local-quit" "with-no-warnings"
                        "with-output-to-temp-buffer" "with-selected-window"
                        "with-selected-frame" "with-silent-modifications"
@@ -347,6 +367,9 @@ It has `lisp-mode-abbrev-table' as its parent."
        ;; and that they get the wrong color.
        ;; ;; CL `with-' and `do-' constructs
        ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
+       (lisp--match-hidden-arg
+        (0 '(face font-lock-warning-face
+             help-echo "Hidden behind deeper element; move to another line?")))
        ))
     "Gaudy level highlighting for Emacs Lisp mode.")
 
@@ -377,6 +400,9 @@ It has `lisp-mode-abbrev-table' as its parent."
        ;; and that they get the wrong color.
        ;; ;; CL `with-' and `do-' constructs
        ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
+       (lisp--match-hidden-arg
+        (0 '(face font-lock-warning-face
+             help-echo "Hidden behind deeper element; move to another line?")))
        ))
     "Gaudy level highlighting for Lisp modes."))
 
@@ -387,6 +413,41 @@ It has `lisp-mode-abbrev-table' as its parent."
 (defvar lisp-cl-font-lock-keywords lisp-cl-font-lock-keywords-1
   "Default expressions to highlight in Lisp modes.")
 
+(defun lisp-string-in-doc-position-p (listbeg startpos)
+  (let* ((firstsym (and listbeg
+                        (save-excursion
+                          (goto-char listbeg)
+                          (and (looking-at "([ \t\n]*\\(\\(\\sw\\|\\s_\\)+\\)")
+                               (match-string 1)))))
+         (docelt (and firstsym
+                      (function-get (intern-soft firstsym)
+                                    lisp-doc-string-elt-property))))
+    (and docelt
+         ;; It's a string in a form that can have a docstring.
+         ;; Check whether it's in docstring position.
+         (save-excursion
+           (when (functionp docelt)
+             (goto-char (match-end 1))
+             (setq docelt (funcall docelt)))
+           (goto-char listbeg)
+           (forward-char 1)
+           (condition-case nil
+               (while (and (> docelt 0) (< (point) startpos)
+                           (progn (forward-sexp 1) t))
+                 (setq docelt (1- docelt)))
+             (error nil))
+           (and (zerop docelt) (<= (point) startpos)
+                (progn (forward-comment (point-max)) t)
+                (= (point) startpos))))))
+
+(defun lisp-string-after-doc-keyword-p (listbeg startpos)
+  (and listbeg                          ; We are inside a Lisp form.
+       (save-excursion
+         (goto-char startpos)
+         (ignore-errors
+           (progn (backward-sexp 1)
+                  (looking-at ":documentation\\_>"))))))
+
 (defun lisp-font-lock-syntactic-face-function (state)
   (if (nth 3 state)
       ;; This might be a (doc)string or a |...| symbol.
@@ -394,32 +455,9 @@ It has `lisp-mode-abbrev-table' as its parent."
         (if (eq (char-after startpos) ?|)
             ;; This is not a string, but a |...| symbol.
             nil
-          (let* ((listbeg (nth 1 state))
-                 (firstsym (and listbeg
-                                (save-excursion
-                                  (goto-char listbeg)
-                                  (and (looking-at "([ \t\n]*\\(\\(\\sw\\|\\s_\\)+\\)")
-                                       (match-string 1)))))
-                 (docelt (and firstsym
-                              (function-get (intern-soft firstsym)
-                                            lisp-doc-string-elt-property))))
-            (if (and docelt
-                     ;; It's a string in a form that can have a docstring.
-                     ;; Check whether it's in docstring position.
-                     (save-excursion
-                       (when (functionp docelt)
-                         (goto-char (match-end 1))
-                         (setq docelt (funcall docelt)))
-                       (goto-char listbeg)
-                       (forward-char 1)
-                       (condition-case nil
-                           (while (and (> docelt 0) (< (point) startpos)
-                                       (progn (forward-sexp 1) t))
-                             (setq docelt (1- docelt)))
-                         (error nil))
-                       (and (zerop docelt) (<= (point) startpos)
-                            (progn (forward-comment (point-max)) t)
-                            (= (point) (nth 8 state)))))
+          (let ((listbeg (nth 1 state)))
+            (if (or (lisp-string-in-doc-position-p listbeg startpos)
+                    (lisp-string-after-doc-keyword-p listbeg startpos))
                 font-lock-doc-face
               font-lock-string-face))))
     font-lock-comment-face))
@@ -465,10 +503,10 @@ font-lock keywords will not be case sensitive."
                lisp-cl-font-lock-keywords-2))
          nil ,keywords-case-insensitive nil nil
          (font-lock-mark-block-function . mark-defun)
+          (font-lock-extra-managed-props help-echo)
          (font-lock-syntactic-face-function
           . lisp-font-lock-syntactic-face-function)))
   (setq-local prettify-symbols-alist lisp--prettify-symbols-alist)
-  ;; electric
   (when elisp
     (setq-local electric-pair-text-pairs
                 (cons '(?\` . ?\') electric-pair-text-pairs)))
@@ -992,26 +1030,20 @@ If CHAR is not a character, return nil."
              (forward-sexp -1))))
 
        (save-restriction
-         ;; vladimir@cs.ualberta.ca 30-Jul-1997: skip ` in
-         ;; `variable' so that the value is returned, not the
-         ;; name
-         (if (and ignore-quotes
-                  (eq (following-char) ?`))
+         (if (and ignore-quotes (eq (following-char) ?`))
+              ;; vladimir@cs.ualberta.ca 30-Jul-1997: Skip ` in `variable' so
+              ;; that the value is returned, not the name.
              (forward-char))
+          (when (looking-at ",@?") (goto-char (match-end 0)))
          (narrow-to-region (point-min) opoint)
          (setq expr (read (current-buffer)))
-         ;; If it's an (interactive ...) form, it's more
-         ;; useful to show how an interactive call would
-         ;; use it.
-         (and (consp expr)
-              (eq (car expr) 'interactive)
+          ;; If it's an (interactive ...) form, it's more useful to show how an
+          ;; interactive call would use it.
+          ;; FIXME: Is it really the right place for this?
+          (when (eq (car-safe expr) 'interactive)
               (setq expr
-                    (list 'call-interactively
-                          (list 'quote
-                                (list 'lambda
-                                      '(&rest args)
-                                      expr
-                                      'args)))))
+                  `(call-interactively
+                    (lambda (&rest args) ,expr args))))
          expr)))))
 
 
index 80366db33d5f6341ac94072a5a799d3f68858bbf..30fee64635c13876df4d44bda234a54ff18f2f3b 100644 (file)
@@ -57,10 +57,14 @@ Should take the same arguments and behave similarly to `forward-sexp'.")
 
 (defun forward-sexp (&optional arg)
   "Move forward across one balanced expression (sexp).
-With ARG, do it that many times.  Negative arg -N means
-move backward across N balanced expressions.
-This command assumes point is not in a string or comment.
-Calls `forward-sexp-function' to do the work, if that is non-nil."
+With ARG, do it that many times.  Negative arg -N means move
+backward across N balanced expressions.  This command assumes
+point is not in a string or comment.  Calls
+`forward-sexp-function' to do the work, if that is non-nil.  If
+unable to move over a sexp, signal `scan-error' with three
+arguments: a message, the start of the obstacle (usually a
+parenthesis or list marker of some kind), and end of the
+obstacle."
   (interactive "^p")
   (or arg (setq arg 1))
   (if forward-sexp-function
@@ -140,38 +144,92 @@ This command assumes point is not in a string or comment."
       (goto-char (or (scan-lists (point) inc -1) (buffer-end arg)))
       (setq arg (- arg inc)))))
 
-(defun backward-up-list (&optional arg)
+(defun backward-up-list (&optional arg escape-strings no-syntax-crossing)
   "Move backward out of one level of parentheses.
 This command will also work on other parentheses-like expressions
-defined by the current language mode.
-With ARG, do this that many times.
-A negative argument means move forward but still to a less deep spot.
-This command assumes point is not in a string or comment."
-  (interactive "^p")
-  (up-list (- (or arg 1))))
-
-(defun up-list (&optional arg)
+defined by the current language mode.  With ARG, do this that
+many times.  A negative argument means move forward but still to
+a less deep spot.  If ESCAPE-STRINGS is non-nil (as it is
+interactively), move out of enclosing strings as well.  If
+NO-SYNTAX-CROSSING is non-nil (as it is interactively), prefer to
+break out of any enclosing string instead of moving to the start
+of a list broken across multiple strings.  On error, location of
+point is unspecified."
+  (interactive "^p\nd\nd")
+  (up-list (- (or arg 1)) escape-strings no-syntax-crossing))
+
+(defun up-list (&optional arg escape-strings no-syntax-crossing)
   "Move forward out of one level of parentheses.
 This command will also work on other parentheses-like expressions
-defined by the current language mode.
-With ARG, do this that many times.
-A negative argument means move backward but still to a less deep spot.
-This command assumes point is not in a string or comment."
-  (interactive "^p")
+defined by the current language mode.  With ARG, do this that
+many times.  A negative argument means move backward but still to
+a less deep spot.  If ESCAPE-STRINGS is non-nil (as it is
+interactively), move out of enclosing strings as well. If
+NO-SYNTAX-CROSSING is non-nil (as it is interactively), prefer to
+break out of any enclosing string instead of moving to the start
+of a list broken across multiple strings.  On error, location of
+point is unspecified."
+  (interactive "^p\nd\nd")
   (or arg (setq arg 1))
   (let ((inc (if (> arg 0) 1 -1))
-        pos)
+        (pos nil))
     (while (/= arg 0)
-      (if (null forward-sexp-function)
-          (goto-char (or (scan-lists (point) inc 1) (buffer-end arg)))
-       (condition-case err
-           (while (progn (setq pos (point))
-                         (forward-sexp inc)
-                         (/= (point) pos)))
-         (scan-error (goto-char (nth (if (> arg 0) 3 2) err))))
-       (if (= (point) pos)
-            (signal 'scan-error
-                    (list "Unbalanced parentheses" (point) (point)))))
+      (condition-case err
+          (save-restriction
+            ;; If we've been asked not to cross string boundaries
+            ;; and we're inside a string, narrow to that string so
+            ;; that scan-lists doesn't find a match in a different
+            ;; string.
+            (when no-syntax-crossing
+              (let* ((syntax (syntax-ppss))
+                     (string-comment-start (nth 8 syntax)))
+                (when string-comment-start
+                  (save-excursion
+                    (goto-char string-comment-start)
+                    (narrow-to-region
+                     (point)
+                     (if (nth 3 syntax) ; in string
+                         (condition-case nil
+                             (progn (forward-sexp) (point))
+                           (scan-error (point-max)))
+                       (forward-comment 1)
+                       (point)))))))
+            (if (null forward-sexp-function)
+                (goto-char (or (scan-lists (point) inc 1)
+                               (buffer-end arg)))
+              (condition-case err
+                  (while (progn (setq pos (point))
+                                (forward-sexp inc)
+                                (/= (point) pos)))
+                (scan-error (goto-char (nth (if (> arg 0) 3 2) err))))
+              (if (= (point) pos)
+                  (signal 'scan-error
+                          (list "Unbalanced parentheses" (point) (point))))))
+        (scan-error
+         (let ((syntax nil))
+           (or
+            ;; If we bumped up against the end of a list, see whether
+            ;; we're inside a string: if so, just go to the beginning
+            ;; or end of that string.
+            (and escape-strings
+                 (or syntax (setf syntax (syntax-ppss)))
+                 (nth 3 syntax)
+                 (goto-char (nth 8 syntax))
+                 (progn (when (> inc 0)
+                          (forward-sexp))
+                        t))
+            ;; If we narrowed to a comment above and failed to escape
+            ;; it, the error might be our fault, not an indication
+            ;; that we're out of syntax.  Try again from beginning or
+            ;; end of the comment.
+            (and no-syntax-crossing
+                 (or syntax (setf syntax (syntax-ppss)))
+                 (nth 4 syntax)
+                 (goto-char (nth 8 syntax))
+                 (or (< inc 0)
+                     (forward-comment 1))
+                 (setf arg (+ arg inc)))
+            (signal (car err) (cdr err))))))
       (setq arg (- arg inc)))))
 
 (defun kill-sexp (&optional arg)
@@ -464,11 +522,15 @@ it marks the next defun after the ones already marked."
             (beginning-of-defun))
           (re-search-backward "^\n" (- (point) 1) t)))))
 
-(defun narrow-to-defun (&optional _arg)
+(defvar narrow-to-defun-include-comments nil
+  "If non-nil, `narrow-to-defun' will also show comments preceding the defun.")
+
+(defun narrow-to-defun (&optional include-comments)
   "Make text outside current defun invisible.
-The defun visible is the one that contains point or follows point.
-Optional ARG is ignored."
-  (interactive)
+The current defun is the one that contains point or follows point.
+Preceding comments are included if INCLUDE-COMMENTS is non-nil.
+Interactively, the behavior depends on `narrow-to-defun-include-comments'."
+  (interactive (list narrow-to-defun-include-comments))
   (save-excursion
     (widen)
     (let ((opoint (point))
@@ -504,6 +566,18 @@ Optional ARG is ignored."
        (setq end (point))
        (beginning-of-defun)
        (setq beg (point)))
+      (when include-comments
+       (goto-char beg)
+       ;; Move back past all preceding comments (and whitespace).
+       (when (forward-comment -1)
+         (while (forward-comment -1))
+         ;; Move forwards past any page breaks within these comments.
+         (when (and page-delimiter (not (string= page-delimiter "")))
+           (while (re-search-forward page-delimiter beg t)))
+         ;; Lastly, move past any empty lines.
+         (skip-chars-forward "[:space:]\n")
+         (beginning-of-line)
+         (setq beg (point))))
       (goto-char end)
       (re-search-backward "^\n" (- (point) 1) t)
       (narrow-to-region beg end))))
index e3a746fa69ee1c7169b44255aa0e8470bd1e8126..44727daf76ae21df6943669aa1e271343b04a978 100644 (file)
@@ -97,7 +97,10 @@ each clause."
 (defun macroexp--compiler-macro (handler form)
   (condition-case err
       (apply handler form (cdr form))
-    (error (message "Compiler-macro error for %S: %S" (car form) err)
+    (error
+     (message "--------------------------------------------------")
+     (backtrace)
+     (message "Compiler-macro error for %S: %S" (car form) err)
            form)))
 
 (defun macroexp--funcall-if-compiled (_form)
@@ -402,7 +405,7 @@ symbol itself."
 (defvar macroexp--pending-eager-loads nil
   "Stack of files currently undergoing eager macro-expansion.")
 
-(defun internal-macroexpand-for-load (form)
+(defun internal-macroexpand-for-load (form full-p)
   ;; Called from the eager-macroexpansion in readevalloop.
   (cond
    ;; Don't repeat the same warning for every top-level element.
@@ -425,7 +428,9 @@ symbol itself."
     (condition-case err
         (let ((macroexp--pending-eager-loads
                (cons load-file-name macroexp--pending-eager-loads)))
-          (macroexpand-all form))
+          (if full-p
+              (macroexpand-all form)
+            (macroexpand form)))
       (error
        ;; Hopefully this shouldn't happen thanks to the cycle detection,
        ;; but in case it does happen, let's catch the error and give the
index 1c8641249cfb9a525608b9acb0c16cf5323a3a35..bfd939d69e267a3f633ab4808a4912f3b5f5480d 100644 (file)
@@ -236,11 +236,12 @@ different, but `function-equal' will hopefully ignore those differences.")
           ;; This function acts like the t special value in buffer-local hooks.
           (lambda (&rest args) (apply (default-value var) args)))))
 
-(defun advice--normalize-place (place)
-  (cond ((eq 'local (car-safe place)) `(advice--buffer-local ,@(cdr place)))
-        ((eq 'var (car-safe place))   (nth 1 place))
-        ((symbolp place)              `(default-value ',place))
-        (t place)))
+(eval-and-compile
+  (defun advice--normalize-place (place)
+    (cond ((eq 'local (car-safe place)) `(advice--buffer-local ,@(cdr place)))
+          ((eq 'var (car-safe place))   (nth 1 place))
+          ((symbolp place)              `(default-value ',place))
+          (t place))))
 
 ;;;###autoload
 (defmacro add-function (where place function &optional props)
index b70b478cd3295c00f535cc21fb00b0451dc4a817..4d7ed8f121c001e4937d7a36cb68bbe770df16dc 100644 (file)
@@ -657,6 +657,7 @@ EXTRA-PROPERTIES is currently unused."
   (let* ((auto-name (format "%s-autoloads.el" name))
         ;;(ignore-name (concat name "-pkg.el"))
         (generated-autoload-file (expand-file-name auto-name pkg-dir))
+         (backup-inhibited t)
         (version-control 'never))
     (package-autoload-ensure-default-file generated-autoload-file)
     (update-directory-autoloads pkg-dir)
@@ -698,6 +699,7 @@ untar into a directory named DIR; otherwise, signal an error."
           (print-length nil))
       (write-region
        (concat
+        ";;; -*- no-byte-compile: t -*-\n"
         (prin1-to-string
          (nconc
           (list 'define-package
@@ -712,14 +714,25 @@ untar into a directory named DIR; otherwise, signal an error."
                            (list (car elt)
                                  (package-version-join (cadr elt))))
                          requires))))
-          (package--alist-to-plist
-           (package-desc-extras pkg-desc))))
+          (let ((alist (package-desc-extras pkg-desc))
+                flat)
+            (while alist
+              (let* ((pair (pop alist))
+                     (key (car pair))
+                     (val (cdr pair)))
+                ;; Don't bother ‘quote’ing ‘key’; it is always a keyword.
+                (push key flat)
+                (push (if (and (not (consp val))
+                               (or (keywordp val)
+                                   (not (symbolp val))
+                                   (memq val '(nil t))))
+                          val
+                        `',val)
+                      flat)))
+            (nreverse flat))))
         "\n")
        nil pkg-file nil 'silent))))
 
-(defun package--alist-to-plist (alist)
-  (apply #'nconc (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist)))
-
 (defun package-unpack (pkg-desc)
   "Install the contents of the current buffer as a package."
   (let* ((name (package-desc-name pkg-desc))
index b2d4f2b71dd50cc3a26c9ea9a164db183c53efed..ff9388171a6b3dd5decf947fecb32a4d03c163f3 100644 (file)
@@ -205,9 +205,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher."
                      (regexp-opt-group suffixes t t)
                      close-group))
 
-         (let* ((sgnirts (mapcar (lambda (s)
-                                   (concat (nreverse (string-to-list s))))
-                                 strings))
+         (let* ((sgnirts (mapcar #'reverse strings))
                 (xiffus (try-completion "" sgnirts)))
            (if (> (length xiffus) 0)
                ;; common suffix: take it and recurse on the prefixes.
@@ -218,8 +216,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher."
                              'string-lessp)))
                  (concat open-group
                          (regexp-opt-group prefixes t t)
-                         (regexp-quote
-                          (concat (nreverse (string-to-list xiffus))))
+                         (regexp-quote (nreverse xiffus))
                          close-group))
 
              ;; Otherwise, divide the list into those that start with a
index 1819daa3df0118adf4beaa8b76d1dd5516a5cdfa..ab51e13afcd02484c0656ec318d79a49bab10da8 100644 (file)
@@ -632,14 +632,14 @@ e.g. a LEFT-LEVEL of nil means this is a token that behaves somewhat like
 an open-paren, whereas a RIGHT-LEVEL of nil would correspond to something
 like a close-paren.")
 
-(defvar smie-forward-token-function 'smie-default-forward-token
+(defvar smie-forward-token-function #'smie-default-forward-token
   "Function to scan forward for the next token.
 Called with no argument should return a token and move to its end.
 If no token is found, return nil or the empty string.
 It can return nil when bumping into a parenthesis, which lets SMIE
 use syntax-tables to handle them in efficient C code.")
 
-(defvar smie-backward-token-function 'smie-default-backward-token
+(defvar smie-backward-token-function #'smie-default-backward-token
   "Function to scan backward the previous token.
 Same calling convention as `smie-forward-token-function' except
 it should move backward to the beginning of the previous token.")
@@ -806,9 +806,9 @@ Possible return values:
   nil: we skipped over an identifier, matched parentheses, ..."
   (smie-next-sexp
    (indirect-function smie-backward-token-function)
-   (indirect-function 'backward-sexp)
-   (indirect-function 'smie-op-left)
-   (indirect-function 'smie-op-right)
+   (indirect-function #'backward-sexp)
+   (indirect-function #'smie-op-left)
+   (indirect-function #'smie-op-right)
    halfsexp))
 
 (defun smie-forward-sexp (&optional halfsexp)
@@ -827,9 +827,9 @@ Possible return values:
   nil: we skipped over an identifier, matched parentheses, ..."
   (smie-next-sexp
    (indirect-function smie-forward-token-function)
-   (indirect-function 'forward-sexp)
-   (indirect-function 'smie-op-right)
-   (indirect-function 'smie-op-left)
+   (indirect-function #'forward-sexp)
+   (indirect-function #'smie-op-right)
+   (indirect-function #'smie-op-left)
    halfsexp))
 
 ;;; Miscellaneous commands using the precedence parser.
@@ -1121,7 +1121,7 @@ OPENER is non-nil if TOKEN is an opener and nil if it's a closer."
   :type 'integer
   :group 'smie)
 
-(defvar smie-rules-function 'ignore
+(defvar smie-rules-function #'ignore
   "Function providing the indentation rules.
 It takes two arguments METHOD and ARG where the meaning of ARG
 and the expected return value depends on METHOD.
@@ -2121,41 +2121,45 @@ position corresponding to each rule."
                otraces)
 
       ;; Finally, guess the indentation rules.
-      (let ((ssigs nil)
-            (rules nil))
-        ;; Sort the sigs by frequency of occurrence.
-        (maphash (lambda (sig sig-data) (push (cons sig sig-data) ssigs)) sigs)
-        (setq ssigs (sort ssigs (lambda (sd1 sd2) (> (cadr sd1) (cadr sd2)))))
-        (while ssigs
-          (pcase-let ((`(,sig ,total ,off-alist ,cotraces) (pop ssigs)))
-            (cl-assert (= total (apply #'+ (mapcar #'cdr off-alist))))
-            (let* ((sorted-off-alist
-                    (sort off-alist (lambda (x y) (> (cdr x) (cdr y)))))
-                   (offset (caar sorted-off-alist)))
-              (if (zerop offset)
-                  ;; Nothing to do with this sig; indentation is
-                  ;; correct already.
-                  nil
-                (push (cons (+ offset (nth 2 sig)) sig) rules)
-                ;; Adjust the rest of the data.
-                (pcase-dolist ((and cotrace `(,count ,toffset . ,trace))
-                               cotraces)
-                  (setf (nth 1 cotrace) (- toffset offset))
-                  (dolist (sig trace)
-                    (let ((sig-data (cdr (assq sig ssigs))))
-                      (when sig-data
-                        (let* ((ooff-data (assq toffset (nth 1 sig-data)))
-                               (noffset (- toffset offset))
-                               (noff-data
-                                (or (assq noffset (nth 1 sig-data))
-                                    (let ((off-data (cons noffset 0)))
-                                      (push off-data (nth 1 sig-data))
-                                      off-data))))
-                          (cl-assert (>= (cdr ooff-data) count))
-                          (cl-decf (cdr ooff-data) count)
-                          (cl-incf (cdr noff-data) count))))))))))
-        (message "Guessing...done")
-        rules))))
+      (prog1
+         (smie-config--guess-1 sigs)
+        (message "Guessing...done")))))
+
+(defun smie-config--guess-1 (sigs)
+  (let ((ssigs nil)
+        (rules nil))
+    ;; Sort the sigs by frequency of occurrence.
+    (maphash (lambda (sig sig-data) (push (cons sig sig-data) ssigs)) sigs)
+    (setq ssigs (sort ssigs (lambda (sd1 sd2) (> (cadr sd1) (cadr sd2)))))
+    (while ssigs
+      (pcase-let ((`(,sig ,total ,off-alist ,cotraces) (pop ssigs)))
+        (cl-assert (= total (apply #'+ (mapcar #'cdr off-alist))))
+        (let* ((sorted-off-alist
+                (sort off-alist (lambda (x y) (> (cdr x) (cdr y)))))
+               (offset (caar sorted-off-alist)))
+          (if (zerop offset)
+              ;; Nothing to do with this sig; indentation is
+              ;; correct already.
+              nil
+            (push (cons (+ offset (nth 2 sig)) sig) rules)
+            ;; Adjust the rest of the data.
+            (pcase-dolist ((and cotrace `(,count ,toffset . ,trace))
+                           cotraces)
+              (setf (nth 1 cotrace) (- toffset offset))
+              (dolist (sig trace)
+                (let ((sig-data (cdr (assq sig ssigs))))
+                  (when sig-data
+                    (let* ((ooff-data (assq toffset (nth 1 sig-data)))
+                           (noffset (- toffset offset))
+                           (noff-data
+                            (or (assq noffset (nth 1 sig-data))
+                                (let ((off-data (cons noffset 0)))
+                                  (push off-data (nth 1 sig-data))
+                                  off-data))))
+                      (cl-assert (>= (cdr ooff-data) count))
+                      (cl-decf (cdr ooff-data) count)
+                      (cl-incf (cdr noff-data) count))))))))))
+    rules))
 
 (defun smie-config-guess ()
   "Try and figure out this buffer's indentation settings.
index 505a556b65f2c33ecde70ea16a59d7a82650e013..76473b39a77fd07da2d5927917d89b6c22e814b3 100644 (file)
 
 ;;; Code:
 
+(require 'pcase)
+
+
+(defmacro internal--thread-argument (first? &rest forms)
+  "Internal implementation for `thread-first' and `thread-last'.
+When Argument FIRST? is non-nil argument is threaded first, else
+last.  FORMS are the expressions to be threaded."
+  (pcase forms
+    (`(,x (,f . ,args) . ,rest)
+     `(internal--thread-argument
+       ,first? ,(if first? `(,f ,x ,@args) `(,f ,@args ,x)) ,@rest))
+    (`(,x ,f . ,rest) `(internal--thread-argument ,first? (,f ,x) ,@rest))
+    (_ (car forms))))
+
+(defmacro thread-first (&rest forms)
+  "Thread FORMS elements as the first argument of their succesor.
+Example:
+    (thread-first
+      5
+      (+ 20)
+      (/ 25)
+      -
+      (+ 40))
+Is equivalent to:
+    (+ (- (/ (+ 5 20) 25)) 40)
+Note how the single `-' got converted into a list before
+threading."
+  (declare (indent 1)
+           (debug (form &rest [&or symbolp (sexp &rest form)])))
+  `(internal--thread-argument t ,@forms))
+
+(defmacro thread-last (&rest forms)
+  "Thread FORMS elements as the last argument of their succesor.
+Example:
+    (thread-last
+      5
+      (+ 20)
+      (/ 25)
+      -
+      (+ 40))
+Is equivalent to:
+    (+ 40 (- (/ 25 (+ 20 5))))
+Note how the single `-' got converted into a list before
+threading."
+  (declare (indent 1) (debug thread-first))
+  `(internal--thread-argument nil ,@forms))
+
+(defsubst internal--listify (elt)
+  "Wrap ELT in a list if it is not one."
+  (if (not (listp elt))
+      (list elt)
+    elt))
+
+(defsubst internal--check-binding (binding)
+  "Check BINDING is properly formed."
+  (when (> (length binding) 2)
+    (signal
+     'error
+     (cons "`let' bindings can have only one value-form" binding)))
+  binding)
+
+(defsubst internal--build-binding-value-form (binding prev-var)
+  "Build the conditional value form for BINDING using PREV-VAR."
+  `(,(car binding) (and ,prev-var ,(cadr binding))))
+
+(defun internal--build-binding (binding prev-var)
+  "Check and build a single BINDING with PREV-VAR."
+  (thread-first
+      binding
+    internal--listify
+    internal--check-binding
+    (internal--build-binding-value-form prev-var)))
+
+(defun internal--build-bindings (bindings)
+  "Check and build conditional value forms for BINDINGS."
+  (let ((prev-var t))
+    (mapcar (lambda (binding)
+              (let ((binding (internal--build-binding binding prev-var)))
+                (setq prev-var (car binding))
+                binding))
+            bindings)))
+
+(defmacro if-let (bindings then &rest else)
+  "Process BINDINGS and if all values are non-nil eval THEN, else ELSE.
+Argument BINDINGS is a list of tuples whose car is a symbol to be
+bound and (optionally) used in THEN, and its cadr is a sexp to be
+evaled to set symbol's value.  In the special case you only want
+to bind a single value, BINDINGS can just be a plain tuple."
+  (declare (indent 2) (debug ((&rest (symbolp form)) form body)))
+  (when (and (<= (length bindings) 2)
+             (not (listp (car bindings))))
+    ;; Adjust the single binding case
+    (setq bindings (list bindings)))
+  `(let* ,(internal--build-bindings bindings)
+     (if ,(car (internal--listify (car (last bindings))))
+         ,then
+       ,@else)))
+
+(defmacro when-let (bindings &rest body)
+  "Process BINDINGS and if all values are non-nil eval BODY.
+Argument BINDINGS is a list of tuples whose car is a symbol to be
+bound and (optionally) used in BODY, and its cadr is a sexp to be
+evaled to set symbol's value.  In the special case you only want
+to bind a single value, BINDINGS can just be a plain tuple."
+  (declare (indent 1) (debug if-let))
+  (list 'if-let bindings (macroexp-progn body)))
+
 (defsubst hash-table-keys (hash-table)
   "Return a list of keys in HASH-TABLE."
   (let ((keys '()))
   "Join all STRINGS using SEPARATOR."
   (mapconcat 'identity strings separator))
 
-(defsubst string-reverse (str)
-  "Reverse the string STR."
-  (apply 'string (nreverse (string-to-list str))))
+(define-obsolete-function-alias 'string-reverse 'reverse "24.5")
 
 (defsubst string-trim-left (string)
   "Remove leading whitespace from STRING."
index d0d71ddb935467327e625270f7da0fb6364ea9ec..3ee261aa06b42ea8bc2e9bb776d46de8cb138ac9 100644 (file)
@@ -323,7 +323,8 @@ to the entry with the same ID element as the current line."
     (if saved-pt
        (progn (goto-char saved-pt)
               (move-to-column saved-col)
-              (recenter))
+              (when (eq (window-buffer) (current-buffer))
+                (recenter)))
       (goto-char (point-min)))))
 
 (defun tabulated-list-print-entry (id cols)
index 96c9ba1e095a71bc219f7d7a34d63fe470bfb04f..ee70071b7eced089a2c3a681825f5bb0c9718aa4 100644 (file)
@@ -1156,19 +1156,6 @@ If ARG is the atom `-', scroll upward by nearly full screen."
        (cancel-timer cua--prefix-override-timer))
     (setq cua--prefix-override-timer nil))
 
-  (cond
-   ;; Only symbol commands can have necessary properties
-   ((not (symbolp this-command))
-    nil)
-
-   ((not (eq (get this-command 'CUA) 'move))
-    nil)
-
-   ;; Set mark if user explicitly said to do so
-   (cua--rectangle ;FIXME: ??
-    (unless mark-active
-      (push-mark-command nil nil))))
-
   ;; Detect extension of rectangles by mouse or other movement
   (setq cua--buffer-and-point-before-command
        (if cua--rectangle (cons (current-buffer) (point)))))
@@ -1367,36 +1354,6 @@ If ARG is the atom `-', scroll upward by nearly full screen."
   )
 
 
-;; Setup standard movement commands to be recognized by CUA.
-
-(dolist (cmd
- '(forward-char backward-char
-   right-char left-char
-   right-word left-word
-   next-line previous-line
-   forward-word backward-word
-   end-of-line beginning-of-line
-   end-of-visual-line beginning-of-visual-line
-   move-end-of-line move-beginning-of-line
-   end-of-buffer beginning-of-buffer
-   scroll-up scroll-down
-   scroll-up-command scroll-down-command
-   up-list down-list backward-up-list
-   end-of-defun beginning-of-defun
-   forward-sexp backward-sexp
-   forward-list backward-list
-   forward-sentence backward-sentence
-   forward-paragraph backward-paragraph
-   ;; CC mode motion commands
-   c-forward-conditional c-backward-conditional
-   c-down-conditional c-up-conditional
-   c-down-conditional-with-else c-up-conditional-with-else
-   c-beginning-of-statement c-end-of-statement))
-  (put cmd 'CUA 'move))
-
-;; Only called if pc-selection-mode is t, which means pc-select is loaded.
-(declare-function pc-selection-mode "pc-select" (&optional arg))
-
 ;; State prior to enabling cua-mode
 ;; Value is a list with the following elements:
 ;;   delete-selection-mode
index a32fb612adb3ebb922497e67be6c460c1c335fc0..e0e2660b70a739baaaf30b0f4965f1563cf1e26f 100644 (file)
@@ -2033,7 +2033,8 @@ created."
   ;; Make highlighting of selected text work properly for EDT commands.
   (if (featurep 'emacs)
       (progn
-       (setq edt-orig-transient-mark-mode transient-mark-mode)
+       (setq edt-orig-transient-mark-mode
+              (default-value 'transient-mark-mode))
        (add-hook 'activate-mark-hook
                  (function
                   (lambda ()
@@ -2068,7 +2069,7 @@ created."
   (edt-reset)
   (force-mode-line-update t)
   (if (featurep 'emacs)
-    (setq transient-mark-mode edt-orig-transient-mark-mode))
+      (setq-default transient-mark-mode edt-orig-transient-mark-mode))
   (message "Original key bindings restored; EDT Emulation disabled"))
 
 (defun edt-default-menu-bar-update-buffers ()
index 9a096a0a7094dc2d61bd79094dfdc402229dc6b0..d1ed679c0f1d16b5255d34653bf0a24e975b2c85 100644 (file)
@@ -70,27 +70,24 @@ USAGE would be `sign' or `encrypt'."
 ;;;###autoload
 (defun epa-mail-decrypt ()
   "Decrypt OpenPGP armors in the current buffer.
-The buffer is expected to contain a mail message.
-
-Don't use this command in Lisp programs!"
+The buffer is expected to contain a mail message."
+  (declare (interactive-only t))
   (interactive)
   (epa-decrypt-armor-in-region (point-min) (point-max)))
 
 ;;;###autoload
 (defun epa-mail-verify ()
   "Verify OpenPGP cleartext signed messages in the current buffer.
-The buffer is expected to contain a mail message.
-
-Don't use this command in Lisp programs!"
+The buffer is expected to contain a mail message."
+  (declare (interactive-only t))
   (interactive)
   (epa-verify-cleartext-in-region (point-min) (point-max)))
 
 ;;;###autoload
 (defun epa-mail-sign (start end signers mode)
   "Sign the current buffer.
-The buffer is expected to contain a mail message.
-
-Don't use this command in Lisp programs!"
+The buffer is expected to contain a mail message."
+  (declare (interactive-only t))
   (interactive
    (save-excursion
      (goto-char (point-min))
@@ -234,9 +231,8 @@ If no one is selected, symmetric encryption will be performed.  "
 ;;;###autoload
 (defun epa-mail-import-keys ()
   "Import keys in the OpenPGP armor format in the current buffer.
-The buffer is expected to contain a mail message.
-
-Don't use this command in Lisp programs!"
+The buffer is expected to contain a mail message."
+  (declare (interactive-only t))
   (interactive)
   (epa-import-armor-in-region (point-min) (point-max)))
 
index be439ef241d5b6d4b727bc1e8c361b25e8357ce6..0c833ab84d61d22fb5a2015b9904a44df06faa08 100644 (file)
@@ -834,6 +834,7 @@ For example:
 
 Don't use this command in Lisp programs!
 See the reason described in the `epa-decrypt-region' documentation."
+  (declare (interactive-only t))
   (interactive "r")
   (save-excursion
     (save-restriction
@@ -873,6 +874,7 @@ For example:
   (decode-coding-string
     (epg-verify-string context (buffer-substring start end))
     'utf-8))"
+  (declare (interactive-only t))
   (interactive "r")
   (let ((context (epg-make-context epa-protocol))
        plain)
@@ -914,6 +916,7 @@ between START and END.
 
 Don't use this command in Lisp programs!
 See the reason described in the `epa-verify-region' documentation."
+  (declare (interactive-only t))
   (interactive "r")
   (save-excursion
     (save-restriction
@@ -956,6 +959,7 @@ For example:
   (epg-sign-string
     context
     (encode-coding-string (buffer-substring start end) 'utf-8)))"
+  (declare (interactive-only t))
   (interactive
    (let ((verbose current-prefix-arg))
      (setq epa-last-coding-system-specified
@@ -1037,6 +1041,7 @@ For example:
     context
     (encode-coding-string (buffer-substring start end) 'utf-8)
     nil))"
+  (declare (interactive-only t))
   (interactive
    (let ((verbose current-prefix-arg)
         (context (epg-make-context epa-protocol))
@@ -1205,6 +1210,7 @@ If no one is selected, default public key is exported.  ")))
 ;; If a prefix-arg is specified, the signature is marked as non exportable.
 
 ;; Don't use this command in Lisp programs!"
+;;   (declare (interactive-only t))
 ;;   (interactive
 ;;    (let ((keys (epa--marked-keys)))
 ;;      (unless keys
index 77181a1a342c5481f6eefd7fb1f0d26272ca2689..26e3b3d2501eca15f789cfd61b7e6ba1ecf1f73d 100644 (file)
@@ -1206,7 +1206,6 @@ This function is for internal use only."
         (coding-system-for-read 'binary)
         process-connection-type
         (process-environment process-environment)
-        (orig-mode (default-file-modes))
         (buffer (generate-new-buffer " *epg*"))
         process
         terminal-name
@@ -1265,14 +1264,9 @@ This function is for internal use only."
       (setq epg-agent-file agent-file)
       (make-local-variable 'epg-agent-mtime)
       (setq epg-agent-mtime agent-mtime))
-    (unwind-protect
-       (progn
-         (set-default-file-modes 448)
-         (setq process
-               (apply #'start-process "epg" buffer
-                      (epg-context-program context)
-                      args)))
-      (set-default-file-modes orig-mode))
+    (with-file-modes 448
+      (setq process (apply #'start-process "epg" buffer
+                          (epg-context-program context) args)))
     (set-process-filter process #'epg--process-filter)
     (epg-context-set-process context process)))
 
index 6d99fdf73d9ce54cca60926dec24b8c00e9c201c..58aa0387f1991599db6f221e217c981ed03f9244 100644 (file)
@@ -1,3 +1,26 @@
+2014-07-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * erc.el (erc-channel-receive-names): Reduce redundancy.
+
+2014-06-19  Kelvin White  <kelvin.white77@gmail.com>
+
+       * erc-backend.el: Handle user modes in relevant server responses
+       * erc.el: Better user mode support.
+       (erc-channel-user): Add members for new modes.
+       (erc-channel-member-halfop-p, erc-channel-user-admin-p)
+       (erc-channel-user-owner-p): Use new struct members.
+       (erc-format-nick, erc-format-@nick): Display user modes as nick prefix.
+       (erc-nick-prefix-face, erc-my-nick-prefix-face): Add new faces
+       (erc-get-user-mode-prefix): Return symbol for mode prefix.
+       (erc-update-channel-member, erc-update-current-channel-member)
+       (erc-channel-receive-names): Update channel users.
+       (erc-nick-at-point): Return correct user info.
+
+2014-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * erc.el (erc-invite-only-mode, erc-toggle-channel-mode): Simplify.
+       (erc-load-script): Tighten a regexp.
+
 2014-02-25  Julien Danjou  <julien@danjou.info>
 
        * erc-networks.el (erc-determine-network): Check that NETWORK as a
@@ -610,4 +633,3 @@ See ChangeLog.08 for earlier changes.
 ;; coding: utf-8
 ;; add-log-time-zone-rule: t
 ;; End:
-
index 01fdfc54d1d98d8a857e55271c27b7efa625b75b..8751a194e3b8e2561c7d7a47867f48b572bf11ed 100644 (file)
@@ -679,7 +679,7 @@ Conditionally try to reconnect and take appropriate action."
     (when (buffer-live-p buf)
       (with-current-buffer buf
         (erc-log (format
-                  "SENTINEL: proc: %S   status: %S  event: %S (quitting: %S)"
+                  "SENTINEL: proc: %S    status: %S  event: %S (quitting: %S)"
                   cproc (process-status cproc) event erc-server-quitting))
         (if (string-match "^open" event)
             ;; newly opened connection (no wait)
@@ -1208,7 +1208,6 @@ add things to `%s' instead."
          parsed 'notice 'active
          'INVITE ?n nick ?u login ?h host ?c chnl)))))
 
-
 (define-erc-response-handler (JOIN)
   "Handle join messages."
   nil
@@ -1244,7 +1243,7 @@ add things to `%s' instead."
                        (erc-format-message
                         'JOIN ?n nick ?u login ?h host ?c chnl))))))
           (when buffer (set-buffer buffer))
-          (erc-update-channel-member chnl nick nick t nil nil host login)
+          (erc-update-channel-member chnl nick nick t nil nil nil nil nil host login)
           ;; on join, we want to stay in the new channel buffer
           ;;(set-buffer ob)
           (erc-display-message parsed nil buffer str))))))
@@ -1413,7 +1412,7 @@ add things to `%s' instead."
             ;; message.  We will accumulate private identities indefinitely
             ;; at this point.
             (erc-update-channel-member (if privp nick tgt) nick nick
-                                       privp nil nil host login nil nil t)
+                                       privp nil nil nil nil nil host login nil nil t)
             (let ((cdata (erc-get-channel-user nick)))
               (setq fnick (funcall erc-format-nick-function
                                    (car cdata) (cdr cdata))))))
@@ -1470,7 +1469,7 @@ add things to `%s' instead."
                                    (current-time))))
     (pcase-let ((`(,nick ,login ,host)
                  (erc-parse-user (erc-response.sender parsed))))
-      (erc-update-channel-member ch nick nick nil nil nil host login)
+      (erc-update-channel-member ch nick nick nil nil nil nil nil nil host login)
       (erc-update-channel-topic ch (format "%s\C-o (%s, %s)" topic nick time))
       (erc-display-message parsed 'notice (erc-get-buffer ch proc)
                            'TOPIC ?n nick ?u login ?h host
@@ -1800,8 +1799,7 @@ See `erc-display-server-message'." nil
       (when (string-match "\\(^[0-9]+ \\)\\(.*\\)$" full-name)
         (setq hopcount (match-string 1 full-name))
         (setq full-name (match-string 2 full-name)))
-      (erc-update-channel-member channel nick nick nil nil nil host
-                                 user full-name)
+      (erc-update-channel-member channel nick nick nil nil nil nil nil nil host user full-name)
       (erc-display-message parsed 'notice 'active 's352
                            ?c channel ?n nick ?a away-flag
                            ?u user ?h host ?f full-name))))
index d93e9e02156b3b444f76f45e27431a3aca9ed743..3bd9ff3ce71a9d3f9f8dab570cfa08c3c0d72f35 100644 (file)
@@ -9,6 +9,7 @@
 ;;               Andreas Fuchs (afs@void.at)
 ;;               Gergely Nagy (algernon@midgard.debian.net)
 ;;               David Edmondson (dme@dme.org)
+;;               Kelvin White (kwhite@gnu.org)
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: IRC, chat, client, Internet
 ;; Version: 5.3
@@ -143,7 +144,7 @@ See function `erc-compute-server' for more details on connection
 parameters and authentication."
   :group 'erc
   :type '(choice (const :tag "None" nil)
-                (string :tag "Server")))
+                 (string :tag "Server")))
 
 (defcustom erc-port nil
   "IRC port to use if not specified.
@@ -151,8 +152,8 @@ parameters and authentication."
 This can be either a string or a number."
   :group 'erc
   :type '(choice (const :tag "None" nil)
-                (integer :tag "Port number")
-                (string :tag "Port string")))
+                 (integer :tag "Port number")
+                 (string :tag "Port string")))
 
 (defcustom erc-nick nil
   "Nickname to use if one is not provided.
@@ -165,8 +166,8 @@ See function `erc-compute-nick' for more details on connection
 parameters and authentication."
   :group 'erc
   :type '(choice (const :tag "None" nil)
-                (string :tag "Nickname")
-                (repeat (string :tag "Nickname"))))
+                 (string :tag "Nickname")
+                 (repeat (string :tag "Nickname"))))
 
 (defcustom erc-nick-uniquifier "`"
   "The string to append to the nick if it is already in use."
@@ -190,10 +191,10 @@ See function `erc-compute-full-name' for more details on connection
 parameters and authentication."
   :group 'erc
   :type '(choice (const :tag "No name" nil)
-                (string :tag "Name")
-                (function :tag "Get from function"))
+                 (string :tag "Name")
+                 (function :tag "Get from function"))
   :set (lambda (sym val)
-        (set sym (if (functionp val) (funcall val) val))))
+         (set sym (if (functionp val) (funcall val) val))))
 
 (defvar erc-password nil
   "Password to use when authenticating to an IRC server.
@@ -243,12 +244,12 @@ If nil, only \"> \" will be shown."
 (define-widget 'erc-message-type 'set
   "A set of standard IRC Message types."
   :args '((const "JOIN")
-         (const "KICK")
-         (const "NICK")
-         (const "PART")
-         (const "QUIT")
-         (const "MODE")
-         (repeat :inline t :tag "Others" (string :tag "IRC Message Type"))))
+          (const "KICK")
+          (const "NICK")
+          (const "PART")
+          (const "QUIT")
+          (const "MODE")
+          (repeat :inline t :tag "Others" (string :tag "IRC Message Type"))))
 
 (defcustom erc-hide-list nil
   "List of IRC type messages to hide.
@@ -339,14 +340,14 @@ nicknames with erc-server-user struct instances.")
 (defun erc-downcase (string)
   "Convert STRING to IRC standard conforming downcase."
   (let ((s (downcase string))
-       (c '((?\[ . ?\{)
-            (?\] . ?\})
-            (?\\ . ?\|)
-            (?~  . ?^))))
+        (c '((?\[ . ?\{)
+             (?\] . ?\})
+             (?\\ . ?\|)
+             (?~  . ?^))))
     (save-match-data
       (while (string-match "[]\\[~]" s)
-       (aset s (match-beginning 0)
-             (cdr (assq (aref s (match-beginning 0)) c)))))
+        (aset s (match-beginning 0)
+              (cdr (assq (aref s (match-beginning 0)) c)))))
     s))
 
 (defmacro erc-with-server-buffer (&rest body)
@@ -356,8 +357,8 @@ If no server buffer exists, return nil."
   (let ((buffer (make-symbol "buffer")))
     `(let ((,buffer (erc-server-buffer)))
        (when (buffer-live-p ,buffer)
-        (with-current-buffer ,buffer
-          ,@body)))))
+         (with-current-buffer ,buffer
+           ,@body)))))
 
 (cl-defstruct (erc-server-user (:type vector) :named)
   ;; User data
@@ -370,7 +371,7 @@ If no server buffer exists, return nil."
   )
 
 (cl-defstruct (erc-channel-user (:type vector) :named)
-  op voice
+  voice halfop op admin owner
   ;; Last message time (in the form of the return value of
   ;; (current-time)
   ;;
@@ -419,11 +420,11 @@ other buffers are also changed."
       (puthash (erc-downcase new-nick) user erc-server-users))
     (dolist (buf (erc-server-user-buffers user))
       (if (buffer-live-p buf)
-         (with-current-buffer buf
-           (let ((cdata (erc-get-channel-user nick)))
-             (remhash (erc-downcase nick) erc-channel-users)
-             (puthash (erc-downcase new-nick) cdata
-                      erc-channel-users)))))))
+          (with-current-buffer buf
+            (let ((cdata (erc-get-channel-user nick)))
+              (remhash (erc-downcase nick) erc-channel-users)
+              (puthash (erc-downcase new-nick) cdata
+                       erc-channel-users)))))))
 
 (defun erc-remove-channel-user (nick)
   "This function is for internal use only.
@@ -437,12 +438,12 @@ See also: `erc-remove-server-user' and `erc-remove-user'."
   (let ((channel-data (erc-get-channel-user nick)))
     (when channel-data
       (let ((user (car channel-data)))
-       (setf (erc-server-user-buffers user)
-             (delq (current-buffer)
-                   (erc-server-user-buffers user)))
-       (remhash (erc-downcase nick) erc-channel-users)
-       (if (null (erc-server-user-buffers user))
-           (erc-remove-server-user nick))))))
+        (setf (erc-server-user-buffers user)
+              (delq (current-buffer)
+                    (erc-server-user-buffers user)))
+        (remhash (erc-downcase nick) erc-channel-users)
+        (if (null (erc-server-user-buffers user))
+            (erc-remove-server-user nick))))))
 
 (defun erc-remove-user (nick)
   "This function is for internal use only.
@@ -455,11 +456,11 @@ See also: `erc-remove-server-user' and
   (let ((user (erc-get-server-user nick)))
     (when user
       (let ((buffers (erc-server-user-buffers user)))
-       (dolist (buf buffers)
-         (if (buffer-live-p buf)
-             (with-current-buffer buf
-               (remhash (erc-downcase nick) erc-channel-users)
-               (run-hooks 'erc-channel-members-changed-hook)))))
+        (dolist (buf buffers)
+          (if (buffer-live-p buf)
+              (with-current-buffer buf
+                (remhash (erc-downcase nick) erc-channel-users)
+                (run-hooks 'erc-channel-members-changed-hook)))))
       (erc-remove-server-user nick))))
 
 (defun erc-remove-channel-users ()
@@ -468,28 +469,52 @@ See also: `erc-remove-server-user' and
 Removes all users in the current channel.  This is called by
 `erc-server-PART' and `erc-server-QUIT'."
   (when (and erc-server-connected
-            (erc-server-process-alive)
-            (hash-table-p erc-channel-users))
+             (erc-server-process-alive)
+             (hash-table-p erc-channel-users))
     (maphash (lambda (nick _cdata)
-              (erc-remove-channel-user nick))
-            erc-channel-users)
+               (erc-remove-channel-user nick))
+             erc-channel-users)
     (clrhash erc-channel-users)))
 
+(defsubst erc-channel-user-owner-p (nick)
+  "Return non-nil if NICK is an owner of the current channel."
+  (and nick
+       (hash-table-p erc-channel-users)
+       (let ((cdata (erc-get-channel-user nick)))
+         (and cdata (cdr cdata)
+              (erc-channel-user-owner (cdr cdata))))))
+
+(defsubst erc-channel-user-admin-p (nick)
+  "Return non-nil if NICK is an admin in the current channel."
+  (and nick
+       (hash-table-p erc-channel-users)
+       (let ((cdata (erc-get-channel-user nick)))
+         (and cdata (cdr cdata)
+              (erc-channel-user-admin (cdr cdata))))))
+
 (defsubst erc-channel-user-op-p (nick)
-  "Return t if NICK is an operator in the current channel."
+  "Return non-nil if NICK is an operator in the current channel."
   (and nick
        (hash-table-p erc-channel-users)
        (let ((cdata (erc-get-channel-user nick)))
-        (and cdata (cdr cdata)
-             (erc-channel-user-op (cdr cdata))))))
+         (and cdata (cdr cdata)
+              (erc-channel-user-op (cdr cdata))))))
+
+(defsubst erc-channel-user-halfop-p (nick)
+  "Return non-nil if NICK is a half-operator in the current channel."
+  (and nick
+       (hash-table-p erc-channel-users)
+       (let ((cdata (erc-get-channel-user nick)))
+         (and cdata (cdr cdata)
+              (erc-channel-user-halfop (cdr cdata))))))
 
 (defsubst erc-channel-user-voice-p (nick)
-  "Return t if NICK has voice in the current channel."
+  "Return non-nil if NICK has voice in the current channel."
   (and nick
        (hash-table-p erc-channel-users)
        (let ((cdata (erc-get-channel-user nick)))
-        (and cdata (cdr cdata)
-             (erc-channel-user-voice (cdr cdata))))))
+         (and cdata (cdr cdata)
+              (erc-channel-user-voice (cdr cdata))))))
 
 (defun erc-get-channel-user-list ()
   "Return a list of users in the current channel.  Each element
@@ -500,9 +525,9 @@ erc-channel-user struct.
 See also: `erc-sort-channel-users-by-activity'"
   (let (users)
     (if (hash-table-p erc-channel-users)
-      (maphash (lambda (_nick cdata)
-                (setq users (cons cdata users)))
-              erc-channel-users))
+        (maphash (lambda (_nick cdata)
+                   (setq users (cons cdata users)))
+                 erc-channel-users))
     users))
 
 (defun erc-get-server-nickname-list ()
@@ -510,22 +535,22 @@ See also: `erc-sort-channel-users-by-activity'"
   (erc-with-server-buffer
     (let (nicks)
       (when (hash-table-p erc-server-users)
-       (maphash (lambda (_n user)
-                  (setq nicks
-                        (cons (erc-server-user-nickname user)
-                              nicks)))
-                erc-server-users)
-       nicks))))
+        (maphash (lambda (_n user)
+                   (setq nicks
+                         (cons (erc-server-user-nickname user)
+                               nicks)))
+                 erc-server-users)
+        nicks))))
 
 (defun erc-get-channel-nickname-list ()
   "Return a list of known nicknames on the current channel."
   (let (nicks)
     (when (hash-table-p erc-channel-users)
       (maphash (lambda (_n cdata)
-                (setq nicks
-                      (cons (erc-server-user-nickname (car cdata))
-                            nicks)))
-              erc-channel-users)
+                 (setq nicks
+                       (cons (erc-server-user-nickname (car cdata))
+                             nicks)))
+               erc-channel-users)
       nicks)))
 
 (defun erc-get-server-nickname-alist ()
@@ -533,22 +558,22 @@ See also: `erc-sort-channel-users-by-activity'"
   (erc-with-server-buffer
     (let (nicks)
       (when (hash-table-p erc-server-users)
-       (maphash (lambda (_n user)
-                  (setq nicks
-                        (cons (cons (erc-server-user-nickname user) nil)
-                              nicks)))
-                erc-server-users)
-       nicks))))
+        (maphash (lambda (_n user)
+                   (setq nicks
+                         (cons (cons (erc-server-user-nickname user) nil)
+                               nicks)))
+                 erc-server-users)
+        nicks))))
 
 (defun erc-get-channel-nickname-alist ()
   "Return an alist of known nicknames on the current channel."
   (let (nicks)
     (when (hash-table-p erc-channel-users)
       (maphash (lambda (_n cdata)
-                (setq nicks
-                      (cons (cons (erc-server-user-nickname (car cdata)) nil)
-                            nicks)))
-              erc-channel-users)
+                 (setq nicks
+                       (cons (cons (erc-server-user-nickname (car cdata)) nil)
+                             nicks)))
+               erc-channel-users)
       nicks)))
 
 (defun erc-sort-channel-users-by-activity (list)
@@ -557,13 +582,13 @@ LIST must be of the form (USER . CHANNEL-DATA).
 
 See also: `erc-get-channel-user-list'."
   (sort list
-       (lambda (x y)
-         (when (and (cdr x) (cdr y))
-           (let ((tx (erc-channel-user-last-message-time (cdr x)))
-                 (ty (erc-channel-user-last-message-time (cdr y))))
-             (and tx
-                  (or (not ty)
-                      (time-less-p ty tx))))))))
+        (lambda (x y)
+          (when (and (cdr x) (cdr y))
+            (let ((tx (erc-channel-user-last-message-time (cdr x)))
+                  (ty (erc-channel-user-last-message-time (cdr y))))
+              (and tx
+                   (or (not ty)
+                       (time-less-p ty tx))))))))
 
 (defun erc-sort-channel-users-alphabetically (list)
   "Sort LIST so that users' nicknames are in alphabetical order.
@@ -571,13 +596,13 @@ LIST must be of the form (USER . CHANNEL-DATA).
 
 See also: `erc-get-channel-user-list'."
   (sort list
-       (lambda (x y)
-         (when (and (cdr x) (cdr y))
-           (let ((nickx (downcase (erc-server-user-nickname (car x))))
-                 (nicky (downcase (erc-server-user-nickname (car y)))))
-             (and nickx
-                  (or (not nicky)
-                      (string-lessp nickx nicky))))))))
+        (lambda (x y)
+          (when (and (cdr x) (cdr y))
+            (let ((nickx (downcase (erc-server-user-nickname (car x))))
+                  (nicky (downcase (erc-server-user-nickname (car y)))))
+              (and nickx
+                   (or (not nicky)
+                       (string-lessp nickx nicky))))))))
 
 (defvar erc-channel-topic nil
   "A topic string for the channel.  Should only be used in channel-buffers.")
@@ -613,10 +638,10 @@ E.g. '(\"i\" \"m\" \"s\" \"b Quake!*@*\")
 
 See also the variable `erc-prompt'."
   (let ((prompt (if (functionp erc-prompt)
-                   (funcall erc-prompt)
-                 erc-prompt)))
+                    (funcall erc-prompt)
+                  erc-prompt)))
     (if (> (length prompt) 0)
-       (concat prompt " ")
+        (concat prompt " ")
       prompt)))
 
 (defcustom erc-command-indicator nil
@@ -635,11 +660,11 @@ If nil, the prompt will be constructed from the variable `erc-prompt'."
 This only has any meaning if the variable `erc-command-indicator' is non-nil."
   (and erc-command-indicator
        (let ((prompt (if (functionp erc-command-indicator)
-                        (funcall erc-command-indicator)
-                        erc-command-indicator)))
-        (if (> (length prompt) 0)
-            (concat prompt " ")
-            prompt))))
+                         (funcall erc-command-indicator)
+                       erc-command-indicator)))
+         (if (> (length prompt) 0)
+             (concat prompt " ")
+           prompt))))
 
 (defcustom erc-notice-prefix "*** "
   "Prefix for all notices."
@@ -658,8 +683,8 @@ The following values are allowed:
 Any other value disables notice's highlighting altogether."
   :group 'erc-display
   :type '(choice (const :tag "highlight notice prefix only" prefix)
-                (const :tag "highlight the entire notice" all)
-                (const :tag "don't highlight notices at all" nil)))
+                 (const :tag "highlight the entire notice" all)
+                 (const :tag "don't highlight notices at all" nil)))
 
 (defcustom erc-echo-notice-hook nil
   "List of functions to call to echo a private notice.
@@ -682,14 +707,14 @@ See also: `erc-echo-notice-always-hook',
   :group 'erc-hooks
   :type 'hook
   :options '(erc-echo-notice-in-default-buffer
-            erc-echo-notice-in-target-buffer
-            erc-echo-notice-in-minibuffer
-            erc-echo-notice-in-server-buffer
-            erc-echo-notice-in-active-non-server-buffer
-            erc-echo-notice-in-active-buffer
-            erc-echo-notice-in-user-buffers
-            erc-echo-notice-in-user-and-target-buffers
-            erc-echo-notice-in-first-user-buffer))
+             erc-echo-notice-in-target-buffer
+             erc-echo-notice-in-minibuffer
+             erc-echo-notice-in-server-buffer
+             erc-echo-notice-in-active-non-server-buffer
+             erc-echo-notice-in-active-buffer
+             erc-echo-notice-in-user-buffers
+             erc-echo-notice-in-user-and-target-buffers
+             erc-echo-notice-in-first-user-buffer))
 
 (defcustom erc-echo-notice-always-hook
   '(erc-echo-notice-in-default-buffer)
@@ -713,14 +738,14 @@ See also: `erc-echo-notice-hook',
   :group 'erc-hooks
   :type 'hook
   :options '(erc-echo-notice-in-default-buffer
-            erc-echo-notice-in-target-buffer
-            erc-echo-notice-in-minibuffer
-            erc-echo-notice-in-server-buffer
-            erc-echo-notice-in-active-non-server-buffer
-            erc-echo-notice-in-active-buffer
-            erc-echo-notice-in-user-buffers
-            erc-echo-notice-in-user-and-target-buffers
-            erc-echo-notice-in-first-user-buffer))
+             erc-echo-notice-in-target-buffer
+             erc-echo-notice-in-minibuffer
+             erc-echo-notice-in-server-buffer
+             erc-echo-notice-in-active-non-server-buffer
+             erc-echo-notice-in-active-buffer
+             erc-echo-notice-in-user-buffers
+             erc-echo-notice-in-user-and-target-buffers
+             erc-echo-notice-in-first-user-buffer))
 
 ;; other tunable parameters
 
@@ -747,7 +772,7 @@ Many consider it impolite to do so automatically."
   "The nickname to take when you are marked as being away."
   :group 'erc
   :type '(choice (const nil)
-                string))
+                 string))
 
 (defcustom erc-paranoid nil
   "If non-nil, then all incoming CTCP requests will be shown."
@@ -782,7 +807,7 @@ set if some hacker is trying to flood you away."
 If nil, ERC will call `system-name' to get this information."
   :group 'erc
   :type '(choice (const :tag "Default system name" nil)
-                string))
+                 string))
 
 (defcustom erc-ignore-list nil
   "List of regexps matching user identifiers to ignore.
@@ -824,8 +849,8 @@ See `erc-server-flood-margin' for other flood-related parameters.")
 
 (defcustom erc-startup-file-list
   (list (concat erc-user-emacs-directory ".ercrc.el")
-       (concat erc-user-emacs-directory ".ercrc")
-       "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
+        (concat erc-user-emacs-directory ".ercrc")
+        "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
   "List of files to try for a startup script.
 The first existent and readable one will get executed.
 
@@ -884,9 +909,9 @@ If no elements match, then the empty string is used.
 As an example:
   (setq erc-quit-reason-various-alist
       '((\"xmms\" dme:now-playing)
-       (\"version\" erc-quit-reason-normal)
-       (\"home\" \"Gone home !\")
-       (\"^$\" \"Default Reason\")))
+        (\"version\" erc-quit-reason-normal)
+        (\"home\" \"Gone home !\")
+        (\"^$\" \"Default Reason\")))
 If the user types \"/quit home\", then \"Gone home !\" will be used
 as the quit message."
   :group 'erc-quit-and-part
@@ -907,9 +932,9 @@ If no elements match, then the empty string is used.
 As an example:
   (setq erc-part-reason-various-alist
       '((\"xmms\" dme:now-playing)
-       (\"version\" erc-part-reason-normal)
-       (\"home\" \"Gone home !\")
-       (\"^$\" \"Default Reason\")))
+        (\"version\" erc-part-reason-normal)
+        (\"home\" \"Gone home !\")
+        (\"^$\" \"Default Reason\")))
 If the user types \"/part home\", then \"Gone home !\" will be used
 as the part message."
   :group 'erc-quit-and-part
@@ -922,8 +947,8 @@ The function is passed a single argument, the string typed by the
 user after \"/quit\"."
   :group 'erc-quit-and-part
   :type '(choice (const erc-quit-reason-normal)
-                (const erc-quit-reason-various)
-                (symbol)))
+                 (const erc-quit-reason-various)
+                 (symbol)))
 
 (defcustom erc-part-reason 'erc-part-reason-normal
   "A function which returns the reason for parting a channel.
@@ -932,8 +957,8 @@ The function is passed a single argument, the string typed by the
 user after \"/PART\"."
   :group 'erc-quit-and-part
   :type '(choice (const erc-part-reason-normal)
-                (const erc-part-reason-various)
-                (symbol)))
+                 (const erc-part-reason-various)
+                 (symbol)))
 
 (defvar erc-grab-buffer-name "*erc-grab*"
   "The name of the buffer created by `erc-grab-region'.")
@@ -1017,8 +1042,8 @@ At this point, all modifications from prior hook functions are done."
   :group 'erc-hooks
   :type 'hook
   :options '(erc-truncate-buffer
-            erc-make-read-only
-            erc-save-buffer-in-logs))
+             erc-make-read-only
+             erc-save-buffer-in-logs))
 
 (defcustom erc-send-modify-hook nil
   "Sending hook for functions that will change the text's appearance.
@@ -1048,8 +1073,8 @@ This function is called with narrowing, ala `erc-send-modify-hook'."
 (defcustom erc-send-completed-hook
   (when (fboundp 'emacspeak-auditory-icon)
     (list (byte-compile
-          (lambda (_str)
-            (emacspeak-auditory-icon 'select-object)))))
+           (lambda (_str)
+             (emacspeak-auditory-icon 'select-object)))))
   "Hook called after a message has been parsed by ERC.
 
 The single argument to the functions is the unmodified string
@@ -1122,6 +1147,14 @@ which the local user typed."
   "ERC default face."
   :group 'erc-faces)
 
+(defface erc-nick-prefix-face '((t :inherit erc-nick-default-face :weight bold))
+  "ERC face used for user mode prefix."
+  :group 'erc-faces)
+
+(defface erc-my-nick-prefix-face '((t :inherit erc-nick-default-face :weight bold))
+  "ERC face used for my user mode prefix."
+  :group 'erc-faces)
+
 (defface erc-direct-msg-face '((t :foreground "IndianRed"))
   "ERC face used for messages you receive in the main erc buffer."
   :group 'erc-faces)
@@ -1189,7 +1222,7 @@ See also `erc-show-my-nick'."
 (make-variable-buffer-local 'erc-dbuf)
 
 (defmacro define-erc-module (name alias doc enable-body disable-body
-                            &optional local-p)
+                                  &optional local-p)
   "Define a new minor mode using ERC conventions.
 Symbol NAME is the name of the module.
 Symbol ALIAS is the alias to use, or nil.
@@ -1209,50 +1242,50 @@ Example:
   (define-erc-module replace nil
     \"This mode replaces incoming text according to `erc-replace-alist'.\"
     ((add-hook 'erc-insert-modify-hook
-              'erc-replace-insert))
+               'erc-replace-insert))
     ((remove-hook 'erc-insert-modify-hook
-                 'erc-replace-insert)))"
+                  'erc-replace-insert)))"
   (declare (doc-string 3))
   (let* ((sn (symbol-name name))
-        (mode (intern (format "erc-%s-mode" (downcase sn))))
-        (group (intern (format "erc-%s" (downcase sn))))
-        (enable (intern (format "erc-%s-enable" (downcase sn))))
-        (disable (intern (format "erc-%s-disable" (downcase sn)))))
+         (mode (intern (format "erc-%s-mode" (downcase sn))))
+         (group (intern (format "erc-%s" (downcase sn))))
+         (enable (intern (format "erc-%s-enable" (downcase sn))))
+         (disable (intern (format "erc-%s-disable" (downcase sn)))))
     `(progn
        (erc-define-minor-mode
-       ,mode
-       ,(format "Toggle ERC %S mode.
+        ,mode
+        ,(format "Toggle ERC %S mode.
 With a prefix argument ARG, enable %s if ARG is positive,
 and disable it otherwise.  If called from Lisp, enable the mode
 if ARG is omitted or nil.
 %s" name name doc)
-       nil nil nil
-       :global ,(not local-p) :group (quote ,group)
-       (if ,mode
-           (,enable)
-         (,disable)))
+        nil nil nil
+        :global ,(not local-p) :group (quote ,group)
+        (if ,mode
+            (,enable)
+          (,disable)))
        (defun ,enable ()
-        ,(format "Enable ERC %S mode."
-                 name)
-        (interactive)
-        (add-to-list 'erc-modules (quote ,name))
-        (setq ,mode t)
-        ,@enable-body)
+         ,(format "Enable ERC %S mode."
+                  name)
+         (interactive)
+         (add-to-list 'erc-modules (quote ,name))
+         (setq ,mode t)
+         ,@enable-body)
        (defun ,disable ()
-        ,(format "Disable ERC %S mode."
-                 name)
-        (interactive)
-        (setq erc-modules (delq (quote ,name) erc-modules))
-        (setq ,mode nil)
-        ,@disable-body)
+         ,(format "Disable ERC %S mode."
+                  name)
+         (interactive)
+         (setq erc-modules (delq (quote ,name) erc-modules))
+         (setq ,mode nil)
+         ,@disable-body)
        ,(when (and alias (not (eq name alias)))
-         `(defalias
-            (quote
-             ,(intern
-               (format "erc-%s-mode"
-                       (downcase (symbol-name alias)))))
-            (quote
-             ,mode)))
+          `(defalias
+             (quote
+              ,(intern
+                (format "erc-%s-mode"
+                        (downcase (symbol-name alias)))))
+             (quote
+              ,mode)))
        ;; For find-function and find-variable.
        (put ',mode    'definition-name ',name)
        (put ',enable  'definition-name ',name)
@@ -1278,13 +1311,13 @@ capabilities."
     (error
      "You should only run `erc-once-with-server-event' in a server buffer"))
   (let ((fun (make-symbol "fun"))
-       (hook (erc-get-hook event)))
+        (hook (erc-get-hook event)))
     (put fun 'erc-original-buffer (current-buffer))
     (fset fun (lambda (proc parsed)
-               (with-current-buffer (get fun 'erc-original-buffer)
-                 (remove-hook hook fun t))
-               (fmakunbound fun)
-               (funcall f proc parsed)))
+                (with-current-buffer (get fun 'erc-original-buffer)
+                  (remove-hook hook fun t))
+                (fmakunbound fun)
+                (funcall f proc parsed)))
     (add-hook hook fun nil t)
     fun))
 
@@ -1311,7 +1344,7 @@ the process buffer."
 If BUFFER is nil, the current buffer is used."
   (with-current-buffer (or buffer (current-buffer))
     (and (eq major-mode 'erc-mode)
-        (null (erc-default-target)))))
+         (null (erc-default-target)))))
 
 (defun erc-open-server-buffer-p (&optional buffer)
   "Return non-nil if argument BUFFER is an ERC server buffer that
@@ -1327,8 +1360,8 @@ If BUFFER is nil, the current buffer is used."
   (with-current-buffer (or buffer (current-buffer))
     (let ((target (erc-default-target)))
       (and (eq major-mode 'erc-mode)
-          target
-          (not (memq (aref target 0) '(?# ?& ?+ ?!)))))))
+           target
+           (not (memq (aref target 0) '(?# ?& ?+ ?!)))))))
 
 (defun erc-ison-p (nick)
   "Return non-nil if NICK is online."
@@ -1338,39 +1371,39 @@ If BUFFER is nil, the current buffer is used."
       (erc-once-with-server-event
        303
        (lambda (_proc parsed)
-        (let ((ison (split-string (aref parsed 3))))
-          (setq erc-online-p (car (erc-member-ignore-case nick ison)))
-          t)))
+         (let ((ison (split-string (aref parsed 3))))
+           (setq erc-online-p (car (erc-member-ignore-case nick ison)))
+           t)))
       (erc-server-send (format "ISON %s" nick))
       (while (eq erc-online-p 'unknown) (accept-process-output))
       (if (called-interactively-p 'interactive)
-         (message "%s is %sonline"
-                  (or erc-online-p nick)
-                  (if erc-online-p "" "not "))
-       erc-online-p))))
+          (message "%s is %sonline"
+                   (or erc-online-p nick)
+                   (if erc-online-p "" "not "))
+        erc-online-p))))
 
 (defun erc-log-aux (string)
   "Do the debug logging of STRING."
   (let ((cb (current-buffer))
-       (point 1)
-       (was-eob nil)
-       (session-buffer (erc-server-buffer)))
+        (point 1)
+        (was-eob nil)
+        (session-buffer (erc-server-buffer)))
     (if session-buffer
-       (progn
-         (set-buffer session-buffer)
-         (if (not (and erc-dbuf (bufferp erc-dbuf) (buffer-live-p erc-dbuf)))
-             (progn
-               (setq erc-dbuf (get-buffer-create
-                               (concat "*ERC-DEBUG: "
-                                       erc-session-server "*")))))
-         (set-buffer erc-dbuf)
-         (setq point (point))
-         (setq was-eob (eobp))
-         (goto-char (point-max))
-         (insert (concat "** " string "\n"))
-         (if was-eob (goto-char (point-max))
-           (goto-char point))
-         (set-buffer cb))
+        (progn
+          (set-buffer session-buffer)
+          (if (not (and erc-dbuf (bufferp erc-dbuf) (buffer-live-p erc-dbuf)))
+              (progn
+                (setq erc-dbuf (get-buffer-create
+                                (concat "*ERC-DEBUG: "
+                                        erc-session-server "*")))))
+          (set-buffer erc-dbuf)
+          (setq point (point))
+          (setq was-eob (eobp))
+          (goto-char (point-max))
+          (insert (concat "** " string "\n"))
+          (if was-eob (goto-char (point-max))
+            (goto-char point))
+          (set-buffer cb))
       (message "ERC: ** %s" string))))
 
 ;; Last active buffer, to print server messages in the right place
@@ -1386,15 +1419,15 @@ server buffer.")
 Defaults to the server buffer."
   (erc-with-server-buffer
     (if (buffer-live-p erc-active-buffer)
-       erc-active-buffer
+        erc-active-buffer
       (setq erc-active-buffer (current-buffer)))))
 
 (defun erc-set-active-buffer (buffer)
   "Set the value of `erc-active-buffer' to BUFFER."
   (cond ((erc-server-buffer)
-        (with-current-buffer (erc-server-buffer)
-          (setq erc-active-buffer buffer)))
-       (t (setq erc-active-buffer buffer))))
+         (with-current-buffer (erc-server-buffer)
+           (setq erc-active-buffer buffer)))
+        (t (setq erc-active-buffer buffer))))
 
 ;; Mode activation routines
 
@@ -1431,19 +1464,19 @@ The available choices are:
   any other value  - in place of the current buffer."
   :group 'erc-buffers
   :type '(choice (const :tag "Split window and select" window)
-                (const :tag "Split window, don't select" window-noselect)
-                (const :tag "New frame" frame)
-                (const :tag "Bury in new buffer" bury)
-                (const :tag "Use current buffer" buffer)
-                (const :tag "Use current buffer" t)))
+                 (const :tag "Split window, don't select" window-noselect)
+                 (const :tag "New frame" frame)
+                 (const :tag "Bury in new buffer" bury)
+                 (const :tag "Use current buffer" buffer)
+                 (const :tag "Use current buffer" t)))
 
 (defcustom erc-frame-alist nil
   "Alist of frame parameters for creating erc frames.
 A value of nil means to use `default-frame-alist'."
   :group 'erc-buffers
   :type '(repeat (cons :format "%v"
-                      (symbol :tag "Parameter")
-                      (sexp :tag "Value"))))
+                       (symbol :tag "Parameter")
+                       (sexp :tag "Value"))))
 
 (defcustom erc-frame-dedicated-flag nil
   "Non-nil means the erc frames are dedicated to that buffer.
@@ -1462,11 +1495,11 @@ effect when `erc-join-buffer' is set to `frame'."
 (defun erc-channel-p (channel)
   "Return non-nil if CHANNEL seems to be an IRC channel name."
   (cond ((stringp channel)
-        (memq (aref channel 0) '(?# ?& ?+ ?!)))
-       ((and (bufferp channel) (buffer-live-p channel))
-        (with-current-buffer channel
-          (erc-channel-p (erc-default-target))))
-       (t nil)))
+         (memq (aref channel 0) '(?# ?& ?+ ?!)))
+        ((and (bufferp channel) (buffer-live-p channel))
+         (with-current-buffer channel
+           (erc-channel-p (erc-default-target))))
+        (t nil)))
 
 (defcustom erc-reuse-buffers t
   "If nil, create new buffers on joining a channel/query.
@@ -1492,17 +1525,17 @@ symbol, it may have these values:
     (let ((port-nr (string-to-number port)))
       (cond
        ((> port-nr 0)
-       port-nr)
+        port-nr)
        ((string-equal port "irc")
-       194)
+        194)
        ((string-equal port "ircs")
-       994)
+        994)
        ((string-equal port "ircd")
-       6667)
+        6667)
        ((string-equal port "ircd-dalnet")
-       7000)
+        7000)
        (t
-       nil))))
+        nil))))
    ((numberp port)
     port)
    (t
@@ -1557,8 +1590,8 @@ All strings are compared according to IRC protocol case rules, see
   (catch 'result
     (while list
       (if (string= string (erc-downcase (car list)))
-         (throw 'result list)
-       (setq list (cdr list))))))
+          (throw 'result list)
+        (setq list (cdr list))))))
 
 (defmacro erc-with-buffer (spec &rest body)
   "Execute BODY in the buffer associated with SPEC.
@@ -1578,21 +1611,21 @@ See also `with-current-buffer'.
 \(fn (TARGET [PROCESS]) BODY...)"
   (declare (indent 1) (debug ((form &optional form) body)))
   (let ((buf (make-symbol "buf"))
-       (proc (make-symbol "proc"))
-       (target (make-symbol "target"))
-       (process (make-symbol "process")))
+        (proc (make-symbol "proc"))
+        (target (make-symbol "target"))
+        (process (make-symbol "process")))
     `(let* ((,target ,(car spec))
-           (,process ,(cadr spec))
-           (,buf (if (bufferp ,target)
-                     ,target
-                   (let ((,proc (or ,process
-                                    (and (processp erc-server-process)
-                                         erc-server-process))))
-                     (if (and ,target ,proc)
-                         (erc-get-buffer ,target ,proc))))))
+            (,process ,(cadr spec))
+            (,buf (if (bufferp ,target)
+                      ,target
+                    (let ((,proc (or ,process
+                                     (and (processp erc-server-process)
+                                          erc-server-process))))
+                      (if (and ,target ,proc)
+                          (erc-get-buffer ,target ,proc))))))
        (when (buffer-live-p ,buf)
-        (with-current-buffer ,buf
-          ,@body)))))
+         (with-current-buffer ,buf
+           ,@body)))))
 
 (defun erc-get-buffer (target &optional proc)
   "Return the buffer matching TARGET in the process PROC.
@@ -1601,10 +1634,10 @@ If PROC is not supplied, all processes are searched."
     (catch 'buffer
       (erc-buffer-filter
        (lambda ()
-        (let ((current (erc-default-target)))
-          (and (stringp current)
-               (string-equal downcased-target (erc-downcase current))
-               (throw 'buffer (current-buffer)))))
+         (let ((current (erc-default-target)))
+           (and (stringp current)
+                (string-equal downcased-target (erc-downcase current))
+                (throw 'buffer (current-buffer)))))
        proc))))
 
 (defun erc-buffer-filter (predicate &optional proc)
@@ -1618,14 +1651,14 @@ server connection, or nil which means all open connections."
     (delq
      nil
      (mapcar (lambda (buf)
-              (when (buffer-live-p buf)
-                (with-current-buffer buf
-                  (and (eq major-mode 'erc-mode)
-                       (or (not proc)
-                           (eq proc erc-server-process))
-                       (funcall predicate)
-                       buf))))
-            (buffer-list)))))
+               (when (buffer-live-p buf)
+                 (with-current-buffer buf
+                   (and (eq major-mode 'erc-mode)
+                        (or (not proc)
+                            (eq proc erc-server-process))
+                        (funcall predicate)
+                        buf))))
+             (buffer-list)))))
 
 (defun erc-buffer-list (&optional predicate proc)
   "Return a list of ERC buffers.
@@ -1645,14 +1678,14 @@ nil."
   (declare (indent 1) (debug (form form body)))
   ;; Make the evaluation have the correct order
   (let ((pre (make-symbol "pre"))
-       (pro (make-symbol "pro")))
+        (pro (make-symbol "pro")))
     `(let* ((,pro ,process)
-           (,pre ,pred)
-           (res (mapcar (lambda (buffer)
-                          (with-current-buffer buffer
-                            ,@forms))
-                        (erc-buffer-list ,pre
-                                         ,pro))))
+            (,pre ,pred)
+            (res (mapcar (lambda (buffer)
+                           (with-current-buffer buffer
+                             ,@forms))
+                         (erc-buffer-list ,pre
+                                          ,pro))))
        ;; Silence the byte-compiler by binding the result of mapcar to
        ;; a variable.
        res)))
@@ -1660,7 +1693,7 @@ nil."
 ;; (iswitchb-mode) will autoload iswitchb.el
 (defvar iswitchb-temp-buflist)
 (declare-function iswitchb-read-buffer "iswitchb"
-                (prompt &optional default require-match start matches-set))
+                  (prompt &optional default require-match start matches-set))
 (defvar iswitchb-make-buflist-hook)
 
 (defun erc-iswitchb (&optional arg)
@@ -1676,20 +1709,20 @@ needs to be active for this function to work."
   (let ((enabled (bound-and-true-p iswitchb-mode)))
     (or enabled (iswitchb-mode 1))
     (unwind-protect
-       (let ((iswitchb-make-buflist-hook
-              (lambda ()
-                (setq iswitchb-temp-buflist
-                      (mapcar 'buffer-name
-                              (erc-buffer-list
-                               nil
-                               (when arg erc-server-process)))))))
-         (switch-to-buffer
-          (iswitchb-read-buffer
-           "Switch-to: "
-           (if (boundp 'erc-modified-channels-alist)
-               (buffer-name (caar (last erc-modified-channels-alist)))
-             nil)
-           t)))
+        (let ((iswitchb-make-buflist-hook
+               (lambda ()
+                 (setq iswitchb-temp-buflist
+                       (mapcar 'buffer-name
+                               (erc-buffer-list
+                                nil
+                                (when arg erc-server-process)))))))
+          (switch-to-buffer
+           (iswitchb-read-buffer
+            "Switch-to: "
+            (if (boundp 'erc-modified-channels-alist)
+                (buffer-name (caar (last erc-modified-channels-alist)))
+              nil)
+            t)))
       (or enabled (iswitchb-mode -1)))))
 
 (defun erc-channel-list (proc)
@@ -1699,7 +1732,7 @@ all channel buffers on all servers."
   (erc-buffer-filter
    (lambda ()
      (and (erc-default-target)
-         (erc-channel-p (erc-default-target))))
+          (erc-channel-p (erc-default-target))))
    proc))
 
 (defun erc-buffer-list-with-nick (nick proc)
@@ -1707,8 +1740,8 @@ all channel buffers on all servers."
   (with-current-buffer (process-buffer proc)
     (let ((user (gethash (erc-downcase nick) erc-server-users)))
       (if user
-         (erc-server-user-buffers user)
-       nil))))
+          (erc-server-user-buffers user)
+        nil))))
 
 ;; Some local variables
 
@@ -1766,31 +1799,31 @@ buffer rather than a server buffer.")
   (let ((transforms '((pcomplete . completion))))
     (erc-delete-dups
      (mapcar (lambda (m) (or (cdr (assoc m transforms)) m))
-            mods))))
+             mods))))
 
 (defcustom erc-modules '(netsplit fill button match track completion readonly
-                        networks ring autojoin noncommands irccontrols
-                        move-to-prompt stamp menu list)
+                                  networks ring autojoin noncommands irccontrols
+                                  move-to-prompt stamp menu list)
   "A list of modules which ERC should enable.
 If you set the value of this without using `customize' remember to call
 \(erc-update-modules) after you change it.  When using `customize', modules
 removed from the list will be disabled."
   :get (lambda (sym)
-        ;; replace outdated names with their newer equivalents
-        (erc-migrate-modules (symbol-value sym)))
+         ;; replace outdated names with their newer equivalents
+         (erc-migrate-modules (symbol-value sym)))
   :set (lambda (sym val)
-        ;; disable modules which have just been removed
-        (when (and (boundp 'erc-modules) erc-modules val)
-          (dolist (module erc-modules)
-            (unless (member module val)
-              (let ((f (intern-soft (format "erc-%s-mode" module))))
-                (when (and (fboundp f) (boundp f) (symbol-value f))
-                  (message "Disabling `erc-%s'" module)
-                  (funcall f 0))))))
-        (set sym val)
-        ;; this test is for the case where erc hasn't been loaded yet
-        (when (fboundp 'erc-update-modules)
-          (erc-update-modules)))
+         ;; disable modules which have just been removed
+         (when (and (boundp 'erc-modules) erc-modules val)
+           (dolist (module erc-modules)
+             (unless (member module val)
+               (let ((f (intern-soft (format "erc-%s-mode" module))))
+                 (when (and (fboundp f) (boundp f) (symbol-value f))
+                   (message "Disabling `erc-%s'" module)
+                   (funcall f 0))))))
+         (set sym val)
+         ;; this test is for the case where erc hasn't been loaded yet
+         (when (fboundp 'erc-update-modules)
+           (erc-update-modules)))
   :type
   '(set
     :greedy t
@@ -1798,42 +1831,42 @@ removed from the list will be disabled."
     (const :tag "autojoin: Join channels automatically" autojoin)
     (const :tag "button: Buttonize URLs, nicknames, and other text" button)
     (const :tag "capab: Mark unidentified users on servers supporting CAPAB"
-          capab-identify)
+           capab-identify)
     (const :tag "completion: Complete nicknames and commands (programmable)"
-          completion)
+           completion)
     (const :tag "hecomplete: Complete nicknames and commands (obsolete, use \"completion\")" hecomplete)
     (const :tag "dcc: Provide Direct Client-to-Client support" dcc)
     (const :tag "fill: Wrap long lines" fill)
     (const :tag "identd: Launch an identd server on port 8113" identd)
     (const :tag "irccontrols: Highlight or remove IRC control characters"
-          irccontrols)
+           irccontrols)
     (const :tag "keep-place: Leave point above un-viewed text" keep-place)
     (const :tag "list: List channels in a separate buffer" list)
     (const :tag "log: Save buffers in logs" log)
     (const :tag "match: Highlight pals, fools, and other keywords" match)
     (const :tag "menu: Display a menu in ERC buffers" menu)
     (const :tag "move-to-prompt: Move to the prompt when typing text"
-          move-to-prompt)
+           move-to-prompt)
     (const :tag "netsplit: Detect netsplits" netsplit)
     (const :tag "networks: Provide data about IRC networks" networks)
     (const :tag "noncommands: Don't display non-IRC commands after evaluation"
-          noncommands)
+           noncommands)
     (const :tag
-          "notify: Notify when the online status of certain users changes"
-          notify)
+           "notify: Notify when the online status of certain users changes"
+           notify)
     (const :tag "notifications: Send notifications on PRIVMSG or nickname mentions"
-          notifications)
+           notifications)
     (const :tag "page: Process CTCP PAGE requests from IRC" page)
     (const :tag "readonly: Make displayed lines read-only" readonly)
     (const :tag "replace: Replace text in messages" replace)
     (const :tag "ring: Enable an input history" ring)
     (const :tag "scrolltobottom: Scroll to the bottom of the buffer"
-          scrolltobottom)
+           scrolltobottom)
     (const :tag "services: Identify to Nickserv (IRC Services) automatically"
-          services)
+           services)
     (const :tag "smiley: Convert smileys to pretty icons" smiley)
     (const :tag "sound: Play sounds when you receive CTCP SOUND requests"
-          sound)
+           sound)
     (const :tag "stamp: Add timestamps to messages" stamp)
     (const :tag "spelling: Check spelling" spelling)
     (const :tag "track: Track channel activity in the mode-line" track)
@@ -1851,27 +1884,27 @@ removed from the list will be disabled."
       (cond
        ;; yuck. perhaps we should bring the filenames into sync?
        ((string= req "erc-capab-identify")
-       (setq req "erc-capab"))
+        (setq req "erc-capab"))
        ((string= req "erc-completion")
-       (setq req "erc-pcomplete"))
+        (setq req "erc-pcomplete"))
        ((string= req "erc-pcomplete")
-       (setq mod 'completion))
+        (setq mod 'completion))
        ((string= req "erc-autojoin")
-       (setq req "erc-join")))
+        (setq req "erc-join")))
       (condition-case nil
-         (require (intern req))
-       (error nil))
+          (require (intern req))
+        (error nil))
       (let ((sym (intern-soft (concat "erc-" (symbol-name mod) "-mode"))))
-       (if (fboundp sym)
-           (funcall sym 1)
-         (error "`%s' is not a known ERC module" mod))))))
+        (if (fboundp sym)
+            (funcall sym 1)
+          (error "`%s' is not a known ERC module" mod))))))
 
 (defun erc-setup-buffer (buffer)
   "Consults `erc-join-buffer' to find out how to display `BUFFER'."
   (pcase erc-join-buffer
     (`window
      (if (active-minibuffer-window)
-        (display-buffer buffer)
+         (display-buffer buffer)
        (switch-to-buffer-other-window buffer)))
     (`window-noselect
      (display-buffer buffer))
@@ -1879,21 +1912,21 @@ removed from the list will be disabled."
      nil)
     (`frame
      (when (or (not erc-reuse-frames)
-              (not (get-buffer-window buffer t)))
+               (not (get-buffer-window buffer t)))
        (let ((frame (make-frame (or erc-frame-alist
-                                   default-frame-alist))))
-        (raise-frame frame)
-        (select-frame frame))
+                                    default-frame-alist))))
+         (raise-frame frame)
+         (select-frame frame))
        (switch-to-buffer buffer)
        (when erc-frame-dedicated-flag
-        (set-window-dedicated-p (selected-window) t))))
+         (set-window-dedicated-p (selected-window) t))))
     (_
      (if (active-minibuffer-window)
-        (display-buffer buffer)
+         (display-buffer buffer)
        (switch-to-buffer buffer)))))
 
 (defun erc-open (&optional server port nick full-name
-                          connect passwd tgt-list channel process)
+                           connect passwd tgt-list channel process)
   "Connect to SERVER on PORT as NICK with FULL-NAME.
 
 If CONNECT is non-nil, connect to the server.  Otherwise assume
@@ -1905,13 +1938,13 @@ non-nil, use it to initialize `erc-default-recipients'.
 
 Returns the buffer for the given server or channel."
   (let ((server-announced-name (when (and (boundp 'erc-session-server)
-                                         (string= server erc-session-server))
-                                erc-server-announced-name))
-       (connected-p (unless connect erc-server-connected))
-       (buffer (erc-get-buffer-create server port channel))
-       (old-buffer (current-buffer))
-       old-point
-       continued-session)
+                                          (string= server erc-session-server))
+                                 erc-server-announced-name))
+        (connected-p (unless connect erc-server-connected))
+        (buffer (erc-get-buffer-create server port channel))
+        (old-buffer (current-buffer))
+        old-point
+        continued-session)
     (when connect (run-hook-with-args 'erc-before-connect server port nick))
     (erc-update-modules)
     (set-buffer buffer)
@@ -1930,8 +1963,8 @@ Returns the buffer for the given server or channel."
     (when (get-text-property (point) 'erc-prompt)
       (setq continued-session t)
       (set-marker erc-input-marker
-                 (or (next-single-property-change (point) 'erc-prompt)
-                     (point-max))))
+                  (or (next-single-property-change (point) 'erc-prompt)
+                      (point-max))))
     (unless continued-session
       (goto-char (point-max))
       (insert "\n"))
@@ -1941,14 +1974,14 @@ Returns the buffer for the given server or channel."
     (setq erc-server-current-nick nil)
     ;; Initialize erc-server-users and erc-channel-users
     (if connect
-       (progn ;; server buffer
-         (setq erc-server-users
-               (make-hash-table :test 'equal))
-         (setq erc-channel-users nil))
+        (progn ;; server buffer
+          (setq erc-server-users
+                (make-hash-table :test 'equal))
+          (setq erc-channel-users nil))
       (progn ;; target buffer
-       (setq erc-server-users nil)
-       (setq erc-channel-users
-             (make-hash-table :test 'equal))))
+        (setq erc-server-users nil)
+        (setq erc-channel-users
+              (make-hash-table :test 'equal))))
     ;; clear last incomplete line read
     (setq erc-server-filter-data nil)
     (setq erc-channel-topic "")
@@ -1969,29 +2002,29 @@ Returns the buffer for the given server or channel."
     (setq erc-default-nicks (if (consp erc-nick) erc-nick (list erc-nick)))
     ;; password stuff
     (setq erc-session-password
-         (or passwd
-             (let ((secret
-                    (plist-get
-                     (nth 0
-                          (auth-source-search :host server
-                                              :max 1
-                                              :user nick
-                                              :port port
-                                              :require '(:secret)))
-                     :secret)))
-               (if (functionp secret)
-                   (funcall secret)
-                 secret))))
+          (or passwd
+              (let ((secret
+                     (plist-get
+                      (nth 0
+                           (auth-source-search :host server
+                                               :max 1
+                                               :user nick
+                                               :port port
+                                               :require '(:secret)))
+                      :secret)))
+                (if (functionp secret)
+                    (funcall secret)
+                  secret))))
     ;; debug output buffer
     (setq erc-dbuf
-         (when erc-log-p
-           (get-buffer-create (concat "*ERC-DEBUG: " server "*"))))
+          (when erc-log-p
+            (get-buffer-create (concat "*ERC-DEBUG: " server "*"))))
     ;; set up prompt
     (unless continued-session
       (goto-char (point-max))
       (insert "\n"))
     (if continued-session
-       (goto-char old-point)
+        (goto-char old-point)
       (set-marker erc-insert-marker (point))
       (erc-display-prompt)
       (goto-char (point-max)))
@@ -2008,9 +2041,9 @@ Returns the buffer for the given server or channel."
     ;; Now display the buffer in a window as per user wishes.
     (unless (eq buffer old-buffer)
       (when erc-log-p
-       ;; we can't log to debug buffer, it may not exist yet
-       (message "erc: old buffer %s, switching to %s"
-                old-buffer buffer))
+        ;; we can't log to debug buffer, it may not exist yet
+        (message "erc: old buffer %s, switching to %s"
+                 old-buffer buffer))
       (erc-setup-buffer buffer))
 
     buffer))
@@ -2021,7 +2054,7 @@ BUFFER is the current buffer."
   (with-current-buffer buffer
     (setq erc-last-saved-position (make-marker))
     (move-marker erc-last-saved-position
-                (1- (marker-position erc-insert-marker)))))
+                 (1- (marker-position erc-insert-marker)))))
 
 ;; interactive startup
 
@@ -2039,9 +2072,9 @@ If no buffer matches, return nil."
   (erc-buffer-list
    (lambda ()
      (and (erc-server-process-alive)
-         (string= erc-session-server server)
-         (erc-port-equal erc-session-port port)
-         (erc-current-nick-p nick)))))
+          (string= erc-session-server server)
+          (erc-port-equal erc-session-port port)
+          (erc-current-nick-p nick)))))
 
 (defcustom erc-before-connect nil
   "Hook called before connecting to a server.
@@ -2063,38 +2096,38 @@ functions in here get called with the parameters SERVER and NICK."
   "Prompt the user for values of nick, server, port, and password."
   (let (user-input server port nick passwd)
     (setq user-input (read-from-minibuffer
-                     "IRC server: "
-                     (erc-compute-server) nil nil 'erc-server-history-list))
+                      "IRC server: "
+                      (erc-compute-server) nil nil 'erc-server-history-list))
 
     (if (string-match "\\(.*\\):\\(.*\\)\\'" user-input)
-       (setq port (erc-string-to-port (match-string 2 user-input))
-             user-input (match-string 1 user-input))
+        (setq port (erc-string-to-port (match-string 2 user-input))
+              user-input (match-string 1 user-input))
       (setq port
-           (erc-string-to-port (read-from-minibuffer
-                                "IRC port: " (erc-port-to-string
-                                              (erc-compute-port))))))
+            (erc-string-to-port (read-from-minibuffer
+                                 "IRC port: " (erc-port-to-string
+                                               (erc-compute-port))))))
 
     (if (string-match "\\`\\(.*\\)@\\(.*\\)" user-input)
-       (setq nick (match-string 1 user-input)
-             user-input (match-string 2 user-input))
+        (setq nick (match-string 1 user-input)
+              user-input (match-string 2 user-input))
       (setq nick
-           (if (erc-already-logged-in server port nick)
-               (read-from-minibuffer
-                (erc-format-message 'nick-in-use ?n nick)
-                nick
-                nil nil 'erc-nick-history-list)
-             (read-from-minibuffer
-              "Nickname: " (erc-compute-nick nick)
-              nil nil 'erc-nick-history-list))))
+            (if (erc-already-logged-in server port nick)
+                (read-from-minibuffer
+                 (erc-format-message 'nick-in-use ?n nick)
+                 nick
+                 nil nil 'erc-nick-history-list)
+              (read-from-minibuffer
+               "Nickname: " (erc-compute-nick nick)
+               nil nil 'erc-nick-history-list))))
 
     (setq server user-input)
 
     (setq passwd (if erc-prompt-for-password
-                    (if (and erc-password
-                             (y-or-n-p "Use the default password? "))
-                        erc-password
-                      (read-passwd "Password: "))
-                  erc-password))
+                     (if (and erc-password
+                              (y-or-n-p "Use the default password? "))
+                         erc-password
+                       (read-passwd "Password: "))
+                   erc-password))
     (when (and passwd (string= "" passwd))
       (setq passwd nil))
 
@@ -2105,17 +2138,17 @@ functions in here get called with the parameters SERVER and NICK."
       ;; bncs transparent, so that erc-compute-buffer-name displays
       ;; the server one is connected to.
       (setq nick (read-from-minibuffer
-                 (erc-format-message 'nick-in-use ?n nick)
-                 nick
-                 nil nil 'erc-nick-history-list)))
+                  (erc-format-message 'nick-in-use ?n nick)
+                  nick
+                  nil nil 'erc-nick-history-list)))
     (list :server server :port port :nick nick :password passwd)))
 
 ;;;###autoload
 (cl-defun erc (&key (server (erc-compute-server))
-                   (port   (erc-compute-port))
-                   (nick   (erc-compute-nick))
-                   password
-                   (full-name (erc-compute-full-name)))
+                    (port   (erc-compute-port))
+                    (nick   (erc-compute-nick))
+                    password
+                    (full-name (erc-compute-full-name)))
   "ERC is a powerful, modular, and extensible IRC client.
 This function is the main entry point for ERC.
 
@@ -2155,7 +2188,7 @@ Arguments are the same as for `erc'."
 The process will be given the name NAME, its target buffer will be
 BUFFER.  HOST and PORT specify the connection target."
   (open-network-stream name buffer host port
-                      :type 'tls))
+                       :type 'tls))
 
 ;;; Displaying error messages
 
@@ -2195,36 +2228,36 @@ If OUTBOUND is non-nil, STRING is being sent to the IRC server
 and appears in face `erc-input-face' in the buffer."
   (when erc-debug-irc-protocol
     (let ((network-name (or (ignore-errors (erc-network-name))
-                           "???")))
+                            "???")))
       (with-current-buffer (get-buffer-create "*erc-protocol*")
-       (save-excursion
-         (goto-char (point-max))
-         (let ((inhibit-read-only t))
-           (insert (if (not outbound)
-                       ;; Cope with the fact that string might
-                       ;; contain multiple lines of text.
-                       (let ((lines (delete "" (split-string string
-                                                             "\n\\|\r\n")))
-                             (result ""))
-                         (dolist (line lines)
-                           (setq result (concat result network-name
-                                                " << " line "\n")))
-                         result)
-                     (erc-propertize
-                       (concat network-name " >> " string
-                               (if (/= ?\n
-                                       (aref string
-                                             (1- (length string))))
-                                   "\n"))
-                       'face 'erc-input-face)))))
-       (let ((orig-win (selected-window))
-             (debug-buffer-window (get-buffer-window (current-buffer) t)))
-         (when debug-buffer-window
-            (select-window debug-buffer-window)
-            (when (= 1 (count-lines (point) (point-max)))
-              (goto-char (point-max))
-              (recenter -1))
-            (select-window orig-win)))))))
+        (save-excursion
+          (goto-char (point-max))
+          (let ((inhibit-read-only t))
+            (insert (if (not outbound)
+                        ;; Cope with the fact that string might
+                        ;; contain multiple lines of text.
+                        (let ((lines (delete "" (split-string string
+                                                              "\n\\|\r\n")))
+                              (result ""))
+                          (dolist (line lines)
+                            (setq result (concat result network-name
+                                                 " << " line "\n")))
+                          result)
+                      (erc-propertize
+                       (concat network-name " >> " string
+                               (if (/= ?\n
+                                       (aref string
+                                             (1- (length string))))
+                                   "\n"))
+                       'face 'erc-input-face)))))
+        (let ((orig-win (selected-window))
+              (debug-buffer-window (get-buffer-window (current-buffer) t)))
+          (when debug-buffer-window
+            (select-window debug-buffer-window)
+            (when (= 1 (count-lines (point) (point-max)))
+              (goto-char (point-max))
+              (recenter -1))
+            (select-window orig-win)))))))
 
 (defun erc-toggle-debug-irc-protocol (&optional arg)
   "Toggle the value of `erc-debug-irc-protocol'.
@@ -2235,26 +2268,26 @@ If ARG is non-nil, show the *erc-protocol* buffer."
     (with-current-buffer buf
       (erc-view-mode-enter)
       (when (null (current-local-map))
-       (let ((inhibit-read-only t))
-         (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
-         (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n")))
-       (use-local-map (make-sparse-keymap))
-       (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
+        (let ((inhibit-read-only t))
+          (insert (erc-make-notice "This buffer displays all IRC protocol traffic exchanged with each server.\n"))
+          (insert (erc-make-notice "Kill this buffer to terminate protocol logging.\n\n")))
+        (use-local-map (make-sparse-keymap))
+        (local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
       (add-hook 'kill-buffer-hook
-               #'(lambda () (setq erc-debug-irc-protocol nil))
-               nil 'local)
+                #'(lambda () (setq erc-debug-irc-protocol nil))
+                nil 'local)
       (goto-char (point-max))
       (let ((inhibit-read-only t))
-       (insert (erc-make-notice
-                (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n"
-                        (if erc-debug-irc-protocol "disabled" "enabled")
-                        (current-time-string))))))
+        (insert (erc-make-notice
+                 (format "IRC protocol logging %s at %s -- Press `t' to toggle logging.\n"
+                         (if erc-debug-irc-protocol "disabled" "enabled")
+                         (current-time-string))))))
     (setq erc-debug-irc-protocol (not erc-debug-irc-protocol))
     (if (and arg
-            (not (get-buffer-window "*erc-protocol*" t)))
-       (display-buffer buf t))
+             (not (get-buffer-window "*erc-protocol*" t)))
+        (display-buffer buf t))
     (message "IRC protocol traffic logging %s (see buffer *erc-protocol*)."
-            (if erc-debug-irc-protocol "enabled" "disabled"))))
+             (if erc-debug-irc-protocol "enabled" "disabled"))))
 
 ;;; I/O interface
 
@@ -2293,69 +2326,69 @@ If STRING is nil, the function does nothing."
   (when string
     (with-current-buffer (or buffer (process-buffer erc-server-process))
       (let ((insert-position (or (marker-position erc-insert-marker)
-                                (point-max))))
-       (let ((string string) ;; FIXME! Can this be removed?
-             (buffer-undo-list t)
-             (inhibit-read-only t))
-         (unless (string-match "\n$" string)
-           (setq string (concat string "\n"))
-           (when (erc-string-invisible-p string)
-             (erc-put-text-properties 0 (length string)
-                                      '(invisible intangible) string)))
-         (erc-log (concat "erc-display-line: " string
-                          (format "(%S)" string) " in buffer "
-                          (format "%s" buffer)))
-         (setq erc-insert-this t)
-         (run-hook-with-args 'erc-insert-pre-hook string)
-         (if (null erc-insert-this)
-             ;; Leave erc-insert-this set to t as much as possible.  Fran
-             ;; Litterio <franl> has seen erc-insert-this set to nil while
-             ;; erc-send-pre-hook is running, which should never happen.  This
-             ;; may cure it.
-             (setq erc-insert-this t)
-           (save-excursion ;; to restore point in the new buffer
-             (save-restriction
-               (widen)
-               (goto-char insert-position)
-               (insert-before-markers string)
-               ;; run insertion hook, with point at restored location
-               (save-restriction
-                 (narrow-to-region insert-position (point))
-                 (run-hooks 'erc-insert-modify-hook)
-                 (run-hooks 'erc-insert-post-hook)
-                 (when erc-remove-parsed-property
-                   (remove-text-properties (point-min) (point-max)
-                                           '(erc-parsed nil))))))))
-       (erc-update-undo-list (- (or (marker-position erc-insert-marker)
-                                    (point-max))
-                                insert-position))))))
+                                 (point-max))))
+        (let ((string string) ;; FIXME! Can this be removed?
+              (buffer-undo-list t)
+              (inhibit-read-only t))
+          (unless (string-match "\n$" string)
+            (setq string (concat string "\n"))
+            (when (erc-string-invisible-p string)
+              (erc-put-text-properties 0 (length string)
+                                       '(invisible intangible) string)))
+          (erc-log (concat "erc-display-line: " string
+                           (format "(%S)" string) " in buffer "
+                           (format "%s" buffer)))
+          (setq erc-insert-this t)
+          (run-hook-with-args 'erc-insert-pre-hook string)
+          (if (null erc-insert-this)
+              ;; Leave erc-insert-this set to t as much as possible.  Fran
+              ;; Litterio <franl> has seen erc-insert-this set to nil while
+              ;; erc-send-pre-hook is running, which should never happen.  This
+              ;; may cure it.
+              (setq erc-insert-this t)
+            (save-excursion ;; to restore point in the new buffer
+              (save-restriction
+                (widen)
+                (goto-char insert-position)
+                (insert-before-markers string)
+                ;; run insertion hook, with point at restored location
+                (save-restriction
+                  (narrow-to-region insert-position (point))
+                  (run-hooks 'erc-insert-modify-hook)
+                  (run-hooks 'erc-insert-post-hook)
+                  (when erc-remove-parsed-property
+                    (remove-text-properties (point-min) (point-max)
+                                            '(erc-parsed nil))))))))
+        (erc-update-undo-list (- (or (marker-position erc-insert-marker)
+                                     (point-max))
+                                 insert-position))))))
 
 (defun erc-update-undo-list (shift)
   ;; Translate buffer positions in buffer-undo-list by SHIFT.
   (unless (or (zerop shift) (atom buffer-undo-list))
     (let ((list buffer-undo-list) elt)
       (while list
-       (setq elt (car list))
-       (cond ((integerp elt)           ; POSITION
-              (cl-incf (car list) shift))
-             ((or (atom elt)           ; nil, EXTENT
-                  ;; (eq t (car elt))  ; (t . TIME)
-                  (markerp (car elt))) ; (MARKER . DISTANCE)
-              nil)
-             ((integerp (car elt))     ; (BEGIN . END)
-              (cl-incf (car elt) shift)
-              (cl-incf (cdr elt) shift))
-             ((stringp (car elt))      ; (TEXT . POSITION)
-              (cl-incf (cdr elt) (* (if (natnump (cdr elt)) 1 -1) shift)))
-             ((null (car elt))         ; (nil PROPERTY VALUE BEG . END)
-              (let ((cons (nthcdr 3 elt)))
-                (cl-incf (car cons) shift)
-                (cl-incf (cdr cons) shift)))
-             ((and (featurep 'xemacs)
-                   (extentp (car elt))) ; (EXTENT START END)
-              (cl-incf (nth 1 elt) shift)
-              (cl-incf (nth 2 elt) shift)))
-       (setq list (cdr list))))))
+        (setq elt (car list))
+        (cond ((integerp elt)           ; POSITION
+               (cl-incf (car list) shift))
+              ((or (atom elt)           ; nil, EXTENT
+                   ;; (eq t (car elt))  ; (t . TIME)
+                   (markerp (car elt))) ; (MARKER . DISTANCE)
+               nil)
+              ((integerp (car elt))     ; (BEGIN . END)
+               (cl-incf (car elt) shift)
+               (cl-incf (cdr elt) shift))
+              ((stringp (car elt))      ; (TEXT . POSITION)
+               (cl-incf (cdr elt) (* (if (natnump (cdr elt)) 1 -1) shift)))
+              ((null (car elt))         ; (nil PROPERTY VALUE BEG . END)
+               (let ((cons (nthcdr 3 elt)))
+                 (cl-incf (car cons) shift)
+                 (cl-incf (cdr cons) shift)))
+              ((and (featurep 'xemacs)
+                    (extentp (car elt))) ; (EXTENT START END)
+               (cl-incf (nth 1 elt) shift)
+               (cl-incf (nth 2 elt) shift)))
+        (setq list (cdr list))))))
 
 (defvar erc-valid-nick-regexp "[]a-zA-Z^[;\\`_{}|][]^[;\\`_{}|a-zA-Z0-9-]*"
   "Regexp which matches all valid characters in a IRC nickname.")
@@ -2376,41 +2409,41 @@ buffer is used.  `erc-display-line-1' is used to display STRING.
 
 If STRING is nil, the function does nothing."
   (let ((inhibit-point-motion-hooks t)
-       new-bufs)
+        new-bufs)
     (dolist (buf (cond
-                 ((bufferp buffer) (list buffer))
-                 ((listp buffer) buffer)
-                 ((processp buffer) (list (process-buffer buffer)))
-                 ((eq 'all buffer)
-                  ;; Hmm, or all of the same session server?
-                  (erc-buffer-list nil erc-server-process))
-                 ((and (eq 'active buffer) (erc-active-buffer))
-                  (list (erc-active-buffer)))
-                 ((erc-server-buffer-live-p)
-                  (list (process-buffer erc-server-process)))
-                 (t (list (current-buffer)))))
+                  ((bufferp buffer) (list buffer))
+                  ((listp buffer) buffer)
+                  ((processp buffer) (list (process-buffer buffer)))
+                  ((eq 'all buffer)
+                   ;; Hmm, or all of the same session server?
+                   (erc-buffer-list nil erc-server-process))
+                  ((and (eq 'active buffer) (erc-active-buffer))
+                   (list (erc-active-buffer)))
+                  ((erc-server-buffer-live-p)
+                   (list (process-buffer erc-server-process)))
+                  (t (list (current-buffer)))))
       (when (buffer-live-p buf)
-       (erc-display-line-1 string buf)
-       (push buf new-bufs)))
+        (erc-display-line-1 string buf)
+        (push buf new-bufs)))
     (when (null new-bufs)
       (erc-display-line-1 string (if (erc-server-buffer-live-p)
-                                    (process-buffer erc-server-process)
-                                  (current-buffer))))))
+                                     (process-buffer erc-server-process)
+                                   (current-buffer))))))
 
 (defun erc-display-message-highlight (type string)
   "Highlight STRING according to TYPE, where erc-TYPE-face is an ERC face.
 
 See also `erc-make-notice'."
   (cond ((eq type 'notice)
-        (erc-make-notice string))
-       (t
-        (erc-put-text-property
-         0 (length string)
-         'face (or (intern-soft
-                    (concat "erc-" (symbol-name type) "-face"))
-                   "erc-default-face")
-         string)
-        string)))
+         (erc-make-notice string))
+        (t
+         (erc-put-text-property
+          0 (length string)
+          'face (or (intern-soft
+                     (concat "erc-" (symbol-name type) "-face"))
+                    "erc-default-face")
+          string)
+         string)))
 
 (defvar erc-lurker-state nil
   "Track the time of the last PRIVMSG for each (server,nick) pair.
@@ -2487,15 +2520,15 @@ consumption for long-lived IRC or Emacs sessions."
    (lambda (server hash)
      (maphash
       (lambda (nick last-PRIVMSG-time)
-       (when
-           (> (float-time (time-subtract
-                           (current-time)
-                           last-PRIVMSG-time))
-              erc-lurker-threshold-time)
-         (remhash nick hash)))
+        (when
+            (> (float-time (time-subtract
+                            (current-time)
+                            last-PRIVMSG-time))
+               erc-lurker-threshold-time)
+          (remhash nick hash)))
       hash)
      (if (zerop (hash-table-count hash))
-        (remhash server erc-lurker-state)))
+         (remhash server erc-lurker-state)))
    erc-lurker-state))
 
 (defvar erc-lurker-cleanup-count 0
@@ -2535,7 +2568,7 @@ updates of `erc-lurker-state'."
             (erc-canonicalize-server-name erc-server-announced-name)))
       (when (equal command "PRIVMSG")
         (when (>= (cl-incf erc-lurker-cleanup-count)
-                 erc-lurker-cleanup-interval)
+                  erc-lurker-cleanup-interval)
           (setq erc-lurker-cleanup-count 0)
           (erc-lurker-cleanup))
         (unless (gethash server erc-lurker-state)
@@ -2550,14 +2583,14 @@ Lurking is the condition where NICK has issued no PRIVMSG on this
 server within `erc-lurker-threshold-time'.  See also
 `erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'."
   (unless erc-lurker-state (erc-lurker-initialize))
-    (let* ((server
-           (erc-canonicalize-server-name erc-server-announced-name))
-          (last-PRIVMSG-time
-           (gethash (erc-lurker-maybe-trim nick)
-                    (gethash server erc-lurker-state (make-hash-table)))))
-      (or (null last-PRIVMSG-time)
-         (> (float-time
-             (time-subtract (current-time) last-PRIVMSG-time))
+  (let* ((server
+          (erc-canonicalize-server-name erc-server-announced-name))
+         (last-PRIVMSG-time
+          (gethash (erc-lurker-maybe-trim nick)
+                   (gethash server erc-lurker-state (make-hash-table)))))
+    (or (null last-PRIVMSG-time)
+        (> (float-time
+            (time-subtract (current-time) last-PRIVMSG-time))
            erc-lurker-threshold-time))))
 
 (defcustom erc-common-server-suffixes
@@ -2577,8 +2610,8 @@ otherwise `erc-server-announced-name'.  SERVER is matched against
 `erc-common-server-suffixes'."
   (when server
     (or (cdar (erc-remove-if-not
-              (lambda (net) (string-match (car net) server))
-              erc-common-server-suffixes))
+               (lambda (net) (string-match (car net) server))
+               erc-common-server-suffixes))
         erc-server-announced-name)))
 
 (defun erc-hide-current-message-p (parsed)
@@ -2599,27 +2632,27 @@ ARGS, PARSED, and TYPE are used to format MSG sensibly.
 
 See also `erc-format-message' and `erc-display-line'."
   (let ((string (if (symbolp msg)
-                   (apply 'erc-format-message msg args)
-                 msg)))
+                    (apply 'erc-format-message msg args)
+                  msg)))
     (setq string
-         (cond
-          ((null type)
-           string)
-          ((listp type)
-           (mapc (lambda (type)
-                   (setq string
-                         (erc-display-message-highlight type string)))
-                 type)
-           string)
-          ((symbolp type)
-           (erc-display-message-highlight type string))))
+          (cond
+           ((null type)
+            string)
+           ((listp type)
+            (mapc (lambda (type)
+                    (setq string
+                          (erc-display-message-highlight type string)))
+                  type)
+            string)
+           ((symbolp type)
+            (erc-display-message-highlight type string))))
 
     (if (not (erc-response-p parsed))
-       (erc-display-line string buffer)
+        (erc-display-line string buffer)
       (unless (erc-hide-current-message-p parsed)
-       (erc-put-text-property 0 (length string) 'erc-parsed parsed string)
-       (erc-put-text-property 0 (length string) 'rear-sticky t string)
-       (erc-display-line string buffer)))))
+        (erc-put-text-property 0 (length string) 'erc-parsed parsed string)
+        (erc-put-text-property 0 (length string) 'rear-sticky t string)
+        (erc-display-line string buffer)))))
 
 (defun erc-message-type-member (position list)
   "Return non-nil if the erc-parsed text-property at POSITION is in LIST.
@@ -2637,19 +2670,19 @@ present."
 
 See also `erc-server-send'."
   (setq line (format "PRIVMSG %s :%s"
-                    target
-                    ;; If the line is empty, we still want to
-                    ;; send it - i.e. an empty pasted line.
-                    (if (string= line "\n")
-                        " \n"
-                      line)))
+                     target
+                     ;; If the line is empty, we still want to
+                     ;; send it - i.e. an empty pasted line.
+                     (if (string= line "\n")
+                         " \n"
+                       line)))
   (erc-server-send line force target))
 
 (defun erc-get-arglist (fun)
   "Return the argument list of a function without the parens."
   (let ((arglist (format "%S" (erc-function-arglist fun))))
     (if (string-match "^(\\(.*\\))$" arglist)
-       (match-string 1 arglist)
+        (match-string 1 arglist)
       arglist)))
 
 (defun erc-command-no-process-p (str)
@@ -2657,15 +2690,15 @@ See also `erc-server-send'."
 is not alive, nil otherwise."
   (let ((fun (erc-extract-command-from-line str)))
     (and fun
-        (symbolp (car fun))
-        (get (car fun) 'process-not-needed))))
+         (symbolp (car fun))
+         (get (car fun) 'process-not-needed))))
 
 (defun erc-command-name (cmd)
   "For CMD being the function name of a ERC command, something like
 erc-cmd-FOO, this returns a string /FOO."
   (let ((command-name (symbol-name cmd)))
     (if (string-match "^erc-cmd-\\(.*\\)$" command-name)
-       (concat "/" (match-string 1 command-name))
+        (concat "/" (match-string 1 command-name))
       command-name)))
 
 (defun erc-process-input-line (line &optional force no-command)
@@ -2681,30 +2714,30 @@ An optional FORCE argument forces sending the line when flood
 protection is in effect.  The optional NO-COMMAND argument prohibits
 this function from interpreting the line as a command."
   (let ((command-list (erc-extract-command-from-line line)))
-    (if        (and command-list
-            (not no-command))
-       (let* ((cmd  (nth 0 command-list))
-              (args (nth 1 command-list)))
-         (condition-case nil
-             (if (listp args)
-                 (apply cmd args)
-               (funcall cmd args))
-           (wrong-number-of-arguments
-            (erc-display-message nil 'error (current-buffer) 'incorrect-args
-                                 ?c (erc-command-name cmd)
-                                 ?u (or (erc-get-arglist cmd)
-                                        "")
-                                 ?d (format "%s\n"
-                                            (or (documentation cmd) "")))
-            nil)))
+    (if (and command-list
+             (not no-command))
+        (let* ((cmd  (nth 0 command-list))
+               (args (nth 1 command-list)))
+          (condition-case nil
+              (if (listp args)
+                  (apply cmd args)
+                (funcall cmd args))
+            (wrong-number-of-arguments
+             (erc-display-message nil 'error (current-buffer) 'incorrect-args
+                                  ?c (erc-command-name cmd)
+                                  ?u (or (erc-get-arglist cmd)
+                                         "")
+                                  ?d (format "%s\n"
+                                             (or (documentation cmd) "")))
+             nil)))
       (let ((r (erc-default-target)))
-       (if r
-           (funcall erc-send-input-line-function r line force)
-         (erc-display-message nil 'error (current-buffer) 'no-target)
-         nil)))))
+        (if r
+            (funcall erc-send-input-line-function r line force)
+          (erc-display-message nil 'error (current-buffer) 'no-target)
+          nil)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;                   Input commands handlers
+;;                    Input commands handlers
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defun erc-cmd-AMSG (line)
@@ -2712,9 +2745,9 @@ this function from interpreting the line as a command."
   (interactive "sSend to all channels you're on: ")
   (setq line (erc-trim-string line))
   (erc-with-all-buffers-of-server nil
-   (lambda ()
-     (erc-channel-p (erc-default-target)))
-   (erc-send-message line)))
+    (lambda ()
+      (erc-channel-p (erc-default-target)))
+    (erc-send-message line)))
 (put 'erc-cmd-AMSG 'do-not-parse-args t)
 
 (defun erc-cmd-SAY (line)
@@ -2735,36 +2768,37 @@ VALUE is computed by evaluating the rest of LINE in Lisp."
   (cond
    ((string-match "^\\s-*\\(\\S-+\\)\\s-+\\(.*\\)$" line)
     (let ((var (read (concat "erc-" (match-string 1 line))))
-         (val (read (match-string 2 line))))
+          (val (read (match-string 2 line))))
       (if (boundp var)
-         (progn
-           (set var (eval val))
-           (erc-display-message
-            nil nil 'active (format "Set %S to %S" var val))
-           t)
-       (setq var (read (match-string 1 line)))
-       (if (boundp var)
-           (progn
-             (set var (eval val))
-             (erc-display-message
-              nil nil 'active (format "Set %S to %S" var val))
-             t)
-         (erc-display-message nil 'error 'active 'variable-not-bound)
-         nil))))
+          (progn
+            (set var (eval val))
+            (erc-display-message
+             nil nil 'active (format "Set %S to %S" var val))
+            t)
+        (setq var (read (match-string 1 line)))
+        (if (boundp var)
+            (progn
+              (set var (eval val))
+              (erc-display-message
+               nil nil 'active (format "Set %S to %S" var val))
+              t)
+          (erc-display-message nil 'error 'active 'variable-not-bound)
+          nil))))
    ((string-match "^\\s-*$" line)
     (erc-display-line
      (concat "Available user variables:\n"
-            (apply
-             'concat
-             (mapcar
-              (lambda (var)
-                (let ((val (symbol-value var)))
-                  (concat (format "%S:" var)
-                          (if (consp val)
-                              (concat "\n" (pp-to-string val))
-                            (format " %S\n" val)))))
-              (apropos-internal "^erc-" 'custom-variable-p))))
-     (current-buffer)) t)
+             (apply
+              'concat
+              (mapcar
+               (lambda (var)
+                 (let ((val (symbol-value var)))
+                   (concat (format "%S:" var)
+                           (if (consp val)
+                               (concat "\n" (pp-to-string val))
+                             (format " %S\n" val)))))
+               (apropos-internal "^erc-" 'custom-variable-p))))
+     (current-buffer))
+    t)
    (t nil)))
 (defalias 'erc-cmd-VAR 'erc-cmd-SET)
 (defalias 'erc-cmd-VARIABLE 'erc-cmd-SET)
@@ -2786,42 +2820,42 @@ therefore has to contain the command itself as well."
 If no USER argument is specified, list the contents of `erc-ignore-list'."
   (if user
       (let ((quoted (regexp-quote user)))
-       (when (and (not (string= user quoted))
-                  (y-or-n-p (format "Use regexp-quoted form (%s) instead? "
-                                    quoted)))
-         (setq user quoted))
-       (erc-display-line
-        (erc-make-notice (format "Now ignoring %s" user))
-        'active)
-       (erc-with-server-buffer (add-to-list 'erc-ignore-list user)))
+        (when (and (not (string= user quoted))
+                   (y-or-n-p (format "Use regexp-quoted form (%s) instead? "
+                                     quoted)))
+          (setq user quoted))
+        (erc-display-line
+         (erc-make-notice (format "Now ignoring %s" user))
+         'active)
+        (erc-with-server-buffer (add-to-list 'erc-ignore-list user)))
     (if (null (erc-with-server-buffer erc-ignore-list))
-       (erc-display-line (erc-make-notice "Ignore list is empty") 'active)
+        (erc-display-line (erc-make-notice "Ignore list is empty") 'active)
       (erc-display-line (erc-make-notice "Ignore list:") 'active)
       (mapc #'(lambda (item)
-               (erc-display-line (erc-make-notice item)
-                                 'active))
-           (erc-with-server-buffer erc-ignore-list))))
+                (erc-display-line (erc-make-notice item)
+                                  'active))
+            (erc-with-server-buffer erc-ignore-list))))
   t)
 
 (defun erc-cmd-UNIGNORE (user)
   "Remove the user specified in USER from the ignore list."
   (let ((ignored-nick (car (erc-with-server-buffer
-                            (erc-member-ignore-case (regexp-quote user)
-                                                    erc-ignore-list)))))
+                             (erc-member-ignore-case (regexp-quote user)
+                                                     erc-ignore-list)))))
     (unless ignored-nick
       (if (setq ignored-nick (erc-ignored-user-p user))
-         (unless (y-or-n-p (format "Remove this regexp (%s)? "
-                                   ignored-nick))
-           (setq ignored-nick nil))
-       (erc-display-line
-        (erc-make-notice (format "%s is not currently ignored!" user))
-        'active)))
+          (unless (y-or-n-p (format "Remove this regexp (%s)? "
+                                    ignored-nick))
+            (setq ignored-nick nil))
+        (erc-display-line
+         (erc-make-notice (format "%s is not currently ignored!" user))
+         'active)))
     (when ignored-nick
       (erc-display-line
        (erc-make-notice (format "No longer ignoring %s" user))
        'active)
       (erc-with-server-buffer
-       (setq erc-ignore-list (delete ignored-nick erc-ignore-list)))))
+        (setq erc-ignore-list (delete ignored-nick erc-ignore-list)))))
   t)
 
 (defun erc-cmd-CLEAR ()
@@ -2835,20 +2869,20 @@ If no USER argument is specified, list the contents of `erc-ignore-list'."
   (interactive)
   (let ((ops nil))
     (if erc-channel-users
-       (maphash (lambda (_nick user-data)
-                  (let ((cuser (cdr user-data)))
-                    (if (and cuser
-                             (erc-channel-user-op cuser))
-                        (setq ops (cons (erc-server-user-nickname
-                                         (car user-data))
-                                        ops)))))
-                erc-channel-users))
+        (maphash (lambda (_nick user-data)
+                   (let ((cuser (cdr user-data)))
+                     (if (and cuser
+                              (erc-channel-user-op cuser))
+                         (setq ops (cons (erc-server-user-nickname
+                                          (car user-data))
+                                         ops)))))
+                 erc-channel-users))
     (setq ops (sort ops 'string-lessp))
     (if ops
-       (erc-display-message
-        nil 'notice (current-buffer) 'ops
-        ?i (length ops) ?s (if (> (length ops) 1) "s" "")
-        ?o (mapconcat 'identity ops " "))
+        (erc-display-message
+         nil 'notice (current-buffer) 'ops
+         ?i (length ops) ?s (if (> (length ops) 1) "s" "")
+         ?o (mapconcat 'identity ops " "))
       (erc-display-message nil 'notice (current-buffer) 'ops-none)))
   t)
 
@@ -2857,11 +2891,11 @@ If no USER argument is specified, list the contents of `erc-ignore-list'."
   (require 'mail-extr)
   (let ((co (ignore-errors (what-domain tld))))
     (if co
-       (erc-display-message
-        nil 'notice 'active 'country ?c co ?d tld)
+        (erc-display-message
+         nil 'notice 'active 'country ?c co ?d tld)
       (erc-display-message
        nil 'notice 'active 'country-unknown ?d tld))
-  t))
+    t))
 (put 'erc-cmd-COUNTRY 'process-not-needed t)
 
 (defun erc-cmd-AWAY (line)
@@ -2872,8 +2906,8 @@ If no reason is given, unset away status."
       (erc-log (format "cmd: AWAY: %s" reason))
       (erc-server-send
        (if (string= reason "")
-          "AWAY"
-        (concat "AWAY :" reason))))
+           "AWAY"
+         (concat "AWAY :" reason))))
     t))
 (put 'erc-cmd-AWAY 'do-not-parse-args t)
 
@@ -2891,8 +2925,8 @@ If no reason is given, unset away status."
 CMD is the CTCP command, possible values being ECHO, FINGER, CLIENTINFO, TIME,
 VERSION and so on.  It is called with ARGS."
   (let ((str (concat cmd
-                    (when args
-                      (concat " " (mapconcat #'identity args " "))))))
+                     (when args
+                       (concat " " (mapconcat #'identity args " "))))))
     (erc-log (format "cmd: CTCP [%s]: [%s]" nick str))
     (erc-send-ctcp-message nick str)
     t))
@@ -2915,29 +2949,29 @@ For help about the WHOIS command, do:
 For a list of user commands (/join /part, ...):
   /help."
   (if func
-    (let* ((sym (or (let ((sym (intern-soft
-                               (concat "erc-cmd-" (upcase func)))))
-                     (if (and sym (or (boundp sym) (fboundp sym)))
-                         sym
-                       nil))
-                   (let ((sym (intern-soft func)))
-                     (if (and sym (or (boundp sym) (fboundp sym)))
-                         sym
-                       nil))
-                   (let ((sym (intern-soft (concat "erc-" func))))
-                     (if (and sym (or (boundp sym) (fboundp sym)))
-                         sym
-                       nil)))))
-      (if sym
-         (cond
-          ((boundp sym) (describe-variable sym))
-          ((fboundp sym) (describe-function sym))
-          (t nil))
-       (apropos-command (concat "erc-.*" func) nil
-                        (lambda (x)
-                          (or (commandp x)
-                              (get x 'custom-type))))
-       t))
+      (let* ((sym (or (let ((sym (intern-soft
+                                  (concat "erc-cmd-" (upcase func)))))
+                        (if (and sym (or (boundp sym) (fboundp sym)))
+                            sym
+                          nil))
+                      (let ((sym (intern-soft func)))
+                        (if (and sym (or (boundp sym) (fboundp sym)))
+                            sym
+                          nil))
+                      (let ((sym (intern-soft (concat "erc-" func))))
+                        (if (and sym (or (boundp sym) (fboundp sym)))
+                            sym
+                          nil)))))
+        (if sym
+            (cond
+             ((boundp sym) (describe-variable sym))
+             ((fboundp sym) (describe-function sym))
+             (t nil))
+          (apropos-command (concat "erc-.*" func) nil
+                           (lambda (x)
+                             (or (commandp x)
+                                 (get x 'custom-type))))
+          t))
     (apropos "erc-cmd-")
     (message "Type C-h m to get additional information about keybindings.")
     t))
@@ -2951,23 +2985,23 @@ If CHANNEL is specified as \"-invite\", join the channel to which you
 were most recently invited.  See also `invitation'."
   (let (chnl)
     (if (string= (upcase channel) "-INVITE")
-       (if erc-invitation
-           (setq chnl erc-invitation)
-         (erc-display-message nil 'error (current-buffer) 'no-invitation))
+        (if erc-invitation
+            (setq chnl erc-invitation)
+          (erc-display-message nil 'error (current-buffer) 'no-invitation))
       (setq chnl (erc-ensure-channel-name channel)))
     (when chnl
       ;; Prevent double joining of same channel on same server.
       (let ((joined-channels
-            (mapcar #'(lambda (chanbuf)
-                        (with-current-buffer chanbuf (erc-default-target)))
-                    (erc-channel-list erc-server-process))))
-       (if (erc-member-ignore-case chnl joined-channels)
-           (switch-to-buffer (car (erc-member-ignore-case chnl
-                                                          joined-channels)))
-         (erc-log (format "cmd: JOIN: %s" chnl))
-         (erc-server-send (if (and chnl key)
-                              (format "JOIN %s %s" chnl key)
-                            (format "JOIN %s" chnl)))))))
+             (mapcar #'(lambda (chanbuf)
+                         (with-current-buffer chanbuf (erc-default-target)))
+                     (erc-channel-list erc-server-process))))
+        (if (erc-member-ignore-case chnl joined-channels)
+            (switch-to-buffer (car (erc-member-ignore-case chnl
+                                                           joined-channels)))
+          (erc-log (format "cmd: JOIN: %s" chnl))
+          (erc-server-send (if (and chnl key)
+                               (format "JOIN %s %s" chnl key)
+                             (format "JOIN %s" chnl)))))))
   t)
 
 (defalias 'erc-cmd-CHANNEL 'erc-cmd-JOIN)
@@ -2986,14 +3020,14 @@ If CHANNEL is not specified, display the users in the current channel.
 This function clears the channel name list first, then sends the
 command."
   (let ((tgt (or (and (erc-channel-p channel) channel)
-                (erc-default-target))))
+                 (erc-default-target))))
     (if (and tgt (erc-channel-p tgt))
-       (progn
-         (erc-log (format "cmd: DEFAULT: NAMES %s" tgt))
-         (erc-with-buffer
-          (tgt)
-          (erc-channel-begin-receiving-names))
-         (erc-server-send (concat "NAMES " tgt)))
+        (progn
+          (erc-log (format "cmd: DEFAULT: NAMES %s" tgt))
+          (erc-with-buffer
+              (tgt)
+            (erc-channel-begin-receiving-names))
+          (erc-server-send (concat "NAMES " tgt)))
       (erc-display-message nil 'error (current-buffer) 'no-default-channel)))
   t)
 (defalias 'erc-cmd-N 'erc-cmd-NAMES)
@@ -3003,27 +3037,27 @@ command."
 LINE has the format: \"#CHANNEL NICK REASON\" or \"NICK REASON\"."
   (let ((reasonstring (mapconcat 'identity reasonwords " ")))
     (if (string= "" reasonstring)
-       (setq reasonstring (format "Kicked by %s" (erc-current-nick))))
+        (setq reasonstring (format "Kicked by %s" (erc-current-nick))))
     (if (erc-channel-p target)
-       (let ((nick reason-or-nick))
-         (erc-log (format "cmd: KICK: %s/%s: %s" nick target reasonstring))
-         (erc-server-send (format "KICK %s %s :%s" target nick reasonstring)
-                          nil target)
-         t)
+        (let ((nick reason-or-nick))
+          (erc-log (format "cmd: KICK: %s/%s: %s" nick target reasonstring))
+          (erc-server-send (format "KICK %s %s :%s" target nick reasonstring)
+                           nil target)
+          t)
       (when target
-       (let ((ch (erc-default-target)))
-         (setq reasonstring (concat
-                             (if reason-or-nick (concat reason-or-nick " "))
-                             reasonstring))
-         (if ch
-             (progn
-               (erc-log
-                (format "cmd: KICK: %s/%s: %s" target ch reasonstring))
-               (erc-server-send
-                (format "KICK %s %s :%s" ch target reasonstring) nil ch))
-           (erc-display-message nil 'error (current-buffer)
-                                'no-default-channel))
-         t)))))
+        (let ((ch (erc-default-target)))
+          (setq reasonstring (concat
+                              (if reason-or-nick (concat reason-or-nick " "))
+                              reasonstring))
+          (if ch
+              (progn
+                (erc-log
+                 (format "cmd: KICK: %s/%s: %s" target ch reasonstring))
+                (erc-server-send
+                 (format "KICK %s %s :%s" ch target reasonstring) nil ch))
+            (erc-display-message nil 'error (current-buffer)
+                                 'no-default-channel))
+          t)))))
 
 (defvar erc-script-args nil)
 
@@ -3038,20 +3072,20 @@ a script after exceeding the flood threshold."
   (cond
    ((string-match "^\\s-*\\(\\S-+\\)\\(.*\\)$" line)
     (let* ((file-to-find (match-string 1 line))
-          (erc-script-args (match-string 2 line))
-          (file (erc-find-file file-to-find erc-script-path)))
+           (erc-script-args (match-string 2 line))
+           (file (erc-find-file file-to-find erc-script-path)))
       (erc-log (format "cmd: LOAD: %s" file-to-find))
       (cond
        ((not file)
-       (erc-display-message nil 'error (current-buffer)
-                            'cannot-find-file ?f file-to-find))
+        (erc-display-message nil 'error (current-buffer)
+                             'cannot-find-file ?f file-to-find))
        ((not (file-readable-p file))
-       (erc-display-message nil 'error (current-buffer)
-                            'cannot-read-file ?f file))
+        (erc-display-message nil 'error (current-buffer)
+                             'cannot-read-file ?f file))
        (t
-       (message "Loading \'%s\'..." file)
-       (erc-load-script file)
-       (message "Loading \'%s\'...done" file))))
+        (message "Loading \'%s\'..." file)
+        (erc-load-script file)
+        (message "Loading \'%s\'...done" file))))
     t)
    (t nil)))
 
@@ -3061,11 +3095,11 @@ a script after exceeding the flood threshold."
 If SERVER is non-nil, use that, rather than the current server."
   ;; FIXME: is the above docstring correct?  -- Lawrence 2004-01-08
   (let ((send (if server
-                 (format "WHOIS %s %s" user server)
-               (format "WHOIS %s" user))))
+                  (format "WHOIS %s %s" user server)
+                (format "WHOIS %s" user))))
     (erc-log (format "cmd: %s" send))
     (erc-server-send send)
-  t))
+    t))
 (defalias 'erc-cmd-WI 'erc-cmd-WHOIS)
 
 (defun erc-cmd-WHOAMI ()
@@ -3076,78 +3110,78 @@ If SERVER is non-nil, use that, rather than the current server."
 (defun erc-cmd-IDLE (nick)
   "Show the length of time NICK has been idle."
   (let ((origbuf (current-buffer))
-       symlist)
+        symlist)
     (erc-with-server-buffer
-     (push (cons (erc-once-with-server-event
-                 311 (lambda (_proc parsed)
-                       (string= nick
-                                (nth 1 (erc-response.command-args
-                                        parsed)))))
-                'erc-server-311-functions)
-          symlist)
-     (push (cons (erc-once-with-server-event
-                 312 (lambda (_proc parsed)
-                       (string= nick
-                                (nth 1 (erc-response.command-args
-                                        parsed)))))
-                'erc-server-312-functions)
-          symlist)
-     (push (cons (erc-once-with-server-event
-                 318 (lambda (_proc parsed)
-                       (string= nick
-                                (nth 1 (erc-response.command-args
-                                        parsed)))))
-                'erc-server-318-functions)
-          symlist)
-     (push (cons (erc-once-with-server-event
-                 319 (lambda (_proc parsed)
-                       (string= nick
-                                (nth 1 (erc-response.command-args
-                                        parsed)))))
-                'erc-server-319-functions)
-          symlist)
-     (push (cons (erc-once-with-server-event
-                 320 (lambda (_proc parsed)
-                       (string= nick
-                                (nth 1 (erc-response.command-args
-                                        parsed)))))
-                'erc-server-320-functions)
-          symlist)
-     (push (cons (erc-once-with-server-event
-                 330 (lambda (_proc parsed)
-                       (string= nick
-                                (nth 1 (erc-response.command-args
-                                        parsed)))))
-                'erc-server-330-functions)
-          symlist)
-     (push (cons (erc-once-with-server-event
-                 317
-                 (lambda (_proc parsed)
-                   (let ((idleseconds
-                          (string-to-number
-                           (cl-third
-                            (erc-response.command-args parsed)))))
-                     (erc-display-line
-                      (erc-make-notice
-                       (format "%s has been idle for %s."
-                               (erc-string-no-properties nick)
-                               (erc-seconds-to-string idleseconds)))
-                      origbuf)
-                     t)))
-                'erc-server-317-functions)
-          symlist)
-
-     ;; Send the WHOIS command.
-     (erc-cmd-WHOIS nick)
-
-     ;; Remove the uninterned symbols from the server hooks that did not run.
-     (run-at-time 20 nil (lambda (buf symlist)
-                          (with-current-buffer buf
-                            (dolist (sym symlist)
-                              (let ((hooksym (cdr sym))
-                                    (funcsym (car sym)))
-                                (remove-hook hooksym funcsym t)))))
-                 (current-buffer) symlist)))
+      (push (cons (erc-once-with-server-event
+                   311 (lambda (_proc parsed)
+                         (string= nick
+                                  (nth 1 (erc-response.command-args
+                                          parsed)))))
+                  'erc-server-311-functions)
+            symlist)
+      (push (cons (erc-once-with-server-event
+                   312 (lambda (_proc parsed)
+                         (string= nick
+                                  (nth 1 (erc-response.command-args
+                                          parsed)))))
+                  'erc-server-312-functions)
+            symlist)
+      (push (cons (erc-once-with-server-event
+                   318 (lambda (_proc parsed)
+                         (string= nick
+                                  (nth 1 (erc-response.command-args
+                                          parsed)))))
+                  'erc-server-318-functions)
+            symlist)
+      (push (cons (erc-once-with-server-event
+                   319 (lambda (_proc parsed)
+                         (string= nick
+                                  (nth 1 (erc-response.command-args
+                                          parsed)))))
+                  'erc-server-319-functions)
+            symlist)
+      (push (cons (erc-once-with-server-event
+                   320 (lambda (_proc parsed)
+                         (string= nick
+                                  (nth 1 (erc-response.command-args
+                                          parsed)))))
+                  'erc-server-320-functions)
+            symlist)
+      (push (cons (erc-once-with-server-event
+                   330 (lambda (_proc parsed)
+                         (string= nick
+                                  (nth 1 (erc-response.command-args
+                                          parsed)))))
+                  'erc-server-330-functions)
+            symlist)
+      (push (cons (erc-once-with-server-event
+                   317
+                   (lambda (_proc parsed)
+                     (let ((idleseconds
+                            (string-to-number
+                             (cl-third
+                              (erc-response.command-args parsed)))))
+                       (erc-display-line
+                        (erc-make-notice
+                         (format "%s has been idle for %s."
+                                 (erc-string-no-properties nick)
+                                 (erc-seconds-to-string idleseconds)))
+                        origbuf)
+                       t)))
+                  'erc-server-317-functions)
+            symlist)
+
+      ;; Send the WHOIS command.
+      (erc-cmd-WHOIS nick)
+
+      ;; Remove the uninterned symbols from the server hooks that did not run.
+      (run-at-time 20 nil (lambda (buf symlist)
+                            (with-current-buffer buf
+                              (dolist (sym symlist)
+                                (let ((hooksym (cdr sym))
+                                      (funcsym (car sym)))
+                                  (remove-hook hooksym funcsym t)))))
+                   (current-buffer) symlist)))
   t)
 
 (defun erc-cmd-DESCRIBE (line)
@@ -3157,7 +3191,7 @@ LINE has the format \"USER ACTION\"."
    ((string-match
      "^\\s-*\\(\\S-+\\)\\s-\\(.*\\)$" line)
     (let ((dst (match-string 1 line))
-         (s (match-string 2 line)))
+          (s (match-string 2 line)))
       (erc-log (format "cmd: DESCRIBE: [%s] %s" dst s))
       (erc-send-action dst s))
     t)
@@ -3203,7 +3237,7 @@ See also `erc-message' and `erc-display-line'."
   (erc-message "PRIVMSG" (concat (erc-default-target) " " line) force)
   (erc-display-line
    (concat (erc-format-my-nick) line)
-     (current-buffer))
+   (current-buffer))
   ;; FIXME - treat multiline, run hooks, or remove me?
   t)
 
@@ -3229,7 +3263,7 @@ URL `http://freenode.net/using_the_network.shtml'."
   "Send a notice to the channel or user given as the first word.
 The rest is the message to send."
   (erc-message "NOTICE" (concat channel-or-user " "
-                               (mapconcat #'identity message " "))))
+                                (mapconcat #'identity message " "))))
 
 (defun erc-cmd-MSG (line)
   "Send a message to the channel or user given as the first word in LINE.
@@ -3250,16 +3284,16 @@ The rest of LINE is the message to send."
   "Change current nickname to NICK."
   (erc-log (format "cmd: NICK: %s (erc-bad-nick: %S)" nick erc-bad-nick))
   (let ((nicklen (cdr (assoc "NICKLEN" (erc-with-server-buffer
-                                        erc-server-parameters)))))
+                                         erc-server-parameters)))))
     (and nicklen (> (length nick) (string-to-number nicklen))
-        (erc-display-message
-         nil 'notice 'active 'nick-too-long
-         ?i (length nick) ?l nicklen)))
+         (erc-display-message
+          nil 'notice 'active 'nick-too-long
+          ?i (length nick) ?l nicklen)))
   (erc-server-send (format "NICK %s" nick))
   (cond (erc-bad-nick
-        (erc-set-current-nick nick)
-        (erc-update-mode-line)
-        (setq erc-bad-nick nil)))
+         (erc-set-current-nick nick)
+         (erc-update-mode-line)
+         (setq erc-bad-nick nil)))
   t)
 
 (defun erc-cmd-PART (line)
@@ -3268,26 +3302,26 @@ Otherwise leave the channel indicated by LINE."
   (cond
    ((string-match "^\\s-*\\([&#+!]\\S-+\\)\\s-?\\(.*\\)$" line)
     (let* ((ch (match-string 1 line))
-          (msg (match-string 2 line))
-          (reason (funcall erc-part-reason (if (equal msg "") nil msg))))
+           (msg (match-string 2 line))
+           (reason (funcall erc-part-reason (if (equal msg "") nil msg))))
       (erc-log (format "cmd: PART: %s: %s" ch reason))
       (erc-server-send (if (string= reason "")
-                          (format "PART %s" ch)
-                        (format "PART %s :%s" ch reason))
-                      nil ch))
+                           (format "PART %s" ch)
+                         (format "PART %s :%s" ch reason))
+                       nil ch))
     t)
    ((string-match "^\\s-*\\(.*\\)$" line)
     (let* ((ch (erc-default-target))
-          (msg (match-string 1 line))
-          (reason (funcall erc-part-reason (if (equal msg "") nil msg))))
+           (msg (match-string 1 line))
+           (reason (funcall erc-part-reason (if (equal msg "") nil msg))))
       (if (and ch (erc-channel-p ch))
-         (progn
-           (erc-log (format "cmd: PART: %s: %s" ch reason))
-           (erc-server-send (if (string= reason "")
-                                (format "PART %s" ch)
-                              (format "PART %s :%s" ch reason))
-                            nil ch))
-       (erc-display-message nil 'error (current-buffer) 'no-target)))
+          (progn
+            (erc-log (format "cmd: PART: %s: %s" ch reason))
+            (erc-server-send (if (string= reason "")
+                                 (format "PART %s" ch)
+                               (format "PART %s :%s" ch reason))
+                             nil ch))
+        (erc-display-message nil 'error (current-buffer) 'no-target)))
     t)
    (t nil)))
 (put 'erc-cmd-PART 'do-not-parse-args t)
@@ -3322,11 +3356,11 @@ See also `erc-auto-query' to decide how private messages from
 other people should be displayed."
   :group 'erc-query
   :type '(choice (const :tag "Split window and select" window)
-                (const :tag "Split window, don't select" window-noselect)
-                (const :tag "New frame" frame)
-                (const :tag "Bury in new buffer" bury)
-                (const :tag "Use current buffer" buffer)
-                (const :tag "Use current buffer" t)))
+                 (const :tag "Split window, don't select" window-noselect)
+                 (const :tag "New frame" frame)
+                 (const :tag "Bury in new buffer" bury)
+                 (const :tag "Use current buffer" buffer)
+                 (const :tag "Use current buffer" t)))
 
 (defun erc-cmd-QUERY (&optional user)
   "Open a query with USER.
@@ -3338,11 +3372,11 @@ If USER is omitted, close the current query buffer if one exists
   (interactive
    (list (read-from-minibuffer "Start a query with: " nil)))
   (let ((session-buffer (erc-server-buffer))
-       (erc-join-buffer erc-query-display))
+        (erc-join-buffer erc-query-display))
     (if user
-       (erc-query user session-buffer)
+        (erc-query user session-buffer)
       ;; currently broken, evil hack to display help anyway
-      ;(erc-delete-query))))
+                                        ;(erc-delete-query))))
       (signal 'wrong-number-of-arguments ""))))
 (defalias 'erc-cmd-Q 'erc-cmd-QUERY)
 
@@ -3352,8 +3386,8 @@ If USER is omitted, close the current query buffer if one exists
 If S is non-nil, it will be used as the quit reason."
   (or s
       (format "\C-bERC\C-b %s (IRC client for Emacs)"; - \C-b%s\C-b"
-             erc-version-string) ; erc-official-location)
-  ))
+              erc-version-string) ; erc-official-location)
+      ))
 
 (defun erc-quit-reason-zippy (&optional s)
   "Zippy quit message.
@@ -3361,8 +3395,8 @@ If S is non-nil, it will be used as the quit reason."
 If S is non-nil, it will be used as the quit reason."
   (or s
       (if (fboundp 'yow)
-         (erc-replace-regexp-in-string "\n" "" (yow))
-       (erc-quit-reason-normal))))
+          (erc-replace-regexp-in-string "\n" "" (yow))
+        (erc-quit-reason-normal))))
 
 (make-obsolete 'erc-quit-reason-zippy "it will be removed." "24.4")
 
@@ -3370,7 +3404,7 @@ If S is non-nil, it will be used as the quit reason."
   "Choose a quit reason based on S (a string)."
   (when (featurep 'xemacs) (require 'poe))
   (let ((res (car (assoc-default (or s "")
-                  erc-quit-reason-various-alist 'string-match))))
+                                 erc-quit-reason-various-alist 'string-match))))
     (cond
      ((functionp res) (funcall res))
      ((stringp res) res)
@@ -3383,8 +3417,8 @@ If S is non-nil, it will be used as the quit reason."
 If S is non-nil, it will be used as the quit reason."
   (or s
       (format "\C-bERC\C-b %s (IRC client for Emacs)"; - \C-b%s\C-b"
-             erc-version-string) ; erc-official-location)
-  ))
+              erc-version-string) ; erc-official-location)
+      ))
 
 (defun erc-part-reason-zippy (&optional s)
   "Zippy part message.
@@ -3392,8 +3426,8 @@ If S is non-nil, it will be used as the quit reason."
 If S is non-nil, it will be used as the quit reason."
   (or s
       (if (fboundp 'yow)
-         (erc-replace-regexp-in-string "\n" "" (yow))
-       (erc-part-reason-normal))))
+          (erc-replace-regexp-in-string "\n" "" (yow))
+        (erc-part-reason-normal))))
 
 (make-obsolete 'erc-part-reason-zippy "it will be removed." "24.4")
 
@@ -3401,7 +3435,7 @@ If S is non-nil, it will be used as the quit reason."
   "Choose a part reason based on S (a string)."
   (when (featurep 'xemacs) (require 'poe))
   (let ((res (car (assoc-default (or s "")
-                  erc-part-reason-various-alist 'string-match))))
+                                 erc-part-reason-various-alist 'string-match))))
     (cond
      ((functionp res) (funcall res))
      ((stringp res) res)
@@ -3417,28 +3451,28 @@ the message given by REASON."
   (cond
    ((string-match "^\\s-*\\(.*\\)$" reason)
     (let* ((s (match-string 1 reason))
-          (buffer (erc-server-buffer))
-          (reason (funcall erc-quit-reason (if (equal s "") nil s)))
-          server-proc)
+           (buffer (erc-server-buffer))
+           (reason (funcall erc-quit-reason (if (equal s "") nil s)))
+           server-proc)
       (with-current-buffer (if (and buffer
-                                   (bufferp buffer))
-                              buffer
-                            (current-buffer))
-       (erc-log (format "cmd: QUIT: %s" reason))
-       (setq erc-server-quitting t)
-       (erc-set-active-buffer (erc-server-buffer))
-       (setq server-proc erc-server-process)
-       (erc-server-send (format "QUIT :%s" reason)))
+                                    (bufferp buffer))
+                               buffer
+                             (current-buffer))
+        (erc-log (format "cmd: QUIT: %s" reason))
+        (setq erc-server-quitting t)
+        (erc-set-active-buffer (erc-server-buffer))
+        (setq server-proc erc-server-process)
+        (erc-server-send (format "QUIT :%s" reason)))
       (run-hook-with-args 'erc-quit-hook server-proc)
       (when erc-kill-queries-on-quit
-       (erc-kill-query-buffers server-proc))
+        (erc-kill-query-buffers server-proc))
       ;; if the process has not been killed within 4 seconds, kill it
       (run-at-time 4 nil
-                  (lambda (proc)
-                    (when (and (processp proc)
-                               (memq (process-status proc) '(run open)))
-                      (delete-process proc)))
-                  server-proc))
+                   (lambda (proc)
+                     (when (and (processp proc)
+                                (memq (process-status proc) '(run open)))
+                       (delete-process proc)))
+                   server-proc))
     t)
    (t nil)))
 
@@ -3451,7 +3485,7 @@ the message given by REASON."
 (defun erc-cmd-GQUIT (reason)
   "Disconnect from all servers at once with the same quit REASON."
   (erc-with-all-buffers-of-server nil #'erc-open-server-buffer-p
-                                 (erc-cmd-QUIT reason))
+                                  (erc-cmd-QUIT reason))
   (when erc-kill-queries-on-quit
     ;; if the query buffers have not been killed within 4 seconds,
     ;; kill them
@@ -3459,8 +3493,8 @@ the message given by REASON."
      4 nil
      (lambda ()
        (dolist (buffer (erc-buffer-list (lambda (buf)
-                                         (not (erc-server-buffer-p buf)))))
-        (kill-buffer buffer)))))
+                                          (not (erc-server-buffer-p buf)))))
+         (kill-buffer buffer)))))
   t)
 
 (defalias 'erc-cmd-GQ 'erc-cmd-GQUIT)
@@ -3470,7 +3504,7 @@ the message given by REASON."
 (defun erc-cmd-RECONNECT ()
   "Try to reconnect to the current IRC server."
   (let ((buffer (erc-server-buffer))
-       (process nil))
+        (process nil))
     (unless (buffer-live-p buffer)
       (setq buffer (current-buffer)))
     (with-current-buffer buffer
@@ -3479,8 +3513,8 @@ the message given by REASON."
       (setq erc-server-reconnect-count 0)
       (setq process (get-buffer-process (erc-server-buffer)))
       (if process
-         (delete-process process)
-       (erc-server-reconnect))
+          (delete-process process)
+        (erc-server-reconnect))
       (setq erc-server-reconnecting nil)))
   t)
 (put 'erc-cmd-RECONNECT 'process-not-needed t)
@@ -3501,54 +3535,54 @@ the message given by REASON."
 (defun erc-cmd-SV ()
   "Say the current ERC and Emacs version into channel."
   (erc-send-message (format "I'm using ERC %s with %s %s (%s%s) of %s."
-                           erc-version-string
-                           (if (featurep 'xemacs) "XEmacs" "GNU Emacs")
-                           emacs-version
-                           system-configuration
-                           (concat
-                            (cond ((featurep 'motif)
-                                   (concat ", " (substring
-                                                 motif-version-string 4)))
-                                  ((featurep 'gtk)
-                                   (concat ", GTK+ Version "
-                                           gtk-version-string))
-                                  ((featurep 'x-toolkit) ", X toolkit")
-                                  (t ""))
-                            (if (and (boundp 'x-toolkit-scroll-bars)
-                                     (memq x-toolkit-scroll-bars
-                                           '(xaw xaw3d)))
-                                (format ", %s scroll bars"
-                                        (capitalize (symbol-name
-                                                     x-toolkit-scroll-bars)))
-                              "")
-                            (if (featurep 'multi-tty) ", multi-tty" ""))
-                           erc-emacs-build-time))
+                            erc-version-string
+                            (if (featurep 'xemacs) "XEmacs" "GNU Emacs")
+                            emacs-version
+                            system-configuration
+                            (concat
+                             (cond ((featurep 'motif)
+                                    (concat ", " (substring
+                                                  motif-version-string 4)))
+                                   ((featurep 'gtk)
+                                    (concat ", GTK+ Version "
+                                            gtk-version-string))
+                                   ((featurep 'x-toolkit) ", X toolkit")
+                                   (t ""))
+                             (if (and (boundp 'x-toolkit-scroll-bars)
+                                      (memq x-toolkit-scroll-bars
+                                            '(xaw xaw3d)))
+                                 (format ", %s scroll bars"
+                                         (capitalize (symbol-name
+                                                      x-toolkit-scroll-bars)))
+                               "")
+                             (if (featurep 'multi-tty) ", multi-tty" ""))
+                            erc-emacs-build-time))
   t)
 
 (defun erc-cmd-SM ()
   "Say the current ERC modes into channel."
   (erc-send-message (format "I'm using the following modules: %s!"
-                           (erc-modes)))
+                            (erc-modes)))
   t)
 
 (defun erc-cmd-DEOP (&rest people)
   "Remove the operator setting from user(s) given in PEOPLE."
   (when (> (length people) 0)
     (erc-server-send (concat "MODE " (erc-default-target)
-                             " -"
-                             (make-string (length people) ?o)
-                             " "
-                             (mapconcat 'identity people " ")))
+                             " -"
+                             (make-string (length people) ?o)
+                             " "
+                             (mapconcat 'identity people " ")))
     t))
 
 (defun erc-cmd-OP (&rest people)
   "Add the operator setting to users(s) given in PEOPLE."
   (when (> (length people) 0)
     (erc-server-send (concat "MODE " (erc-default-target)
-                             " +"
-                             (make-string (length people) ?o)
-                             " "
-                             (mapconcat 'identity people " ")))
+                             " +"
+                             (make-string (length people) ?o)
+                             " "
+                             (mapconcat 'identity people " ")))
     t))
 
 (defun erc-cmd-TIME (&optional line)
@@ -3574,7 +3608,7 @@ be displayed."
    ;; /topic #channel TOPIC
    ((string-match "^\\s-*\\([&#+!]\\S-+\\)\\s-\\(.*\\)$" topic)
     (let ((ch (match-string 1 topic))
-         (topic (match-string 2 topic)))
+          (topic (match-string 2 topic)))
       (erc-log (format "cmd: TOPIC [%s]: %s" ch topic))
       (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))
     t)
@@ -3591,12 +3625,12 @@ be displayed."
    ;; /topic TOPIC
    ((string-match "^\\s-*\\(.*\\)$" topic)
     (let ((ch (erc-default-target))
-         (topic (match-string 1 topic)))
+          (topic (match-string 1 topic)))
       (if (and ch (erc-channel-p ch))
-         (progn
-           (erc-log (format "cmd: TOPIC [%s]: %s" ch topic))
-           (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))
-       (erc-display-message nil 'error (current-buffer) 'no-target)))
+          (progn
+            (erc-log (format "cmd: TOPIC [%s]: %s" ch topic))
+            (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))
+        (erc-display-message nil 'error (current-buffer) 'no-target)))
     t)
    (t nil)))
 (defalias 'erc-cmd-T 'erc-cmd-TOPIC)
@@ -3641,69 +3675,69 @@ or not the ban list has been requested from the server.")
 
 The ban list is fetched from the server if necessary."
   (let ((chnl (erc-default-target))
-       (chnl-name (buffer-name)))
+        (chnl-name (buffer-name)))
 
     (cond
      ((not (erc-channel-p chnl))
       (erc-display-line (erc-make-notice "You're not on a channel\n")
-                       'active))
+                        'active))
 
      ((not (get 'erc-channel-banlist 'received-from-server))
       (let ((old-367-hook erc-server-367-functions))
-       (setq erc-server-367-functions 'erc-banlist-store
-             erc-channel-banlist nil)
-       ;; fetch the ban list then callback
-       (erc-with-server-buffer
-         (erc-once-with-server-event
-          368
-          (lambda (_proc _parsed)
-            (with-current-buffer chnl-name
-             (put 'erc-channel-banlist 'received-from-server t)
-             (setq erc-server-367-functions old-367-hook)
-             (erc-cmd-BANLIST)
-             t)))
-         (erc-server-send (format "MODE %s b" chnl)))))
+        (setq erc-server-367-functions 'erc-banlist-store
+              erc-channel-banlist nil)
+        ;; fetch the ban list then callback
+        (erc-with-server-buffer
+          (erc-once-with-server-event
+           368
+           (lambda (_proc _parsed)
+             (with-current-buffer chnl-name
+               (put 'erc-channel-banlist 'received-from-server t)
+               (setq erc-server-367-functions old-367-hook)
+               (erc-cmd-BANLIST)
+               t)))
+          (erc-server-send (format "MODE %s b" chnl)))))
 
      ((null erc-channel-banlist)
       (erc-display-line (erc-make-notice
-                        (format "No bans for channel: %s\n" chnl))
-                       'active)
+                         (format "No bans for channel: %s\n" chnl))
+                        'active)
       (put 'erc-channel-banlist 'received-from-server nil))
 
      (t
       (let* ((erc-fill-column (or (and (boundp 'erc-fill-column)
-                                      erc-fill-column)
-                                 (and (boundp 'fill-column)
-                                      fill-column)
-                                 (1- (window-width))))
-            (separator (make-string erc-fill-column ?=))
-            (fmt (concat
-                  "%-" (number-to-string (/ erc-fill-column 2)) "s"
-                  "%" (number-to-string (/ erc-fill-column 2)) "s")))
-
-       (erc-display-line
-        (erc-make-notice (format "Ban list for channel: %s\n"
-                                 (erc-default-target)))
-        'active)
-
-       (erc-display-line separator 'active)
-       (erc-display-line (format fmt "Ban Mask" "Banned By") 'active)
-       (erc-display-line separator 'active)
-
-       (mapc
-        (lambda (x)
-          (erc-display-line
-           (format fmt
-                   (truncate-string-to-width (cdr x) (/ erc-fill-column 2))
-                   (if (car x)
-                       (truncate-string-to-width (car x) (/ erc-fill-column 2))
-                     ""))
-           'active))
-        erc-channel-banlist)
-
-       (erc-display-line (erc-make-notice "End of Ban list")
-                         'active)
-       (put 'erc-channel-banlist 'received-from-server nil)))))
+                                       erc-fill-column)
+                                  (and (boundp 'fill-column)
+                                       fill-column)
+                                  (1- (window-width))))
+             (separator (make-string erc-fill-column ?=))
+             (fmt (concat
+                   "%-" (number-to-string (/ erc-fill-column 2)) "s"
+                   "%" (number-to-string (/ erc-fill-column 2)) "s")))
+
+        (erc-display-line
+         (erc-make-notice (format "Ban list for channel: %s\n"
+                                  (erc-default-target)))
+         'active)
+
+        (erc-display-line separator 'active)
+        (erc-display-line (format fmt "Ban Mask" "Banned By") 'active)
+        (erc-display-line separator 'active)
+
+        (mapc
+         (lambda (x)
+           (erc-display-line
+            (format fmt
+                    (truncate-string-to-width (cdr x) (/ erc-fill-column 2))
+                    (if (car x)
+                        (truncate-string-to-width (car x) (/ erc-fill-column 2))
+                      ""))
+            'active))
+         erc-channel-banlist)
+
+        (erc-display-line (erc-make-notice "End of Ban list")
+                          'active)
+        (put 'erc-channel-banlist 'received-from-server nil)))))
   t)
 
 (defalias 'erc-cmd-BL 'erc-cmd-BANLIST)
@@ -3722,31 +3756,31 @@ Unban all currently banned users in the current channel."
 
      ((not (get 'erc-channel-banlist 'received-from-server))
       (let ((old-367-hook erc-server-367-functions))
-       (setq erc-server-367-functions 'erc-banlist-store)
-       ;; fetch the ban list then callback
-       (erc-with-server-buffer
-        (erc-once-with-server-event
-         368
-         (lambda (_proc _parsed)
-           (with-current-buffer chnl
-             (put 'erc-channel-banlist 'received-from-server t)
-             (setq erc-server-367-functions old-367-hook)
-             (erc-cmd-MASSUNBAN)
-             t)))
-        (erc-server-send (format "MODE %s b" chnl)))))
+        (setq erc-server-367-functions 'erc-banlist-store)
+        ;; fetch the ban list then callback
+        (erc-with-server-buffer
+          (erc-once-with-server-event
+           368
+           (lambda (_proc _parsed)
+             (with-current-buffer chnl
+               (put 'erc-channel-banlist 'received-from-server t)
+               (setq erc-server-367-functions old-367-hook)
+               (erc-cmd-MASSUNBAN)
+               t)))
+          (erc-server-send (format "MODE %s b" chnl)))))
 
      (t (let ((bans (mapcar 'cdr erc-channel-banlist)))
-         (when bans
-           ;; Glob the bans into groups of three, and carry out the unban.
-           ;; eg. /mode #foo -bbb a*!*@* b*!*@* c*!*@*
-           (mapc
-            (lambda (x)
-              (erc-server-send
-               (format "MODE %s -%s %s" (erc-default-target)
-                       (make-string (length x) ?b)
-                       (mapconcat 'identity x " "))))
-            (erc-group-list bans 3))))
-       t))))
+          (when bans
+            ;; Glob the bans into groups of three, and carry out the unban.
+            ;; eg. /mode #foo -bbb a*!*@* b*!*@* c*!*@*
+            (mapc
+             (lambda (x)
+               (erc-server-send
+                (format "MODE %s -%s %s" (erc-default-target)
+                        (make-string (length x) ?b)
+                        (mapconcat 'identity x " "))))
+             (erc-group-list bans 3))))
+        t))))
 
 (defalias 'erc-cmd-MUB 'erc-cmd-MASSUNBAN)
 
@@ -3770,12 +3804,12 @@ text again."
   (erc-set-active-buffer (current-buffer))
   (save-excursion
     (let* ((cb (current-buffer))
-          (buf (generate-new-buffer erc-grab-buffer-name))
-          (region (buffer-substring start end))
-          (lines (erc-split-multiline-safe region)))
+           (buf (generate-new-buffer erc-grab-buffer-name))
+           (region (buffer-substring start end))
+           (lines (erc-split-multiline-safe region)))
       (set-buffer buf)
       (dolist (line lines)
-       (insert (concat line "\n")))
+        (insert (concat line "\n")))
       (set-buffer cb)
       (switch-to-buffer-other-window buf)))
   (message "erc-grab-region doesn't grab colors etc. anymore. If you use this, please tell the maintainers.")
@@ -3791,8 +3825,8 @@ If POS is nil, PROMPT will be displayed at `point'.
 If FACE is non-nil, it will be used to propertize the prompt.  If it is nil,
 `erc-prompt-face' will be used."
   (let* ((prompt (or prompt (erc-prompt)))
-        (l (length prompt))
-        (ob (current-buffer)))
+         (l (length prompt))
+         (ob (current-buffer)))
     ;; We cannot use save-excursion because we move point, therefore
     ;; we resort to the ol' ob trick to restore this.
     (when (and buffer (bufferp buffer))
@@ -3804,20 +3838,20 @@ If FACE is non-nil, it will be used to propertize the prompt.  If it is nil,
       (setq pos (or pos (point)))
       (goto-char pos)
       (when (> l 0)
-       ;; Do not extend the text properties when typing at the end
-       ;; of the prompt, but stuff typed in front of the prompt
-       ;; shall remain part of the prompt.
-       (setq prompt (erc-propertize prompt
-                                    'start-open t ; XEmacs
-                                    'rear-nonsticky t ; Emacs
-                                    'erc-prompt t
-                                    'field t
-                                    'front-sticky t
-                                    'read-only t))
-       (erc-put-text-property 0 (1- (length prompt))
-                              'face (or face 'erc-prompt-face)
-                              prompt)
-       (insert prompt))
+        ;; Do not extend the text properties when typing at the end
+        ;; of the prompt, but stuff typed in front of the prompt
+        ;; shall remain part of the prompt.
+        (setq prompt (erc-propertize prompt
+                                     'start-open t ; XEmacs
+                                     'rear-nonsticky t ; Emacs
+                                     'erc-prompt t
+                                     'field t
+                                     'front-sticky t
+                                     'read-only t))
+        (erc-put-text-property 0 (1- (length prompt))
+                               'face (or face 'erc-prompt-face)
+                               prompt)
+        (insert prompt))
       ;; Set the input marker
       (set-marker erc-input-marker (point)))
 
@@ -3837,11 +3871,12 @@ If FACE is non-nil, it will be used to propertize the prompt.  If it is nil,
   "Read input from the minibuffer."
   (interactive)
   (let ((minibuffer-allow-text-properties t)
-       (read-map minibuffer-local-map))
+        (read-map minibuffer-local-map))
     (insert (read-from-minibuffer "Message: "
-                                 (string (if (featurep 'xemacs)
-                                             last-command-char
-                                           last-command-event)) read-map))
+                                  (string (if (featurep 'xemacs)
+                                              last-command-char
+                                            last-command-event))
+                                 read-map))
     (erc-send-current-line)))
 
 (defvar erc-action-history-list ()
@@ -3852,9 +3887,9 @@ If FACE is non-nil, it will be used to propertize the prompt.  If it is nil,
   (interactive "")
   (erc-set-active-buffer (current-buffer))
   (let ((action (read-from-minibuffer
-                "Action: " nil nil nil 'erc-action-history-list)))
+                 "Action: " nil nil nil 'erc-action-history-list)))
     (if (not (string-match "^\\s-*$" action))
-       (erc-send-action (erc-default-target) action))))
+        (erc-send-action (erc-default-target) action))))
 
 (defun erc-join-channel (channel &optional key)
   "Join CHANNEL.
@@ -3863,9 +3898,9 @@ If `point' is at the beginning of a channel name, use that as default."
   (interactive
    (list
     (let ((chnl (if (looking-at "\\([&#+!][^ \n]+\\)") (match-string 1) ""))
-         (table (when (erc-server-buffer-live-p)
-                  (set-buffer (process-buffer erc-server-process))
-                  erc-channel-list)))
+          (table (when (erc-server-buffer-live-p)
+                   (set-buffer (process-buffer erc-server-process))
+                   erc-channel-list)))
       (completing-read "Join channel: " table nil nil nil nil chnl))
     (when (or current-prefix-arg erc-prompt-for-channel-key)
       (read-from-minibuffer "Channel key (RET for none): " nil))))
@@ -3876,9 +3911,9 @@ If `point' is at the beginning of a channel name, use that as default."
   (interactive
    (list
     (if (and (boundp 'reason) (stringp reason) (not (string= reason "")))
-       reason
+        reason
       (read-from-minibuffer (concat "Reason for leaving " (erc-default-target)
-                                   ": ")))))
+                                    ": ")))))
   (erc-cmd-PART (concat (erc-default-target)" " reason)))
 
 (defun erc-set-topic (topic)
@@ -3889,8 +3924,8 @@ If `point' is at the beginning of a channel name, use that as default."
      (concat "Set topic of " (erc-default-target) ": ")
      (when erc-channel-topic
        (let ((ss (split-string erc-channel-topic "\C-o")))
-        (cons (apply 'concat (if (cdr ss) (butlast ss) ss))
-              0))))))
+         (cons (apply 'concat (if (cdr ss) (butlast ss) ss))
+               0))))))
   (let ((topic-list (split-string topic "\C-o"))) ; strip off the topic setter
     (erc-cmd-TOPIC (concat (erc-default-target) " " (car topic-list)))))
 
@@ -3898,31 +3933,31 @@ If `point' is at the beginning of a channel name, use that as default."
   "Set a LIMIT for the current channel.  Remove limit if nil.
 Prompt for one if called interactively."
   (interactive (list (read-from-minibuffer
-                     (format "Limit for %s (RET to remove limit): "
-                             (erc-default-target)))))
+                      (format "Limit for %s (RET to remove limit): "
+                              (erc-default-target)))))
   (let ((tgt (erc-default-target)))
     (erc-server-send (if (and limit (>= (length limit) 1))
-                        (format "MODE %s +l %s" tgt limit)
-                      (format "MODE %s -l" tgt)))))
+                         (format "MODE %s +l %s" tgt limit)
+                       (format "MODE %s -l" tgt)))))
 
 (defun erc-set-channel-key (&optional key)
   "Set a KEY for the current channel.  Remove key if nil.
 Prompt for one if called interactively."
   (interactive (list (read-from-minibuffer
-                     (format "Key for %s (RET to remove key): "
-                             (erc-default-target)))))
+                      (format "Key for %s (RET to remove key): "
+                              (erc-default-target)))))
   (let ((tgt (erc-default-target)))
     (erc-server-send (if (and key (>= (length key) 1))
-                        (format "MODE %s +k %s" tgt key)
-                      (format "MODE %s -k" tgt)))))
+                         (format "MODE %s +k %s" tgt key)
+                       (format "MODE %s -k" tgt)))))
 
 (defun erc-quit-server (reason)
   "Disconnect from current server after prompting for REASON.
 `erc-quit-reason' works with this just like with `erc-cmd-QUIT'."
   (interactive (list (read-from-minibuffer
-                     (format "Reason for quitting %s: "
-                             (or erc-server-announced-name
-                                 erc-session-server)))))
+                      (format "Reason for quitting %s: "
+                              (or erc-server-announced-name
+                                  erc-session-server)))))
   (erc-cmd-QUIT reason))
 
 ;; Movement of point
@@ -3941,10 +3976,10 @@ This places `point' just after the prompt, or at the beginning of the line."
   "Kill current input line using `erc-bol' followed by `kill-line'."
   (interactive)
   (when (and (erc-bol)
-            (/= (point) (point-max))) ;; Prevent a (ding) and an error when
-                                      ;; there's nothing to kill
+             (/= (point) (point-max))) ;; Prevent a (ding) and an error when
+    ;; there's nothing to kill
     (if (boundp 'erc-input-ring-index)
-       (setq erc-input-ring-index nil))
+        (setq erc-input-ring-index nil))
     (kill-line)))
 
 (defun erc-complete-word-at-point ()
@@ -3954,7 +3989,7 @@ This places `point' just after the prompt, or at the beginning of the line."
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
-;;                       IRC SERVER INPUT HANDLING
+;;                        IRC SERVER INPUT HANDLING
 ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -3964,7 +3999,7 @@ This places `point' just after the prompt, or at the beginning of the line."
 ; experiment area.
 
 (defcustom erc-default-server-hook '(erc-debug-missing-hooks
-                                    erc-default-server-handler)
+                                     erc-default-server-handler)
   "Default for server messages which aren't covered by `erc-server-hooks'."
   :group 'erc-server-hooks
   :type 'hook)
@@ -3979,9 +4014,9 @@ Displays PROC and PARSED appropriately using `erc-display-message'."
     'identity
     (let (res)
       (mapc #'(lambda (x)
-               (if (stringp x)
-                   (setq res (append res (list x)))))
-           parsed)
+                (if (stringp x)
+                    (setq res (append res (list x)))))
+            parsed)
       res)
     " ")))
 
@@ -4003,18 +4038,18 @@ See `erc-default-server-hook'."
 To change how this query window is displayed, use `let' to bind
 `erc-join-buffer' before calling this."
   (unless (and server
-              (buffer-live-p server)
-              (set-buffer server))
+               (buffer-live-p server)
+               (set-buffer server))
     (error "Couldn't switch to server buffer"))
   (let ((buf (erc-open erc-session-server
-                      erc-session-port
-                      (erc-current-nick)
-                      erc-session-user-full-name
-                      nil
-                      nil
-                      (list target)
-                      target
-                      erc-server-process)))
+                       erc-session-port
+                       (erc-current-nick)
+                       erc-session-user-full-name
+                       nil
+                       nil
+                       (list target)
+                       target
+                       erc-server-process)))
     (unless buf
       (error "Couldn't open query window"))
     (erc-update-mode-line)
@@ -4030,12 +4065,12 @@ a new window, but not to select it.  See the documentation for
 `erc-join-buffer' for a description of the available choices."
   :group 'erc-query
   :type '(choice (const :tag "Don't create query window" nil)
-                (const :tag "Split window and select" window)
-                (const :tag "Split window, don't select" window-noselect)
-                (const :tag "New frame" frame)
-                (const :tag "Bury in new buffer" bury)
-                (const :tag "Use current buffer" buffer)
-                (const :tag "Use current buffer" t)))
+                 (const :tag "Split window and select" window)
+                 (const :tag "Split window, don't select" window-noselect)
+                 (const :tag "New frame" frame)
+                 (const :tag "Bury in new buffer" bury)
+                 (const :tag "Use current buffer" buffer)
+                 (const :tag "Use current buffer" t)))
 
 (defcustom erc-query-on-unjoined-chan-privmsg t
   "If non-nil create query buffer on receiving any PRIVMSG at all.
@@ -4069,15 +4104,17 @@ unmodified if nothing can be removed.
 E.g. \"Read error to Nick [user@some.host]: 110\" would be shortened to
 \"Read error: 110\". The same applies for \"Ping Timeout\"."
   (setq nick (regexp-quote nick)
-       login (regexp-quote login)
-       host (regexp-quote host))
+        login (regexp-quote login)
+        host (regexp-quote host))
   (or (when (string-match (concat "^\\(Read error\\) to "
-                                 nick "\\[" host "\\]: "
-                                 "\\(.+\\)$") reason)
-       (concat (match-string 1 reason) ": " (match-string 2 reason)))
+                                  nick "\\[" host "\\]: "
+                                  "\\(.+\\)$")
+                         reason)
+        (concat (match-string 1 reason) ": " (match-string 2 reason)))
       (when (string-match (concat "^\\(Ping timeout\\) for "
-                                 nick "\\[" host "\\]$") reason)
-       (match-string 1 reason))
+                                  nick "\\[" host "\\]$")
+                         reason)
+        (match-string 1 reason))
       reason))
 
 (defun erc-nickname-in-use (nick reason)
@@ -4085,40 +4122,40 @@ E.g. \"Read error to Nick [user@some.host]: 110\" would be shortened to
 
 See also `erc-display-error-notice'."
   (if (or (not erc-try-new-nick-p)
-         ;; how many default-nicks are left + one more try...
-         (eq erc-nick-change-attempt-count
-             (if (consp erc-nick)
-                 (+ (length erc-nick) 1)
-               1)))
+          ;; how many default-nicks are left + one more try...
+          (eq erc-nick-change-attempt-count
+              (if (consp erc-nick)
+                  (+ (length erc-nick) 1)
+                1)))
       (erc-display-error-notice
        nil
        (format "Nickname %s is %s, try another." nick reason))
     (setq erc-nick-change-attempt-count (+ erc-nick-change-attempt-count 1))
     (let ((newnick (nth 1 erc-default-nicks))
-         (nicklen (cdr (assoc "NICKLEN"
-                              (erc-with-server-buffer
-                                erc-server-parameters)))))
+          (nicklen (cdr (assoc "NICKLEN"
+                               (erc-with-server-buffer
+                                 erc-server-parameters)))))
       (setq erc-bad-nick t)
       ;; try to use a different nick
       (if erc-default-nicks
-         (setq erc-default-nicks (cdr erc-default-nicks)))
+          (setq erc-default-nicks (cdr erc-default-nicks)))
       (if (not newnick)
-         (setq newnick (concat (truncate-string-to-width
-                                nick
-                                (if (and erc-server-connected nicklen)
-                                    (- (string-to-number nicklen)
-                                       (length erc-nick-uniquifier))
-                                  ;; rfc2812 max nick length = 9
-                                  ;; we must assume this is the
-                                  ;; server's setting if we haven't
-                                  ;; established a connection yet
-                                  (- 9 (length erc-nick-uniquifier))))
-                               erc-nick-uniquifier)))
+          (setq newnick (concat (truncate-string-to-width
+                                 nick
+                                 (if (and erc-server-connected nicklen)
+                                     (- (string-to-number nicklen)
+                                        (length erc-nick-uniquifier))
+                                   ;; rfc2812 max nick length = 9
+                                   ;; we must assume this is the
+                                   ;; server's setting if we haven't
+                                   ;; established a connection yet
+                                   (- 9 (length erc-nick-uniquifier))))
+                                erc-nick-uniquifier)))
       (erc-cmd-NICK newnick)
       (erc-display-error-notice
        nil
        (format "Nickname %s is %s, trying %s"
-              nick reason newnick)))))
+               nick reason newnick)))))
 
 ;;; Server messages
 
@@ -4142,21 +4179,21 @@ and as second argument the event parsed as a vector."
   "Put this on `erc-server-PRIVMSG-functions'."
   (when erc-auto-query
     (let* ((nick (car (erc-parse-user (erc-response.sender parsed))))
-          (target (car (erc-response.command-args parsed)))
-          (msg (erc-response.contents parsed))
-          (query  (if (not erc-query-on-unjoined-chan-privmsg)
-                      nick
-                    (if (erc-current-nick-p target)
-                        nick
-                      target))))
+           (target (car (erc-response.command-args parsed)))
+           (msg (erc-response.contents parsed))
+           (query  (if (not erc-query-on-unjoined-chan-privmsg)
+                       nick
+                     (if (erc-current-nick-p target)
+                         nick
+                       target))))
       (and (not (erc-ignored-user-p (erc-response.sender parsed)))
-          (or erc-query-on-unjoined-chan-privmsg
-              (string= target (erc-current-nick)))
-          (not (erc-get-buffer query proc))
-          (not (erc-is-message-ctcp-and-not-action-p msg))
-          (let ((erc-query-display erc-auto-query))
-            (erc-cmd-QUERY query))
-          nil))))
+           (or erc-query-on-unjoined-chan-privmsg
+               (string= target (erc-current-nick)))
+           (not (erc-get-buffer query proc))
+           (not (erc-is-message-ctcp-and-not-action-p msg))
+           (let ((erc-query-display erc-auto-query))
+             (erc-cmd-QUERY query))
+           nil))))
 
 (defun erc-is-message-ctcp-p (message)
   "Check if MESSAGE is a CTCP message or not."
@@ -4170,16 +4207,16 @@ and as second argument the event parsed as a vector."
 (defun erc-format-privmessage (nick msg privp msgp)
   "Format a PRIVMSG in an insertable fashion."
   (let* ((mark-s (if msgp (if privp "*" "<") "-"))
-        (mark-e (if msgp (if privp "*" ">") "-"))
-        (str    (format "%s%s%s %s" mark-s nick mark-e msg))
-        (nick-face (if privp 'erc-nick-msg-face 'erc-nick-default-face))
-        (msg-face (if privp 'erc-direct-msg-face 'erc-default-face)))
+         (mark-e (if msgp (if privp "*" ">") "-"))
+         (str    (format "%s%s%s %s" mark-s nick mark-e msg))
+         (nick-face (if privp 'erc-nick-msg-face 'erc-nick-default-face))
+         (msg-face (if privp 'erc-direct-msg-face 'erc-default-face)))
     ;; add text properties to text before the nick, the nick and after the nick
     (erc-put-text-property 0 (length mark-s) 'face msg-face str)
     (erc-put-text-property (length mark-s) (+ (length mark-s) (length nick))
-                          'face nick-face str)
+                           'face nick-face str)
     (erc-put-text-property (+ (length mark-s) (length nick)) (length str)
-                          'face msg-face str)
+                           'face msg-face str)
     str))
 
 (defcustom erc-format-nick-function 'erc-format-nick
@@ -4190,28 +4227,51 @@ and as second argument the event parsed as a vector."
 (defun erc-format-nick (&optional user _channel-data)
   "Return the nickname of USER.
 See also `erc-format-nick-function'."
-  (when user (erc-server-user-nickname user)))
+  (let ((nick (erc-server-user-nickname user)))
+    (concat (erc-propertize
+             (erc-get-user-mode-prefix nick)
+             'face 'erc-nick-prefix-face)
+           nick)))
+
+(defun erc-get-user-mode-prefix (user)
+  (when user
+    (cond ((erc-channel-user-owner-p user)
+           (erc-propertize "~" 'help-echo "owner"))
+          ((erc-channel-user-admin-p user)
+           (erc-propertize "&" 'help-echo "admin"))
+          ((erc-channel-user-op-p user)
+           (erc-propertize "@" 'help-echo "operator"))
+          ((erc-channel-user-halfop-p user)
+           (erc-propertize "%" 'help-echo "half-op"))
+          ((erc-channel-user-voice-p user)
+           (erc-propertize "+" 'help-echo "voice"))
+          (t ""))))
 
 (defun erc-format-@nick (&optional user channel-data)
-  "Format the nickname of USER showing if USER is an operator or has voice.
-Operators have \"@\" and users with voice have \"+\" as a prefix.
-Use CHANNEL-DATA to determine op and voice status.
-See also `erc-format-nick-function'."
+  "Format the nickname of USER showing if USER has a voice, is an
+operator, half-op, admin or owner. Owners have \"~\", admins have
+\"&\", operators have \"@\" and users with voice have \"+\" as a
+prefix.  Use CHANNEL-DATA to determine op and voice status.  See
+also `erc-format-nick-function'."
   (when user
-    (let ((op (and channel-data (erc-channel-user-op channel-data) "@"))
-         (voice (and channel-data (erc-channel-user-voice channel-data) "+")))
-      (concat voice op (erc-server-user-nickname user)))))
+    (let ((nick (erc-server-user-nickname user)))
+      (concat (erc-propertize
+               (erc-get-user-mode-prefix nick)
+               'face 'erc-nick-prefix-face)
+             nick))))
 
 (defun erc-format-my-nick ()
   "Return the beginning of this user's message, correctly propertized."
   (if erc-show-my-nick
-      (let ((open "<")
-           (close "> ")
-           (nick (erc-current-nick)))
-       (concat
-        (erc-propertize open 'face 'erc-default-face)
-        (erc-propertize nick 'face 'erc-my-nick-face)
-        (erc-propertize close 'face 'erc-default-face)))
+      (let* ((open "<")
+             (close "> ")
+             (nick (erc-current-nick))
+             (mode (erc-get-user-mode-prefix nick)))
+        (concat
+         (erc-propertize open 'face 'erc-default-face)
+         (erc-propertize mode 'face 'erc-my-nick-prefix-face)
+         (erc-propertize nick 'face 'erc-my-nick-face)
+         (erc-propertize close 'face 'erc-default-face)))
     (let ((prefix "> "))
       (erc-propertize prefix 'face 'erc-default-face))))
 
@@ -4275,7 +4335,7 @@ See also: `erc-echo-notice-in-first-user-buffer',
 `erc-buffer-list-with-nick'."
   (let ((buffers (erc-buffer-list-with-nick sender erc-server-process)))
     (if buffers
-       (progn (erc-display-message parsed nil buffers s) t)
+        (progn (erc-display-message parsed nil buffers s) t)
       nil)))
 
 (defun erc-echo-notice-in-user-and-target-buffers (s parsed buffer sender)
@@ -4290,8 +4350,8 @@ See also: `erc-echo-notice-in-user-buffers',
 `erc-buffer-list-with-nick'."
   (let ((buffers (erc-buffer-list-with-nick sender erc-server-process)))
     (unless (memq buffer buffers) (push buffer buffers))
-    (if buffers                                ;FIXME: How could it be nil?
-       (progn (erc-display-message parsed nil buffers s) t)
+    (if buffers                         ;FIXME: How could it be nil?
+        (progn (erc-display-message parsed nil buffers s) t)
       nil)))
 
 (defun erc-echo-notice-in-first-user-buffer (s parsed _buffer sender)
@@ -4305,7 +4365,7 @@ See also: `erc-echo-notice-in-user-buffers',
 `erc-buffer-list-with-nick'."
   (let ((buffers (erc-buffer-list-with-nick sender erc-server-process)))
     (if buffers
-       (progn (erc-display-message parsed nil (car buffers) s) t)
+        (progn (erc-display-message parsed nil (car buffers) s) t)
       nil)))
 
 ;;; Ban manipulation
@@ -4313,61 +4373,61 @@ See also: `erc-echo-notice-in-user-buffers',
 (defun erc-banlist-store (proc parsed)
   "Record ban entries for a channel."
   (pcase-let ((`(,channel ,mask ,whoset)
-              (cdr (erc-response.command-args parsed))))
+               (cdr (erc-response.command-args parsed))))
     ;; Determine to which buffer the message corresponds
     (let ((buffer (erc-get-buffer channel proc)))
       (with-current-buffer buffer
-       (unless (member (cons whoset mask) erc-channel-banlist)
-         (setq erc-channel-banlist (cons (cons whoset mask)
-                                         erc-channel-banlist))))))
+        (unless (member (cons whoset mask) erc-channel-banlist)
+          (setq erc-channel-banlist (cons (cons whoset mask)
+                                          erc-channel-banlist))))))
   nil)
 
 (defun erc-banlist-finished (proc parsed)
   "Record that we have received the banlist."
   (let* ((channel (nth 1 (erc-response.command-args parsed)))
-        (buffer (erc-get-buffer channel proc)))
+         (buffer (erc-get-buffer channel proc)))
     (with-current-buffer buffer
       (put 'erc-channel-banlist 'received-from-server t)))
-  t)                                   ; suppress the 'end of banlist' message
+  t)                                    ; suppress the 'end of banlist' message
 
 (defun erc-banlist-update (proc parsed)
   "Check MODE commands for bans and update the banlist appropriately."
   ;; FIXME: Possibly incorrect. -- Lawrence 2004-05-11
   (let* ((tgt (car (erc-response.command-args parsed)))
-        (mode (erc-response.contents parsed))
-        (whoset (erc-response.sender parsed))
-        (buffer (erc-get-buffer tgt proc)))
+         (mode (erc-response.contents parsed))
+         (whoset (erc-response.sender parsed))
+         (buffer (erc-get-buffer tgt proc)))
     (when buffer
       (with-current-buffer buffer
-       (cond ((not (get 'erc-channel-banlist 'received-from-server)) nil)
-             ((string-match "^\\([+-]\\)b" mode)
-              ;; This is a ban
-              (cond
-               ((string-match "^-" mode)
-                ;; Remove the unbanned masks from the ban list
-                (setq erc-channel-banlist
-                      (erc-delete-if
-                       #'(lambda (y)
-                           (member (upcase (cdr y))
-                                   (mapcar #'upcase
-                                           (cdr (split-string mode)))))
-                       erc-channel-banlist)))
-               ((string-match "^+" mode)
-                ;; Add the banned mask(s) to the ban list
-                (mapc
-                 (lambda (mask)
-                   (unless (member (cons whoset mask) erc-channel-banlist)
-                     (setq erc-channel-banlist
-                           (cons (cons whoset mask) erc-channel-banlist))))
-                 (cdr (split-string mode))))))))))
+        (cond ((not (get 'erc-channel-banlist 'received-from-server)) nil)
+              ((string-match "^\\([+-]\\)b" mode)
+               ;; This is a ban
+               (cond
+                ((string-match "^-" mode)
+                 ;; Remove the unbanned masks from the ban list
+                 (setq erc-channel-banlist
+                       (erc-delete-if
+                        #'(lambda (y)
+                            (member (upcase (cdr y))
+                                    (mapcar #'upcase
+                                            (cdr (split-string mode)))))
+                        erc-channel-banlist)))
+                ((string-match "^+" mode)
+                 ;; Add the banned mask(s) to the ban list
+                 (mapc
+                  (lambda (mask)
+                    (unless (member (cons whoset mask) erc-channel-banlist)
+                      (setq erc-channel-banlist
+                            (cons (cons whoset mask) erc-channel-banlist))))
+                  (cdr (split-string mode))))))))))
   nil)
 
 ;; used for the banlist cmds
 (defun erc-group-list (list n)
   "Group LIST into sublists of length N."
   (cond ((null list) nil)
-       ((null (nthcdr n list)) (list list))
-       (t (cons (erc-subseq list 0 n) (erc-group-list (nthcdr n list) n)))))
+        ((null (nthcdr n list)) (list list))
+        (t (cons (erc-subseq list 0 n) (erc-group-list (nthcdr n list) n)))))
 
 
 ;;; MOTD numreplies
@@ -4380,7 +4440,7 @@ See also: `erc-echo-notice-in-user-buffers',
     ;; execute a startup script
     (let ((f (erc-select-startup-file)))
       (when f
-       (erc-load-script f)))))
+        (erc-load-script f)))))
 
 (defun erc-connection-established (proc parsed)
   "Run just after connection.
@@ -4389,14 +4449,14 @@ Set user modes and run `erc-after-connect' hook."
   (with-current-buffer (process-buffer proc)
     (unless erc-server-connected ; only once per session
       (let ((server (or erc-server-announced-name
-                       (erc-response.sender parsed)))
-           (nick (car (erc-response.command-args parsed)))
-           (buffer (process-buffer proc)))
-       (setq erc-server-connected t)
-       (erc-update-mode-line)
-       (erc-set-initial-user-mode nick buffer)
-       (erc-server-setup-periodical-ping buffer)
-       (run-hook-with-args 'erc-after-connect server nick)))))
+                        (erc-response.sender parsed)))
+            (nick (car (erc-response.command-args parsed)))
+            (buffer (process-buffer proc)))
+        (setq erc-server-connected t)
+        (erc-update-mode-line)
+        (erc-set-initial-user-mode nick buffer)
+        (erc-server-setup-periodical-ping buffer)
+        (run-hook-with-args 'erc-after-connect server nick)))))
 
 (defun erc-set-initial-user-mode (nick buffer)
   "If `erc-user-mode' is non-nil for NICK, set the user modes.
@@ -4404,11 +4464,11 @@ The server buffer is given by BUFFER."
   (with-current-buffer buffer
     (when erc-user-mode
       (let ((mode (if (functionp erc-user-mode)
-                     (funcall erc-user-mode)
-                   erc-user-mode)))
-       (when (stringp mode)
-         (erc-log (format "changing mode for %s to %s" nick mode))
-         (erc-server-send (format "MODE %s %s" nick mode)))))))
+                      (funcall erc-user-mode)
+                    erc-user-mode)))
+        (when (stringp mode)
+          (erc-log (format "changing mode for %s to %s" nick mode))
+          (erc-server-send (format "MODE %s %s" nick mode)))))))
 
 (defun erc-display-error-notice (parsed string)
   "Display STRING as an error notice.
@@ -4421,41 +4481,41 @@ See also `erc-display-message'."
   ;; FIXME: This needs a proper docstring -- Lawrence 2004-01-08
   "Process a CTCP query."
   (let ((queries (delete "" (split-string (erc-response.contents parsed)
-                                         "\C-a"))))
+                                          "\C-a"))))
     (if (> (length queries) 4)
-       (erc-display-message
-        parsed (list 'notice 'error) proc 'ctcp-too-many)
+        (erc-display-message
+         parsed (list 'notice 'error) proc 'ctcp-too-many)
       (if (= 0 (length queries))
-         (erc-display-message
-          parsed (list 'notice 'error) proc
-          'ctcp-empty ?n nick)
-       (while queries
-         (let* ((type (upcase (car (split-string (car queries)))))
-                (hook (intern-soft (concat "erc-ctcp-query-" type "-hook"))))
-           (if (and hook (boundp hook))
-               (if (string-equal type "ACTION")
-                   (run-hook-with-args-until-success
-                    hook proc parsed nick login host
-                    (car (erc-response.command-args parsed))
-                    (car queries))
-                 (when erc-paranoid
-                   (if (erc-current-nick-p
-                        (car (erc-response.command-args parsed)))
-                       (erc-display-message
-                        parsed 'error 'active 'ctcp-request
-                        ?n nick ?u login ?h host ?r (car queries))
-                     (erc-display-message
-                      parsed 'error 'active 'ctcp-request-to
-                      ?n nick ?u login ?h host ?r (car queries)
-                      ?t (car (erc-response.command-args parsed)))))
-                 (run-hook-with-args-until-success
-                  hook proc nick login host
-                  (car (erc-response.command-args parsed))
-                  (car queries)))
-             (erc-display-message
-              parsed (list 'notice 'error) proc
-              'undefined-ctcp)))
-         (setq queries (cdr queries)))))))
+          (erc-display-message
+           parsed (list 'notice 'error) proc
+           'ctcp-empty ?n nick)
+        (while queries
+          (let* ((type (upcase (car (split-string (car queries)))))
+                 (hook (intern-soft (concat "erc-ctcp-query-" type "-hook"))))
+            (if (and hook (boundp hook))
+                (if (string-equal type "ACTION")
+                    (run-hook-with-args-until-success
+                     hook proc parsed nick login host
+                     (car (erc-response.command-args parsed))
+                     (car queries))
+                  (when erc-paranoid
+                    (if (erc-current-nick-p
+                         (car (erc-response.command-args parsed)))
+                        (erc-display-message
+                         parsed 'error 'active 'ctcp-request
+                         ?n nick ?u login ?h host ?r (car queries))
+                      (erc-display-message
+                       parsed 'error 'active 'ctcp-request-to
+                       ?n nick ?u login ?h host ?r (car queries)
+                       ?t (car (erc-response.command-args parsed)))))
+                  (run-hook-with-args-until-success
+                   hook proc nick login host
+                   (car (erc-response.command-args parsed))
+                   (car queries)))
+              (erc-display-message
+               parsed (list 'notice 'error) proc
+               'undefined-ctcp)))
+          (setq queries (cdr queries)))))))
 
 (defvar erc-ctcp-query-ACTION-hook '(erc-ctcp-query-ACTION))
 
@@ -4463,9 +4523,9 @@ See also `erc-display-message'."
   "Respond to a CTCP ACTION query."
   (when (string-match "^ACTION\\s-\\(.*\\)\\s-*$" msg)
     (let ((s (match-string 1 msg))
-         (buf (or (erc-get-buffer to proc)
-                  (erc-get-buffer nick proc)
-                  (process-buffer proc))))
+          (buf (or (erc-get-buffer to proc)
+                   (erc-get-buffer nick proc)
+                   (process-buffer proc))))
       (erc-display-message
        parsed 'action buf
        'ACTION ?n nick ?u login ?h host ?a s))))
@@ -4477,7 +4537,7 @@ See also `erc-display-message'."
   (when (string-match "^CLIENTINFO\\(\\s-*\\|\\s-+.*\\)$" msg)
     (let ((s (erc-client-info (erc-trim-string (match-string 1 msg)))))
       (unless erc-disable-ctcp-replies
-         (erc-send-ctcp-notice nick (format "CLIENTINFO %s" s)))))
+        (erc-send-ctcp-notice nick (format "CLIENTINFO %s" s)))))
   nil)
 
 (defvar erc-ctcp-query-ECHO-hook '(erc-ctcp-query-ECHO))
@@ -4486,7 +4546,7 @@ See also `erc-display-message'."
   (when (string-match "^ECHO\\s-+\\(.*\\)\\s-*$" msg)
     (let ((s (match-string 1 msg)))
       (unless erc-disable-ctcp-replies
-       (erc-send-ctcp-notice nick (format "ECHO %s" s)))))
+        (erc-send-ctcp-notice nick (format "ECHO %s" s)))))
   nil)
 
 (defvar erc-ctcp-query-FINGER-hook '(erc-ctcp-query-FINGER))
@@ -4494,15 +4554,15 @@ See also `erc-display-message'."
   "Respond to a CTCP FINGER query."
   (unless erc-disable-ctcp-replies
     (let ((s (if erc-anonymous-login
-                (format "FINGER I'm %s." (erc-current-nick))
-              (format "FINGER %s (%s@%s)."
-                      (user-full-name)
-                      (user-login-name)
-                      (system-name))))
-         (ns (erc-time-diff erc-server-last-sent-time (erc-current-time))))
-       (when (> ns 0)
-           (setq s (concat s " Idle for " (erc-sec-to-time ns))))
-       (erc-send-ctcp-notice nick s)))
+                 (format "FINGER I'm %s." (erc-current-nick))
+               (format "FINGER %s (%s@%s)."
+                       (user-full-name)
+                       (user-login-name)
+                       (system-name))))
+          (ns (erc-time-diff erc-server-last-sent-time (erc-current-time))))
+      (when (> ns 0)
+        (setq s (concat s " Idle for " (erc-sec-to-time ns))))
+      (erc-send-ctcp-notice nick s)))
   nil)
 
 (defvar erc-ctcp-query-PING-hook '(erc-ctcp-query-PING))
@@ -4511,7 +4571,7 @@ See also `erc-display-message'."
   (when (string-match "^PING\\s-+\\(.*\\)" msg)
     (unless erc-disable-ctcp-replies
       (let ((arg (match-string 1 msg)))
-       (erc-send-ctcp-notice nick (format "PING %s" arg)))))
+        (erc-send-ctcp-notice nick (format "PING %s" arg)))))
   nil)
 
 (defvar erc-ctcp-query-TIME-hook '(erc-ctcp-query-TIME))
@@ -4534,19 +4594,19 @@ See also `erc-display-message'."
   (unless erc-disable-ctcp-replies
     (erc-send-ctcp-notice
      nick (format
-          "VERSION \C-bERC\C-b %s - an IRC client for emacs (\C-b%s\C-b)"
-          erc-version-string
-          erc-official-location)))
+           "VERSION \C-bERC\C-b %s - an IRC client for emacs (\C-b%s\C-b)"
+           erc-version-string
+           erc-official-location)))
   nil)
 
 (defun erc-process-ctcp-reply (proc parsed nick login host msg)
   "Process MSG as a CTCP reply."
   (let* ((type (car (split-string msg)))
-        (hook (intern (concat "erc-ctcp-reply-" type "-hook"))))
+         (hook (intern (concat "erc-ctcp-reply-" type "-hook"))))
     (if (boundp hook)
-       (run-hook-with-args-until-success
-        hook proc nick login host
-        (car (erc-response.command-args parsed)) msg)
+        (run-hook-with-args-until-success
+         hook proc nick login host
+         (car (erc-response.command-args parsed)) msg)
       (erc-display-message
        parsed 'notice 'active
        'CTCP-UNKNOWN ?n nick ?u login ?h host ?m msg))))
@@ -4588,16 +4648,16 @@ See also `erc-display-message'."
       nil
     (let ((time (match-string 1 msg)))
       (condition-case nil
-         (let ((delta (erc-time-diff (string-to-number time)
-                                     (erc-current-time))))
-           (erc-display-message
-            nil 'notice 'active
-            'CTCP-PING ?n nick
-            ?t (erc-sec-to-time delta)))
-       (range-error
-        (erc-display-message
-         nil 'error 'active
-         'bad-ping-response ?n nick ?t time))))))
+          (let ((delta (erc-time-diff (string-to-number time)
+                                      (erc-current-time))))
+            (erc-display-message
+             nil 'notice 'active
+             'CTCP-PING ?n nick
+             ?t (erc-sec-to-time delta)))
+        (range-error
+         (erc-display-message
+          nil 'error 'active
+          'bad-ping-response ?n nick ?t time))))))
 
 (defvar erc-ctcp-reply-TIME-hook '(erc-ctcp-reply-TIME))
 (defun erc-ctcp-reply-TIME (_proc nick _login _host _to msg)
@@ -4627,31 +4687,31 @@ If non-nil, return from being away."
   (let ((sessionbuf (process-buffer proc)))
     (when sessionbuf
       (with-current-buffer sessionbuf
-       (when erc-away-nickname
-         (erc-log (format "erc-process-away: away-nick: %s, away-p: %s"
-                          erc-away-nickname away-p))
-         (erc-cmd-NICK (if away-p
-                           erc-away-nickname
-                         erc-nick)))
-       (cond
-        (away-p
-         (setq erc-away (current-time)))
-        (t
-         (let ((away-time erc-away))
-           ;; away must be set to NIL BEFORE sending anything to prevent
-           ;; an infinite recursion
-           (setq erc-away nil)
-           (with-current-buffer (erc-active-buffer)
-             (when erc-public-away-p
-               (erc-send-action
-                (erc-default-target)
-                (if away-time
-                    (format "is back (gone for %s)"
-                            (erc-sec-to-time
-                             (erc-time-diff
-                              (erc-emacs-time-to-erc-time away-time)
-                              (erc-current-time))))
-                  "is back")))))))))
+        (when erc-away-nickname
+          (erc-log (format "erc-process-away: away-nick: %s, away-p: %s"
+                           erc-away-nickname away-p))
+          (erc-cmd-NICK (if away-p
+                            erc-away-nickname
+                          erc-nick)))
+        (cond
+         (away-p
+          (setq erc-away (current-time)))
+         (t
+          (let ((away-time erc-away))
+            ;; away must be set to NIL BEFORE sending anything to prevent
+            ;; an infinite recursion
+            (setq erc-away nil)
+            (with-current-buffer (erc-active-buffer)
+              (when erc-public-away-p
+                (erc-send-action
+                 (erc-default-target)
+                 (if away-time
+                     (format "is back (gone for %s)"
+                             (erc-sec-to-time
+                              (erc-time-diff
+                               (erc-emacs-time-to-erc-time away-time)
+                               (erc-current-time))))
+                   "is back")))))))))
     (erc-update-mode-line)))
 
 ;;;; List of channel members handling
@@ -4674,30 +4734,30 @@ channel buffer.
 
 See also `erc-channel-begin-receiving-names'."
   (maphash (lambda (nick _user)
-            (if (null (gethash nick erc-channel-new-member-names))
-                (erc-remove-channel-user nick)))
-          erc-channel-users)
+             (if (null (gethash nick erc-channel-new-member-names))
+                 (erc-remove-channel-user nick)))
+           erc-channel-users)
   (setq erc-channel-new-member-names nil))
 
 (defun erc-parse-prefix ()
   "Return an alist of valid prefix character types and their representations.
 Example: (operator) o => @, (voiced) v => +."
   (let ((str (or (cdr (assoc "PREFIX" (erc-with-server-buffer
-                                       erc-server-parameters)))
-                ;; provide a sane default
-                "(ov)@+"))
-       types chars)
+                                        erc-server-parameters)))
+                 ;; provide a sane default
+                 "(qaohv)~&@%+"))
+        types chars)
     (when (string-match "^(\\([^)]+\\))\\(.+\\)$" str)
       (setq types (match-string 1 str)
-           chars (match-string 2 str))
+            chars (match-string 2 str))
       (let ((len (min (length types) (length chars)))
-           (i 0)
-           (alist nil))
-       (while (< i len)
-         (setq alist (cons (cons (elt types i) (elt chars i))
-                           alist))
-         (setq i (1+ i)))
-       alist))))
+            (i 0)
+            (alist nil))
+        (while (< i len)
+          (setq alist (cons (cons (elt types i) (elt chars i))
+                            alist))
+          (setq i (1+ i)))
+        alist))))
 
 (defun erc-channel-receive-names (names-string)
   "This function is for internal use only.
@@ -4705,40 +4765,37 @@ Example: (operator) o => @, (voiced) v => +."
 Update `erc-channel-users' according to NAMES-STRING.
 NAMES-STRING is a string listing some of the names on the
 channel."
-  (let (prefix op-ch voice-ch names name op voice)
-    (setq prefix (erc-parse-prefix))
-    (setq op-ch (cdr (assq ?o prefix))
-         voice-ch (cdr (assq ?v prefix)))
-    ;; We need to delete "" because in XEmacs, (split-string "a ")
-    ;; returns ("a" "").
+  (let* ((prefix (erc-parse-prefix))
+         (voice-ch (cdr (assq ?v prefix)))
+         (op-ch (cdr (assq ?o prefix)))
+         (hop-ch (cdr (assq ?h prefix)))
+         (adm-ch (cdr (assq ?a prefix)))
+         (own-ch (cdr (assq ?q prefix)))
+         names name op voice halfop admin owner)
     (setq names (delete "" (split-string names-string)))
     (let ((erc-channel-members-changed-hook nil))
       (dolist (item names)
-       (let ((updatep t))
-         (if (rassq (elt item 0) prefix)
-             (cond ((= (length item) 1)
-                    (setq updatep nil))
-                   ((eq (elt item 0) op-ch)
-                    (setq name (substring item 1)
-                          op 'on
-                          voice 'off))
-                   ((eq (elt item 0) voice-ch)
-                    (setq name (substring item 1)
-                          op 'off
-                          voice 'on))
-                   (t (setq name (substring item 1)
-                            op 'off
-                            voice 'off)))
-           (setq name item
-                 op 'off
-                 voice 'off))
-         (when updatep
-           (puthash (erc-downcase name) t
-                    erc-channel-new-member-names)
-           (erc-update-current-channel-member
-            name name t op voice)))))
+        (let ((updatep t))
+          (setq name item op 'off voice 'off halfop 'off admin 'off owner 'off)
+          (if (rassq (elt item 0) prefix)
+              (if (= (length item) 1)
+                 (setq updatep nil)
+               (setq name (substring item 1))
+               (setf (pcase (aref item 0)
+                       ((pred (eq voice-ch)) voice)
+                       ((pred (eq hop-ch))   hop)
+                       ((pred (eq op-ch))    op)
+                       ((pred (eq adm-ch))   adm)
+                       ((pred (eq own-ch))   own))
+                     'on)))
+          (when updatep
+            (puthash (erc-downcase name) t
+                     erc-channel-new-member-names)
+            (erc-update-current-channel-member
+             name name t voice halfop op admin owner)))))
     (run-hooks 'erc-channel-members-changed-hook)))
 
+
 (defcustom erc-channel-members-changed-hook nil
   "This hook is called every time the variable `channel-members' changes.
 The buffer where the change happened is current while this hook is called."
@@ -4746,15 +4803,15 @@ The buffer where the change happened is current while this hook is called."
   :type 'hook)
 
 (defun erc-update-user-nick (nick &optional new-nick
-                                 host login full-name info)
+                                  host login full-name info)
   "Update the stored user information for the user with nickname NICK.
 
 See also: `erc-update-user'."
   (erc-update-user (erc-get-server-user nick) new-nick
-                  host login full-name info))
+                   host login full-name info))
 
 (defun erc-update-user (user &optional new-nick
-                            host login full-name info)
+                             host login full-name info)
   "Update user info for USER.  USER must be an erc-server-user
 struct.  Any of NEW-NICK, HOST, LOGIN, FULL-NAME, INFO which are
 non-nil and not equal to the existing values for USER are used to
@@ -4766,45 +4823,44 @@ which USER is a member, and t is returned."
   (let (changed)
     (when user
       (when (and new-nick
-                (not (equal (erc-server-user-nickname user)
-                            new-nick)))
-       (setq changed t)
-       (erc-change-user-nickname user new-nick))
+                 (not (equal (erc-server-user-nickname user)
+                             new-nick)))
+        (setq changed t)
+        (erc-change-user-nickname user new-nick))
       (when (and host
-                (not (equal (erc-server-user-host user) host)))
-       (setq changed t)
-       (setf (erc-server-user-host user) host))
+                 (not (equal (erc-server-user-host user) host)))
+        (setq changed t)
+        (setf (erc-server-user-host user) host))
       (when (and login
-                (not (equal (erc-server-user-login user) login)))
-       (setq changed t)
-       (setf (erc-server-user-login user) login))
+                 (not (equal (erc-server-user-login user) login)))
+        (setq changed t)
+        (setf (erc-server-user-login user) login))
       (when (and full-name
-                (not (equal (erc-server-user-full-name user)
-                            full-name)))
-       (setq changed t)
-       (setf (erc-server-user-full-name user) full-name))
+                 (not (equal (erc-server-user-full-name user)
+                             full-name)))
+        (setq changed t)
+        (setf (erc-server-user-full-name user) full-name))
       (when (and info
-                (not (equal (erc-server-user-info user) info)))
-       (setq changed t)
-       (setf (erc-server-user-info user) info))
+                 (not (equal (erc-server-user-info user) info)))
+        (setq changed t)
+        (setf (erc-server-user-info user) info))
       (if changed
-         (dolist (buf (erc-server-user-buffers user))
-           (if (buffer-live-p buf)
-               (with-current-buffer buf
-                 (run-hooks 'erc-channel-members-changed-hook))))))
+          (dolist (buf (erc-server-user-buffers user))
+            (if (buffer-live-p buf)
+                (with-current-buffer buf
+                  (run-hooks 'erc-channel-members-changed-hook))))))
     changed))
 
 (defun erc-update-current-channel-member
-  (nick new-nick &optional add op voice host login full-name info
-       update-message-time)
+  (nick new-nick &optional add voice halfop op admin owner host login full-name info
+        update-message-time)
   "Update the stored user information for the user with nickname NICK.
 `erc-update-user' is called to handle changes to nickname,
-HOST, LOGIN, FULL-NAME, and INFO.  If OP or VOICE are non-nil,
-they must be equal to either `on' or `off', in which case the
-operator or voice status of the user in the current channel is
-changed accordingly.  If UPDATE-MESSAGE-TIME is non-nil, the
-last-message-time of the user in the current channel is set
-to (current-time).
+HOST, LOGIN, FULL-NAME, and INFO.  If VOICE HALFOP OP ADMIN or OWNER
+are non-nil, they must be equal to either `on' or `off', in which
+case the status of the user in the current channel is changed accordingly.
+If UPDATE-MESSAGE-TIME is non-nil, the last-message-time of the user
+ in the current channel is set to (current-time).
 
 If ADD is non-nil, the user will be added with the specified
 information if it is not already present in the user or channel
@@ -4815,74 +4871,104 @@ If, and only if, changes are made, or the user is added,
 
 See also: `erc-update-user' and `erc-update-channel-member'."
   (let* (changed user-changed
-        (channel-data (erc-get-channel-user nick))
-        (cuser (cdr channel-data))
-        (user (if channel-data (car channel-data)
-                (erc-get-server-user nick))))
+                 (channel-data (erc-get-channel-user nick))
+                 (cuser (cdr channel-data))
+                 (user (if channel-data (car channel-data)
+                         (erc-get-server-user nick))))
     (if cuser
-       (progn
-         (erc-log (format "update-member: user = %S, cuser = %S" user cuser))
-         (when (and op
-                    (not (eq (erc-channel-user-op cuser) op)))
-             (setq changed t)
-           (setf (erc-channel-user-op cuser)
-                 (cond ((eq op 'on) t)
-                       ((eq op 'off) nil)
-                       (t op))))
-         (when (and voice
-                    (not (eq (erc-channel-user-voice cuser) voice)))
-             (setq changed t)
-           (setf (erc-channel-user-voice cuser)
-                 (cond ((eq voice 'on) t)
-                       ((eq voice 'off) nil)
-                       (t voice))))
-         (when update-message-time
-           (setf (erc-channel-user-last-message-time cuser) (current-time)))
-         (setq user-changed
-               (erc-update-user user new-nick
-                                host login full-name info)))
+        (progn
+          (erc-log (format "update-member: user = %S, cuser = %S" user cuser))
+          (when (and voice
+                     (not (eq (erc-channel-user-voice cuser) voice)))
+            (setq changed t)
+            (setf (erc-channel-user-voice cuser)
+                  (cond ((eq voice 'on) t)
+                        ((eq voice 'off) nil)
+                        (t voice))))
+          (when (and halfop
+                     (not (eq (erc-channel-user-halfop cuser) halfop)))
+            (setq changed t)
+            (setf (erc-channel-user-halfop cuser)
+                  (cond ((eq halfop 'on) t)
+                        ((eq halfop 'off) nil)
+                        (t halfop))))
+          (when (and op
+                     (not (eq (erc-channel-user-op cuser) op)))
+            (setq changed t)
+            (setf (erc-channel-user-op cuser)
+                  (cond ((eq op 'on) t)
+                        ((eq op 'off) nil)
+                        (t op))))
+          (when (and admin
+                     (not (eq (erc-channel-user-admin cuser) admin)))
+            (setq changed t)
+            (setf (erc-channel-user-admin cuser)
+                  (cond ((eq admin 'on) t)
+                        ((eq admin 'off) nil)
+                        (t admin))))
+          (when (and owner
+                     (not (eq (erc-channel-user-owner cuser) owner)))
+            (setq changed t)
+            (setf (erc-channel-user-owner cuser)
+                  (cond ((eq owner 'on) t)
+                        ((eq owner 'off) nil)
+                        (t owner))))
+          (when update-message-time
+            (setf (erc-channel-user-last-message-time cuser) (current-time)))
+          (setq user-changed
+                (erc-update-user user new-nick
+                                 host login full-name info)))
       (when add
-       (if (null user)
-           (progn
-             (setq user (make-erc-server-user
-                         :nickname nick
-                         :host host
-                         :full-name full-name
-                         :login login
-                         :info info
-                         :buffers (list (current-buffer))))
-             (erc-add-server-user nick user))
-         (setf (erc-server-user-buffers user)
-               (cons (current-buffer)
-                     (erc-server-user-buffers user))))
-       (setq cuser (make-erc-channel-user
-                    :op (cond ((eq op 'on) t)
-                              ((eq op 'off) nil)
-                              (t op))
-                    :voice (cond ((eq voice 'on) t)
-                                 ((eq voice 'off) nil)
-                                 (t voice))
-                    :last-message-time
-                    (if update-message-time (current-time))))
-       (puthash (erc-downcase nick) (cons user cuser)
-                erc-channel-users)
-       (setq changed t)))
+        (if (null user)
+            (progn
+              (setq user (make-erc-server-user
+                          :nickname nick
+                          :host host
+                          :full-name full-name
+                          :login login
+                          :info info
+                          :buffers (list (current-buffer))))
+              (erc-add-server-user nick user))
+          (setf (erc-server-user-buffers user)
+                (cons (current-buffer)
+                      (erc-server-user-buffers user))))
+        (setq cuser (make-erc-channel-user
+                     :voice (cond ((eq voice 'on) t)
+                                  ((eq voice 'off) nil)
+                                  (t voice))
+                     :halfop (cond ((eq halfop 'on) t)
+                                ((eq halfop 'off) nil)
+                                (t halfop))
+                     :op (cond ((eq op 'on) t)
+                               ((eq op 'off) nil)
+                               (t op))
+                     :admin (cond ((eq admin 'on) t)
+                                  ((eq admin 'off) nil)
+                                  (t admin))
+                     :owner (cond ((eq owner 'on) t)
+                                  ((eq owner 'off) nil)
+                                  (t owner))
+                     :last-message-time
+                     (if update-message-time (current-time))))
+        (puthash (erc-downcase nick) (cons user cuser)
+                 erc-channel-users)
+        (setq changed t)))
     (when (and changed (null user-changed))
       (run-hooks 'erc-channel-members-changed-hook))
     (or changed user-changed add)))
 
 (defun erc-update-channel-member (channel nick new-nick
-                                 &optional add op voice host login
-                                 full-name info update-message-time)
+                                          &optional add voice halfop op admin owner host login
+                                          full-name info update-message-time)
   "Update user and channel information for the user with
 nickname NICK in channel CHANNEL.
 
 See also: `erc-update-current-channel-member'."
   (erc-with-buffer
-   (channel)
-   (erc-update-current-channel-member nick new-nick add op voice host
-                                     login full-name info
-                                     update-message-time)))
+      (channel)
+    (erc-update-current-channel-member nick new-nick add voice halfop op admin owner host
+                                       login full-name info
+                                       update-message-time)))
 
 (defun erc-remove-current-channel-member (nick)
   "Remove NICK from current channel membership list.
@@ -4897,8 +4983,8 @@ Runs `erc-channel-members-changed-hook'."
 
 See also `erc-remove-current-channel-member'."
   (erc-with-buffer
-   (channel)
-   (erc-remove-current-channel-member nick)))
+      (channel)
+    (erc-remove-current-channel-member nick)))
 
 (defun erc-update-channel-topic (channel topic &optional modify)
   "Find a buffer for CHANNEL and set the TOPIC for it.
@@ -4907,40 +4993,40 @@ If optional MODIFY is 'append or 'prepend, then append or prepend the
 TOPIC string to the current topic."
   (erc-with-buffer (channel)
     (cond ((eq modify 'append)
-          (setq erc-channel-topic (concat erc-channel-topic topic)))
-         ((eq modify 'prepend)
-          (setq erc-channel-topic (concat topic erc-channel-topic)))
-         (t (setq erc-channel-topic topic)))
+           (setq erc-channel-topic (concat erc-channel-topic topic)))
+          ((eq modify 'prepend)
+           (setq erc-channel-topic (concat topic erc-channel-topic)))
+          (t (setq erc-channel-topic topic)))
     (erc-update-mode-line-buffer (current-buffer))))
 
 (defun erc-set-modes (tgt mode-string)
   "Set the modes for the TGT provided as MODE-STRING."
   (let* ((modes (erc-parse-modes mode-string))
-        (add-modes (nth 0 modes))
-        ;; list of triples: (mode-char 'on/'off argument)
-        (arg-modes (nth 2 modes)))
+         (add-modes (nth 0 modes))
+         ;; list of triples: (mode-char 'on/'off argument)
+         (arg-modes (nth 2 modes)))
     (cond ((erc-channel-p tgt); channel modes
-          (let ((buf (and erc-server-process
-                          (erc-get-buffer tgt erc-server-process))))
-            (when buf
-              (with-current-buffer buf
-                (setq erc-channel-modes add-modes)
-                (setq erc-channel-user-limit nil)
-                (setq erc-channel-key nil)
-                (while arg-modes
-                  (let ((mode (nth 0 (car arg-modes)))
-                        (onoff (nth 1 (car arg-modes)))
-                        (arg (nth 2 (car arg-modes))))
-                    (cond ((string-match "^[Ll]" mode)
-                           (erc-update-channel-limit tgt onoff arg))
-                          ((string-match "^[Kk]" mode)
-                           (erc-update-channel-key tgt onoff arg))
-                          (t nil)))
-                  (setq arg-modes (cdr arg-modes)))
-                (erc-update-mode-line-buffer buf)))))
-         ;; we do not keep our nick's modes yet
-         ;;(t (setq erc-user-modes add-modes))
-         )
+           (let ((buf (and erc-server-process
+                           (erc-get-buffer tgt erc-server-process))))
+             (when buf
+               (with-current-buffer buf
+                 (setq erc-channel-modes add-modes)
+                 (setq erc-channel-user-limit nil)
+                 (setq erc-channel-key nil)
+                 (while arg-modes
+                   (let ((mode (nth 0 (car arg-modes)))
+                         (onoff (nth 1 (car arg-modes)))
+                         (arg (nth 2 (car arg-modes))))
+                     (cond ((string-match "^[Ll]" mode)
+                            (erc-update-channel-limit tgt onoff arg))
+                           ((string-match "^[Kk]" mode)
+                            (erc-update-channel-key tgt onoff arg))
+                           (t nil)))
+                   (setq arg-modes (cdr arg-modes)))
+                 (erc-update-mode-line-buffer buf)))))
+          ;; we do not keep our nick's modes yet
+          ;;(t (setq erc-user-modes add-modes))
+          )
     ))
 
 (defun erc-sort-strings (list-of-strings)
@@ -4963,42 +5049,42 @@ arg-modes is a list of triples of the form:
   (MODE-CHAR ON/OFF ARGUMENT)."
   (if (string-match "^\\s-*\\(\\S-+\\)\\(\\s-.*$\\|$\\)" mode-string)
       (let ((chars (mapcar 'char-to-string (match-string 1 mode-string)))
-           ;; arguments in channel modes
-           (args-str (match-string 2 mode-string))
-           (args nil)
-           (add-modes nil)
-           (remove-modes nil)
-           (arg-modes nil); list of triples: (mode-char 'on/'off argument)
-           (add-p t))
-       ;; make the argument list
-       (while (string-match "^\\s-*\\(\\S-+\\)\\(\\s-+.*$\\|$\\)" args-str)
-         (setq args (cons (match-string 1 args-str) args))
-         (setq args-str (match-string 2 args-str)))
-       (setq args (nreverse args))
-       ;; collect what modes changed, and match them with arguments
-       (while chars
-         (cond ((string= (car chars) "+") (setq add-p t))
-               ((string= (car chars) "-") (setq add-p nil))
-               ((string-match "^[ovbOVB]" (car chars))
-                (setq arg-modes (cons (list (car chars)
-                                            (if add-p 'on 'off)
-                                            (if args (car args) nil))
-                                      arg-modes))
-                (if args (setq args (cdr args))))
-               ((string-match "^[LlKk]" (car chars))
-                (setq arg-modes (cons (list (car chars)
-                                            (if add-p 'on 'off)
-                                            (if (and add-p args)
-                                                (car args) nil))
-                                      arg-modes))
-                (if (and add-p args) (setq args (cdr args))))
-               (add-p (setq add-modes (cons (car chars) add-modes)))
-               (t (setq remove-modes (cons (car chars) remove-modes))))
-         (setq chars (cdr chars)))
-       (setq add-modes (nreverse add-modes))
-       (setq remove-modes (nreverse remove-modes))
-       (setq arg-modes (nreverse arg-modes))
-       (list add-modes remove-modes arg-modes))
+            ;; arguments in channel modes
+            (args-str (match-string 2 mode-string))
+            (args nil)
+            (add-modes nil)
+            (remove-modes nil)
+            (arg-modes nil); list of triples: (mode-char 'on/'off argument)
+            (add-p t))
+        ;; make the argument list
+        (while (string-match "^\\s-*\\(\\S-+\\)\\(\\s-+.*$\\|$\\)" args-str)
+          (setq args (cons (match-string 1 args-str) args))
+          (setq args-str (match-string 2 args-str)))
+        (setq args (nreverse args))
+        ;; collect what modes changed, and match them with arguments
+        (while chars
+          (cond ((string= (car chars) "+") (setq add-p t))
+                ((string= (car chars) "-") (setq add-p nil))
+                ((string-match "^[qaovhbQAOVHB]" (car chars))
+                 (setq arg-modes (cons (list (car chars)
+                                             (if add-p 'on 'off)
+                                             (if args (car args) nil))
+                                       arg-modes))
+                 (if args (setq args (cdr args))))
+                ((string-match "^[LlKk]" (car chars))
+                 (setq arg-modes (cons (list (car chars)
+                                             (if add-p 'on 'off)
+                                             (if (and add-p args)
+                                                 (car args) nil))
+                                       arg-modes))
+                 (if (and add-p args) (setq args (cdr args))))
+                (add-p (setq add-modes (cons (car chars) add-modes)))
+                (t (setq remove-modes (cons (car chars) remove-modes))))
+          (setq chars (cdr chars)))
+        (setq add-modes (nreverse add-modes))
+        (setq remove-modes (nreverse remove-modes))
+        (setq arg-modes (nreverse arg-modes))
+        (list add-modes remove-modes arg-modes))
     nil))
 
 (defun erc-update-modes (tgt mode-string &optional nick host login)
@@ -5007,65 +5093,70 @@ Optional arguments: NICK, HOST and LOGIN - the attributes of the
 person who changed the modes."
   ;; FIXME: neither of nick, host, and login are used!
   (let* ((modes (erc-parse-modes mode-string))
-        (add-modes (nth 0 modes))
-        (remove-modes (nth 1 modes))
-        ;; list of triples: (mode-char 'on/'off argument)
-        (arg-modes (nth 2 modes)))
+         (add-modes (nth 0 modes))
+         (remove-modes (nth 1 modes))
+         ;; list of triples: (mode-char 'on/'off argument)
+         (arg-modes (nth 2 modes)))
     ;; now parse the modes changes and do the updates
     (cond ((erc-channel-p tgt); channel modes
-          (let ((buf (and erc-server-process
-                          (erc-get-buffer tgt erc-server-process))))
-            (when buf
-              ;; FIXME! This used to have an original buffer
-              ;; variable, but it never switched back to the original
-              ;; buffer. Is this wanted behavior?
-              (set-buffer buf)
-              (if (not (boundp 'erc-channel-modes))
-                  (setq erc-channel-modes nil))
-              (while remove-modes
-                (setq erc-channel-modes (delete (car remove-modes)
-                                                erc-channel-modes)
-                      remove-modes (cdr remove-modes)))
-              (while add-modes
-                (setq erc-channel-modes (cons (car add-modes)
-                                              erc-channel-modes)
-                      add-modes (cdr add-modes)))
-              (setq erc-channel-modes (erc-sort-strings erc-channel-modes))
-              (while arg-modes
-                (let ((mode (nth 0 (car arg-modes)))
-                      (onoff (nth 1 (car arg-modes)))
-                      (arg (nth 2 (car arg-modes))))
-                  (cond ((string-match "^[oO]" mode)
-                         (erc-update-channel-member tgt arg arg nil onoff))
-                        ((string-match "^[Vv]" mode)
-                         (erc-update-channel-member tgt arg arg nil nil
-                                                    onoff))
-                        ((string-match "^[Ll]" mode)
-                         (erc-update-channel-limit tgt onoff arg))
-                        ((string-match "^[Kk]" mode)
-                         (erc-update-channel-key tgt onoff arg))
-                        (t nil)); only ops are tracked now
-                  (setq arg-modes (cdr arg-modes))))
-              (erc-update-mode-line buf))))
-         ;; nick modes - ignored at this point
-         (t nil))))
+           (let ((buf (and erc-server-process
+                           (erc-get-buffer tgt erc-server-process))))
+             (when buf
+               ;; FIXME! This used to have an original buffer
+               ;; variable, but it never switched back to the original
+               ;; buffer. Is this wanted behavior?
+               (set-buffer buf)
+               (if (not (boundp 'erc-channel-modes))
+                   (setq erc-channel-modes nil))
+               (while remove-modes
+                 (setq erc-channel-modes (delete (car remove-modes)
+                                                 erc-channel-modes)
+                       remove-modes (cdr remove-modes)))
+               (while add-modes
+                 (setq erc-channel-modes (cons (car add-modes)
+                                               erc-channel-modes)
+                       add-modes (cdr add-modes)))
+               (setq erc-channel-modes (erc-sort-strings erc-channel-modes))
+               (while arg-modes
+                 (let ((mode (nth 0 (car arg-modes)))
+                       (onoff (nth 1 (car arg-modes)))
+                       (arg (nth 2 (car arg-modes))))
+                   (cond ((string-match "^[Vv]" mode)
+                          (erc-update-channel-member tgt arg arg nil onoff))
+                         ((string-match "^[hH]" mode)
+                          (erc-update-channel-member tgt arg arg nil nil onoff))
+                         ((string-match "^[oO]" mode)
+                          (erc-update-channel-member tgt arg arg nil nil nil onoff))
+                         ((string-match "^[aA]" mode)
+                          (erc-update-channel-member tgt arg arg nil nil nil nil onoff))
+                         ((string-match "^[qQ]" mode)
+                          (erc-update-channel-member tgt arg arg nil nil nil nil nil onoff))
+                         ((string-match "^[Ll]" mode)
+                          (erc-update-channel-limit tgt onoff arg))
+                         ((string-match "^[Kk]" mode)
+                          (erc-update-channel-key tgt onoff arg))
+                         (t nil)); only ops are tracked now
+                   (setq arg-modes (cdr arg-modes))))
+               (erc-update-mode-line buf))))
+          ;; nick modes - ignored at this point
+          (t nil))))
 
 (defun erc-update-channel-limit (channel onoff n)
   ;; FIXME: what does ONOFF actually do?  -- Lawrence 2004-01-08
   "Update CHANNEL's user limit to N."
   (if (or (not (eq onoff 'on))
-         (and (stringp n) (string-match "^[0-9]+$" n)))
+          (and (stringp n) (string-match "^[0-9]+$" n)))
       (erc-with-buffer
-       (channel)
-      (cond ((eq onoff 'on) (setq erc-channel-user-limit (string-to-number n)))
-           (t (setq erc-channel-user-limit nil))))))
+          (channel)
+        (cond ((eq onoff 'on) (setq erc-channel-user-limit (string-to-number n)))
+              (t (setq erc-channel-user-limit nil))))))
 
 (defun erc-update-channel-key (channel onoff key)
   "Update CHANNEL's key to KEY if ONOFF is 'on or to nil if it's 'off."
   (erc-with-buffer
-   (channel)
-   (cond ((eq onoff 'on) (setq erc-channel-key key))
-        (t (setq erc-channel-key nil)))))
+      (channel)
+    (cond ((eq onoff 'on) (setq erc-channel-key key))
+          (t (setq erc-channel-key nil)))))
 
 (defun erc-handle-user-status-change (type nlh &optional l)
   "Handle changes in any user's status.
@@ -5078,9 +5169,9 @@ and L is a list containing additional TYPE-specific arguments.
 
 So far the following TYPE/L pairs are supported:
 
-       Event                   TYPE                   L
+       Event                    TYPE                   L
 
-    nickname change           'nick                (NEW-NICK)"
+    nickname change            'nick                (NEW-NICK)"
   (erc-log (format "user-change: type: %S  nlh: %S  l: %S" type nlh l))
   (cond
    ;; nickname change
@@ -5095,7 +5186,7 @@ See also variable `erc-notice-highlight-type'."
   (cond
    ((eq erc-notice-highlight-type 'prefix)
     (erc-put-text-property 0 (length erc-notice-prefix)
-                          'face 'erc-notice-face s)
+                           'face 'erc-notice-face s)
     s)
    ((eq erc-notice-highlight-type 'all)
     (erc-put-text-property 0 (length s) 'face 'erc-notice-face s)
@@ -5139,13 +5230,13 @@ Return a list of the three separate tokens."
   (cond
    ((string-match "^\\([^!\n]*\\)!\\([^@\n]*\\)@\\(.*\\)$" string)
     (list (match-string 1 string)
-         (match-string 2 string)
-         (match-string 3 string)))
+          (match-string 2 string)
+          (match-string 3 string)))
    ;; Some bogus bouncers send Nick!(null), try to live with that.
    ((string-match "^\\([^!\n]*\\)!\\(.*\\)$" string)
     (list (match-string 1 string)
-         ""
-         (match-string 2 string)))
+          ""
+          (match-string 2 string)))
    (t
     (list string "" ""))))
 
@@ -5156,7 +5247,7 @@ See also `erc-parse-user'."
   (car (erc-parse-user string)))
 
 (defun erc-put-text-properties (start end properties
-                               &optional object value-list)
+                                      &optional object value-list)
   "Set text-properties for OBJECT.
 
 START and END describe positions in OBJECT.
@@ -5164,7 +5255,7 @@ If VALUE-LIST is nil, set each property in PROPERTIES to t, else set
 each property to the corresponding value in VALUE-LIST."
   (unless value-list
     (setq value-list (mapcar (lambda (_x) t)
-                            properties)))
+                             properties)))
   (while (and properties value-list)
     (erc-put-text-property
      start end (pop properties) (pop value-list) object)))
@@ -5176,7 +5267,7 @@ each property to the corresponding value in VALUE-LIST."
 
 Specifically, return the position of `erc-insert-marker'."
   (or (and (boundp 'erc-insert-marker)
-          (markerp erc-insert-marker))
+           (markerp erc-insert-marker))
       (error "erc-insert-marker has no value, please report a bug"))
   (marker-position erc-insert-marker))
 
@@ -5206,43 +5297,43 @@ submitted line to be intentional."
   (interactive)
   (let ((now (float-time)))
     (if (or (not erc-accidental-paste-threshold-seconds)
-           (< erc-accidental-paste-threshold-seconds
-              (- now erc-last-input-time)))
-       (save-restriction
-         (widen)
-         (if (< (point) (erc-beg-of-input-line))
-             (erc-error "Point is not in the input area")
-           (let ((inhibit-read-only t)
-                 (str (erc-user-input))
-                 (old-buf (current-buffer)))
-             (if (and (not (erc-server-buffer-live-p))
-                      (not (erc-command-no-process-p str)))
-                 (erc-error "ERC: No process running")
-               (erc-set-active-buffer (current-buffer))
-               ;; Kill the input and the prompt
-               (delete-region (erc-beg-of-input-line)
-                              (erc-end-of-input-line))
-               (unwind-protect
-                   (erc-send-input str)
-                 ;; Fix the buffer if the command didn't kill it
-                 (when (buffer-live-p old-buf)
-                   (with-current-buffer old-buf
-                     (save-restriction
-                       (widen)
-                       (goto-char (point-max))
-                       (when (processp erc-server-process)
-                         (set-marker (process-mark erc-server-process) (point)))
-                       (set-marker erc-insert-marker (point))
-                       (let ((buffer-modified (buffer-modified-p)))
-                         (erc-display-prompt)
-                         (set-buffer-modified-p buffer-modified))))))
-
-               ;; Only when last hook has been run...
-               (run-hook-with-args 'erc-send-completed-hook str))))
-         (setq erc-last-input-time now))
+            (< erc-accidental-paste-threshold-seconds
+               (- now erc-last-input-time)))
+        (save-restriction
+          (widen)
+          (if (< (point) (erc-beg-of-input-line))
+              (erc-error "Point is not in the input area")
+            (let ((inhibit-read-only t)
+                  (str (erc-user-input))
+                  (old-buf (current-buffer)))
+              (if (and (not (erc-server-buffer-live-p))
+                       (not (erc-command-no-process-p str)))
+                  (erc-error "ERC: No process running")
+                (erc-set-active-buffer (current-buffer))
+                ;; Kill the input and the prompt
+                (delete-region (erc-beg-of-input-line)
+                               (erc-end-of-input-line))
+                (unwind-protect
+                    (erc-send-input str)
+                  ;; Fix the buffer if the command didn't kill it
+                  (when (buffer-live-p old-buf)
+                    (with-current-buffer old-buf
+                      (save-restriction
+                        (widen)
+                        (goto-char (point-max))
+                        (when (processp erc-server-process)
+                          (set-marker (process-mark erc-server-process) (point)))
+                        (set-marker erc-insert-marker (point))
+                        (let ((buffer-modified (buffer-modified-p)))
+                          (erc-display-prompt)
+                          (set-buffer-modified-p buffer-modified))))))
+
+                ;; Only when last hook has been run...
+                (run-hook-with-args 'erc-send-completed-hook str))))
+          (setq erc-last-input-time now))
       (switch-to-buffer "*ERC Accidental Paste Overflow*")
       (lwarn 'erc :warning
-            "You seem to have accidentally pasted some text!"))))
+             "You seem to have accidentally pasted some text!"))))
 
 (defun erc-user-input ()
   "Return the input of the user in the current buffer."
@@ -5261,7 +5352,7 @@ This returns non-nil only if we actually send anything."
   (cond
    ;; Ignore empty input
    ((if erc-send-whitespace-lines
-       (string= input "")
+        (string= input "")
       (string-match "\\`[ \t\r\f\n]*\\'" input))
     (when erc-warn-about-blank-lines
       (message "Blank line - ignoring...")
@@ -5269,48 +5360,48 @@ This returns non-nil only if we actually send anything."
     nil)
    (t
     (let ((str input)
-         (erc-insert-this t))
+          (erc-insert-this t))
       (setq erc-send-this t)
       (run-hook-with-args 'erc-send-pre-hook input)
       (when erc-send-this
-       (if (or (string-match "\n" str)
-               (not (string-match erc-command-regexp str)))
-           (mapc
-            (lambda (line)
-              (mapc
-               (lambda (line)
-                 ;; Insert what has to be inserted for this.
-                 (erc-display-msg line)
-                 (erc-process-input-line (concat line "\n")
-                                         (null erc-flood-protect) t))
-               (or (and erc-flood-protect (erc-split-line line))
-                   (list line))))
-            (split-string str "\n"))
-         ;; Insert the prompt along with the command.
-         (erc-display-command str)
-         (erc-process-input-line (concat str "\n") t nil))
-       t)))))
+        (if (or (string-match "\n" str)
+                (not (string-match erc-command-regexp str)))
+            (mapc
+             (lambda (line)
+               (mapc
+                (lambda (line)
+                  ;; Insert what has to be inserted for this.
+                  (erc-display-msg line)
+                  (erc-process-input-line (concat line "\n")
+                                          (null erc-flood-protect) t))
+                (or (and erc-flood-protect (erc-split-line line))
+                    (list line))))
+             (split-string str "\n"))
+          ;; Insert the prompt along with the command.
+          (erc-display-command str)
+          (erc-process-input-line (concat str "\n") t nil))
+        t)))))
 
 (defun erc-display-command (line)
   (when erc-insert-this
     (let ((insert-position (point)))
       (unless erc-hide-prompt
-       (erc-display-prompt nil nil (erc-command-indicator)
-                           (and (erc-command-indicator)
-                                'erc-command-indicator-face)))
+        (erc-display-prompt nil nil (erc-command-indicator)
+                            (and (erc-command-indicator)
+                                 'erc-command-indicator-face)))
       (let ((beg (point)))
-       (insert line)
-       (erc-put-text-property beg (point)
-                              'face 'erc-command-indicator-face)
-       (insert "\n"))
+        (insert line)
+        (erc-put-text-property beg (point)
+                               'face 'erc-command-indicator-face)
+        (insert "\n"))
       (when (processp erc-server-process)
-       (set-marker (process-mark erc-server-process) (point)))
+        (set-marker (process-mark erc-server-process) (point)))
       (set-marker erc-insert-marker (point))
       (save-excursion
-       (save-restriction
-         (narrow-to-region insert-position (point))
-         (run-hooks 'erc-send-modify-hook)
-         (run-hooks 'erc-send-post-hook))))))
+        (save-restriction
+          (narrow-to-region insert-position (point))
+          (run-hooks 'erc-send-modify-hook)
+          (run-hooks 'erc-send-post-hook))))))
 
 (defun erc-display-msg (line)
   "Display LINE as a message of the user to the current target at the
@@ -5319,18 +5410,18 @@ current position."
     (let ((insert-position (point)))
       (insert (erc-format-my-nick))
       (let ((beg (point)))
-       (insert line)
-       (erc-put-text-property beg (point)
-                              'face 'erc-input-face))
+        (insert line)
+        (erc-put-text-property beg (point)
+                               'face 'erc-input-face))
       (insert "\n")
       (when (processp erc-server-process)
-       (set-marker (process-mark erc-server-process) (point)))
+        (set-marker (process-mark erc-server-process) (point)))
       (set-marker erc-insert-marker (point))
       (save-excursion
-       (save-restriction
-         (narrow-to-region insert-position (point))
-         (run-hooks 'erc-send-modify-hook)
-         (run-hooks 'erc-send-post-hook))))))
+        (save-restriction
+          (narrow-to-region insert-position (point))
+          (run-hooks 'erc-send-modify-hook)
+          (run-hooks 'erc-send-post-hook))))))
 
 (defun erc-command-symbol (command)
   "Return the ERC command symbol for COMMAND if it exists and is bound."
@@ -5343,16 +5434,16 @@ If no command was given, return nil.  If command matches, return a
 list of the form: (command args) where both elements are strings."
   (when (string-match erc-command-regexp line)
     (let* ((cmd (erc-command-symbol (match-string 1 line)))
-          ;; note: return is nil, we apply this simply for side effects
-          (_canon-defun (while (and cmd (symbolp (symbol-function cmd)))
-                          (setq cmd (symbol-function cmd))))
-          (cmd-fun (or cmd #'erc-cmd-default))
-          (arg (if cmd
-                   (if (get cmd-fun 'do-not-parse-args)
-                       (format "%s" (match-string 2 line))
-                     (delete "" (split-string (erc-trim-string
-                                               (match-string 2 line)) " ")))
-                 line)))
+           ;; note: return is nil, we apply this simply for side effects
+           (_canon-defun (while (and cmd (symbolp (symbol-function cmd)))
+                           (setq cmd (symbol-function cmd))))
+           (cmd-fun (or cmd #'erc-cmd-default))
+           (arg (if cmd
+                    (if (get cmd-fun 'do-not-parse-args)
+                        (format "%s" (match-string 2 line))
+                      (delete "" (split-string (erc-trim-string
+                                                (match-string 2 line)) " ")))
+                  line)))
       (list cmd-fun arg))))
 
 (defun erc-split-multiline-safe (string)
@@ -5360,16 +5451,16 @@ list of the form: (command args) where both elements are strings."
 Do it only for STRING as the complete input, do not carry unfinished
 strings over to the next call."
   (let ((l ())
-       (i0 0)
-       (doit t))
+        (i0 0)
+        (doit t))
     (while doit
       (let ((i (string-match "\r?\n" string i0))
-           (s (substring string i0)))
-       (cond (i (setq l (cons (substring string i0 i) l))
-                (setq i0 (match-end 0)))
-             ((> (length s) 0)
-                (setq l (cons s l))(setq doit nil))
-             (t (setq doit nil)))))
+            (s (substring string i0)))
+        (cond (i (setq l (cons (substring string i0 i) l))
+                 (setq i0 (match-end 0)))
+              ((> (length s) 0)
+               (setq l (cons s l))(setq doit nil))
+              (t (setq doit nil)))))
     (nreverse l)))
 
 ;; nick handling
@@ -5377,15 +5468,15 @@ strings over to the next call."
 (defun erc-set-current-nick (nick)
   "Set the current nickname to NICK."
   (with-current-buffer (if (buffer-live-p (erc-server-buffer))
-                          (erc-server-buffer)
-                        (current-buffer))
+                           (erc-server-buffer)
+                         (current-buffer))
     (setq erc-server-current-nick nick)))
 
 (defun erc-current-nick ()
   "Return the current nickname."
   (with-current-buffer (if (buffer-live-p (erc-server-buffer))
-                          (erc-server-buffer)
-                        (current-buffer))
+                           (erc-server-buffer)
+                         (current-buffer))
     erc-server-current-nick))
 
 (defun erc-current-nick-p (nick)
@@ -5399,7 +5490,7 @@ This matches strings according to the IRC protocol's case convention.
 
 See also `erc-downcase'."
   (string= (erc-downcase nick1)
-          (erc-downcase nick2)))
+           (erc-downcase nick2)))
 
 ;; default target handling
 
@@ -5414,38 +5505,38 @@ See also `erc-downcase'."
 (defun erc-add-default-channel (channel)
   "Add CHANNEL to the default channel list."
   (let ((chl (downcase channel)))
-      (setq erc-default-recipients
-           (cons chl erc-default-recipients))))
+    (setq erc-default-recipients
+          (cons chl erc-default-recipients))))
 
 (defun erc-delete-default-channel (channel &optional buffer)
   "Delete CHANNEL from the default channel list."
   (with-current-buffer (if (and buffer
-                               (bufferp buffer))
-                          buffer
-                        (current-buffer))
+                                (bufferp buffer))
+                           buffer
+                         (current-buffer))
     (setq erc-default-recipients (delete (downcase channel)
-                                        erc-default-recipients))))
+                                         erc-default-recipients))))
 
 (defun erc-add-query (nickname)
   "Add QUERY'd NICKNAME to the default channel list.
 
 The previous default target of QUERY type gets removed."
   (let ((d1 (car erc-default-recipients))
-       (d2 (cdr erc-default-recipients))
-       (qt (cons 'QUERY (downcase nickname))))
+        (d2 (cdr erc-default-recipients))
+        (qt (cons 'QUERY (downcase nickname))))
     (setq erc-default-recipients (cons qt (if (and (listp d1)
-                                                  (eq (car d1) 'QUERY))
-                                             d2
-                                           erc-default-recipients)))))
+                                                   (eq (car d1) 'QUERY))
+                                              d2
+                                            erc-default-recipients)))))
 
 (defun erc-delete-query ()
   "Delete the topmost target if it is a QUERY."
 
   (let ((d1 (car erc-default-recipients))
-       (d2 (cdr erc-default-recipients)))
+        (d2 (cdr erc-default-recipients)))
     (if (and (listp d1)
-            (eq (car d1) 'QUERY))
-       (setq erc-default-recipients d2)
+             (eq (car d1) 'QUERY))
+        (setq erc-default-recipients d2)
       (error "Current target is not a QUERY"))))
 
 (defun erc-ignored-user-p (spec)
@@ -5457,7 +5548,7 @@ match, returns that regexp."
   (catch 'found
     (dolist (ignored (erc-with-server-buffer erc-ignore-list))
       (if (string-match ignored spec)
-         (throw 'found ignored)))))
+          (throw 'found ignored)))))
 
 (defun erc-ignored-reply-p (msg tgt proc)
   ;; FIXME: this docstring needs fixing -- Lawrence 2004-01-08
@@ -5467,12 +5558,12 @@ Takes a message MSG to a channel and returns non-nil if the addressed
 user matches any regexp in `erc-ignore-reply-list'."
   (let ((target-nick (erc-message-target msg)))
     (if (not target-nick)
-       nil
+        nil
       (erc-with-buffer (tgt proc)
-       (let ((user (erc-get-server-user target-nick)))
-         (when user
-           (erc-list-match erc-ignore-reply-list
-                           (erc-user-spec user))))))))
+        (let ((user (erc-get-server-user target-nick)))
+          (when user
+            (erc-list-match erc-ignore-reply-list
+                            (erc-user-spec user))))))))
 
 (defun erc-message-target (msg)
   "Return the addressed target in MSG.
@@ -5485,19 +5576,19 @@ The addressed target is the string before the first colon in MSG."
 (defun erc-user-spec (user)
   "Create a nick!user@host spec from a user struct."
   (let ((nick (erc-server-user-nickname user))
-       (host (erc-server-user-host user))
-       (login (erc-server-user-login user)))
-  (concat (or nick "")
-         "!"
-         (or login "")
-         "@"
-         (or host ""))))
+        (host (erc-server-user-host user))
+        (login (erc-server-user-login user)))
+    (concat (or nick "")
+            "!"
+            (or login "")
+            "@"
+            (or host ""))))
 
 (defun erc-list-match (lst str)
   "Return non-nil if any regexp in LST matches STR."
   (memq nil (mapcar (lambda (regexp)
-                     (not (string-match regexp str)))
-                   lst)))
+                      (not (string-match regexp str)))
+                    lst)))
 
 ;; other "toggles"
 
@@ -5509,9 +5600,9 @@ If ARG is positive, turns CTCP replies on.
 If ARG is non-nil and not positive, turns CTCP replies off."
   (interactive "P")
   (cond ((and (numberp arg) (> arg 0))
-        (setq erc-disable-ctcp-replies t))
-       (arg (setq erc-disable-ctcp-replies nil))
-       (t (setq erc-disable-ctcp-replies (not erc-disable-ctcp-replies))))
+         (setq erc-disable-ctcp-replies t))
+        (arg (setq erc-disable-ctcp-replies nil))
+        (t (setq erc-disable-ctcp-replies (not erc-disable-ctcp-replies))))
   (message "ERC CTCP replies are %s" (if erc-disable-ctcp-replies "OFF" "ON")))
 
 (defun erc-toggle-flood-control (&optional arg)
@@ -5524,12 +5615,12 @@ See `erc-server-flood-margin' for an explanation of the available
 flood control parameters."
   (interactive "P")
   (cond ((and (numberp arg) (> arg 0))
-        (setq erc-flood-protect t))
-       (arg (setq erc-flood-protect nil))
-       (t (setq erc-flood-protect (not erc-flood-protect))))
+         (setq erc-flood-protect t))
+        (arg (setq erc-flood-protect nil))
+        (t (setq erc-flood-protect (not erc-flood-protect))))
   (message "ERC flood control is %s"
-          (cond (erc-flood-protect "ON")
-                (t "OFF"))))
+           (cond (erc-flood-protect "ON")
+                 (t "OFF"))))
 
 ;; Some useful channel and nick commands for fast key bindings
 
@@ -5542,12 +5633,11 @@ This command is sent even if excess flood is detected."
   (interactive "P")
   (erc-set-active-buffer (current-buffer))
   (let ((tgt (erc-default-target)))
-    (cond ((or (not tgt) (not (erc-channel-p tgt)))
-          (erc-display-message nil 'error (current-buffer) 'no-target))
-         (arg (erc-load-irc-script-lines (list (concat "/mode " tgt " -i"))
-                                         t))
-         (t (erc-load-irc-script-lines (list (concat "/mode " tgt " +i"))
-                                       t)))))
+    (if (or (not tgt) (not (erc-channel-p tgt)))
+        (erc-display-message nil 'error (current-buffer) 'no-target)
+      (erc-load-irc-script-lines
+       (list (concat "/mode " tgt (if arg " -i" " +i")))
+       t))))
 
 (defun erc-get-channel-mode-from-keypress (key)
   "Read a key sequence and call the corresponding channel mode function.
@@ -5562,14 +5652,14 @@ Anything else will be sent to `erc-toggle-channel-mode'."
   (when (featurep 'xemacs)
     (setq key (char-to-string (event-to-character (aref key 0)))))
   (cond ((equal key "\C-g")
-        (keyboard-quit))
-       ((equal key "\C-m")
-        (erc-insert-mode-command))
-       ((equal key "l")
-        (call-interactively 'erc-set-channel-limit))
-       ((equal key "k")
-        (call-interactively 'erc-set-channel-key))
-       (t (erc-toggle-channel-mode key))))
+         (keyboard-quit))
+        ((equal key "\C-m")
+         (erc-insert-mode-command))
+        ((equal key "l")
+         (call-interactively 'erc-set-channel-limit))
+        ((equal key "k")
+         (call-interactively 'erc-set-channel-key))
+        (t (erc-toggle-channel-mode key))))
 
 (defun erc-toggle-channel-mode (mode &optional channel)
   "Toggle channel MODE.
@@ -5579,15 +5669,14 @@ If CHANNEL is non-nil, toggle MODE for that channel, otherwise use
   (interactive "P")
   (erc-set-active-buffer (current-buffer))
   (let ((tgt (or channel (erc-default-target))))
-    (cond ((or (null tgt) (null (erc-channel-p tgt)))
-          (erc-display-message nil 'error 'active 'no-target))
-         ((member mode erc-channel-modes)
-          (erc-log (format "%s: Toggle mode %s OFF" tgt mode))
-          (message "Toggle channel mode %s OFF" mode)
-          (erc-server-send (format "MODE %s -%s" tgt mode)))
-         (t (erc-log (format "%s: Toggle channel mode %s ON" tgt mode))
-            (message "Toggle channel mode %s ON" mode)
-            (erc-server-send (format "MODE %s +%s" tgt mode))))))
+    (if (or (null tgt) (null (erc-channel-p tgt)))
+        (erc-display-message nil 'error 'active 'no-target)
+      (let* ((active (member mode erc-channel-modes))
+             (newstate (if active "OFF" "ON")))
+        (erc-log (format "%s: Toggle mode %s %s" tgt mode newstate))
+        (message "Toggle channel mode %s %s" mode newstate)
+        (erc-server-send (format "MODE %s %s%s"
+                                 tgt (if active "-" "+") mode))))))
 
 (defun erc-insert-mode-command ()
   "Insert the line \"/mode <current target> \" at `point'."
@@ -5623,9 +5712,9 @@ If FILE is found, return the path to it."
   (let ((filepath file))
     (if (file-readable-p filepath) filepath
       (while (and path
-                 (progn (setq filepath (expand-file-name file (car path)))
-                        (not (file-readable-p filepath))))
-       (setq path (cdr path)))
+                  (progn (setq filepath (expand-file-name file (car path)))
+                         (not (file-readable-p filepath))))
+        (setq path (cdr path)))
       (if path filepath nil))))
 
 (defun erc-select-startup-file ()
@@ -5635,7 +5724,7 @@ See also `erc-startup-file-list'."
     (dolist (f erc-startup-file-list)
       (setq f (convert-standard-filename f))
       (when (file-readable-p f)
-       (throw 'found f)))))
+        (throw 'found f)))))
 
 (defun erc-find-script-file (file)
   "Search for FILE in `default-directory', and any in `erc-script-path'."
@@ -5650,7 +5739,7 @@ as an Emacs Lisp program.  Otherwise, treat it as a regular IRC
 script."
   (erc-log (concat "erc-load-script: " file))
   (cond
-   ((string-match "\\.el$" file)
+   ((string-match "\\.el\\'" file)
     (load file))
    (t
     (erc-load-irc-script file))))
@@ -5668,15 +5757,15 @@ $* = the entire argument string, $1 = the first argument, $2 = the second,
 and so on."
   (if (not args) (setq args ""))
   (let* ((arg-esc-regexp "\\(\\$\\(\\*\\|[1-9][0-9]*\\)\\)\\([^0-9]\\|$\\)")
-        (percent-regexp "\\(%.\\)")
-        (esc-regexp (concat arg-esc-regexp "\\|" percent-regexp))
-        (tgt (erc-default-target))
-        (server (and (boundp 'erc-session-server) erc-session-server))
-        (nick (erc-current-nick))
-        (res "")
-        (tmp nil)
-        (arg-list nil)
-        (arg-num 0))
+         (percent-regexp "\\(%.\\)")
+         (esc-regexp (concat arg-esc-regexp "\\|" percent-regexp))
+         (tgt (erc-default-target))
+         (server (and (boundp 'erc-session-server) erc-session-server))
+         (nick (erc-current-nick))
+         (res "")
+         (tmp nil)
+         (arg-list nil)
+         (arg-num 0))
     (if (not tgt) (setq tgt ""))
     (if (not server) (setq server ""))
     (if (not nick) (setq nick ""))
@@ -5692,36 +5781,36 @@ and so on."
     (while tmp
       ;;(message "beginning of while: tmp=%S" tmp)
       (let* ((hd (substring line 0 tmp))
-            (esc "")
-            (subst "")
-            (tail (substring line tmp)))
-       (cond ((string-match (concat "^" arg-esc-regexp) tail)
-              (setq esc (match-string 1 tail))
-              (setq tail (substring tail (match-end 1))))
-             ((string-match (concat "^" percent-regexp) tail)
-              (setq esc (match-string 1 tail))
-              (setq tail (substring tail (match-end 1)))))
-       ;;(message "hd=%S, esc=%S, tail=%S, arg-num=%S" hd esc tail arg-num)
-       (setq res (concat res hd))
-       (setq subst
-             (cond ((string= esc "") "")
-                   ((string-match "^\\$\\*$" esc) args)
-                   ((string-match "^\\$\\([0-9]+\\)$" esc)
-                    (let ((n (string-to-number (match-string 1 esc))))
-                      (message "n = %S, integerp(n)=%S" n (integerp n))
-                      (if (<= n arg-num) (nth (1- n) arg-list) "")))
-                   ((string-match "^%[Cc]$" esc) tgt)
-                   ((string-match "^%[Ss]$" esc) server)
-                   ((string-match "^%[Nn]$" esc) nick)
-                   ((string-match "^%\\(.\\)$" esc) (match-string 1 esc))
-                   (t (erc-log (format "BUG in erc-process-script-line: bad escape sequence: %S\n" esc))
-                      (message "BUG IN ERC: esc=%S" esc)
-                      "")))
-       (setq line tail)
-       (setq tmp (string-match esc-regexp line))
-       (setq res (concat res subst))
-       ;;(message "end of while: line=%S, res=%S, tmp=%S" line res tmp)
-       ))
+             (esc "")
+             (subst "")
+             (tail (substring line tmp)))
+        (cond ((string-match (concat "^" arg-esc-regexp) tail)
+               (setq esc (match-string 1 tail))
+               (setq tail (substring tail (match-end 1))))
+              ((string-match (concat "^" percent-regexp) tail)
+               (setq esc (match-string 1 tail))
+               (setq tail (substring tail (match-end 1)))))
+        ;;(message "hd=%S, esc=%S, tail=%S, arg-num=%S" hd esc tail arg-num)
+        (setq res (concat res hd))
+        (setq subst
+              (cond ((string= esc "") "")
+                    ((string-match "^\\$\\*$" esc) args)
+                    ((string-match "^\\$\\([0-9]+\\)$" esc)
+                     (let ((n (string-to-number (match-string 1 esc))))
+                       (message "n = %S, integerp(n)=%S" n (integerp n))
+                       (if (<= n arg-num) (nth (1- n) arg-list) "")))
+                    ((string-match "^%[Cc]$" esc) tgt)
+                    ((string-match "^%[Ss]$" esc) server)
+                    ((string-match "^%[Nn]$" esc) nick)
+                    ((string-match "^%\\(.\\)$" esc) (match-string 1 esc))
+                    (t (erc-log (format "BUG in erc-process-script-line: bad escape sequence: %S\n" esc))
+                       (message "BUG IN ERC: esc=%S" esc)
+                       "")))
+        (setq line tail)
+        (setq tmp (string-match esc-regexp line))
+        (setq res (concat res subst))
+        ;;(message "end of while: line=%S, res=%S, tmp=%S" line res tmp)
+        ))
     (setq res (concat res line))
     res))
 
@@ -5729,8 +5818,8 @@ and so on."
   "Load an IRC script from FILE."
   (erc-log (concat "erc-load-script: " file))
   (let ((str (with-temp-buffer
-              (insert-file-contents file)
-              (buffer-string))))
+               (insert-file-contents file)
+               (buffer-string))))
     (erc-load-irc-script-lines (erc-split-multiline-safe str) force)))
 
 (defun erc-load-irc-script-lines (lines &optional force noexpand)
@@ -5740,25 +5829,25 @@ If optional NOEXPAND is non-nil, do not expand script-specific
 sequences, process the lines verbatim.  Use this for multiline
 user input."
   (let* ((cb (current-buffer))
-        (s "")
-        (sp (or (erc-command-indicator) (erc-prompt)))
-        (args (and (boundp 'erc-script-args) erc-script-args)))
+         (s "")
+         (sp (or (erc-command-indicator) (erc-prompt)))
+         (args (and (boundp 'erc-script-args) erc-script-args)))
     (if (and args (string-match "^ " args))
-       (setq args (substring args 1)))
+        (setq args (substring args 1)))
     ;; prepare the prompt string for echo
     (erc-put-text-property 0 (length sp)
-                          'face 'erc-command-indicator-face sp)
+                           'face 'erc-command-indicator-face sp)
     (while lines
       (setq s (car lines))
       (erc-log (concat "erc-load-script: CMD: " s))
       (unless (string-match "^\\s-*$" s)
-       (let ((line (if noexpand s (erc-process-script-line s args))))
-         (if (and (erc-process-input-line line force)
-                  erc-script-echo)
-             (progn
-               (erc-put-text-property 0 (length line)
-                                      'face 'erc-input-face line)
-               (erc-display-line (concat sp line) cb)))))
+        (let ((line (if noexpand s (erc-process-script-line s args))))
+          (if (and (erc-process-input-line line force)
+                   erc-script-echo)
+              (progn
+                (erc-put-text-property 0 (length line)
+                                       'face 'erc-input-face line)
+                (erc-display-line (concat sp line) cb)))))
       (setq lines (cdr lines)))))
 
 ;; authentication
@@ -5766,21 +5855,21 @@ user input."
 (defun erc-login ()
   "Perform user authentication at the IRC server."
   (erc-log (format "login: nick: %s, user: %s %s %s :%s"
-                  (erc-current-nick)
-                  (user-login-name)
-                  (or erc-system-name (system-name))
-                  erc-session-server
-                  erc-session-user-full-name))
+                   (erc-current-nick)
+                   (user-login-name)
+                   (or erc-system-name (system-name))
+                   erc-session-server
+                   erc-session-user-full-name))
   (if erc-session-password
       (erc-server-send (format "PASS %s" erc-session-password))
     (message "Logging in without password"))
   (erc-server-send (format "NICK %s" (erc-current-nick)))
   (erc-server-send
    (format "USER %s %s %s :%s"
-          ;; hacked - S.B.
-          (if erc-anonymous-login erc-email-userid (user-login-name))
-          "0" "*"
-          erc-session-user-full-name))
+           ;; hacked - S.B.
+           (if erc-anonymous-login erc-email-userid (user-login-name))
+           "0" "*"
+           erc-session-user-full-name))
   (erc-update-mode-line))
 
 ;; connection properties' heuristics
@@ -5796,8 +5885,8 @@ Sets the buffer local variables:
 - `erc-server-current-nick'"
   (setq erc-session-connector erc-server-connect-function
         erc-session-server (erc-compute-server server)
-       erc-session-port (or port erc-default-port)
-       erc-session-user-full-name (erc-compute-full-name name))
+        erc-session-port (or port erc-default-port)
+        erc-session-user-full-name (erc-compute-full-name name))
   (erc-set-current-nick (erc-compute-nick nick)))
 
 (defun erc-compute-server (&optional server)
@@ -5865,7 +5954,7 @@ non-nil value is found.
 Returns a list of the form (HIGH LOW), compatible with Emacs time format."
   (let* ((n (string-to-number (concat string ".0"))))
     (list (truncate (/ n 65536))
-         (truncate (mod n 65536)))))
+          (truncate (mod n 65536)))))
 
 (defun erc-emacs-time-to-erc-time (time)
   "Convert Emacs TIME to a number of seconds since the epoch."
@@ -5891,33 +5980,33 @@ See also `erc-emacs-time-to-erc-time'."
   "Convert NS to a time string HH:MM.SS."
   (setq ns (truncate ns))
   (format "%02d:%02d.%02d"
-         (/ ns 3600)
-         (/ (% ns 3600) 60)
-         (% ns 60)))
+          (/ ns 3600)
+          (/ (% ns 3600) 60)
+          (% ns 60)))
 
 (defun erc-seconds-to-string (seconds)
   "Convert a number of SECONDS into an English phrase."
   (let (days hours minutes format-args output)
-    (setq days         (/ seconds 86400)
-         seconds       (% seconds 86400)
-         hours         (/ seconds 3600)
-         seconds       (% seconds 3600)
-         minutes       (/ seconds 60)
-         seconds       (% seconds 60)
-         format-args   (if (> days 0)
-                           `("%d days, %d hours, %d minutes, %d seconds"
-                             ,days ,hours ,minutes ,seconds)
-                         (if (> hours 0)
-                             `("%d hours, %d minutes, %d seconds"
-                               ,hours ,minutes ,seconds)
-                           (if (> minutes 0)
-                               `("%d minutes, %d seconds" ,minutes ,seconds)
-                             `("%d seconds" ,seconds))))
-         output        (apply 'format format-args))
+    (setq days          (/ seconds 86400)
+          seconds       (% seconds 86400)
+          hours         (/ seconds 3600)
+          seconds       (% seconds 3600)
+          minutes       (/ seconds 60)
+          seconds       (% seconds 60)
+          format-args   (if (> days 0)
+                            `("%d days, %d hours, %d minutes, %d seconds"
+                              ,days ,hours ,minutes ,seconds)
+                          (if (> hours 0)
+                              `("%d hours, %d minutes, %d seconds"
+                                ,hours ,minutes ,seconds)
+                            (if (> minutes 0)
+                                `("%d minutes, %d seconds" ,minutes ,seconds)
+                              `("%d seconds" ,seconds))))
+          output        (apply 'format format-args))
     ;; Change all "1 units" to "1 unit".
     (while (string-match "\\([^0-9]\\|^\\)1 \\S-+\\(s\\)" output)
       (setq output (erc-replace-match-subexpression-in-string
-                   "" output (match-string 2 output) 2 (match-beginning 2))))
+                    "" output (match-string 2 output) 2 (match-beginning 2))))
     output))
 
 
@@ -5940,14 +6029,14 @@ If S is nil or an empty string then return general CLIENTINFO."
   (if (or (not s) (string= s ""))
       (concat
        (apply #'concat
-             (mapcar (lambda (e)
-                       (concat (car e) " "))
-                     erc-clientinfo-alist))
+              (mapcar (lambda (e)
+                        (concat (car e) " "))
+                      erc-clientinfo-alist))
        ": use CLIENTINFO <COMMAND> to get more specific information")
     (let ((h (assoc (upcase s) erc-clientinfo-alist)))
       (if h
-         (concat s " " (cdr h))
-       (concat s ": unknown command")))))
+          (concat s " " (cdr h))
+        (concat s ": unknown command")))))
 
 ;; Hook functions
 
@@ -5962,9 +6051,9 @@ If it doesn't exist, create it."
   ;; here, we only want to match the channel buffers, to avoid
   ;; "selecting killed buffers" b0rkage.
   (erc-with-all-buffers-of-server process
-                                 (lambda ()
-                                   (not (erc-server-buffer-p)))
-                                 (kill-buffer (current-buffer))))
+    (lambda ()
+      (not (erc-server-buffer-p)))
+    (kill-buffer (current-buffer))))
 
 (defun erc-nick-at-point ()
   "Give information about the nickname at `point'.
@@ -5975,31 +6064,37 @@ entry of `channel-members'."
   (interactive)
   (require 'thingatpt)
   (let* ((word (word-at-point))
-        (channel-data (erc-get-channel-user word))
-        (cuser (cdr channel-data))
-        (user (if channel-data
-                  (car channel-data)
-                (erc-get-server-user word)))
-        host login full-name nick op voice)
+         (channel-data (erc-get-channel-user word))
+         (cuser (cdr channel-data))
+         (user (if channel-data
+                   (car channel-data)
+                 (erc-get-server-user word)))
+         host login full-name nick voice halfop op admin owner)
     (when user
       (setq nick (erc-server-user-nickname user)
-           host (erc-server-user-host user)
-           login (erc-server-user-login user)
-           full-name (erc-server-user-full-name user))
+            host (erc-server-user-host user)
+            login (erc-server-user-login user)
+            full-name (erc-server-user-full-name user))
       (if cuser
-         (setq op (erc-channel-user-op cuser)
-               voice (erc-channel-user-voice cuser)))
-      (if (called-interactively-p 'interactive)
-         (message "%s is %s@%s%s%s"
-                  nick login host
-                  (if full-name (format " (%s)" full-name) "")
-                  (if (or op voice)
-                              (format " and is +%s%s on %s"
-                              (if op "o" "")
-                              (if voice "v" "")
-                              (erc-default-target))
-                            ""))
-       user))))
+          (setq voice (erc-channel-user-voice cuser)
+                halfop (erc-channel-user-halfop cuser)
+                op (erc-channel-user-op cuser)
+                admin (erc-channel-user-admin cuser)
+                owner (erc-channel-user-owner cuser))))
+    (if (called-interactively-p 'interactive)
+        (message "%s is %s@%s%s%s"
+                 nick login host
+                 (if full-name (format " (%s)" full-name) "")
+                 (if (or voice halfop op admin owner)
+                     (format " and is +%s%s on %s"
+                             (if voice "v" "")
+                             (if halfop "h" "")
+                             (if op "o" "")
+                             (if admin "a" "")
+                             (if owner "q" "")
+                             (erc-default-target))
+                   ""))
+      user)))
 
 (defun erc-away-time ()
   "Return non-nil if the current ERC process is set away.
@@ -6044,11 +6139,11 @@ displayed.
 See `erc-mode-line-format' for which characters are can be used."
   :group 'erc-mode-line-and-header
   :set (lambda (sym val)
-        (set sym val)
-        (when (fboundp 'erc-update-mode-line)
-          (erc-update-mode-line nil)))
+         (set sym val)
+         (when (fboundp 'erc-update-mode-line)
+           (erc-update-mode-line nil)))
   :type '(choice (const :tag "Disabled" nil)
-                string))
+                 string))
 
 (defcustom erc-header-line-uses-tabbar-p nil
   "Use tabbar mode instead of the header line to display the header."
@@ -6069,8 +6164,8 @@ If given a function, call it and use the resulting face name.
 Otherwise, use the `erc-header-line' face."
   :group 'erc-mode-line-and-header
   :type '(choice (const :tag "Don't colorize" nil)
-                (const :tag "Use the erc-header-line face" t)
-                (function :tag "Call a function")))
+                 (const :tag "Use the erc-header-line face" t)
+                 (function :tag "Call a function")))
 
 (defcustom erc-show-channel-key-p t
   "Show the channel key in the header line."
@@ -6089,40 +6184,40 @@ This should be a string with substitution variables recognized by
   "Shorten SERVER-NAME according to `erc-common-server-suffixes'."
   (if (stringp server-name)
       (with-temp-buffer
-       (insert server-name)
-       (let ((alist erc-common-server-suffixes))
-         (while alist
-           (goto-char (point-min))
-       (if (re-search-forward (caar alist) nil t)
-           (replace-match (cdar alist)))
-       (setq alist (cdr alist))))
-       (buffer-string))))
+        (insert server-name)
+        (let ((alist erc-common-server-suffixes))
+          (while alist
+            (goto-char (point-min))
+            (if (re-search-forward (caar alist) nil t)
+                (replace-match (cdar alist)))
+            (setq alist (cdr alist))))
+        (buffer-string))))
 
 (defun erc-format-target ()
   "Return the name of the target (channel or nickname or servername:port)."
   (let ((target (erc-default-target)))
     (or target
-       (concat (erc-shorten-server-name
-                (or erc-server-announced-name
-                    erc-session-server))
-               ":" (erc-port-to-string erc-session-port)))))
+        (concat (erc-shorten-server-name
+                 (or erc-server-announced-name
+                     erc-session-server))
+                ":" (erc-port-to-string erc-session-port)))))
 
 (defun erc-format-target-and/or-server ()
   "Return the server name or the current target and server name combined."
   (let ((server-name (erc-shorten-server-name
-                     (or erc-server-announced-name
-                         erc-session-server))))
+                      (or erc-server-announced-name
+                          erc-session-server))))
     (cond ((erc-default-target)
-          (concat (erc-string-no-properties (erc-default-target))
-                  "@" server-name))
-         (server-name server-name)
-         (t (buffer-name (current-buffer))))))
+           (concat (erc-string-no-properties (erc-default-target))
+                   "@" server-name))
+          (server-name server-name)
+          (t (buffer-name (current-buffer))))))
 
 (defun erc-format-network ()
   "Return the name of the network we are currently on."
   (let ((network (and (fboundp 'erc-network-name) (erc-network-name))))
     (if (and network (symbolp network))
-       (symbol-name network)
+        (symbol-name network)
       "")))
 
 (defun erc-format-target-and/or-network ()
@@ -6130,48 +6225,48 @@ This should be a string with substitution variables recognized by
 If the name of the network is not available, then use the
 shortened server name instead."
   (let ((network-name (or (and (fboundp 'erc-network-name) (erc-network-name))
-                         (erc-shorten-server-name
-                          (or erc-server-announced-name
-                              erc-session-server)))))
+                          (erc-shorten-server-name
+                           (or erc-server-announced-name
+                               erc-session-server)))))
     (when (and network-name (symbolp network-name))
       (setq network-name (symbol-name network-name)))
     (cond ((erc-default-target)
-          (concat (erc-string-no-properties (erc-default-target))
-                  "@" network-name))
-         (network-name network-name)
-         (t (buffer-name (current-buffer))))))
+           (concat (erc-string-no-properties (erc-default-target))
+                   "@" network-name))
+          (network-name network-name)
+          (t (buffer-name (current-buffer))))))
 
 (defun erc-format-away-status ()
   "Return a formatted `erc-mode-line-away-status-format'
 if `erc-away' is non-nil."
   (let ((a (erc-away-time)))
     (if a
-       (format-time-string erc-mode-line-away-status-format a)
+        (format-time-string erc-mode-line-away-status-format a)
       "")))
 
 (defun erc-format-channel-modes ()
   "Return the current channel's modes."
   (concat (apply 'concat
-                "+" erc-channel-modes)
-         (cond ((and erc-channel-user-limit erc-channel-key)
-                (if erc-show-channel-key-p
-                    (format "lk %.0f %s" erc-channel-user-limit
-                            erc-channel-key)
-                  (format "kl %.0f" erc-channel-user-limit)))
-               (erc-channel-user-limit
-                ;; Emacs has no bignums
-                (format "l %.0f" erc-channel-user-limit))
-               (erc-channel-key
-                (if erc-show-channel-key-p
-                    (format "k %s" erc-channel-key)
-                  "k"))
-               (t nil))))
+                 "+" erc-channel-modes)
+          (cond ((and erc-channel-user-limit erc-channel-key)
+                 (if erc-show-channel-key-p
+                     (format "lk %.0f %s" erc-channel-user-limit
+                             erc-channel-key)
+                   (format "kl %.0f" erc-channel-user-limit)))
+                (erc-channel-user-limit
+                 ;; Emacs has no bignums
+                 (format "l %.0f" erc-channel-user-limit))
+                (erc-channel-key
+                 (if erc-show-channel-key-p
+                     (format "k %s" erc-channel-key)
+                   "k"))
+                (t nil))))
 
 (defun erc-format-lag-time ()
   "Return the estimated lag time to server, `erc-server-lag'."
   (let ((lag (erc-with-server-buffer erc-server-lag)))
     (cond (lag (format "lag:%.0f" lag))
-         (t ""))))
+          (t ""))))
 
 ;; erc-goodies is required at end of this file.
 (declare-function erc-controls-strip "erc-goodies" (str))
@@ -6182,66 +6277,66 @@ if `erc-away' is non-nil."
   "Update the mode line in a single ERC buffer BUFFER."
   (with-current-buffer buffer
     (let ((spec (format-spec-make
-                ?a (erc-format-away-status)
-                ?l (erc-format-lag-time)
-                ?m (erc-format-channel-modes)
-                ?n (or (erc-current-nick) "")
-                ?N (erc-format-network)
-                ?o (or (erc-controls-strip erc-channel-topic) "")
-                ?p (erc-port-to-string erc-session-port)
-                ?s (erc-format-target-and/or-server)
-                ?S (erc-format-target-and/or-network)
-                ?t (erc-format-target)))
-         (process-status (cond ((and (erc-server-process-alive)
-                                     (not erc-server-connected))
-                                ":connecting")
-                               ((erc-server-process-alive)
-                                "")
-                               (t
-                                ": CLOSED")))
-         (face (cond ((eq erc-header-line-face-method nil)
-                      nil)
-                     ((functionp erc-header-line-face-method)
-                      (funcall erc-header-line-face-method))
-                     (t
-                      'erc-header-line))))
+                 ?a (erc-format-away-status)
+                 ?l (erc-format-lag-time)
+                 ?m (erc-format-channel-modes)
+                 ?n (or (erc-current-nick) "")
+                 ?N (erc-format-network)
+                 ?o (or (erc-controls-strip erc-channel-topic) "")
+                 ?p (erc-port-to-string erc-session-port)
+                 ?s (erc-format-target-and/or-server)
+                 ?S (erc-format-target-and/or-network)
+                 ?t (erc-format-target)))
+          (process-status (cond ((and (erc-server-process-alive)
+                                      (not erc-server-connected))
+                                 ":connecting")
+                                ((erc-server-process-alive)
+                                 "")
+                                (t
+                                 ": CLOSED")))
+          (face (cond ((eq erc-header-line-face-method nil)
+                       nil)
+                      ((functionp erc-header-line-face-method)
+                       (funcall erc-header-line-face-method))
+                      (t
+                       'erc-header-line))))
       (cond ((featurep 'xemacs)
-            (setq modeline-buffer-identification
-                  (list (format-spec erc-mode-line-format spec)))
-            (setq modeline-process (list process-status)))
-           (t
-            (setq mode-line-buffer-identification
-                  (list (format-spec erc-mode-line-format spec)))
-            (setq mode-line-process (list process-status))))
+             (setq modeline-buffer-identification
+                   (list (format-spec erc-mode-line-format spec)))
+             (setq modeline-process (list process-status)))
+            (t
+             (setq mode-line-buffer-identification
+                   (list (format-spec erc-mode-line-format spec)))
+             (setq mode-line-process (list process-status))))
       (when (boundp 'header-line-format)
-       (let ((header (if erc-header-line-format
-                         (format-spec erc-header-line-format spec)
-                       nil)))
-         (cond (erc-header-line-uses-tabbar-p
-                (set (make-local-variable 'tabbar--local-hlf)
-                     header-line-format)
-                (kill-local-variable 'header-line-format))
-               ((null header)
-                (setq header-line-format nil))
-               (erc-header-line-uses-help-echo-p
-                (let ((help-echo (with-temp-buffer
-                                   (insert header)
-                                   (fill-region (point-min) (point-max))
-                                   (buffer-string))))
-                  (setq header-line-format
-                        (erc-replace-regexp-in-string
-                         "%"
-                         "%%"
-                         (if face
-                             (erc-propertize header 'help-echo help-echo
-                                             'face face)
-                           (erc-propertize header 'help-echo help-echo))))))
-               (t (setq header-line-format
-                        (if face
-                            (erc-propertize header 'face face)
-                          header)))))))
+        (let ((header (if erc-header-line-format
+                          (format-spec erc-header-line-format spec)
+                        nil)))
+          (cond (erc-header-line-uses-tabbar-p
+                 (set (make-local-variable 'tabbar--local-hlf)
+                      header-line-format)
+                 (kill-local-variable 'header-line-format))
+                ((null header)
+                 (setq header-line-format nil))
+                (erc-header-line-uses-help-echo-p
+                 (let ((help-echo (with-temp-buffer
+                                    (insert header)
+                                    (fill-region (point-min) (point-max))
+                                    (buffer-string))))
+                   (setq header-line-format
+                         (erc-replace-regexp-in-string
+                          "%"
+                          "%%"
+                          (if face
+                              (erc-propertize header 'help-echo help-echo
+                                              'face face)
+                            (erc-propertize header 'help-echo help-echo))))))
+                (t (setq header-line-format
+                         (if face
+                             (erc-propertize header 'face face)
+                           header)))))))
     (if (featurep 'xemacs)
-       (redraw-modeline)
+        (redraw-modeline)
       (force-mode-line-update))))
 
 (defun erc-update-mode-line (&optional buffer)
@@ -6252,7 +6347,7 @@ If BUFFER is nil, update the mode line in all ERC buffers."
       (erc-update-mode-line-buffer buffer)
     (dolist (buf (erc-buffer-list))
       (when (buffer-live-p buf)
-       (erc-update-mode-line-buffer buf)))))
+        (erc-update-mode-line-buffer buf)))))
 
 ;; Miscellaneous
 
@@ -6269,40 +6364,40 @@ P may be an integer or a service name."
       s
     (let ((n (string-to-number s)))
       (if (= n 0)
-         s
-       n))))
+          s
+        n))))
 
 (defun erc-version (&optional here)
   "Show the version number of ERC in the minibuffer.
 If optional argument HERE is non-nil, insert version number at point."
   (interactive "P")
   (let ((version-string
-        (format "ERC %s (GNU Emacs %s)" erc-version-string emacs-version)))
+         (format "ERC %s (GNU Emacs %s)" erc-version-string emacs-version)))
     (if here
-       (insert version-string)
+        (insert version-string)
       (if (called-interactively-p 'interactive)
-         (message "%s" version-string)
-       version-string))))
+          (message "%s" version-string)
+        version-string))))
 
 (defun erc-modes (&optional here)
   "Show the active ERC modes in the minibuffer.
 If optional argument HERE is non-nil, insert version number at point."
   (interactive "P")
   (let ((string
-        (mapconcat 'identity
-                   (let (modes (case-fold-search nil))
-                     (dolist (var (apropos-internal "^erc-.*mode$"))
-                       (when (and (boundp var)
-                                  (symbol-value var))
-                         (setq modes (cons (symbol-name var)
-                                           modes))))
-                     modes)
-                   ", ")))
+         (mapconcat 'identity
+                    (let (modes (case-fold-search nil))
+                      (dolist (var (apropos-internal "^erc-.*mode$"))
+                        (when (and (boundp var)
+                                   (symbol-value var))
+                          (setq modes (cons (symbol-name var)
+                                            modes))))
+                      modes)
+                    ", ")))
     (if here
-       (insert string)
+        (insert string)
       (if (called-interactively-p 'interactive)
-         (message "%s" string)
-       string))))
+          (message "%s" string)
+        string))))
 
 (defun erc-trim-string (s)
   "Trim leading and trailing spaces off S."
@@ -6328,34 +6423,34 @@ All windows are opened in the current frame."
       (switch-to-buffer (car bufs))
       (setq bufs (cdr bufs))
       (while bufs
-       (split-window)
-       (other-window 1)
-       (switch-to-buffer (car bufs))
-       (setq bufs (cdr bufs))
-       (balance-windows)))))
+        (split-window)
+        (other-window 1)
+        (switch-to-buffer (car bufs))
+        (setq bufs (cdr bufs))
+        (balance-windows)))))
 
 (defun erc-popup-input-buffer ()
   "Provide an input buffer."
-   (interactive)
-   (let ((buffer-name (generate-new-buffer-name "*ERC input*"))
-        (mode (intern
-               (completing-read
-                "Mode: "
-                (mapcar (lambda (e)
-                          (list (symbol-name e)))
-                        (apropos-internal "-mode$" 'commandp))
-                nil t))))
-     (pop-to-buffer (make-indirect-buffer (current-buffer) buffer-name))
-     (funcall mode)
-     (narrow-to-region (point) (point))
-     (shrink-window-if-larger-than-buffer)))
+  (interactive)
+  (let ((buffer-name (generate-new-buffer-name "*ERC input*"))
+        (mode (intern
+               (completing-read
+                "Mode: "
+                (mapcar (lambda (e)
+                          (list (symbol-name e)))
+                        (apropos-internal "-mode$" 'commandp))
+                nil t))))
+    (pop-to-buffer (make-indirect-buffer (current-buffer) buffer-name))
+    (funcall mode)
+    (narrow-to-region (point) (point))
+    (shrink-window-if-larger-than-buffer)))
 
 ;;; Message catalog
 
 (defun erc-make-message-variable-name (catalog entry)
   "Create a variable name corresponding to CATALOG's ENTRY."
   (intern (concat "erc-message-"
-                 (symbol-name catalog) "-" (symbol-name entry))))
+                  (symbol-name catalog) "-" (symbol-name entry))))
 
 (defun erc-define-catalog-entry (catalog entry format-spec)
   "Set CATALOG's ENTRY to FORMAT-SPEC."
@@ -6497,18 +6592,18 @@ All windows are opened in the current frame."
 This function is an example on what could be done with formatting
 functions."
   (let ((nick (cadr (memq ?n args)))
-       (user (cadr (memq ?u args)))
-       (host (cadr (memq ?h args)))
-       (channel (cadr (memq ?c args)))
-       (reason (cadr (memq ?r args))))
+        (user (cadr (memq ?u args)))
+        (host (cadr (memq ?h args)))
+        (channel (cadr (memq ?c args)))
+        (reason (cadr (memq ?r args))))
     (if (string= nick (erc-current-nick))
-       (format "You have left channel %s" channel)
+        (format "You have left channel %s" channel)
       (format "%s (%s@%s) has left channel %s%s"
-             nick user host channel
-             (if (not (string= reason ""))
-                 (format ": %s"
-                         (erc-replace-regexp-in-string "%" "%%" reason))
-               "")))))
+              nick user host channel
+              (if (not (string= reason ""))
+                  (format ": %s"
+                          (erc-replace-regexp-in-string "%" "%%" reason))
+                "")))))
 
 
 (defvar erc-current-message-catalog 'english)
@@ -6524,15 +6619,15 @@ english, catalog."
   (unless catalog (setq catalog erc-current-message-catalog))
   (let ((var (erc-make-message-variable-name catalog entry)))
     (if (boundp var)
-       (symbol-value var)
+        (symbol-value var)
       (when (boundp (erc-make-message-variable-name 'english entry))
-       (symbol-value (erc-make-message-variable-name 'english entry))))))
+        (symbol-value (erc-make-message-variable-name 'english entry))))))
 
 (defun erc-format-message (msg &rest args)
   "Format MSG according to ARGS.
 
 See also `format-spec'."
-  (when (eq (logand (length args) 1) 1)        ; oddp
+  (when (eq (logand (length args) 1) 1) ; oddp
     (error "Obscure usage of this function appeared"))
   (let ((entry (erc-retrieve-catalog-entry msg)))
     (when (not entry)
@@ -6593,8 +6688,8 @@ This function should be on `erc-kill-channel-hook'."
   (when (erc-server-process-alive)
     (let ((tgt (erc-default-target)))
       (erc-server-send (format "PART %s :%s" tgt
-                              (funcall erc-part-reason nil))
-                      nil tgt))))
+                               (funcall erc-part-reason nil))
+                       nil tgt))))
 
 ;;; Dealing with `erc-parsed'
 
@@ -6616,10 +6711,10 @@ This function should be on `erc-kill-channel-hook'."
 (defun erc-get-parsed-vector-nick (vect)
   "Return nickname in the parsed vector VECT."
   (let* ((untreated-nick (and vect (erc-response.sender vect)))
-        (maybe-nick (when untreated-nick
-                      (car (split-string untreated-nick "!")))))
+         (maybe-nick (when untreated-nick
+                       (car (split-string untreated-nick "!")))))
     (when (and (not (null maybe-nick))
-              (erc-is-valid-nick-p maybe-nick))
+               (erc-is-valid-nick-p maybe-nick))
       untreated-nick)))
 
 (defun erc-get-parsed-vector-type (vect)
@@ -6636,18 +6731,18 @@ This function should be on `erc-kill-channel-hook'."
 If ERC is already connected to HOST:PORT, simply /join CHANNEL.
 Otherwise, connect to HOST:PORT as USER and /join CHANNEL."
   (let ((server-buffer
-        (car (erc-buffer-filter
-              (lambda ()
-                (and (string-equal erc-session-server host)
-                     (= erc-session-port port)
-                     (erc-open-server-buffer-p)))))))
+         (car (erc-buffer-filter
+               (lambda ()
+                 (and (string-equal erc-session-server host)
+                      (= erc-session-port port)
+                      (erc-open-server-buffer-p)))))))
     (with-current-buffer (or server-buffer (current-buffer))
       (if (and server-buffer channel)
-         (erc-cmd-JOIN channel)
-       (erc-open host port (or user (erc-compute-nick)) (erc-compute-full-name)
-                 (not server-buffer) password nil channel
-                 (when server-buffer
-                   (get-buffer-process server-buffer)))))))
+          (erc-cmd-JOIN channel)
+        (erc-open host port (or user (erc-compute-nick)) (erc-compute-full-name)
+                  (not server-buffer) password nil channel
+                  (when server-buffer
+                    (get-buffer-process server-buffer)))))))
 
 (provide 'erc)
 
index ee6181000ba62e97ee441b8f2807617d2e7561cc..70c53a809b59baa17eb62c5421f76f2b920ba879 100644 (file)
@@ -188,7 +188,8 @@ The options are `begin', `after' or `end'."
     (add-hook 'eshell-post-command-hook
              (function
               (lambda ()
-                (setq eshell-smart-command-done t))) t t)
+                (setq eshell-smart-command-done t)))
+              t t)
 
     (unless (eq eshell-review-quick-commands t)
       (add-hook 'eshell-post-command-hook
@@ -200,8 +201,7 @@ The options are `begin', `after' or `end'."
   (unless eshell-currently-handling-window
     (let ((inhibit-point-motion-hooks t)
          (eshell-currently-handling-window t))
-      (save-selected-window
-       (select-window wind)
+      (with-selected-window wind
        (eshell-smart-redisplay)))))
 
 (defun eshell-refresh-windows (&optional frame)
@@ -212,12 +212,12 @@ The options are `begin', `after' or `end'."
       (lambda (wind)
        (with-current-buffer (window-buffer wind)
          (if eshell-mode
-             (let (window-scroll-functions)
+             (let (window-scroll-functions) ;;FIXME: Why?
                (eshell-smart-scroll-window wind (window-start))
                (setq affected t))))))
      0 frame)
     (if affected
-       (let (window-scroll-functions)
+       (let (window-scroll-functions) ;;FIXME: Why?
          (eshell-redisplay)))))
 
 (defun eshell-smart-display-setup ()
index 5286f280b393c82b9ff6471378d10aeb3ecbe317..3bb6e8f31c7c711b2f1a1c95ac0a1a9c0f63a657 100644 (file)
@@ -539,20 +539,17 @@ Unless optional argument INPLACE is non-nil, return a new string."
 
 (defmacro eshell-with-file-modes (modes &rest forms)
   "Evaluate, with file-modes set to MODES, the given FORMS."
-  `(let ((modes (default-file-modes)))
-     (set-default-file-modes ,modes)
-     (unwind-protect
-        (progn ,@forms)
-       (set-default-file-modes modes))))
+  (declare (obsolete with-file-modes "24.5"))
+  `(with-file-modes ,modes ,@forms))
 
 (defmacro eshell-with-private-file-modes (&rest forms)
   "Evaluate FORMS with private file modes set."
-  `(eshell-with-file-modes ,eshell-private-file-modes ,@forms))
+  `(with-file-modes ,eshell-private-file-modes ,@forms))
 
 (defsubst eshell-make-private-directory (dir &optional parents)
   "Make DIR with file-modes set to `eshell-private-directory-modes'."
-  (eshell-with-file-modes eshell-private-directory-modes
-                         (make-directory dir parents)))
+  (with-file-modes eshell-private-directory-modes
+    (make-directory dir parents)))
 
 (defsubst eshell-substring (string sublen)
   "Return the beginning of STRING, up to SUBLEN bytes."
index 5590483a54b6a5c71eb01408e87bfaf74aeaf6bc..af67266e67b34e3b7e6137b3d04bf6809059ca78 100644 (file)
 ;; @ 4nt
 ;; @ csh
 
-;;;_* Speeding up load time
-;;
-;; If you find that Eshell loads too slowly, there is something you
-;; can do to speed it up.
-;;
-;; Create a file, named /tmp/elc, containing this filelist:
-;;
-;;   esh-util.elc
-;;   eshell.elc
-;;   esh-module.elc
-;;   esh-var.elc
-;;   esh-proc.elc
-;;   esh-arg.elc
-;;   esh-io.elc
-;;   esh-ext.elc
-;;   esh-cmd.elc
-;;   esh-mode.elc
-;;   esh-opt.elc
-;;   em-alias.elc
-;;   em-banner.elc
-;;   em-basic.elc
-;;   em-cmpl.elc
-;;   em-dirs.elc
-;;   em-pred.elc
-;;   em-glob.elc
-;;   em-hist.elc
-;;   em-ls.elc
-;;   em-prompt.elc
-;;   em-rebind.elc
-;;   em-script.elc
-;;   em-smart.elc
-;;   em-term.elc
-;;   em-unix.elc
-;;   em-xtra.elc
-;;
-;; The order is very important.  Remove from the filelist any features
-;; you don't use.  These all begin with "em-".  If you don't use
-;; Eshell's key rebinding module, you can remove "em-rebind.elc" from
-;; the filelist.  The modules you are currently using are listed in
-;; `eshell-modules-list'.
-;;
-;; Now, concatenating all of the above mentioned .elc files, in that
-;; order, to another file.  Here is how to do this on UNIX:
-;;
-;;   cat `cat /tmp/elc` > tmp.elc ; mv tmp.elc eshell.elc
-;;
-;; Now your eshell.elc file contains all of the .elc files that make
-;; up Eshell, in the right load order.  When you next load Eshell, it
-;; will only have to read in this one file, which will greatly speed
-;; things up.
+;;; Code:
 
 (eval-when-compile
   (require 'cl-lib))
index f316245d165f9264adbef83204b18341f5af4fc5..d9239d9e1eb030b7f377ab238792958e87e6d746 100644 (file)
@@ -35,6 +35,26 @@ the terminal-initialization file to be loaded."
                 (string :tag "Name of directory with term files"))
   :group 'terminals)
 
+(defcustom term-file-aliases
+  '(("apollo" . "vt100")
+    ("vt102" . "vt100")
+    ("vt125" . "vt100")
+    ("vt201" . "vt200")
+    ("vt220" . "vt200")
+    ("vt240" . "vt200")
+    ("vt300" . "vt200")
+    ("vt320" . "vt200")
+    ("vt400" . "vt200")
+    ("vt420" . "vt200")
+    )
+  "Alist of terminal type aliases.
+Entries are of the form (TYPE . ALIAS), where both elements are strings.
+This means to treat a terminal of type TYPE as if it were of type ALIAS."
+  :type '(alist :key-type (string :tag "Terminal")
+               :value-type (string :tag "Alias"))
+  :group 'terminals
+  :version "24.5")
+
 (declare-function xw-defined-colors "term/common-win" (&optional frame))
 
 (defvar help-xref-stack-item)
@@ -129,15 +149,11 @@ REGISTRY, ALTERNATIVE1, ALTERNATIVE2, and etc."
   "Return a list of all defined faces."
   (mapcar #'car face-new-frame-defaults))
 
-(defun make-face (face &optional no-init-from-resources)
+(defun make-face (face)
   "Define a new face with name FACE, a symbol.
 Do not call this directly from Lisp code; use `defface' instead.
 
-If FACE is already known as a face, leave it unmodified.  Return FACE.
-
-NO-INIT-FROM-RESOURCES has been deprecated and is no longer used
-and will go away.  Handling of conditional X resources application
-has been pushed down to make-x-resource-internal itself."
+If FACE is already known as a face, leave it unmodified.  Return FACE."
   (interactive (list (read-from-minibuffer
                      "Make face: " nil nil t 'face-name-history)))
   (unless (facep face)
@@ -151,11 +167,6 @@ has been pushed down to make-x-resource-internal itself."
     (make-face-x-resource-internal face))
   face)
 
-;; Handling of whether to apply X resources or not, has been pushed down
-;; to make-face-x-resource-internal itself, thus the optional arg is no
-;; longer evaluated at all and going away.
-(set-advertised-calling-convention 'make-face '(face) "24.4")
-
 (defun make-empty-face (face)
   "Define a new, empty face with name FACE.
 Do not call this directly from Lisp code; use `defface' instead."
@@ -2054,17 +2065,16 @@ Calculate the face definitions using the face specs, custom theme
 settings, X resources, and `face-new-frame-defaults'.
 Finally, apply any relevant face attributes found amongst the
 frame parameters in PARAMETERS."
-  (let ((window-system-p (memq (window-system frame) '(x w32))))
-    ;; The `reverse' is so that `default' goes first.
-    (dolist (face (nreverse (face-list)))
-      (condition-case ()
-         (progn
-           ;; Initialize faces from face spec and custom theme.
-           (face-spec-recalc face frame)
-           ;; Apply attributes specified by face-new-frame-defaults
-           (internal-merge-in-global-face face frame))
-       ;; Don't let invalid specs prevent frame creation.
-       (error nil))))
+  ;; The `reverse' is so that `default' goes first.
+  (dolist (face (nreverse (face-list)))
+    (condition-case ()
+       (progn
+         ;; Initialize faces from face spec and custom theme.
+         (face-spec-recalc face frame)
+         ;; Apply attributes specified by face-new-frame-defaults
+         (internal-merge-in-global-face face frame))
+      ;; Don't let invalid specs prevent frame creation.
+      (error nil)))
 
   ;; Apply attributes specified by frame parameters.
   (let ((face-params '((foreground-color default :foreground)
@@ -2146,11 +2156,16 @@ This can be used to fine tune the `input-decode-map', for example.")
 The optional TYPE parameter may be used to override the autodetected
 terminal type to a different value.
 
+This consults `term-file-aliases' to map terminal types to their aliases.
+
 If optional argument RUN-HOOK is non-nil, then as a final step,
 this runs the hook `tty-setup-hook'.
 
 If you set `term-file-prefix' to nil, this function does nothing."
   (setq type (or type (tty-type frame)))
+  (let ((alias (tty-find-type
+               (lambda (typ) (assoc typ term-file-aliases)) type)))
+    (if alias (setq type (cdr (assoc alias term-file-aliases)))))
   ;; Load library for our terminal type.
   ;; User init file can set term-file-prefix to nil to prevent this.
   (with-selected-frame frame
index 119e0ad30789aab7f774ac5986a0c6ecbf453214..95a651bbde6c8feaf19a310acf38d6126a82b6d5 100644 (file)
@@ -163,6 +163,12 @@ schemes (e.g. \"ftp\"); in that case, only convert those URLs."
   :group 'ffap
   :version "24.3")
 
+(defcustom ffap-lax-url nil
+  "If non-nil, allow lax URL matching."
+  :type 'boolean
+  :group 'ffap
+  :version "24.5")
+
 (defcustom ffap-ftp-default-user "anonymous"
   "User name in FTP file names generated by `ffap-host-to-path'.
 Note this name may be omitted if it equals the default
@@ -1096,7 +1102,7 @@ Assumes the buffer has not changed."
             (w3-view-this-url t))
        (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
              (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix))
-         (thing-at-point-url-at-point t
+         (thing-at-point-url-at-point ffap-lax-url
                                       (if (use-region-p)
                                           (cons (region-beginning)
                                                 (region-end))))))))
@@ -1253,7 +1259,8 @@ which may actually result in an URL rather than a filename."
                         (not (ffap-file-exists-string dir))
                         (not (equal dir (setq dir (file-name-directory
                                                    (directory-file-name dir)))))))
-            (ffap-file-exists-string dir)))
+            (and (not (string= dir "/"))
+                (ffap-file-exists-string dir))))
         )
       (set-match-data data))))
 \f
index 6c3b8f4fa4dc10216413ab0dbd96665eeb7d4a8e..9272e98384fc1248741de47799156f2cfb3d9e90 100644 (file)
@@ -559,14 +559,6 @@ A value of nil means ignore them; anything else means query."
                 (other :tag "Query" other))
   :group 'find-file)
 
-;; Avoid losing in versions where CLASH_DETECTION is disabled.
-(or (fboundp 'lock-buffer)
-    (defalias 'lock-buffer 'ignore))
-(or (fboundp 'unlock-buffer)
-    (defalias 'unlock-buffer 'ignore))
-(or (fboundp 'file-locked-p)
-    (defalias 'file-locked-p 'ignore))
-
 (defcustom view-read-only nil
   "Non-nil means buffers visiting files read-only do so in view mode.
 In fact, this means that all read-only buffers normally have
@@ -891,7 +883,7 @@ which we're looking."
   ;;
   ;; Represent /home/luser/foo as ~/foo so that we don't try to look for
   ;; `name' in /home or in /.
-  (setq file (abbreviate-file-name file))
+  (setq file (abbreviate-file-name (expand-file-name file)))
   (let ((root nil)
         ;; `user' is not initialized outside the loop because
         ;; `file' may not exist, so we may have to walk up part of the
@@ -949,14 +941,10 @@ directory if it does not exist."
             (if (file-directory-p user-emacs-directory)
                 (or (file-accessible-directory-p user-emacs-directory)
                     (setq errtype "access"))
-              (let ((umask (default-file-modes)))
-                (unwind-protect
-                    (progn
-                      (set-default-file-modes ?\700)
-                      (condition-case nil
-                          (make-directory user-emacs-directory)
-                        (error (setq errtype "create"))))
-                  (set-default-file-modes umask))))
+              (with-file-modes ?\700
+                (condition-case nil
+                    (make-directory user-emacs-directory)
+                  (error (setq errtype "create")))))
             (when (and errtype
                        user-emacs-directory-warning
                        (not (get 'user-emacs-directory-warning 'this-session)))
@@ -1281,36 +1269,31 @@ You can then use `write-region' to write new data into the file.
 If DIR-FLAG is non-nil, create a new empty directory instead of a file.
 
 If SUFFIX is non-nil, add that at the end of the file name."
-  (let ((umask (default-file-modes))
-       file)
-    (unwind-protect
-       (progn
-         ;; Create temp files with strict access rights.  It's easy to
-         ;; loosen them later, whereas it's impossible to close the
-         ;; time-window of loose permissions otherwise.
-         (set-default-file-modes ?\700)
-         (while (condition-case ()
-                    (progn
-                      (setq file
-                            (make-temp-name
-                              (if (zerop (length prefix))
-                                  (file-name-as-directory
-                                   temporary-file-directory)
-                                (expand-file-name prefix
-                                                  temporary-file-directory))))
-                      (if suffix
-                          (setq file (concat file suffix)))
-                      (if dir-flag
-                          (make-directory file)
-                        (write-region "" nil file nil 'silent nil 'excl))
-                      nil)
-                  (file-already-exists t))
-           ;; the file was somehow created by someone else between
-           ;; `make-temp-name' and `write-region', let's try again.
-           nil)
-         file)
-      ;; Reset the umask.
-      (set-default-file-modes umask))))
+  ;; Create temp files with strict access rights.  It's easy to
+  ;; loosen them later, whereas it's impossible to close the
+  ;; time-window of loose permissions otherwise.
+  (with-file-modes ?\700
+    (let (file)
+      (while (condition-case ()
+                (progn
+                  (setq file
+                        (make-temp-name
+                         (if (zerop (length prefix))
+                             (file-name-as-directory
+                              temporary-file-directory)
+                           (expand-file-name prefix
+                                             temporary-file-directory))))
+                  (if suffix
+                      (setq file (concat file suffix)))
+                  (if dir-flag
+                      (make-directory file)
+                    (write-region "" nil file nil 'silent nil 'excl))
+                  nil)
+              (file-already-exists t))
+       ;; the file was somehow created by someone else between
+       ;; `make-temp-name' and `write-region', let's try again.
+       nil)
+      file)))
 
 (defun recode-file-name (file coding new-coding &optional ok-if-already-exists)
   "Change the encoding of FILE's name from CODING to NEW-CODING.
@@ -1399,14 +1382,16 @@ called additional times).
 This macro actually adds an auxiliary function that calls FUN,
 rather than FUN itself, to `minibuffer-setup-hook'."
   (declare (indent 1) (debug t))
-  (let ((hook (make-symbol "setup-hook")))
-    `(let (,hook)
+  (let ((hook (make-symbol "setup-hook"))
+        (funsym (make-symbol "fun")))
+    `(let ((,funsym ,fun)
+           ,hook)
        (setq ,hook
             (lambda ()
               ;; Clear out this hook so it does not interfere
               ;; with any recursive minibuffer usage.
               (remove-hook 'minibuffer-setup-hook ,hook)
-              (funcall ,fun)))
+              (funcall ,funsym)))
        (unwind-protect
           (progn
             (add-hook 'minibuffer-setup-hook ,hook)
@@ -1801,6 +1786,14 @@ When nil, never request confirmation."
   :version "22.1"
   :type '(choice integer (const :tag "Never request confirmation" nil)))
 
+(defcustom out-of-memory-warning-percentage 50
+  "Warn if file size exceeds this percentage of available free memory.
+When nil, never issue warning."
+  :group 'files
+  :group 'find-file
+  :version "24.4"
+  :type '(choice integer (const :tag "Never issue warning" nil)))
+
 (defun abort-if-file-too-large (size op-type filename)
   "If file SIZE larger than `large-file-warning-threshold', allow user to abort.
 OP-TYPE specifies the file operation being performed (for message to user)."
@@ -1811,6 +1804,25 @@ OP-TYPE specifies the file operation being performed (for message to user)."
                                    (file-size-human-readable size) op-type))))
     (error "Aborted")))
 
+(defun warn-maybe-out-of-memory (size)
+  "Warn if an attempt to open file of SIZE bytes may run out of memory."
+  (when (and (numberp size) (not (zerop size))
+            (integerp out-of-memory-warning-percentage))
+    (let ((meminfo (memory-info)))
+      (when (consp meminfo)
+       (let ((total-free-memory (float (+ (nth 1 meminfo) (nth 3 meminfo)))))
+         (when (> (/ size 1024)
+                  (/ (* total-free-memory out-of-memory-warning-percentage)
+                     100.0))
+           (warn
+            "You are trying to open a file whose size (%s)
+exceeds the %S%% of currently available free memory (%s).
+If that fails, try to open it with `find-file-literally'
+\(but note that some characters might be displayed incorrectly)."
+            (file-size-human-readable size)
+            out-of-memory-warning-percentage
+            (file-size-human-readable (* total-free-memory 1024)))))))))
+
 (defun find-file-noselect (filename &optional nowarn rawfile wildcards)
   "Read file FILENAME into a buffer and return the buffer.
 If a buffer exists visiting FILENAME, return that one, but
@@ -1863,7 +1875,8 @@ the various files."
                  (setq buf other))))
        ;; Check to see if the file looks uncommonly large.
        (when (not (or buf nowarn))
-         (abort-if-file-too-large (nth 7 attributes) "open" filename))
+         (abort-if-file-too-large (nth 7 attributes) "open" filename)
+         (warn-maybe-out-of-memory (nth 7 attributes)))
        (if buf
            ;; We are using an existing buffer.
            (let (nonexistent)
@@ -2091,9 +2104,9 @@ This function ensures that none of these modifications will take place."
 This function is meant for the user to run interactively.
 Don't call it from programs!  Use `insert-file-contents-literally' instead.
 \(Its calling sequence is different; see its documentation)."
+  (declare (interactive-only insert-file-contents-literally))
   (interactive "*fInsert file literally: ")
   (insert-file-1 filename #'insert-file-contents-literally))
-(put 'insert-file-literally 'interactive-only 'insert-file-contents-literally)
 
 (defvar find-file-literally nil
   "Non-nil if this buffer was made by `find-file-literally' or equivalent.
@@ -2457,7 +2470,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode)
      ("/\\.\\(?:enigma\\|gltron\\|gtk\\|hxplayer\\|net\\|neverball\\|qt/.+\\|realplayer\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode)
      ("/\\.\\(?:gdbtkinit\\|grip\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-mode)
      ("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode)
-     ("/X11.+app-defaults/" . conf-xdefaults-mode)
+     ("/X11.+app-defaults/\\|\\.ad\\'" . conf-xdefaults-mode)
      ("/X11.+locale/.+/Compose\\'" . conf-colon-mode)
      ;; this contains everything twice, with space and with colon :-(
      ("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode)
@@ -2520,6 +2533,7 @@ and `magic-mode-alist', which determines modes based on file contents.")
      ("[acjkwz]sh" . sh-mode)
      ("r?bash2?" . sh-mode)
      ("dash" . sh-mode)
+     ("mksh" . sh-mode)
      ("\\(dt\\|pd\\|w\\)ksh" . sh-mode)
      ("es" . sh-mode)
      ("i?tcsh" . sh-mode)
@@ -3675,10 +3689,9 @@ of no valid cache entry."
 ;;;     (setq locals-file nil))
     ;; Find the best cached value in `dir-locals-directory-cache'.
     (dolist (elt dir-locals-directory-cache)
-      (when (and (eq t (compare-strings file nil (length (car elt))
-                                       (car elt) nil nil
-                                       (memq system-type
-                                             '(windows-nt cygwin ms-dos))))
+      (when (and (string-prefix-p (car elt) file
+                                 (memq system-type
+                                       '(windows-nt cygwin ms-dos)))
                 (> (length (car elt)) (length (car dir-elt))))
        (setq dir-elt elt)))
     (if (and dir-elt
@@ -4081,31 +4094,26 @@ BACKUPNAME is the backup file name, which is the old file renamed."
            (file-error nil))))))
 
 (defun backup-buffer-copy (from-name to-name modes extended-attributes)
-  (let ((umask (default-file-modes)))
-    (unwind-protect
-       (progn
-         ;; Create temp files with strict access rights.  It's easy to
-         ;; loosen them later, whereas it's impossible to close the
-         ;; time-window of loose permissions otherwise.
-         (set-default-file-modes ?\700)
-         (when (condition-case nil
-                   ;; Try to overwrite old backup first.
-                   (copy-file from-name to-name t t t)
-                 (error t))
-           (while (condition-case nil
-                      (progn
-                        (when (file-exists-p to-name)
-                          (delete-file to-name))
-                        (copy-file from-name to-name nil t t)
-                        nil)
-                    (file-already-exists t))
-             ;; The file was somehow created by someone else between
-             ;; `delete-file' and `copy-file', so let's try again.
-             ;; rms says "I think there is also a possible race
-             ;; condition for making backup files" (emacs-devel 20070821).
-             nil)))
-      ;; Reset the umask.
-      (set-default-file-modes umask)))
+  ;; Create temp files with strict access rights.  It's easy to
+  ;; loosen them later, whereas it's impossible to close the
+  ;; time-window of loose permissions otherwise.
+  (with-file-modes ?\700
+    (when (condition-case nil
+             ;; Try to overwrite old backup first.
+             (copy-file from-name to-name t t t)
+           (error t))
+      (while (condition-case nil
+                (progn
+                  (when (file-exists-p to-name)
+                    (delete-file to-name))
+                  (copy-file from-name to-name nil t t)
+                  nil)
+              (file-already-exists t))
+       ;; The file was somehow created by someone else between
+       ;; `delete-file' and `copy-file', so let's try again.
+       ;; rms says "I think there is also a possible race
+       ;; condition for making backup files" (emacs-devel 20070821).
+       nil)))
   ;; If set-file-extended-attributes fails, fall back on set-file-modes.
   (unless (and extended-attributes
               (with-demoted-errors
@@ -4528,18 +4536,14 @@ on a DOS/Windows machine, it returns FILENAME in expanded form."
         (let ((ancestor ".")
              (filename-dir (file-name-as-directory filename)))
           (while (not
-                 (or
-                  (eq t (compare-strings filename-dir nil (length directory)
-                                         directory nil nil fold-case))
-                  (eq t (compare-strings filename nil (length directory)
-                                         directory nil nil fold-case))))
+                 (or (string-prefix-p directory filename-dir fold-case)
+                     (string-prefix-p directory filename fold-case)))
             (setq directory (file-name-directory (substring directory 0 -1))
                  ancestor (if (equal ancestor ".")
                               ".."
                             (concat "../" ancestor))))
           ;; Now ancestor is empty, or .., or ../.., etc.
-          (if (eq t (compare-strings filename nil (length directory)
-                                    directory nil nil fold-case))
+          (if (string-prefix-p directory filename fold-case)
              ;; We matched within FILENAME's directory part.
              ;; Add the rest of FILENAME onto ANCESTOR.
              (let ((rest (substring filename (length directory))))
@@ -5006,6 +5010,7 @@ With prefix ARG, mark buffer as modified, so \\[save-buffer] will save.
 
 It is not a good idea to use this function in Lisp programs, because it
 prints a message in the minibuffer.  Instead, use `set-buffer-modified-p'."
+  (declare (interactive-only set-buffer-modified-p))
   (interactive "P")
   (message (if arg "Modification-flag set"
               "Modification-flag cleared"))
@@ -5026,9 +5031,9 @@ Set mark after the inserted text.
 This function is meant for the user to run interactively.
 Don't call it from programs!  Use `insert-file-contents' instead.
 \(Its calling sequence is different; see its documentation)."
+  (declare (interactive-only insert-file-contents))
   (interactive "*fInsert file: ")
   (insert-file-1 filename #'insert-file-contents))
-(put 'insert-file 'interactive-only 'insert-file-contents)
 
 (defun append-to-file (start end filename)
   "Append the contents of the region to the end of file FILENAME.
@@ -5997,10 +6002,9 @@ default directory.  However, if FULL is non-nil, they are absolute."
                             (file-expand-wildcards (directory-file-name dirpart)))
                   (list dirpart)))
           contents)
-      (while dirs
-       (when (or (null (car dirs))     ; Possible if DIRPART is not wild.
-                 (and (file-directory-p (directory-file-name (car dirs)))
-                      (file-readable-p (car dirs))))
+      (dolist (dir dirs)
+       (when (or (null dir)    ; Possible if DIRPART is not wild.
+                 (file-accessible-directory-p dir))
          (let ((this-dir-contents
                 ;; Filter out "." and ".."
                 (delq nil
@@ -6008,16 +6012,15 @@ default directory.  However, if FULL is non-nil, they are absolute."
                                   (unless (string-match "\\`\\.\\.?\\'"
                                                         (file-name-nondirectory name))
                                     name))
-                              (directory-files (or (car dirs) ".") full
+                              (directory-files (or dir ".") full
                                                (wildcard-to-regexp nondir))))))
            (setq contents
                  (nconc
-                  (if (and (car dirs) (not full))
-                      (mapcar (function (lambda (name) (concat (car dirs) name)))
+                  (if (and dir (not full))
+                      (mapcar #'(lambda (name) (concat dir name))
                               this-dir-contents)
                     this-dir-contents)
-                  contents))))
-       (setq dirs (cdr dirs)))
+                  contents)))))
       contents)))
 
 ;; Let Tramp know that `file-expand-wildcards' does not need an advice.
@@ -6875,15 +6878,11 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
                      trash-info-dir filename))
 
           ;; Ensure that the trash directory exists; otherwise, create it.
-          (let ((saved-default-file-modes (default-file-modes)))
-            (unwind-protect
-                (progn
-                  (set-default-file-modes #o700)
-                  (unless (file-exists-p trash-files-dir)
-                    (make-directory trash-files-dir t))
-                  (unless (file-exists-p trash-info-dir)
-                    (make-directory trash-info-dir t)))
-              (set-default-file-modes saved-default-file-modes)))
+          (with-file-modes #o700
+            (unless (file-exists-p trash-files-dir)
+              (make-directory trash-files-dir t))
+            (unless (file-exists-p trash-info-dir)
+              (make-directory trash-info-dir t)))
 
           ;; Try to move to trash with .trashinfo undo information
           (save-excursion
index 82e97c4da62124028aeea00e4d0ad1eb7251e8dc..fe37c24579b4b060d4b523b44c610a944c7ab583 100644 (file)
@@ -601,14 +601,14 @@ This is normally set via `font-lock-defaults'.")
 Currently, valid mode names are `fast-lock-mode', `jit-lock-mode' and
 `lazy-lock-mode'.  This is normally set via `font-lock-defaults'.")
 
-(defvar font-lock-multiline nil
+(defvar-local font-lock-multiline nil
   "Whether font-lock should cater to multiline keywords.
 If nil, don't try to handle multiline patterns.
 If t, always handle multiline patterns.
 If `undecided', don't try to handle multiline patterns until you see one.
 Major/minor modes can set this variable if they know which option applies.")
 
-(defvar font-lock-fontified nil)       ; Whether we have fontified the buffer.
+(defvar-local font-lock-fontified nil) ; Whether we have fontified the buffer.
 \f
 ;; Font Lock mode.
 
@@ -626,6 +626,8 @@ Major/minor modes can set this variable if they know which option applies.")
   ;; Shut up the byte compiler.
   (defvar font-lock-face-attributes))  ; Obsolete but respected if set.
 
+(defvar-local font-lock-set-defaults nil) ; Whether we have set up defaults.
+
 (defun font-lock-specified-p (mode)
   "Return non-nil if the current buffer is ready for fontification.
 The MODE argument, if non-nil, means Font Lock mode is about to
@@ -634,7 +636,6 @@ be enabled."
       (and (boundp 'font-lock-keywords)
           font-lock-keywords)
       (and mode
-          (boundp 'font-lock-set-defaults)
           font-lock-set-defaults
           font-lock-major-mode
           (not (eq font-lock-major-mode major-mode)))))
@@ -921,6 +922,14 @@ The value of this variable is used when Font Lock mode is turned on."
      ;; Prepare for jit-lock
      (remove-hook 'after-change-functions
                   'font-lock-after-change-function t)
+     (set (make-local-variable 'font-lock-flush-function)
+          'jit-lock-refontify)
+     (set (make-local-variable 'font-lock-ensure-function)
+          'jit-lock-fontify-now)
+     ;; Prevent font-lock-fontify-buffer from fontifying eagerly the whole
+     ;; buffer.  This is important for things like CWarn mode which
+     ;; adds/removes a few keywords and does a refontify (which takes ages on
+     ;; large files).
      (set (make-local-variable 'font-lock-fontify-buffer-function)
           'jit-lock-refontify)
      ;; Don't fontify eagerly (and don't abort if the buffer is large).
@@ -1025,12 +1034,23 @@ This function should preserve the match-data.
 The region it returns may start or end in the middle of a line.")
 (make-variable-buffer-local 'font-lock-extend-after-change-region-function)
 
-(defun font-lock-fontify-buffer ()
+(defun font-lock-fontify-buffer (&optional interactively)
   "Fontify the current buffer the way the function `font-lock-mode' would."
-  (interactive)
+  (declare
+   ;; When called from Lisp, this function is a big mess.  The caller usually
+   ;; expects one of the following behaviors:
+   ;; - refresh the highlighting (because the font-lock-keywords have been
+   ;;   changed).
+   ;; - apply font-lock highlighting even if font-lock-mode is not enabled.
+   ;; - reset the highlighting rules because font-lock-defaults
+   ;;   has been changed (and then rehighlight everything).
+   ;; Of course, this function doesn't do all of the above in all situations
+   ;; (e.g. depending on whether jit-lock is in use) and it can't guess what
+   ;; the caller wants.
+   (interactive-only "use font-lock-ensure or font-lock-flush instead."))
+  (interactive "p")
   (font-lock-set-defaults)
-  (let ((font-lock-verbose (or font-lock-verbose
-                              (called-interactively-p 'interactive))))
+  (let ((font-lock-verbose (or font-lock-verbose interactively)))
     (funcall font-lock-fontify-buffer-function)))
 
 (defun font-lock-unfontify-buffer ()
@@ -1049,6 +1069,31 @@ This works by calling `font-lock-unfontify-region-function'."
   (save-buffer-state
     (funcall font-lock-unfontify-region-function beg end)))
 
+(defvar font-lock-flush-function #'font-lock-after-change-function
+  "Function to use to mark a region for refontification.
+Called with two arguments BEG and END.")
+
+(defun font-lock-flush (&optional beg end)
+  "Declare the region BEG...END's fontification as out-of-date.
+If the region is not specified, it defaults to the whole buffer."
+  (and font-lock-mode
+       font-lock-fontified
+       (funcall font-lock-flush-function
+                (or beg (point-min)) (or end (point-max)))))
+
+(defvar font-lock-ensure-function
+  (lambda (_beg _end)
+    (unless font-lock-fontified (font-lock-default-fontify-buffer)))
+  "Function to make sure a region has been fontified.
+Called with two arguments BEG and END.")
+
+(defun font-lock-ensure (&optional beg end)
+  "Make sure the region BEG...END has been fontified.
+If the region is not specified, it defaults to the whole buffer."
+  (font-lock-set-defaults)
+  (funcall font-lock-ensure-function
+           (or beg (point-min)) (or end (point-max))))
+
 (defun font-lock-default-fontify-buffer ()
   "Fontify the whole buffer using `font-lock-fontify-region-function'."
   (let ((verbose (if (numberp font-lock-verbose)
@@ -1059,7 +1104,7 @@ This works by calling `font-lock-unfontify-region-function'."
          (format "Fontifying %s..." (buffer-name)))
       ;; Make sure we fontify etc. in the whole buffer.
       (save-restriction
-       (widen)
+        (unless font-lock-dont-widen (widen))
        (condition-case nil
            (save-excursion
              (save-match-data
@@ -1201,7 +1246,7 @@ This function is the default `font-lock-unfontify-region-function'."
              '(face font-lock-multiline)))))
 
 ;; Called when any modification is made to buffer text.
-(defun font-lock-after-change-function (beg end old-len)
+(defun font-lock-after-change-function (beg end &optional old-len)
   (save-excursion
     (let ((inhibit-point-motion-hooks t)
           (inhibit-quit t)
@@ -1786,8 +1831,6 @@ A LEVEL of nil is equal to a LEVEL of 0, a LEVEL of t is equal to
        (t
         (car keywords))))
 
-(defvar font-lock-set-defaults nil)    ; Whether we have set up defaults.
-
 (defun font-lock-refresh-defaults ()
   "Restart fontification in current buffer after recomputing from defaults.
 Recompute fontification variables using `font-lock-defaults' and
@@ -1815,9 +1858,7 @@ Sets various variables using `font-lock-defaults' and
   (unless (and font-lock-set-defaults
               (eq font-lock-major-mode major-mode))
     (setq font-lock-major-mode major-mode)
-    (set (make-local-variable 'font-lock-set-defaults) t)
-    (make-local-variable 'font-lock-fontified)
-    (make-local-variable 'font-lock-multiline)
+    (setq font-lock-set-defaults t)
     (let* ((defaults font-lock-defaults)
           (keywords
            (font-lock-choose-keywords (nth 0 defaults)
@@ -1825,7 +1866,6 @@ Sets various variables using `font-lock-defaults' and
           (local (cdr (assq major-mode font-lock-keywords-alist)))
           (removed-keywords
            (cdr-safe (assq major-mode font-lock-removed-keywords-alist))))
-      (set (make-local-variable 'font-lock-defaults) defaults)
       ;; Syntactic fontification?
       (if (nth 1 defaults)
           (set (make-local-variable 'font-lock-keywords-only) t)
@@ -1868,7 +1908,8 @@ Sets various variables using `font-lock-defaults' and
       ;; Now compile the keywords.
       (unless (eq (car font-lock-keywords) t)
        (setq font-lock-keywords
-              (font-lock-compile-keywords font-lock-keywords))))))
+              (font-lock-compile-keywords font-lock-keywords))))
+    (font-lock-flush)))
 \f
 ;;; Color etc. support.
 
index 5e9b535100588240995c16e42f42102fd8ef209c..d3e84d21024db696c6336d6e4c8063c1d67e6a6e 100644 (file)
@@ -1,7 +1,6 @@
 ;;; frame.el --- multi-frame management independent of window systems
 
-;; Copyright (C) 1993-1994, 1996-1997, 2000-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1993-1994, 1996-1997, 2000-2014 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
@@ -149,12 +148,6 @@ This function runs the hook `focus-out-hook'."
 ;; 3) Once the init file is done, we apply any newly set parameters
 ;; in initial-frame-alist to the frame.
 
-;; These are now called explicitly at the proper times,
-;; since that is easier to understand.
-;; Actually using hooks within Emacs is bad for future maintenance. --rms.
-;; (add-hook 'before-init-hook 'frame-initialize)
-;; (add-hook 'window-setup-hook 'frame-notice-user-settings)
-
 ;; If we create the initial frame, this is it.
 (defvar frame-initial-frame nil)
 
@@ -263,60 +256,43 @@ there (in decreasing order of priority)."
     ;; If the initial frame is still around, apply initial-frame-alist
     ;; and default-frame-alist to it.
     (when (frame-live-p frame-initial-frame)
-
       ;; When tool-bar has been switched off, correct the frame size
       ;; by the lines added in x-create-frame for the tool-bar and
       ;; switch `tool-bar-mode' off.
       (when (display-graphic-p)
-       (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist)
-                                 (assq 'tool-bar-lines window-system-frame-alist)
-                                 (assq 'tool-bar-lines default-frame-alist))))
-         (when (and tool-bar-originally-present
-                     (or (null tool-bar-lines)
-                         (null (cdr tool-bar-lines))
-                         (eq 0 (cdr tool-bar-lines))))
-           (let* ((char-height (frame-char-height frame-initial-frame))
-                  (image-height tool-bar-images-pixel-height)
-                  (margin (cond ((and (consp tool-bar-button-margin)
-                                      (integerp (cdr tool-bar-button-margin))
-                                      (> tool-bar-button-margin 0))
-                                 (cdr tool-bar-button-margin))
-                                ((and (integerp tool-bar-button-margin)
-                                      (> tool-bar-button-margin 0))
-                                 tool-bar-button-margin)
-                                (t 0)))
-                  (relief (if (and (integerp tool-bar-button-relief)
-                                   (> tool-bar-button-relief 0))
-                              tool-bar-button-relief 3))
-                  (lines (/ (+ image-height
-                               (* 2 margin)
-                               (* 2 relief)
-                               (1- char-height))
-                            char-height))
-                  (height (frame-parameter frame-initial-frame 'height))
-                  (newparms (list (cons 'height (- height lines))))
-                  (initial-top (cdr (assq 'top
-                                          frame-initial-geometry-arguments)))
+       (let ((tool-bar-lines
+              (or (assq 'tool-bar-lines initial-frame-alist)
+                  (assq 'tool-bar-lines window-system-frame-alist)
+                  (assq 'tool-bar-lines default-frame-alist))))
+         ;; Shrink frame by its initial tool bar height iff either zero
+         ;; tool bar lines have been requested in one of the frame's
+         ;; alists or tool bar mode has been turned off explicitly in
+         ;; the user's init file.
+         (when (and tool-bar-lines
+                    (> frame-initial-frame-tool-bar-height 0)
+                    (or (not tool-bar-mode)
+                        (null (cdr tool-bar-lines))
+                        (eq 0 (cdr tool-bar-lines))))
+           (set-frame-height
+            frame-initial-frame (- (frame-text-height frame-initial-frame)
+                                   frame-initial-frame-tool-bar-height)
+            nil t)
+           (let* ((initial-top
+                   (cdr (assq 'top frame-initial-geometry-arguments)))
                   (top (frame-parameter frame-initial-frame 'top)))
              (when (and (consp initial-top) (eq '- (car initial-top)))
                (let ((adjusted-top
-                      (cond ((and (consp top)
-                                  (eq '+ (car top)))
-                             (list '+
-                                   (+ (cadr top)
-                                      (* lines char-height))))
-                            ((and (consp top)
-                                  (eq '- (car top)))
-                             (list '-
-                                   (- (cadr top)
-                                      (* lines char-height))))
-                            (t (+ top (* lines char-height))))))
-                 (setq newparms
-                       (append newparms
-                               `((top . ,adjusted-top))
-                               nil))))
-             (modify-frame-parameters frame-initial-frame newparms)
-             (tool-bar-mode -1)))))
+                      (cond
+                       ((and (consp top) (eq '+ (car top)))
+                        (list '+ (+ (cadr top)
+                                    frame-initial-frame-tool-bar-height)))
+                       ((and (consp top) (eq '- (car top)))
+                        (list '- (- (cadr top)
+                                    frame-initial-frame-tool-bar-height)))
+                       (t (+ top frame-initial-frame-tool-bar-height)))))
+                 (modify-frame-parameters
+                  frame-initial-frame '((top . adjusted-top))))))
+           (tool-bar-mode -1))))
 
       ;; The initial frame we create above always has a minibuffer.
       ;; If the user wants to remove it, or make it a minibuffer-only
index 9a4745198132d1726219d3a20861a89e5aac6860..b943d47e7bfa04cd87a596d02865e9d30c040419 100644 (file)
@@ -1265,6 +1265,17 @@ Called from `jump-to-register'.  Internal use only."
        (set-frame-selected-window frame window)
        (with-current-buffer buffer (goto-char (aref data 2)))))))
 
+;;;###autoload
+(defun frameset--print-register (data)
+  "Print basic info about frameset stored in DATA.
+Called from `list-registers' and `view-register'.  Internal use only."
+  (let* ((fs (aref data 0))
+        (ns (length (frameset-states fs))))
+    (princ (format "a frameset (%d frame%s, saved on %s)."
+                  ns
+                  (if (= 1 ns) "" "s")
+                  (format-time-string "%c" (frameset-timestamp fs))))))
+
 ;;;###autoload
 (defun frameset-to-register (register)
   "Store the current frameset in register REGISTER.
@@ -1282,7 +1293,7 @@ Interactively, reads the register using `register-read-with-preview'."
                         ;; in the current buffer, so record that separately.
                         (frameset-frame-id nil)
                         (point-marker))
-                :print-func (lambda (_data) (princ "a frameset."))
+                :print-func #'frameset--print-register
                 :jump-func #'frameset--jump-to-register)))
 
 (provide 'frameset)
index 993bbbb2475a8227e61244fced3b096fccaa5623..f55e04f02e62cc230b8e838870713b87d3d2eddf 100644 (file)
+2014-07-22  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-utils.el (gnus-recursive-directory-files):
+       Unify hard or symbolic links (bug#18063).
+
+2013-07-17  Albert Krewinkel  <albert@zeitkraut.de>
+
+       * gnus-msg.el (gnus-configure-posting-style):
+       Allow string replacements in values when matching against a header.
+
+2014-07-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-start.el (gnus-dribble-read-file): Don't stop the auto-saving of
+       the dribble buffer even when it is shrunk a lot.
+       <http://thread.gmane.org/gmane.emacs.gnus.user/16923>
+
 2014-06-26  Glenn Morris  <rgm@gnu.org>
 
        * mm-util.el (help-function-arglist): Remove outdated declaration.
 
-2014-06-22  Andreas Schwab  <schwab@linux-m68k.org>
+2014-06-24  Andreas Schwab  <schwab@linux-m68k.org>
 
        * html2text.el (html2text-get-attr): Rewrite to handle spaces in quoted
        attribute values.  (Bug#17834)
 
-2014-05-28  Andreas Schwab  <schwab@linux-m68k.org>
+2013-06-22  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * gnus-sum.el (gnus-summary-edit-article-done):
+       Prefer point-marker to copy-marker of point.
+
+2014-06-05  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-edit-part): Don't modifiy markers.
+       (gnus-article-read-summary-keys):
+       Don't bug out when there is no article in the summary buffer.
+       (gnus-mime-buttonize-attachments-in-header):
+       Improve criterion that finds parts to display.
+
+       * gnus-art.el (gnus-mm-display-part):
+       * mm-decode.el (mm-shr):
+       * mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text)
+       (mm-insert-inline): Revert last changes.
+
+2014-06-05  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mm-display-part):
+       * mm-decode.el (mm-shr):
+       * mm-view.el (mm-inline-text-html-render-with-w3m, mm-inline-text)
+       (mm-insert-inline): Set insertion type of end-marker, not only
+       start-marker, of undisplayer so as to stay after inserted text.
+
+2014-06-02  Andreas Schwab  <schwab@linux-m68k.org>
 
        * html2text.el (html2text-get-attr): Fix typo when splitting value from
        attribute. (Bug#17613)
 
-2014-05-06  Glenn Morris  <rgm@gnu.org>
+2014-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mm-view.el (mm-display-inline-fontify): Use font-lock-ensure.
+       * gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush.
+
+2014-05-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part):
+       Don't delete next part button; keep spacing between buttons.
+
+2014-05-14  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part):
+       Work for the last MIME part in an article.
+       (gnus-mime-display-single): Suppress excessive newlines between parts.
+
+       * mm-uu.el (mm-uu-dissect): Assume that separators may be accompanied
+       by leading or trailing newline.
+
+2014-05-09  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mm-display-part): Don't put article out of sight
+       while prompting a user for a file name, etc.
+       (gnus-mime-display-single): Display part with a common appearance no
+       matter whether MIME button is omitted or not; don't add duplicate entry
+       to gnus-article-mime-handle-alist.
+       (gnus-mime-buttonize-attachments-in-header): Use copied buttons.
+
+2014-05-08  Adam Sjøgren  <asjo@koldfront.dk>
+
+       * mml2015.el (mml2015-display-key-image): New variable.
+
+2014-05-08  Glenn Morris  <rgm@gnu.org>
 
        * gnus-fun.el (gnus-grab-cam-face):
        Do not use predictable temp-file name.  (http://bugs.debian.org/747100)
        This is CVE-2014-3421.
 
-2014-05-01  Glenn Morris  <rgm@gnu.org>
+2014-05-04  Glenn Morris  <rgm@gnu.org>
 
        * gnus-registry.el (gnus-registry-install-p): Doc fix.
 
+2014-05-02  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mime-inline-part): Redisplay a button so as to show
+       the displaying state of a part.
+       (gnus-mm-display-part): Don't insert a newline in the beginning of
+       a part like gnus-mime-inline-part doesn't; work for XEmacs.
+
+       * mm-decode.el (mm-display-part): Don't insert a newline in the top.
+       (mm-shr): Make undisplayer unbreakable.
+
+       * mm-view.el (mm-inline-image-emacs, mm-inline-image-xemacs):
+       Don't insert excessive newline.
+       (mm-inline-text-html-render-with-w3m, mm-inline-text)
+       (mm-insert-inline): Make undisplayer unbreakable.
+
+2014-05-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mm-display-part):
+       Highlight header attachment buttons.
+
+2014-04-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mm-display-part): Don't move point while toggling
+       a part; redisplay a button (enbugged in 2014-03-23).
+
+2014-04-27  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * auth-source.el (auth-source-search, auth-source-search-backends):
+       Treat :max 0 as an indicator that a boolean return is wanted, as
+       documented. Reported by Joe Bloggs.
+
+2014-04-20  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-icalendar.el: Require gnus-art.
+
+2014-04-20  Jan Tatarik  <jan.tatarik@gmail.com>
+
+       * gnus-icalendar.el (gnus-icalendar-event->org-entry)
+       (gnus-icalendar--update-org-event): put event timestamp in
+       the org entry body instead of the drawer.
+       (gnus-icalendar-event--get-attendee-names): list of participants should
+       contain even attendees without common name attribute.
+       (gnus-icalendar--update-org-event): don't generate duplicates of empty
+       property tags in org drawers.
+
+2014-04-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gmm-utils.el (gmm-format-time-string): New function.
+
+       * message.el (message-insert-formatted-citation-line): Use the original
+       author's time zone to express a date string.
+
+2014-04-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * gnus-srvr.el (gnus-tmp-how, gnus-tmp-name, gnus-tmp-where)
+       (gnus-tmp-status, gnus-tmp-agent, gnus-tmp-cloud)
+       (gnus-tmp-news-server, gnus-tmp-news-method, gnus-tmp-user-defined):
+       Silence compiler warnings.
+       (gnus-server-insert-server-line): Don't use dyn-bind var as argument.
+
+2014-03-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mml.el: Require url when compiling.
+
+       * gnus-cloud.el (gnus-cloud-parse-version-1):
+       Use plist-get rather than CL's getf.
+       (gnus-activate-group, gnus-subscribe-group): Declare.
+
+       * gnus-sum.el (gnus-mime-buttonize-attachments-in-header): Declare.
+
+2014-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-sum.el (gnus-summary-toggle-header): Display header attachment
+       buttons when toggling the header off.
+
+2014-03-23  Daiki Ueno  <ueno@gnu.org>
+
+       * mml2015.el (mml2015-use): Don't check the availability of GnuPG
+       commands here; instead, only check if epg-config.el is available.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * mml.el (mml-expand-html-into-multipart-related): Allow sending HTML
+       messages with embedded images.
+       (mml-generate-mime): Don't bug out if you don't have libxml.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * message.el (message-make-html-message-with-image-files): New command.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * mml.el (mml-insert-mime-headers): Allow `recipient-filename'.
+
+2014-03-23  David Engster  <deng@randomsample.de>
+
+       * auth-source.el (auth-source-netrc-saver): Do not depend on `cl-lib'
+       to stay compatible with older Emacsen, so replace `cl-loop' with
+       `loop'.
+
+2014-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-prepare, gnus-article-prepare-display):
+       Display header attachment buttons by gnus-article-prepare-display
+       rather than gnus-article-prepare so as to view in mml-preview as well.
+
+2014-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-goto-part): Find a button in the body first.
+       (gnus-mime-buttonize-attachments-in-header): Number hidden buttons.
+
+2014-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-mime-buttonize-attachments-in-header):
+       Display buttons that are hidden in unselected alternative part as well.
+       (gnus-mime-display-alternative): Redraw attachment buttons in header.
+
+       * gmm-utils.el (gmm-labels): Add edebug spec.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-srvr.el (gnus-server-toggle-cloud-server): New command and
+       keystroke.
+       (gnus-server-toggle-cloud-server): Only allow clouding applicable
+       types.
+
+2014-03-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.el (gnus-copy-overlay, gnus-overlays-at): New functions.
+
+       * gnus-art.el (gnus-mime-display-attachment-buttons-in-header):
+       New user option.
+       (gnus-mime-buttonize-attachments-in-header): New function.
+       (gnus-article-prepare): Use it.
+       (gnus-mime-inline-part): Suppress extra newline.
+       (gnus-mm-display-part): Save excursion;
+       remove useless deleting and adding of buttons.
+       (gnus-insert-mime-button): Allow insertion in the middle of a line.
+
+       * gnus-sum.el (gnus-summary-wash-mime-map, gnus-summary-article-menu):
+       Add gnus-mime-buttonize-attachments-in-header.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-request-articles): New command to download several
+       articles at once.
+
+       * gnus.el (gnus-variable-list): Save Cloud variables.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-cloud.el: New file to provide the Emacs Cloud.
+
+       * gravatar.el (gravatar-retrieve-synchronously): XEmacs also has
+       `url-retrieve-synchronously', apparently.
+
+       * gnus-notifications.el (gravatar-retrieve-synchronously): Declare for
+       XEmacs.
+
+       * nnrss.el (libxml-parse-html-region): Silence compilation error.
+
+2014-03-23  Daniel Dehennin  <daniel.dehennin@baby-gnu.org>
+
+       * gnus-mlspl.el (gnus-group-split-fancy): Use `gnus-parameters' in
+       `gnus-group-split-fancy'.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * message.el (message-remove-header): Doc fix.
+       (message-forward-included-headers): New variable.
+       (message-remove-ignored-headers): Use it.
+
+2014-03-23  Dave Abrahams  <dave@boostpro.com>
+
+       * gnus-sum.el (gnus-summary-open-group-with-article): New command.
+
+2014-03-23  Rasmus Pank Roulund  <emacs@pank.eu>
+
+       * gnus-fun.el (gnus-x-face-omit-files): Regexp to omit matched results
+       from random face commands.
+       (gnus-face-directory): Like `gnus-x-face-directory` for png files and
+       Face.
+       (gnus-face-omit-files): Like `gnus-x-face-omit-files` for Face.
+       (gnus--random-face-with-type): Generic function returning a face-type
+       as a string.
+       (gnus--insert-random-face-with-type): Generic function inserting a face
+       in a message buffer header.
+       (gnus-random-x-face): Rewritten to use `gnus--random-face-with-type`.
+       (gnus-insert-random-x-face-header): Rewritten to use
+       `gnus--insert-random-face-with-type`.
+       (gnus-random-face): Return random (png) Face as string.
+       (nus-insert-random-face-header): Insert random (png) Face in a message
+       buffer.
+
+2014-03-23  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * mm-url.el: Remove all usage of w3.
+
+       * nnrss.el: Ditto.
+
+       * mm-decode.el: Ditto.
+
+       * mm-view.el: Ditto.
+
+       * gnus-setup.el: Remove outdated file.
+
 2014-03-07  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * nnimap.el (nnimap-request-accept-article): Make respooling to nnimap
index a50ad75063b352c35081e83d36a448eed15a81d7..2efb16b8611be9c4438c55eafbfb2d4473fde90e 100644 (file)
@@ -654,9 +654,11 @@ Use `auth-source-delete' in ELisp code instead of calling
 'secrets are the only ones supported right now.
 
 :max N means to try to return at most N items (defaults to 1).
-When 0 the function will return just t or nil to indicate if any
-matches were found.  More than N items may be returned, depending
-on the search and the backend.
+More than N items may be returned, depending on the search and
+the backend.
+
+When :max is 0 the function will return just t or nil to indicate
+if any matches were found.
 
 :host (X Y Z) means to match only hosts X, Y, or Z according to
 the match rules above.  Defaults to t.
@@ -757,18 +759,22 @@ must call it to obtain the actual value."
       (when auth-source-do-cache
         (auth-source-remember spec found)))
 
-    found))
+    (if (zerop max)
+        (not (null found))
+      found)))
 
 (defun auth-source-search-backends (backends spec max create delete require)
-  (let (matches)
+  (let ((max (if (zerop max) 1 max)) ; stop with 1 match if we're asked for zero
+        matches)
     (dolist (backend backends)
-      (when (> max (length matches))   ; when we need more matches...
+      (when (> max (length matches)) ; if we need more matches...
         (let* ((bmatches (apply
                           (slot-value backend 'search-function)
                           :backend backend
                           :type (slot-value backend :type)
                           ;; note we're overriding whatever the spec
-                          ;; has for :require, :create, and :delete
+                          ;; has for :max, :require, :create, and :delete
+                          :max max
                           :require require
                           :create create
                           :delete delete
@@ -783,6 +789,7 @@ must call it to obtain the actual value."
             (setq matches (append matches bmatches))))))
     matches))
 
+;; (auth-source-search :max 0)
 ;; (auth-source-search :max 1)
 ;; (funcall (plist-get (nth 0 (auth-source-search :max 1)) :secret))
 ;; (auth-source-search :host "nonesuch" :type 'netrc :K 1)
@@ -1524,10 +1531,10 @@ list, it matches the original pattern."
            (heads (if (stringp value)
                       (list (list key value))
                     (mapcar (lambda (v) (list key v)) value))))
-      (cl-loop
+      (loop
          for h in heads
          nconc
-           (cl-loop
+           (loop
               for tl in tails
               collect (append h tl))))))
 
@@ -1653,6 +1660,7 @@ authentication tokens:
 
 ;; (let ((auth-sources '("macos-keychain-internet:/Users/tzz/Library/Keychains/login.keychain"))) (auth-source-search :max 1))
 ;; (let ((auth-sources '("macos-keychain-generic:Login"))) (auth-source-search :max 1 :host "git.gnus.org"))
+;; (let ((auth-sources '("macos-keychain-generic:Login"))) (auth-source-search :max 1))
 
 (defun* auth-source-macos-keychain-search (&rest
                                     spec
index 8ce29323088094e4d978a3aad6036531473c9bce..70ef27a7e900761b5d1dfbd3e36eb3b3da063a8f 100644 (file)
@@ -441,6 +441,39 @@ rather than relying on `lexical-binding'.
   `(,(progn (require 'cl) (if (fboundp 'cl-labels) 'cl-labels 'labels))
     ,bindings ,@body))
 (put 'gmm-labels 'lisp-indent-function 1)
+(put 'gmm-labels 'edebug-form-spec '((&rest (sexp sexp &rest form)) &rest form))
+
+(defun gmm-format-time-string (format-string &optional time tz)
+  "Use FORMAT-STRING to format the time TIME, or now if omitted.
+The optional TZ specifies the time zone in a number of seconds; any
+other non-nil value will be treated as 0.  Note that both the format
+specifiers `%Z' and `%z' will be replaced with a numeric form. "
+;; FIXME: is there a smart way to replace %Z with a time zone name?
+  (if (and (numberp tz) (not (zerop tz)))
+      (let ((st 0)
+           (case-fold-search t)
+           ls nd rest)
+       (setq time (if time
+                      (copy-sequence time)
+                    (current-time)))
+       (if (>= (setq ls (- (cadr time) (car (current-time-zone)) (- tz))) 0)
+           (setcar (cdr time) ls)
+         (setcar (cdr time) (+ ls 65536))
+         (setcar time (1- (car time))))
+       (setq tz (format "%s%02d%02d"
+                        (if (>= tz 0) "+" "-")
+                        (/ (abs tz) 3600)
+                        (/ (% (abs tz) 3600) 60)))
+       (while (string-match "%+z" format-string st)
+         (if (zerop (% (- (setq nd (match-end 0)) (match-beginning 0)) 2))
+             (progn
+               (push (substring format-string st (- nd 2)) rest)
+               (push tz rest))
+           (push (substring format-string st nd) rest))
+         (setq st nd))
+       (push (substring format-string st) rest)
+       (format-time-string (apply 'concat (nreverse rest)) time))
+    (format-time-string format-string time tz)))
 
 (provide 'gmm-utils)
 
index 29d70aa1a86b405cbfed1576a703a261f1f22491..b08e523c4405e4e37855643621e75171dafd235f 100644 (file)
@@ -24,9 +24,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile
   (require 'cl))
 (defvar tool-bar-map)
@@ -4728,7 +4725,10 @@ If ALL-HEADERS is non-nil, no headers are hidden."
          gnus-article-image-alist nil)
     (gnus-run-hooks 'gnus-tmp-internal-hook)
     (when gnus-display-mime-function
-      (funcall gnus-display-mime-function))))
+      (funcall gnus-display-mime-function))
+    ;; Add attachment buttons to the header.
+    (when gnus-mime-display-attachment-buttons-in-header
+      (gnus-mime-buttonize-attachments-in-header))))
 
 ;;;
 ;;; Gnus Sticky Article Mode
@@ -4987,7 +4987,6 @@ and `gnus-mime-delete-part', and not provided at run-time normally."
     (gnus-article-edit-article
      `(lambda ()
        (buffer-disable-undo)
-       (erase-buffer)
        (let ((mail-parse-charset (or gnus-article-charset
                                      ',gnus-newsgroup-charset))
              (mail-parse-ignored-charsets
@@ -4995,7 +4994,14 @@ and `gnus-mime-delete-part', and not provided at run-time normally."
                   ',gnus-newsgroup-ignored-charsets))
              (mbl mml-buffer-list))
          (setq mml-buffer-list nil)
-         (insert-buffer-substring gnus-original-article-buffer)
+         ;; A new text must be inserted before deleting existing ones
+         ;; at the end so as not to move existing markers of which
+         ;; the insertion type is t.
+         (delete-region
+          (point-min)
+          (prog1
+              (goto-char (point-max))
+            (insert-buffer-substring gnus-original-article-buffer)))
          (mime-to-mml ',handles)
          (setq gnus-article-mime-handles nil)
          (let ((mbl1 mml-buffer-list))
@@ -5300,12 +5306,26 @@ are decompressed."
 Compressed files like .gz and .bz2 are decompressed."
   (interactive (list nil current-prefix-arg))
   (gnus-article-check-buffer)
-  (unless handle
-    (setq handle (get-text-property (point) 'gnus-data)))
-  (when handle
-    (let ((b (point))
-         (inhibit-read-only t)
-         contents charset coding-system)
+  (let* ((inhibit-read-only t)
+        (b (point))
+        (btn ;; position where the MIME button exists
+         (if handle
+             (if (eq handle (get-text-property b 'gnus-data))
+                 b
+               (article-goto-body)
+               (or (text-property-any (point) (point-max) 'gnus-data handle)
+                   (text-property-any (point-min) (point) 'gnus-data handle)))
+           (setq handle (get-text-property b 'gnus-data))
+           b))
+        start contents charset coding-system)
+    (when handle
+      (when (= b (prog1
+                    btn
+                  (setq start (next-single-property-change btn 'gnus-data
+                                                           nil (point-max))
+                        btn (previous-single-property-change start
+                                                             'gnus-data))))
+       (setq b btn))
       (if (and (not arg) (mm-handle-undisplayer handle))
          (mm-remove-part handle)
        (mm-with-unibyte-buffer
@@ -5331,9 +5351,48 @@ Compressed files like .gz and .bz2 are decompressed."
                    (mm-read-coding-system "Charset: "))))
         ((mm-handle-undisplayer handle)
          (mm-remove-part handle)))
-       (forward-line 2)
-        (mm-display-inline handle)
-       (goto-char b)))))
+       (goto-char start)
+       (unless (bolp)
+         ;; This is a header button.
+         (forward-line 1))
+       (mm-display-inline handle))
+      ;; Toggle the button appearance between `[button]...' and `[button]'.
+      (goto-char btn)
+      (let ((displayed-p (mm-handle-displayed-p handle)))
+       (gnus-insert-mime-button handle (get-text-property btn 'gnus-part)
+                                (list displayed-p))
+       (if (featurep 'emacs)
+           (delete-region
+            (point)
+            (next-single-property-change (point) 'gnus-data nil (point-max)))
+         (let* ((end (next-single-property-change (point) 'gnus-data))
+                (annots (annotations-at (or end (point-max)))))
+           (delete-region (point)
+                          (if end
+                              (if annots (1+ end) end)
+                            (point-max)))
+           (dolist (annot annots)
+             (set-extent-endpoints annot (point) (point)))))
+       (setq start (point))
+       (if (search-backward "\n\n" nil t)
+           (progn
+             (goto-char start)
+             (unless (or displayed-p (eolp))
+               ;; Add extra newline.
+               (insert (propertize (buffer-substring (1- start) start)
+                                   'gnus-undeletable t))))
+         ;; We're in the article header.
+         (delete-char -1)
+         (dolist (ovl (gnus-overlays-in btn (point)))
+           (gnus-overlay-put ovl 'gnus-button-attachment-extra t)
+           (gnus-overlay-put ovl 'face nil))
+         (save-restriction
+           (message-narrow-to-field)
+           (let ((gnus-treatment-function-alist
+                  '((gnus-treat-highlight-headers
+                     gnus-article-highlight-headers))))
+             (gnus-treat-article 'head)))))
+      (goto-char b))))
 
 (defun gnus-mime-set-charset-parameters (handle charset)
   "Set CHARSET to parameters in HANDLE.
@@ -5635,54 +5694,106 @@ all parts."
   "Display HANDLE and fix MIME button."
   (let ((id (get-text-property (point) 'gnus-part))
        (point (point))
-       (inhibit-read-only t))
-    (forward-line 1)
-    (prog1
-       (let ((window (selected-window))
-             (mail-parse-charset gnus-newsgroup-charset)
-             (mail-parse-ignored-charsets
-              (if (gnus-buffer-live-p gnus-summary-buffer)
-                  (with-current-buffer gnus-summary-buffer
-                    gnus-newsgroup-ignored-charsets)
-                nil)))
-         (save-excursion
-           (unwind-protect
-               (let ((win (gnus-get-buffer-window (current-buffer) t))
-                     (beg (point)))
-                 (when win
-                   (select-window win))
-                 (goto-char point)
-                 (forward-line)
-                 (if (mm-handle-displayed-p handle)
-                     ;; This will remove the part.
-                     (mm-display-part handle)
-                   (save-restriction
-                     (narrow-to-region (point)
-                                       (if (eobp) (point) (1+ (point))))
-                     (gnus-bind-safe-url-regexp (mm-display-part handle))
-                     ;; We narrow to the part itself and
-                     ;; then call the treatment functions.
-                     (goto-char (point-min))
-                     (forward-line 1)
-                     (narrow-to-region (point) (point-max))
-                     (gnus-treat-article
-                      nil id
-                      (gnus-article-mime-total-parts)
-                      (mm-handle-media-type handle)))))
-             (if (window-live-p window)
-                 (select-window window)))))
+       (inhibit-read-only t)
+       (window (selected-window))
+       (mail-parse-charset gnus-newsgroup-charset)
+       (mail-parse-ignored-charsets
+        (if (gnus-buffer-live-p gnus-summary-buffer)
+            (with-current-buffer gnus-summary-buffer
+              gnus-newsgroup-ignored-charsets)
+          nil))
+       start retval)
+    (unwind-protect
+       (progn
+         (let ((win (gnus-get-buffer-window (current-buffer) t)))
+           (when win
+             (select-window win)
+             (goto-char point)))
+         (setq start (next-single-property-change point 'gnus-data
+                                                  nil (point-max))
+               point (previous-single-property-change start 'gnus-data))
+         (if (mm-handle-displayed-p handle)
+             ;; This will remove the part.
+             (setq retval (mm-display-part handle))
+           (let ((part (or (and (mm-inlinable-p handle)
+                                (mm-inlined-p handle)
+                                t)
+                           (with-temp-buffer
+                             (gnus-bind-safe-url-regexp
+                              (setq retval (mm-display-part handle)))
+                             (unless (zerop (buffer-size))
+                               (buffer-string))))))
+             (goto-char start)
+             (unless (bolp)
+               ;; This is a header button.
+               (forward-line 1))
+             (cond ((stringp part)
+                    (save-restriction
+                      (narrow-to-region (point)
+                                        (progn
+                                          (insert part)
+                                          (unless (bolp) (insert "\n"))
+                                          (point)))
+                      (gnus-treat-article nil id
+                                          (gnus-article-mime-total-parts)
+                                          (mm-handle-media-type handle))
+                      (mm-handle-set-undisplayer
+                       handle
+                       `(lambda ()
+                          (let ((inhibit-read-only t))
+                            (delete-region ,(copy-marker (point-min) t)
+                                           ,(point-max-marker)))))))
+                   (part
+                    (mm-display-inline handle))))))
       (goto-char point)
-      (gnus-delete-line)
-      (gnus-insert-mime-button
-       handle id (list (mm-handle-displayed-p handle)))
-      (goto-char point))))
+      ;; Toggle the button appearance between `[button]...' and `[button]'.
+      (let ((displayed-p (mm-handle-displayed-p handle)))
+       (gnus-insert-mime-button handle id (list displayed-p))
+       (if (featurep 'emacs)
+           (delete-region
+            (point)
+            (next-single-property-change (point) 'gnus-data nil (point-max)))
+         (let* ((end (next-single-property-change (point) 'gnus-data))
+                (annots (annotations-at (or end (point-max)))))
+           (delete-region (point)
+                          (if end
+                              (if annots (1+ end) end)
+                            (point-max)))
+           (dolist (annot annots)
+             (set-extent-endpoints annot (point) (point)))))
+       (setq start (point))
+       (if (search-backward "\n\n" nil t)
+           (progn
+             (goto-char start)
+             (unless (or displayed-p (eolp))
+               ;; Add extra newline.
+               (insert (propertize (buffer-substring (1- start) start)
+                                   'gnus-undeletable t))))
+         ;; We're in the article header.
+         (delete-char -1)
+         (dolist (ovl (gnus-overlays-in point (point)))
+           (gnus-overlay-put ovl 'gnus-button-attachment-extra t)
+           (gnus-overlay-put ovl 'face nil))
+         (save-restriction
+           (message-narrow-to-field)
+           (let ((gnus-treatment-function-alist
+                  '((gnus-treat-highlight-headers
+                     gnus-article-highlight-headers))))
+             (gnus-treat-article 'head)))))
+      (goto-char point)
+      (if (window-live-p window)
+         (select-window window)))
+    retval))
 
 (defun gnus-article-goto-part (n)
   "Go to MIME part N."
   (when gnus-break-pages
     (widen))
+  (article-goto-body)
   (prog1
-      (let ((start (text-property-any (point-min) (point-max) 'gnus-part n))
+      (let ((start (or (text-property-any (point) (point-max) 'gnus-part n)
+                      ;; There may be header buttons.
+                      (text-property-any (point-min) (point) 'gnus-part n)))
            part handle end next handles)
        (when start
          (goto-char start)
@@ -5736,8 +5847,6 @@ all parts."
                                          (concat "; " gnus-tmp-name))))
     (unless (equal gnus-tmp-description "")
       (setq gnus-tmp-type-long (concat " --- " gnus-tmp-type-long)))
-    (unless (bolp)
-      (insert "\n"))
     (setq b (point))
     (gnus-eval-format
      gnus-mime-button-line-format gnus-mime-button-line-format-alist
@@ -5862,6 +5971,16 @@ If displaying \"text/html\" is discouraged \(see
   :group 'gnus-article-mime
   :type 'boolean)
 
+(defcustom gnus-mime-display-attachment-buttons-in-header t
+  "Add attachment buttons in the end of the header of an article.
+Since MIME attachments tend to be put at the end of an article, we may
+overlook them if there is a huge body.  This option offers you a copy
+of all non-inlinable MIME parts as buttons shown in front of an article.
+If nil, don't show those extra buttons."
+  :version "24.5"
+  :group 'gnus-article-mime
+  :type 'boolean)
+
 (defun gnus-mime-display-part (handle)
   (cond
    ;; Maybe a broken MIME message.
@@ -5884,14 +6003,6 @@ If displaying \"text/html\" is discouraged \(see
    ((and (equal (car handle) "multipart/related")
         (not (or gnus-mime-display-multipart-as-mixed
                  gnus-mime-display-multipart-related-as-mixed)))
-    ;;;!!!We should find the start part, but we just default
-    ;;;!!!to the first part.
-    ;;(gnus-mime-display-part (cadr handle))
-    ;;;!!! Most multipart/related is an HTML message plus images.
-    ;;;!!! Unfortunately we are unable to let W3 display those
-    ;;;!!! included images, so we just display it as a mixed multipart.
-    ;;(gnus-mime-display-mixed (cdr handle))
-    ;;;!!! No, w3 can display everything just fine.
     (gnus-mime-display-part (cadr handle)))
    ((equal (car handle) "multipart/signed")
     (gnus-add-wash-type 'signed)
@@ -5915,7 +6026,6 @@ If displaying \"text/html\" is discouraged \(see
   (let ((type (mm-handle-media-type handle))
        (ignored gnus-ignored-mime-types)
        (not-attachment t)
-       (move nil)
        display text)
     (catch 'ignored
       (progn
@@ -5941,9 +6051,11 @@ If displaying \"text/html\" is discouraged \(see
            (setq display t)
          (when (equal (mm-handle-media-supertype handle) "text")
            (setq text t)))
-       (let ((id (1+ (length gnus-article-mime-handle-alist)))
+       (let ((id (car (rassq handle gnus-article-mime-handle-alist)))
              beg)
-         (push (cons id handle) gnus-article-mime-handle-alist)
+         (unless id
+           (setq id (1+ (length gnus-article-mime-handle-alist)))
+           (push (cons id handle) gnus-article-mime-handle-alist))
          (when (and display
                     (equal (mm-handle-media-supertype handle) "message"))
            (insert-char
@@ -5955,31 +6067,28 @@ If displaying \"text/html\" is discouraged \(see
                    (not (gnus-unbuttonized-mime-type-p type))
                    (eq id gnus-mime-buttonized-part-id))
            (gnus-insert-mime-button
-            handle id (list (or display (and not-attachment text))))
-           (gnus-article-insert-newline)
-           ;; Remember modify the number of forward lines.
-           (setq move t))
+            handle id (list (or display (and not-attachment text)))))
          (setq beg (point))
          (cond
           (display
-           (when move
-             (forward-line -1)
-             (setq beg (point)))
            (let ((mail-parse-charset gnus-newsgroup-charset)
                  (mail-parse-ignored-charsets
                   (save-excursion (condition-case ()
                                       (set-buffer gnus-summary-buffer)
                                     (error))
                                   gnus-newsgroup-ignored-charsets)))
-             (gnus-bind-safe-url-regexp (mm-display-part handle t)))
-           (goto-char (point-max)))
+             (gnus-bind-safe-url-regexp (mm-display-part handle t))))
           ((and text not-attachment)
-           (when move
-             (forward-line -1)
-             (setq beg (point)))
-           (gnus-article-insert-newline)
-           (mm-display-inline handle)
-           (goto-char (point-max))))
+           (mm-display-inline handle)))
+         (goto-char (point-max))
+         (if (string-match "\\`image/" type)
+             (gnus-article-insert-newline)
+           (if (prog1
+                   (= (skip-chars-backward "\n") -1)
+                 (forward-char 1))
+               (gnus-article-insert-newline)
+             (put-text-property (point) (point-max) 'gnus-undeletable t))
+           (goto-char (point-max)))
          ;; Do highlighting.
          (save-excursion
            (save-restriction
@@ -6110,7 +6219,10 @@ If displaying \"text/html\" is discouraged \(see
          (goto-char (point-max))
          (setcdr begend (point-marker)))))
     (when ibegend
-      (goto-char point))))
+      (goto-char point)))
+  ;; Redraw attachment buttons in the header.
+  (when gnus-mime-display-attachment-buttons-in-header
+    (gnus-mime-buttonize-attachments-in-header)))
 
 (defconst gnus-article-wash-status-strings
   (let ((alist '((cite "c" "Possible hidden citation text"
@@ -6216,6 +6328,116 @@ Provided for backwards compatibility."
     (when image
       (gnus-add-image 'shr image))))
 
+(defun gnus-mime-buttonize-attachments-in-header (&optional interactive)
+  "Show attachments as buttons in the end of the header of an article.
+This function toggles the display when called interactively.  Note that
+buttons to be added to the header are only the ones that aren't inlined
+in the body.  Use `gnus-header-face-alist' to highlight buttons."
+  (interactive (list t))
+  (gnus-with-article-buffer
+    (gmm-labels
+       ;; Function that returns a flattened version of
+       ;; `gnus-article-mime-handle-alist'.
+       ((flattened-alist
+         (&optional alist id all)
+         (if alist
+             (let ((i 1) newid flat)
+               (dolist (handle alist flat)
+                 (setq newid (append id (list i))
+                       i (1+ i))
+                 (if (stringp (car handle))
+                     (setq flat (nconc flat (flattened-alist (cdr handle)
+                                                             newid all)))
+                   (delq (rassq handle all) all)
+                   (setq flat (nconc flat (list (cons newid handle)))))))
+           (let ((flat (list nil)))
+             ;; Assume that elements of `gnus-article-mime-handle-alist'
+             ;; are in the decreasing order, but unnumbered subsidiaries
+             ;; in each element are in the increasing order.
+             (dolist (handle (reverse gnus-article-mime-handle-alist))
+               (if (stringp (cadr handle))
+                   (setq flat (nconc flat (flattened-alist (cddr handle)
+                                                           (list (car handle))
+                                                           flat)))
+                 (delq (rassq (cdr handle) flat) flat)
+                 (setq flat (nconc flat (list (cons (list (car handle))
+                                                    (cdr handle)))))))
+             (setq flat (cdr flat))
+             (mapc (lambda (handle)
+                     (if (cdar handle)
+                         ;; This is a hidden (i.e. unnumbered) handle.
+                         (progn
+                           (setcar handle
+                                   (1+ (caar gnus-article-mime-handle-alist)))
+                           (push handle gnus-article-mime-handle-alist))
+                       (setcar handle (caar handle))))
+                   flat)
+             flat))))
+      (let ((case-fold-search t) buttons handle type st)
+       (save-excursion
+         (save-restriction
+           (widen)
+           (article-narrow-to-head)
+           ;; Header buttons exist?
+           (while (and (not buttons)
+                       (re-search-forward "^attachments?:[\n ]+" nil t))
+             (when (get-char-property (match-end 0)
+                                      'gnus-button-attachment-extra)
+               (setq buttons (match-beginning 0))))
+           (widen)
+           (when buttons
+             ;; Delete header buttons.
+             (delete-region buttons (if (re-search-forward "^[^ ]" nil t)
+                                        (match-beginning 0)
+                                      (point-max))))
+           (unless (and interactive buttons)
+             ;; Find buttons.
+             (setq buttons nil)
+             (dolist (button (flattened-alist))
+               (setq handle (cdr button)
+                     type (mm-handle-media-type handle))
+               (when (or (and (if (gnus-buffer-live-p gnus-summary-buffer)
+                                  (with-current-buffer gnus-summary-buffer
+                                    gnus-inhibit-images)
+                                gnus-inhibit-images)
+                              (string-match "\\`image/" type))
+                         (mm-inline-override-p handle)
+                         (and (mm-handle-disposition handle)
+                              (not (equal (car (mm-handle-disposition handle))
+                                          "inline"))
+                              (not (mm-attachment-override-p handle)))
+                         (not (mm-automatic-display-p handle))
+                         (not (or (and (mm-inlinable-p handle)
+                                       (mm-inlined-p handle))
+                                  (mm-automatic-external-display-p type))))
+                 (push button buttons)))
+             (when buttons
+               ;; Add header buttons.
+               (article-goto-body)
+               (forward-line -1)
+               (narrow-to-region (point) (point))
+               (insert "Attachment" (if (cdr buttons) "s" "") ":")
+               (dolist (button (nreverse buttons))
+                 (setq st (point))
+                 (insert " ")
+                 (mm-handle-set-undisplayer
+                  (setq handle (copy-sequence (cdr button))) nil)
+                 (gnus-insert-mime-button handle (car button))
+                 (skip-chars-backward "\t\n ")
+                 (delete-region (point) (point-max))
+                 (when (> (current-column) (window-width))
+                   (goto-char st)
+                   (insert "\n")
+                   (end-of-line)))
+               (insert "\n")
+               (dolist (ovl (gnus-overlays-in (point-min) (point)))
+                 (gnus-overlay-put ovl 'gnus-button-attachment-extra t)
+                 (gnus-overlay-put ovl 'face nil))
+               (let ((gnus-treatment-function-alist
+                      '((gnus-treat-highlight-headers
+                         gnus-article-highlight-headers))))
+                 (gnus-treat-article 'head))))))))))
+
 ;;; Article savers.
 
 (defun gnus-output-to-file (file-name)
@@ -6584,7 +6806,7 @@ not have a face in `gnus-article-boring-faces'."
                        (when (eq obuf (current-buffer))
                          (set-buffer in-buffer)
                          t))
-               (setq selected (gnus-summary-select-article))
+               (setq selected (ignore-errors (gnus-summary-select-article)))
                (set-buffer obuf)
                (unless not-restore-window
                  (set-window-configuration owin))
index d58acbd18cabade4aac69144cd8119a30a702d74..544d6672a8ccc9067926aba4109f00d3b4fad058 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'gnus)
index db6a0f63e38b9442f2d5f12f75b7443c3edbb2c7..5a6d6f8f2433762d56dd406d010ce3c9876be9fa 100644 (file)
@@ -1204,7 +1204,8 @@ When enabled, it automatically turns on `font-lock-mode'."
   nil ;; init-value
   "" ;; lighter
   nil ;; keymap
-  (when (eq major-mode 'message-mode)
+  (when (eq major-mode 'message-mode)   ;FIXME: Use derived-mode-p.
+    ;; FIXME: Use font-lock-add-keywords!
     (let ((defaults (car (if (featurep 'xemacs)
                             (get 'message-mode 'font-lock-defaults)
                           font-lock-defaults)))
@@ -1233,8 +1234,10 @@ When enabled, it automatically turns on `font-lock-mode'."
                font-lock-keywords nil))
       (setq font-lock-set-defaults nil))
     (font-lock-set-defaults)
-    (cond ((symbol-value 'font-lock-mode)
-          (font-lock-fontify-buffer))
+    (cond (font-lock-mode
+           (if (fboundp 'font-lock-flush)
+               (font-lock-flush)
+             (font-lock-fontify-buffer)))
          (gnus-message-citation-mode
           (font-lock-mode 1)))))
 
diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el
new file mode 100644 (file)
index 0000000..c47976b
--- /dev/null
@@ -0,0 +1,332 @@
+;;; gnus-cloud.el --- storing and retrieving data via IMAP
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Keywords: mail
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(require 'parse-time)
+(require 'nnimap)
+
+(defgroup gnus-cloud nil
+  "Syncing Gnus data via IMAP."
+  :group 'gnus)
+
+(defcustom gnus-cloud-synced-files
+  '(;;"~/.authinfo"
+    "~/.authinfo.gpg"
+    "~/.gnus.el"
+    (:directory "~/News" :match ".*.SCORE\\'"))
+  "List of file regexps that should be kept up-to-date via the cloud."
+  :group 'gnus-cloud
+  :type '(repeat regexp))
+
+(defvar gnus-cloud-group-name "*Emacs Cloud*")
+(defvar gnus-cloud-covered-servers nil)
+
+(defvar gnus-cloud-version 1)
+(defvar gnus-cloud-sequence 1)
+
+(defvar gnus-cloud-method nil
+  "The IMAP select method used to store the cloud data.")
+
+(defun gnus-cloud-make-chunk (elems)
+  (with-temp-buffer
+    (insert (format "Version %s\n" gnus-cloud-version))
+    (insert (gnus-cloud-insert-data elems))
+    (buffer-string)))
+
+(defun gnus-cloud-insert-data (elems)
+  (mm-with-unibyte-buffer
+    (dolist (elem elems)
+      (cond
+       ((eq (plist-get elem :type) :file)
+       (let (length data)
+         (mm-with-unibyte-buffer
+           (insert-file-contents-literally (plist-get elem :file-name))
+           (setq length (buffer-size)
+                 data (buffer-string)))
+         (insert (format "(:type :file :file-name %S :timestamp %S :length %d)\n"
+                         (plist-get elem :file-name)
+                         (plist-get elem :timestamp)
+                         length))
+         (insert data)
+         (insert "\n")))
+       ((eq (plist-get elem :type) :data)
+       (insert (format "(:type :data :name %S :length %d)\n"
+                       (plist-get elem :name)
+                       (with-current-buffer (plist-get elem :buffer)
+                         (buffer-size))))
+       (insert-buffer-substring (plist-get elem :buffer))
+       (insert "\n"))
+       ((eq (plist-get elem :type) :delete)
+       (insert (format "(:type :delete :file-name %S)\n"
+                       (plist-get elem :file-name))))))
+    (gnus-cloud-encode-data)
+    (buffer-string)))
+
+(defun gnus-cloud-encode-data ()
+  (call-process-region (point-min) (point-max) "gzip"
+                      t (current-buffer) nil
+                      "-c")
+  (base64-encode-region (point-min) (point-max)))
+
+(defun gnus-cloud-decode-data ()
+  (base64-decode-region (point-min) (point-max))
+  (call-process-region (point-min) (point-max) "gunzip"
+                      t (current-buffer) nil
+                      "-c"))
+
+(defun gnus-cloud-parse-chunk ()
+  (save-excursion
+    (goto-char (point-min))
+    (unless (looking-at "Version \\([0-9]+\\)")
+      (error "Not a valid Cloud chunk in the current buffer"))
+    (forward-line 1)
+    (let ((version (string-to-number (match-string 1)))
+         (data (buffer-substring (point) (point-max))))
+      (mm-with-unibyte-buffer
+       (insert data)
+       (cond
+        ((= version 1)
+         (gnus-cloud-decode-data)
+         (goto-char (point-min))
+         (gnus-cloud-parse-version-1))
+        (t
+         (error "Unsupported Cloud chunk version %s" version)))))))
+
+(defun gnus-cloud-parse-version-1 ()
+  (let ((elems nil))
+    (while (not (eobp))
+      (while (and (not (eobp))
+                 (not (looking-at "(:type")))
+       (forward-line 1))
+      (unless (eobp)
+       (let ((spec (ignore-errors (read (current-buffer))))
+             length)
+         (when (and (consp spec)
+                    (memq (plist-get spec :type) '(:file :data :deleta)))
+           (setq length (plist-get spec :length))
+           (push (append spec
+                         (list
+                          :contents (buffer-substring (1+ (point))
+                                                      (+ (point) 1 length))))
+                 elems)
+           (goto-char (+ (point) 1 length))))))
+    (nreverse elems)))
+
+(defun gnus-cloud-update-data (elems)
+  (dolist (elem elems)
+    (let ((type (plist-get elem :type)))
+      (cond
+       ((eq type :data)
+       )
+       ((eq type :delete)
+       (gnus-cloud-delete-file (plist-get elem :file-name))
+       )
+       ((eq type :file)
+       (gnus-cloud-update-file elem))
+       (t
+       (message "Unknown type %s; ignoring" type))))))
+
+(defun gnus-cloud-update-file (elem)
+  (let ((file-name (plist-get elem :file-name))
+       (date (plist-get elem :timestamp))
+       (contents (plist-get elem :contents)))
+    (unless (gnus-cloud-file-covered-p file-name)
+      (message "%s isn't covered by the cloud; ignoring" file-name))
+    (when (or (not (file-exists-p file-name))
+             (and (file-exists-p file-name)
+                  (mm-with-unibyte-buffer
+                    (insert-file-contents-literally file-name)
+                    (not (equal (buffer-string) contents)))))
+      (gnus-cloud-replace-file file-name date contents))))
+
+(defun gnus-cloud-replace-file (file-name date new-contents)
+  (mm-with-unibyte-buffer
+    (insert new-contents)
+    (when (file-exists-p file-name)
+      (rename-file file-name (car (find-backup-file-name file-name))))
+    (write-region (point-min) (point-max) file-name)
+    (set-file-times file-name (parse-iso8601-time-string date))))
+
+(defun gnus-cloud-delete-file (file-name)
+  (unless (gnus-cloud-file-covered-p file-name)
+    (message "%s isn't covered by the cloud; ignoring" file-name))
+  (when (file-exists-p file-name)
+    (rename-file file-name (car (find-backup-file-name file-name)))))
+
+(defun gnus-cloud-file-covered-p (file-name)
+  (let ((matched nil))
+    (dolist (elem gnus-cloud-synced-files)
+      (cond
+       ((stringp elem)
+       (when (equal elem file-name)
+         (setq matched t)))
+       ((consp elem)
+       (when (and (equal (directory-file-name (plist-get elem :directory))
+                         (directory-file-name (file-name-directory file-name)))
+                  (string-match (plist-get elem :match)
+                                (file-name-nondirectory file-name)))
+         (setq matched t)))))
+    matched))
+
+(defun gnus-cloud-all-files ()
+  (let ((files nil))
+    (dolist (elem gnus-cloud-synced-files)
+      (cond
+       ((stringp elem)
+       (push elem files))
+       ((consp elem)
+       (dolist (file (directory-files (plist-get elem :directory)
+                                      nil
+                                      (plist-get elem :match)))
+         (push (format "%s/%s"
+                       (directory-file-name (plist-get elem :directory))
+                       file)
+               files)))))
+    (nreverse files)))
+
+(defvar gnus-cloud-file-timestamps nil)
+
+(defun gnus-cloud-files-to-upload (&optional full)
+  (let ((files nil)
+       timestamp)
+    (dolist (file (gnus-cloud-all-files))
+      (if (file-exists-p file)
+         (when (setq timestamp (gnus-cloud-file-new-p file full))
+           (push `(:type :file :file-name ,file :timestamp ,timestamp) files))
+       (when (assoc file gnus-cloud-file-timestamps)
+         (push `(:type :delete :file-name ,file) files))))
+    (nreverse files)))
+
+(defun gnus-cloud-file-new-p (file full)
+  (let ((timestamp (format-time-string
+                   "%FT%T%z" (nth 5 (file-attributes file))))
+       (old (cadr (assoc file gnus-cloud-file-timestamps))))
+    (when (or full
+             (null old)
+             (string< old timestamp))
+      timestamp)))
+
+(declare-function gnus-activate-group "gnus-start"
+                 (group &optional scan dont-check method dont-sub-check))
+(declare-function gnus-subscribe-group "gnus-start"
+                 (group &optional previous method))
+
+(defun gnus-cloud-ensure-cloud-group ()
+  (let ((method (if (stringp gnus-cloud-method)
+                   (gnus-server-to-method gnus-cloud-method)
+                 gnus-cloud-method)))
+    (unless (or (gnus-active gnus-cloud-group-name)
+               (gnus-activate-group gnus-cloud-group-name nil nil
+                                    gnus-cloud-method))
+      (and (gnus-request-create-group gnus-cloud-group-name gnus-cloud-method)
+          (gnus-activate-group gnus-cloud-group-name nil nil gnus-cloud-method)
+          (gnus-subscribe-group gnus-cloud-group-name)))))
+
+(defun gnus-cloud-upload-data (&optional full)
+  (gnus-cloud-ensure-cloud-group)
+  (with-temp-buffer
+    (let ((elems (gnus-cloud-files-to-upload full)))
+      (insert (format "Subject: (sequence: %d type: %s)\n"
+                     gnus-cloud-sequence
+                     (if full :full :partial)))
+      (insert "From: nobody@invalid.com\n")
+      (insert "\n")
+      (insert (gnus-cloud-make-chunk elems))
+      (when (gnus-request-accept-article gnus-cloud-group-name gnus-cloud-method
+                                        t t)
+       (setq gnus-cloud-sequence (1+ gnus-cloud-sequence))
+       (gnus-cloud-add-timestamps elems)))))
+
+(defun gnus-cloud-add-timestamps (elems)
+  (dolist (elem elems)
+    (let* ((file-name (plist-get elem :file-name))
+          (old (assoc file-name gnus-cloud-file-timestamps)))
+      (when old
+       (setq gnus-cloud-file-timestamps
+             (delq old gnus-cloud-file-timestamps)))
+      (push (list file-name (plist-get elem :timestamp))
+           gnus-cloud-file-timestamps))))
+
+(defun gnus-cloud-available-chunks ()
+  (gnus-activate-group gnus-cloud-group-name nil nil gnus-cloud-method)
+  (let* ((group (gnus-group-full-name gnus-cloud-group-name gnus-cloud-method))
+        (active (gnus-active group))
+        headers head)
+    (when (gnus-retrieve-headers (gnus-uncompress-range active) group)
+      (with-current-buffer nntp-server-buffer
+       (goto-char (point-min))
+       (while (and (not (eobp))
+                   (setq head (nnheader-parse-head)))
+         (push head headers))))
+    (sort (nreverse headers)
+         (lambda (h1 h2)
+           (> (gnus-cloud-chunk-sequence (mail-header-subject h1))
+              (gnus-cloud-chunk-sequence (mail-header-subject h2)))))))
+
+(defun gnus-cloud-chunk-sequence (string)
+  (if (string-match "sequence: \\([0-9]+\\)" string)
+      (string-to-number (match-string 1 string))
+    0))
+
+(defun gnus-cloud-prune-old-chunks (headers)
+  (let ((headers (reverse headers))
+       (found nil))
+  (while (and headers
+             (not found))
+    (when (string-match "type: :full" (mail-header-subject (car headers)))
+      (setq found t))
+    (pop headers))
+  ;; All the chunks that are older than the newest :full chunk can be
+  ;; deleted.
+  (when headers
+    (gnus-request-expire-articles
+     (mapcar (lambda (h)
+              (mail-header-number h))
+            (nreverse headers))
+     (gnus-group-full-name gnus-cloud-group-name gnus-cloud-method)))))
+
+(defun gnus-cloud-download-data ()
+  (let ((articles nil)
+       chunks)
+    (dolist (header (gnus-cloud-available-chunks))
+      (when (> (gnus-cloud-chunk-sequence (mail-header-subject header))
+              gnus-cloud-sequence)
+       (push (mail-header-number header) articles)))
+    (when articles
+      (nnimap-request-articles (nreverse articles) gnus-cloud-group-name)
+      (with-current-buffer nntp-server-buffer
+       (goto-char (point-min))
+       (while (re-search-forward "^Version " nil t)
+         (beginning-of-line)
+         (push (gnus-cloud-parse-chunk) chunks)
+         (forward-line 1))))))
+
+(defun gnus-cloud-server-p (server)
+  (member server gnus-cloud-covered-servers))
+
+(provide 'gnus-cloud)
+
+;;; gnus-cloud.el ends here
index 28c6a4d3312348b030bd2cd6ebf443ffe1deacc2..e0d1578f49a7bc866f0a299f1e4bd9f6a55c11f9 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile
   (require 'cl))
 
   :group 'gnus-fun
   :type 'directory)
 
+(defcustom gnus-x-face-omit-files nil
+  "Regexp to match faces in `gnus-x-face-directory' to be omitted."
+  :version "24.5"
+  :group 'gnus-fun
+  :type 'string)
+
+(defcustom gnus-face-directory (expand-file-name "faces" gnus-directory)
+  "*Directory where Face PNG files are stored."
+  :version "24.5"
+  :group 'gnus-fun
+  :type 'directory)
+
+(defcustom gnus-face-omit-files nil
+  "Regexp to match faces in `gnus-face-directory' to be omitted."
+  :version "24.5"
+  :group 'gnus-fun
+  :type 'string)
+
 (defcustom gnus-convert-pbm-to-x-face-command "pbmtoxbm %s | compface"
   "Command for converting a PBM to an X-Face."
   :version "22.1"
@@ -86,35 +100,57 @@ PNG format."
                  nil shell-command-switch command)))
 
 ;;;###autoload
-(defun gnus-random-x-face ()
-  "Return X-Face header data chosen randomly from `gnus-x-face-directory'."
-  (interactive)
-  (when (file-exists-p gnus-x-face-directory)
-    (let* ((files (directory-files gnus-x-face-directory t "\\.pbm$"))
-          (file (nth (random (length files)) files)))
+(defun gnus--random-face-with-type (dir ext omit fun)
+  "Return file from DIR with extension EXT, omitting matches of OMIT, processed by FUN."
+  (when (file-exists-p dir)
+    (let* ((files
+            (remove nil (mapcar
+                         (lambda (f) (unless (string-match (or omit "^$") f) f))
+                         (directory-files dir t ext))))
+           (file (nth (random (length files)) files)))
       (when file
-       (gnus-shell-command-to-string
-        (format gnus-convert-pbm-to-x-face-command
-                (shell-quote-argument file)))))))
+        (funcall fun file)))))
 
+;;;###autoload
 (autoload 'message-goto-eoh "message" nil t)
+(autoload 'message-insert-header "message" nil t)
+
+(defun gnus--insert-random-face-with-type (fun type)
+  "Get a random face using FUN and insert it as a header TYPE.
+
+For instance, to insert an X-Face use `gnus-random-x-face' as FUN
+  and \"X-Face\" as TYPE."
+  (let ((data (funcall fun)))
+    (save-excursion
+      (if data
+          (progn (message-goto-eoh)
+                 (insert  type ": " data "\n"))
+       (message
+        "No face returned by the function %s." (symbol-name fun))))))
+
+
+
+;;;###autoload
+(defun gnus-random-x-face ()
+  "Return X-Face header data chosen randomly from `gnus-x-face-directory'.
+
+Files matching `gnus-x-face-omit-files' are not considered."
+  (interactive)
+  (gnus--random-face-with-type gnus-x-face-directory "\\.pbm$" gnus-x-face-omit-files
+                         (lambda (file)
+                           (gnus-shell-command-to-string
+                            (format gnus-convert-pbm-to-x-face-command
+                                    (shell-quote-argument file))))))
 
 ;;;###autoload
 (defun gnus-insert-random-x-face-header ()
   "Insert a random X-Face header from `gnus-x-face-directory'."
   (interactive)
-  (let ((data (gnus-random-x-face)))
-    (save-excursion
-      (message-goto-eoh)
-      (if data
-         (insert "X-Face: " data)
-       (message
-        "No face returned by `gnus-random-x-face'.  Does %s/*.pbm exist?"
-        gnus-x-face-directory)))))
+  (gnus--insert-random-face-with-type 'gnus-random-x-face 'X-Face))
 
 ;;;###autoload
 (defun gnus-x-face-from-file (file)
-  "Insert an X-Face header based on an image file.
+  "Insert an X-Face header based on an image FILE.
 
 Depending on `gnus-convert-image-to-x-face-command' it may accept
 different input formats."
@@ -126,7 +162,7 @@ different input formats."
 
 ;;;###autoload
 (defun gnus-face-from-file (file)
-  "Return a Face header based on an image file.
+  "Return a Face header based on an image FILE.
 
 Depending on `gnus-convert-image-to-face-command' it may accept
 different input formats."
@@ -191,6 +227,21 @@ FILE should be a PNG file that's 48x48 and smaller than or equal to
             (buffer-size)))
     (gnus-face-encode)))
 
+;;;###autoload
+(defun gnus-random-face ()
+  "Return randomly chosen Face from `gnus-face-directory'.
+
+Files matching `gnus-face-omit-files' are not considered."
+  (interactive)
+  (gnus--random-face-with-type gnus-face-directory "\\.png$"
+                         gnus-face-omit-files
+                         'gnus-convert-png-to-face))
+
+;;;###autoload
+(defun gnus-insert-random-face-header ()
+  "Insert a randome Face header from `gnus-face-directory'."
+  (gnus--insert-random-face-with-type 'gnus-random-face 'Face))
+
 (defface gnus-x-face '((t (:foreground "black" :background "white")))
   "Face to show X-Face.
 The colors from this face are used as the foreground and background
index d8260b404346b35239d7ce3c57dd495d4a5e2fc0..31078be48aa5ca8e4437a0c9023c2a218026dde0 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile
   (require 'cl))
 (defvar tool-bar-mode)
index 90947fe4d8ca7778274d3cf4d2a25e6d515ab598..540694f34fb46416b99a82c7234339aafa36910f 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'gnus-art)
index 79f1e2fe2030cad8859a5582e777fdfd4c171875..9027c53a6f3bfe1ffe35ec765d5d60624b5881f3 100644 (file)
@@ -38,6 +38,7 @@
 (require 'gmm-utils)
 (require 'mm-decode)
 (require 'gnus-sum)
+(require 'gnus-art)
 
 (eval-when-compile (require 'cl))
 
                           (caddr event))))
 
     (gmm-labels ((attendee-role (prop) (plist-get (cadr prop) 'ROLE))
-                 (attendee-name (prop) (plist-get (cadr prop) 'CN))
+                 (attendee-name (prop)
+                                (or (plist-get (cadr prop) 'CN)
+                                    (replace-regexp-in-string "^.*MAILTO:" "" (caddr prop))))
                  (attendees-by-type (type)
                    (gnus-remove-if-not
                     (lambda (p) (string= (attendee-role p) type))
@@ -452,7 +455,6 @@ Return nil for non-recurring EVENT."
                       "Not replied yet"))
              (props `(("ICAL_EVENT" . "t")
                       ("ID" . ,uid)
-                      ("DT" . ,(gnus-icalendar-event:org-timestamp event))
                       ("ORGANIZER" . ,(gnus-icalendar-event:organizer event))
                       ("LOCATION" . ,(gnus-icalendar-event:location event))
                       ("PARTICIPATION_TYPE" . ,(symbol-name (gnus-icalendar-event:participation-type event)))
@@ -470,7 +472,9 @@ Return nil for non-recurring EVENT."
       (when description
         (save-restriction
           (narrow-to-region (point) (point))
-          (insert description)
+          (insert (gnus-icalendar-event:org-timestamp event)
+                  "\n\n"
+                  description)
           (indent-region (point-min) (point-max) 2)
           (fill-region (point-min) (point-max))))
 
@@ -551,20 +555,31 @@ is searched."
                 (when description
                   (save-restriction
                     (narrow-to-region (point) (point))
-                    (insert "\n" (replace-regexp-in-string "[\n]+$" "\n" description) "\n")
+                    (insert "\n"
+                            (gnus-icalendar-event:org-timestamp event)
+                            "\n\n"
+                            (replace-regexp-in-string "[\n]+$" "\n" description)
+                            "\n")
                     (indent-region (point-min) (point-max) (1+ entry-outline-level))
                     (fill-region (point-min) (point-max))))
 
                 ;; update entry properties
-                (org-entry-put event-pos "DT" (gnus-icalendar-event:org-timestamp event))
-                (org-entry-put event-pos "ORGANIZER" organizer)
-                (org-entry-put event-pos "LOCATION" location)
-                (org-entry-put event-pos "PARTICIPATION_TYPE" (symbol-name participation-type))
-                (org-entry-put event-pos "REQ_PARTICIPANTS" (gnus-icalendar--format-participant-list req-participants))
-                (org-entry-put event-pos "OPT_PARTICIPANTS" (gnus-icalendar--format-participant-list opt-participants))
-                (org-entry-put event-pos "RRULE" recur)
-                (when reply-status (org-entry-put event-pos "REPLY"
-                                                  (capitalize (symbol-name reply-status))))
+                (gmm-labels
+                    ((update-org-entry (position property value)
+                                       (if (or (null value)
+                                               (string= value ""))
+                                           (org-entry-delete position property)
+                                         (org-entry-put position property value))))
+
+                  (update-org-entry event-pos "ORGANIZER" organizer)
+                  (update-org-entry event-pos "LOCATION" location)
+                  (update-org-entry event-pos "PARTICIPATION_TYPE" (symbol-name participation-type))
+                  (update-org-entry event-pos "REQ_PARTICIPANTS" (gnus-icalendar--format-participant-list req-participants))
+                  (update-org-entry event-pos "OPT_PARTICIPANTS" (gnus-icalendar--format-participant-list opt-participants))
+                  (update-org-entry event-pos "RRULE" recur)
+                  (update-org-entry event-pos "REPLY"
+                                    (if reply-status (capitalize (symbol-name reply-status))
+                                      "Not replied yet")))
                 (save-buffer)))))))))
 
 
index 8dec6f2421705ec3954cfad220130ef8d617300d..2d86d0b81ad7b3992c61ab1c065d984c7b434452 100644 (file)
@@ -146,20 +146,27 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns:
       (any \"\\\\(foo@nowhere\\\\.gov\\\\|foo@localhost\\\\|foo-redist@home\\\\)\"
           - \"bugs-foo\" - \"rambling-foo\" \"mail.foo\"))
    \"mail.others\")"
-  (let* ((newsrc (cdr gnus-newsrc-alist))
-        split)
-    (dolist (info newsrc)
-      (let ((group (gnus-info-group info))
-           (params (gnus-info-params info)))
-       ;; For all GROUPs that match the specified GROUPS
-       (when (or (not groups)
-                 (and (listp groups)
-                      (memq group groups))
-                 (and (stringp groups)
-                      (string-match groups group)))
-         (let ((split-spec (assoc 'split-spec params)) group-clean)
-           ;; Remove backend from group name
-           (setq group-clean (string-match ":" group))
+  (let ((group-names (if (and (listp groups)
+                             (not (null groups)))
+                        groups
+                      (delete-dups
+                       (delq nil
+                             (mapcar
+                              (lambda (info)
+                                (let ((group (gnus-info-group info)))
+                                  (if (or (not groups)
+                                          (and (stringp groups)
+                                               (string-match groups group)))
+                                      group)))
+                              (append gnus-newsrc-alist gnus-parameters))))))
+       split)
+    (dolist (group group-names)
+      (let ((params (gnus-group-find-parameter group)))
+       ;; Skip groups without param (or nonexistent)
+       (when (not (null params))
+         (let ((split-spec (assoc 'split-spec params)) group-clean)
+           ;; Remove backend from group name
+           (setq group-clean (string-match ":" group))
            (setq group-clean
                  (if group-clean
                      (substring group (1+ group-clean))
index 1c8635c5992bc03cfd70c2aa579ff8db5e227968..8b9842918da7f10ad06a3096f990c77db28bd260 100644 (file)
@@ -1726,7 +1726,20 @@ this is a reply."
          (var (or gnus-outgoing-message-group gnus-message-archive-group))
         (gcc-self-val
          (and group (not (gnus-virtual-group-p group))
-              (gnus-group-find-parameter group 'gcc-self)))
+              (gnus-group-find-parameter group 'gcc-self t)))
+        (gcc-self-get (lambda (gcc-self-val group)
+                        (if (stringp gcc-self-val)
+                            (if (string-match " " gcc-self-val)
+                                (concat "\"" gcc-self-val "\"")
+                              gcc-self-val)
+                          ;; In nndoc groups, we use the parent group name
+                          ;; instead of the current group.
+                          (let ((group (or (gnus-group-find-parameter
+                                            gnus-newsgroup-name 'parent-group)
+                                           group)))
+                            (if (string-match " " group)
+                                (concat "\"" group "\"")
+                              group)))))
         result
         (groups
          (cond
@@ -1777,19 +1790,11 @@ this is a reply."
          (if gcc-self-val
              ;; Use the `gcc-self' param value instead.
              (progn
-               (insert
-                (if (stringp gcc-self-val)
-                    (if (string-match " " gcc-self-val)
-                        (concat "\"" gcc-self-val "\"")
-                      gcc-self-val)
-                  ;; In nndoc groups, we use the parent group name
-                  ;; instead of the current group.
-                  (let ((group (or (gnus-group-find-parameter
-                                    gnus-newsgroup-name 'parent-group)
-                                   group)))
-                    (if (string-match " " group)
-                        (concat "\"" group "\"")
-                      group))))
+               (insert (if (listp gcc-self-val)
+                           (mapconcat (lambda (val)
+                                        (funcall gcc-self-get val group))
+                                      gcc-self-val ", ")
+                           (funcall gcc-self-get gcc-self-val group)))
                (if (not (eq gcc-self-val 'none))
                    (insert "\n")
                  (gnus-delete-line)))
@@ -1826,7 +1831,7 @@ this is a reply."
                      (with-current-buffer gnus-summary-buffer
                        gnus-posting-styles)
                    gnus-posting-styles))
-         style match attribute value v results
+         style match attribute value v results matched-string
          filep name address element)
       ;; If the group has a posting-style parameter, add it at the end with a
       ;; regexp matching everything, to be sure it takes precedence over all
@@ -1846,7 +1851,9 @@ this is a reply."
        (when (cond
               ((stringp match)
                ;; Regexp string match on the group name.
-               (string-match match group))
+               (when (string-match match group)
+                  (setq matched-string group)
+                  t))
               ((eq match 'header)
                ;; Obsolete format of header match.
                (and (gnus-buffer-live-p gnus-article-copy)
@@ -1875,7 +1882,8 @@ this is a reply."
                           (nnheader-narrow-to-headers)
                           (let ((header (message-fetch-field (nth 1 match))))
                             (and header
-                                 (string-match (nth 2 match) header)))))))
+                                 (string-match (nth 2 match) header)
+                                 (setq matched-string header)))))))
                 (t
                  ;; This is a form to be evalled.
                  (eval match)))))
@@ -1896,10 +1904,11 @@ this is a reply."
            (setq v
                  (cond
                   ((stringp value)
-                   (if (and (stringp match)
+                   (if (and matched-string
                             (gnus-string-match-p "\\\\[&[:digit:]]" value)
                             (match-beginning 1))
-                       (gnus-match-substitute-replacement value nil nil group)
+                       (gnus-match-substitute-replacement value nil nil
+                                                          matched-string)
                      value))
                   ((or (symbolp value)
                        (functionp value))
index 0621c23c20c2eb228c8ec0a0aec6b3e6fc76c463..ee1083d80056b0e1ae83c2b250fd14a5a76d3c42 100644 (file)
@@ -102,6 +102,9 @@ Return a notification id if any, or t on success."
     ;; Don't return an id
     t))
 
+(declare-function gravatar-retrieve-synchronously "gravatar.el"
+                 (mail-address))
+
 (defun gnus-notifications-get-photo (mail-address)
   "Get photo for mail address."
   (let ((google-photo (when (and gnus-notifications-use-google-contacts
index 83629df1713684ceb249545c481693e667cb8db0..05301673a50a4f7ffa370589d387672a7c1c8456 100644 (file)
 ;;
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'gnus)
diff --git a/lisp/gnus/gnus-setup.el b/lisp/gnus/gnus-setup.el
deleted file mode 100644 (file)
index 7ef8dc5..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-;;; gnus-setup.el --- Initialization & Setup for Gnus 5
-
-;; Copyright (C) 1995-1996, 2000-2014 Free Software Foundation, Inc.
-
-;; Author: Steven L. Baur <steve@miranova.com>
-;; Keywords: news
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;; My head is starting to spin with all the different mail/news packages.
-;; Stop The Madness!
-
-;; Given that Emacs Lisp byte codes may be diverging, it is probably best
-;; not to byte compile this, and just arrange to have the .el loaded out
-;; of .emacs.
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-
-(defvar gnus-use-installed-gnus t
-  "*If non-nil use installed version of Gnus.")
-
-(defvar gnus-use-installed-mailcrypt (featurep 'xemacs)
-  "*If non-nil use installed version of mailcrypt.")
-
-(defvar gnus-emacs-lisp-directory (if (featurep 'xemacs)
-                                     "/usr/local/lib/xemacs/"
-                                   "/usr/local/share/emacs/")
-  "Directory where Emacs site lisp is located.")
-
-(defvar gnus-gnus-lisp-directory (concat gnus-emacs-lisp-directory
-                                        "gnus/lisp/")
-  "Directory where Gnus Emacs lisp is found.")
-
-(defvar gnus-mailcrypt-lisp-directory (concat gnus-emacs-lisp-directory
-                                             "site-lisp/mailcrypt/")
-  "Directory where Mailcrypt Emacs Lisp is found.")
-
-(defvar gnus-bbdb-lisp-directory (concat gnus-emacs-lisp-directory
-                                        "site-lisp/bbdb/")
-  "Directory where Big Brother Database is found.")
-
-(defvar gnus-use-mhe nil
-  "Set this if you want to use MH-E for mail reading.")
-(defvar gnus-use-rmail nil
-  "Set this if you want to use RMAIL for mail reading.")
-(defvar gnus-use-sendmail nil
-  "Set this if you want to use SENDMAIL for mail reading.")
-(defvar gnus-use-vm nil
-  "Set this if you want to use the VM package for mail reading.")
-(defvar gnus-use-sc nil
-  "Set this if you want to use Supercite.")
-(defvar gnus-use-mailcrypt t
-  "Set this if you want to use Mailcrypt for dealing with PGP messages.")
-(defvar gnus-use-bbdb nil
-  "Set this if you want to use the Big Brother DataBase.")
-
-(when (and (not gnus-use-installed-gnus)
-          (null (member gnus-gnus-lisp-directory load-path)))
-  (push gnus-gnus-lisp-directory load-path))
-
-;;; We can't do this until we know where Gnus is.
-(require 'message)
-
-;;; Mailcrypt by
-;;; Jin Choi <jin@atype.com>
-;;; Patrick LoPresti <patl@lcs.mit.edu>
-
-(when gnus-use-mailcrypt
-  (when (and (not gnus-use-installed-mailcrypt)
-            (null (member gnus-mailcrypt-lisp-directory load-path)))
-    (setq load-path (cons gnus-mailcrypt-lisp-directory load-path)))
-  (autoload 'mc-install-write-mode "mailcrypt" nil t)
-  (autoload 'mc-install-read-mode "mailcrypt" nil t)
-;;;   (add-hook 'message-mode-hook 'mc-install-write-mode)
-;;;   (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
-  (when gnus-use-mhe
-    (add-hook 'mh-folder-mode-hook 'mc-install-read-mode)
-    (add-hook 'mh-letter-mode-hook 'mc-install-write-mode)))
-
-;;; BBDB by
-;;; Jamie Zawinski <jwz@lucid.com>
-
-(when gnus-use-bbdb
-  ;; bbdb will never be installed with emacs.
-  (when (null (member gnus-bbdb-lisp-directory load-path))
-    (setq load-path (cons gnus-bbdb-lisp-directory load-path)))
-  (autoload 'bbdb "bbdb-com"
-    "Insidious Big Brother Database" t)
-  (autoload 'bbdb-name "bbdb-com"
-    "Insidious Big Brother Database" t)
-  (autoload 'bbdb-company "bbdb-com"
-    "Insidious Big Brother Database" t)
-  (autoload 'bbdb-net "bbdb-com"
-    "Insidious Big Brother Database" t)
-  (autoload 'bbdb-notes "bbdb-com"
-    "Insidious Big Brother Database" t)
-
-  (when gnus-use-vm
-    (autoload 'bbdb-insinuate-vm "bbdb-vm"
-      "Hook BBDB into VM" t))
-
-  (when gnus-use-rmail
-    (autoload 'bbdb-insinuate-rmail "bbdb-rmail"
-      "Hook BBDB into RMAIL" t)
-    (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail))
-
-  (when gnus-use-mhe
-    (autoload 'bbdb-insinuate-mh "bbdb-mh"
-      "Hook BBDB into MH-E" t)
-    (add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh))
-
-  (autoload 'bbdb-insinuate-gnus "bbdb-gnus"
-    "Hook BBDB into Gnus" t)
-  (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
-
-  (when gnus-use-sendmail
-    (autoload 'bbdb-insinuate-sendmail "bbdb"
-      "Insidious Big Brother Database" t)
-    (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
-    (add-hook 'message-setup-hook 'bbdb-insinuate-sendmail)))
-
-(when gnus-use-sc
-  (add-hook 'mail-citation-hook 'sc-cite-original)
-  (setq message-cite-function 'sc-cite-original))
-\f
-;;;### (autoloads (gnus gnus-slave gnus-no-server) "gnus" "lisp/gnus.el" (12473 2137))
-;;; Generated autoloads from lisp/gnus.el
-
-;; Don't redo this if autoloads already exist
-(unless (fboundp 'gnus)
-  (autoload 'gnus-slave-no-server "gnus" "\
-Read network news as a slave without connecting to local server." t nil)
-
-  (autoload 'gnus-no-server "gnus" "\
-Read network news.
-If ARG is a positive number, Gnus will use that as the
-startup level.  If ARG is nil, Gnus will be started at level 2.
-If ARG is non-nil and not a positive number, Gnus will
-prompt the user for the name of an NNTP server to use.
-As opposed to `gnus', this command will not connect to the local server." t nil)
-
-  (autoload 'gnus-slave "gnus" "\
-Read news as a slave." t nil)
-
-  (autoload 'gnus "gnus" "\
-Read network news.
-If ARG is non-nil and a positive number, Gnus will use that as the
-startup level.  If ARG is non-nil and not a positive number, Gnus will
-prompt the user for the name of an NNTP server to use." t nil)
-
-;;;***
-
-;;; These have moved out of gnus.el into other files.
-;;; FIX FIX FIX: should other things be in gnus-setup? or these not in it?
-  (autoload 'gnus-update-format "gnus-spec" "\
-Update the format specification near point." t nil)
-
-  (autoload 'gnus-fetch-group "gnus-group" "\
-Start Gnus if necessary and enter GROUP.
-Returns whether the fetching was successful or not." t nil)
-
-  (defalias 'gnus-batch-kill 'gnus-batch-score)
-
-  (autoload 'gnus-batch-score "gnus-kill" "\
-Run batched scoring.
-Usage: emacs -batch -l gnus -f gnus-batch-score <newsgroups> ...
-Newsgroups is a list of strings in Bnews format.  If you want to score
-the comp hierarchy, you'd say \"comp.all\".  If you would not like to
-score the alt hierarchy, you'd say \"!alt.all\"." t nil))
-
-(provide 'gnus-setup)
-
-(run-hooks 'gnus-setup-load-hook)
-
-;;; gnus-setup.el ends here
index 54714d503bc75c2fea555f008d2e74fca5a42339..e11ddc4c4f5be4e90ecc656e586402289880ab9d 100644 (file)
@@ -24,9 +24,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile (require 'cl))
 (defvar gnus-newsrc-file-version)
 
index 319f7a8cbce444000fe686b540974b7aee91d8b8..083a3d68183f44232e7f409b2658c2f03d57a877 100644 (file)
@@ -45,7 +45,7 @@
   :group 'gnus-server
   :type 'hook)
 
-(defcustom gnus-server-line-format "     {%(%h:%w%)} %s%a\n"
+(defcustom gnus-server-line-format "     {%(%h:%w%)} %s%a%c\n"
   "Format of server lines.
 It works along the same lines as a normal formatting string,
 with some simple extensions.
@@ -78,6 +78,16 @@ If nil, a faster, but more primitive, buffer is used instead."
 
 ;;; Internal variables.
 
+(defvar gnus-tmp-how)
+(defvar gnus-tmp-name)
+(defvar gnus-tmp-where)
+(defvar gnus-tmp-status)
+(defvar gnus-tmp-agent)
+(defvar gnus-tmp-cloud)
+(defvar gnus-tmp-news-server)
+(defvar gnus-tmp-news-method)
+(defvar gnus-tmp-user-defined)
+
 (defvar gnus-inserted-opened-servers nil)
 
 (defvar gnus-server-line-format-alist
@@ -85,7 +95,8 @@ If nil, a faster, but more primitive, buffer is used instead."
     (?n gnus-tmp-name ?s)
     (?w gnus-tmp-where ?s)
     (?s gnus-tmp-status ?s)
-    (?a gnus-tmp-agent ?s)))
+    (?a gnus-tmp-agent ?s)
+    (?c gnus-tmp-cloud ?s)))
 
 (defvar gnus-server-mode-line-format-alist
   `((?S gnus-tmp-news-server ?s)
@@ -127,6 +138,7 @@ If nil, a faster, but more primitive, buffer is used instead."
        ["Close" gnus-server-close-server t]
        ["Offline" gnus-server-offline-server t]
        ["Deny" gnus-server-deny-server t]
+       ["Toggle Cloud" gnus-server-toggle-cloud-server t]
        "---"
        ["Open All" gnus-server-open-all-servers t]
        ["Close All" gnus-server-close-all-servers t]
@@ -172,6 +184,8 @@ If nil, a faster, but more primitive, buffer is used instead."
 
     "z" gnus-server-compact-server
 
+    "i" gnus-server-toggle-cloud-server
+
     "\C-c\C-i" gnus-info-find-node
     "\C-c\C-b" gnus-bug))
 
@@ -185,6 +199,13 @@ If nil, a faster, but more primitive, buffer is used instead."
 (put 'gnus-server-agent-face 'face-alias 'gnus-server-agent)
 (put 'gnus-server-agent-face 'obsolete-face "22.1")
 
+(defface gnus-server-cloud
+  '((((class color) (background light)) (:foreground "ForestGreen" :bold t))
+    (((class color) (background dark)) (:foreground "PaleGreen" :bold t))
+    (t (:bold t)))
+  "Face used for displaying AGENTIZED servers"
+  :group 'gnus-server-visual)
+
 (defface gnus-server-opened
   '((((class color) (background light)) (:foreground "Green3" :bold t))
     (((class color) (background dark)) (:foreground "Green1" :bold t))
@@ -228,6 +249,7 @@ If nil, a faster, but more primitive, buffer is used instead."
 
 (defvar gnus-server-font-lock-keywords
   '(("(\\(agent\\))" 1 'gnus-server-agent)
+    ("(\\(cloud\\))" 1 'gnus-server-cloud)
     ("(\\(opened\\))" 1 'gnus-server-opened)
     ("(\\(closed\\))" 1 'gnus-server-closed)
     ("(\\(offline\\))" 1 'gnus-server-offline)
@@ -264,8 +286,9 @@ The following commands are available:
         '(gnus-server-font-lock-keywords t)))
   (gnus-run-mode-hooks 'gnus-server-mode-hook))
 
-(defun gnus-server-insert-server-line (gnus-tmp-name method)
-  (let* ((gnus-tmp-how (car method))
+(defun gnus-server-insert-server-line (name method)
+  (let* ((gnus-tmp-name name)
+         (gnus-tmp-how (car method))
         (gnus-tmp-where (nth 1 method))
         (elem (assoc method gnus-opened-servers))
         (gnus-tmp-status
@@ -282,6 +305,9 @@ The following commands are available:
         (gnus-tmp-agent (if (and gnus-agent
                                  (gnus-agent-method-p method))
                             " (agent)"
+                          ""))
+        (gnus-tmp-cloud (if (gnus-cloud-server-p gnus-tmp-name)
+                            " (cloud)"
                           "")))
     (beginning-of-line)
     (gnus-add-text-properties
@@ -1084,6 +1110,27 @@ Requesting compaction of %s... (this may take a long time)"
       (let ((original (get-buffer gnus-original-article-buffer)))
        (and original (gnus-kill-buffer original))))))
 
+(defun gnus-server-toggle-cloud-server ()
+  "Make the server under point be replicated in the Emacs Cloud."
+  (interactive)
+  (let ((server (gnus-server-server-name)))
+    (unless server
+      (error "No server on the current line"))
+
+    (unless (gnus-method-option-p server 'cloud)
+      (error "The server under point doesn't support cloudiness"))
+
+    (if (gnus-cloud-server-p server)
+       (setq gnus-cloud-covered-servers
+             (delete server gnus-cloud-covered-servers))
+      (push server gnus-cloud-covered-servers))
+
+    (gnus-server-update-server server)
+    (gnus-message 1 (if (gnus-cloud-server-p server)
+                       "Replication of %s in the cloud will start"
+                     "Replication of %s in the cloud will stop")
+                 server)))
+
 (provide 'gnus-srvr)
 
 ;;; gnus-srvr.el ends here
index b9b259e0d18c252d2503d74ca027f89e9cc859ce..766e7c26ac4428375eb09b9a6b85625bb01bd987 100644 (file)
@@ -30,6 +30,7 @@
 (require 'gnus-spec)
 (require 'gnus-range)
 (require 'gnus-util)
+(require 'gnus-cloud)
 (autoload 'message-make-date "message")
 (autoload 'gnus-agent-read-servers-validate "gnus-agent")
 (autoload 'gnus-agent-save-local "gnus-agent")
@@ -888,6 +889,11 @@ If REGEXP is given, lines that match it will be deleted."
       (setq buffer-save-without-query t)
       (erase-buffer)
       (setq buffer-file-name dribble-file)
+      ;; The buffer may be shrunk a lot when deleting old entries.
+      ;; It caused the auto-saving to stop.
+      (if (featurep 'emacs)
+         (set (make-local-variable 'auto-save-include-big-deletions) t)
+       (set (make-local-variable 'disable-auto-save-when-buffer-shrinks) nil))
       (auto-save-mode t)
       (buffer-disable-undo)
       (bury-buffer (current-buffer))
index d6c801fdd392e0570708fc933f7667e4ed3b1da0..c0e099ba3ca13ddbff9033171bf29b255accc0c4 100644 (file)
@@ -24,9 +24,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile
   (require 'cl))
 (eval-when-compile
@@ -2188,6 +2185,7 @@ increase the score of each group you read."
 (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map)
   "w" gnus-article-decode-mime-words
   "c" gnus-article-decode-charset
+  "h" gnus-mime-buttonize-attachments-in-header
   "v" gnus-mime-view-all-parts
   "b" gnus-article-view-part)
 
@@ -2394,6 +2392,8 @@ increase the score of each group you read."
              ["QP" gnus-article-de-quoted-unreadable t]
              ["Base64" gnus-article-de-base64-unreadable t]
              ["View MIME buttons" gnus-summary-display-buttonized t]
+             ["View MIME buttons in header"
+              gnus-mime-buttonize-attachments-in-header t]
              ["View all" gnus-mime-view-all-parts t]
              ["Verify and Decrypt" gnus-summary-force-verify-and-decrypt t]
              ["Encrypt body" gnus-article-encrypt-body
@@ -9085,6 +9085,41 @@ non-numeric or nil fetch the number specified by the
       (gnus-summary-limit-include-thread id)))
   (gnus-summary-show-thread))
 
+(defun gnus-summary-open-group-with-article (message-id)
+  "Open a group containing the article with the given MESSAGE-ID."
+  (interactive "sMessage-ID: ")
+  (require 'nndoc)
+  (with-temp-buffer
+    ;; Prepare a dummy article
+    (erase-buffer)
+    (insert "From nobody Tue Sep 13 22:05:34 2011\n\n")
+
+    ;; Prepare pretty modelines for summary and article buffers
+    (let ((gnus-summary-mode-line-format "Found %G")
+          (gnus-article-mode-line-format
+           ;; Group names just get in the way here, especially the
+           ;; abbreviated ones
+           (if (string-match "%[gG]" gnus-article-mode-line-format)
+              (concat (substring gnus-article-mode-line-format
+                                 0 (match-beginning 0))
+                      (substring gnus-article-mode-line-format (match-end 0)))
+            gnus-article-mode-line-format)))
+
+      ;; Build an ephemeral group containing the dummy article (hidden)
+      (gnus-group-read-ephemeral-group
+       message-id
+       `(nndoc ,message-id
+              (nndoc-address ,(current-buffer))
+              (nndoc-article-type mbox))
+       :activate
+       (cons (current-buffer) gnus-current-window-configuration)
+       (not :request-only)
+       '(-1)                           ; :select-articles
+       (not :parameters)
+       0))                             ; :number
+    ;; Fetch the desired article
+    (gnus-summary-refer-article message-id)))
+
 (defun gnus-summary-refer-article (message-id)
   "Fetch an article specified by MESSAGE-ID."
   (interactive "sMessage-ID: ")
@@ -9748,6 +9783,8 @@ If ARG is a negative number, turn header display off."
 (declare-function article-narrow-to-head "gnus-art" ())
 (declare-function gnus-article-hidden-text-p "gnus-art" (type))
 (declare-function gnus-delete-wash-type "gnus-art" (type))
+(declare-function gnus-mime-buttonize-attachments-in-header
+                 "gnus-art" (&optional interactive))
 
 (defun gnus-summary-toggle-header (&optional arg)
   "Show the headers if they are hidden, or hide them if they are shown.
@@ -9779,7 +9816,10 @@ If ARG is a negative number, hide the unwanted header lines."
                  (gnus-treat-hide-boring-headers nil))
              (gnus-delete-wash-type 'headers)
              (gnus-treat-article 'head))
-         (gnus-treat-article 'head))
+         (gnus-treat-article 'head)
+         ;; Add attachment buttons to the header.
+         (when gnus-mime-display-attachment-buttons-in-header
+           (gnus-mime-buttonize-attachments-in-header)))
        (widen)
        (if window
            (set-window-start window (goto-char (point-min))))
@@ -10573,7 +10613,7 @@ groups."
       (let ((lines (count-lines (point) (point-max)))
            (length (- (point-max) (point)))
            (case-fold-search t)
-           (body (copy-marker (point))))
+           (body (point-marker)))
        (goto-char (point-min))
        (when (re-search-forward "^content-length:[ \t]\\([0-9]+\\)" body t)
          (delete-region (match-beginning 1) (match-end 1))
index a3038a1bfe5d245d882c5a3745695e40fb797c09..fe4d707be2e0c0dbb180ca670ce7cbe6118f0f35 100644 (file)
@@ -32,9 +32,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile
   (require 'cl))
 
@@ -1913,17 +1910,25 @@ Sizes are in pixels."
                    image)))
       image)))
 
+(eval-when-compile (require 'gmm-utils))
 (defun gnus-recursive-directory-files (dir)
-  "Return all regular files below DIR."
-  (let (files)
-    (dolist (file (directory-files dir t))
-      (when (and (not (member (file-name-nondirectory file) '("." "..")))
-                (file-readable-p file))
-       (cond
-        ((file-regular-p file)
-         (push file files))
-        ((file-directory-p file)
-         (setq files (append (gnus-recursive-directory-files file) files))))))
+  "Return all regular files below DIR.
+The first found will be returned if a file has hard or symbolic links."
+  (let (files attr attrs)
+    (gmm-labels
+       ((fn (directory)
+            (dolist (file (directory-files directory t))
+              (setq attr (file-attributes (file-truename file)))
+              (when (and (not (member attr attrs))
+                         (not (member (file-name-nondirectory file)
+                                      '("." "..")))
+                         (file-readable-p file))
+                (push attr attrs)
+                (cond ((file-regular-p file)
+                       (push file files))
+                      ((file-directory-p file)
+                       (fn file)))))))
+      (fn dir))
     files))
 
 (defun gnus-list-memq-of-list (elements list)
index b1d60de93d99a999f5618e8cda763bd78c478fb6..206f5a502fc7df8ea840835bca308b6c7f5b8865 100644 (file)
 
 (eval '(run-hooks 'gnus-load-hook))
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 (require 'wid-edit)
 (require 'mm-util)
@@ -309,6 +305,7 @@ be set in `.emacs' instead."
 
 (unless (featurep 'gnus-xmas)
   (defalias 'gnus-make-overlay 'make-overlay)
+  (defalias 'gnus-copy-overlay 'copy-overlay)
   (defalias 'gnus-delete-overlay 'delete-overlay)
   (defalias 'gnus-overlay-get 'overlay-get)
   (defalias 'gnus-overlay-put 'overlay-put)
@@ -316,6 +313,7 @@ be set in `.emacs' instead."
   (defalias 'gnus-overlay-buffer 'overlay-buffer)
   (defalias 'gnus-overlay-start 'overlay-start)
   (defalias 'gnus-overlay-end 'overlay-end)
+  (defalias 'gnus-overlays-at 'overlays-at)
   (defalias 'gnus-overlays-in 'overlays-in)
   (defalias 'gnus-extent-detached-p 'ignore)
   (defalias 'gnus-extent-start-open 'ignore)
@@ -1614,7 +1612,7 @@ slower."
   :type 'string)
 
 (defcustom gnus-valid-select-methods
-  '(("nntp" post address prompt-address physical-address)
+  '(("nntp" post address prompt-address physical-address cloud)
     ("nnspool" post address)
     ("nnvirtual" post-mail virtual prompt-address)
     ("nnmbox" mail respool address)
@@ -1631,7 +1629,7 @@ slower."
     ("nnrss" none global)
     ("nnagent" post-mail)
     ("nnimap" post-mail address prompt-address physical-address respool
-     server-marks)
+     server-marks cloud)
     ("nnmaildir" mail respool address server-marks)
     ("nnnil" none))
   "*An alist of valid select methods.
@@ -2703,7 +2701,10 @@ such as a mark that says whether an article is stored in the cache
                        gnus-newsrc-last-checked-date
                        gnus-newsrc-alist gnus-server-alist
                        gnus-killed-list gnus-zombie-list
-                       gnus-topic-topology gnus-topic-alist)
+                       gnus-topic-topology gnus-topic-alist
+                       gnus-cloud-sequence
+                       gnus-cloud-covered-servers
+                       gnus-cloud-file-timestamps)
   "Gnus variables saved in the quick startup file.")
 
 (defvar gnus-newsrc-alist nil
index 650564e2802e6136fe42c36480d13ceffd3e5dcb..ffbc37ae15887748346f35d7c2aa433a5434dc4d 100644 (file)
@@ -138,9 +138,7 @@ You can provide a list of argument to pass to CB in CBARGS."
   "Retrieve MAIL-ADDRESS gravatar and returns it."
   (let ((url (gravatar-build-url mail-address)))
     (if (gravatar-cache-expired url)
-        (with-current-buffer (if (featurep 'xemacs)
-                                (url-retrieve url)
-                              (url-retrieve-synchronously url))
+        (with-current-buffer (url-retrieve-synchronously url)
          (when gravatar-automatic-caching
             (url-store-in-cache (current-buffer)))
           (let ((data (gravatar-data->image)))
index d54377fae199ce50ac64d179f9ba19cc4c26394a..51b9c9115455994aaba23f4e1d9234a7c26c7305 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'format-spec)
 (eval-when-compile
   (require 'cl)
index 5515a348b4c02b863e39856ee089f6e12f461323..4f1bdf4b1dffe76d689eb96454e7ed55ad581e9a 100644 (file)
@@ -215,10 +215,6 @@ This is a compatibility function for different Emacsen."
       (viewer . vm-mode)
       (test   . (fboundp 'vm-mode))
       (type   . "message/rfc822"))
-     ("rfc-*822"
-      (viewer . w3-mode)
-      (test   . (fboundp 'w3-mode))
-      (type   . "message/rfc822"))
      ("rfc-*822"
       (viewer . view-mode)
       (type   . "message/rfc822")))
@@ -252,10 +248,6 @@ This is a compatibility function for different Emacsen."
       (test   . (eq window-system 'x))
       ("needsx11")))
     ("text"
-     ("plain"
-      (viewer  . w3-mode)
-      (test    . (fboundp 'w3-mode))
-      (type    . "text/plain"))
      ("plain"
       (viewer  . view-mode)
       (test    . (fboundp 'view-mode))
@@ -267,10 +259,6 @@ This is a compatibility function for different Emacsen."
       (viewer . enriched-decode)
       (test   . (fboundp 'enriched-decode))
       (type   . "text/enriched"))
-     ("html"
-      (viewer . mm-w3-prepare-buffer)
-      (test   . (fboundp 'w3-prepare-buffer))
-      (type   . "text/html"))
      ("dns"
       (viewer . dns-mode)
       (test   . (fboundp 'dns-mode))
index 5300de5eabbb91e023614fd5701357b74713bd60..ca0280c874f1431c46ad0b24e3a27986a2028350 100644 (file)
@@ -28,9 +28,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile
   (require 'cl))
 
@@ -50,6 +47,7 @@
 (require 'mml)
 (require 'rfc822)
 (require 'format-spec)
+(require 'dired)
 
 (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
 
@@ -606,7 +604,8 @@ Done before generating the new subject of a forward."
                 regexp))
 
 (defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
-  "*All headers that match this regexp will be deleted when forwarding a message."
+  "*All headers that match this regexp will be deleted when forwarding a message.
+This may also be a list of regexps."
   :version "21.1"
   :group 'message-forwarding
   :type '(repeat :value-to-internal (lambda (widget value)
@@ -616,6 +615,19 @@ Done before generating the new subject of a forward."
                              (widget-editable-list-match widget value)))
                 regexp))
 
+(defcustom message-forward-included-headers nil
+  "If non-nil, delete non-matching headers when forwarding a message.
+Only headers that match this regexp will be included.  This
+variable should be a regexp or a list of regexps."
+  :version "24.5"
+  :group 'message-forwarding
+  :type '(repeat :value-to-internal (lambda (widget value)
+                                     (custom-split-regexp-maybe value))
+                :match (lambda (widget value)
+                         (or (stringp value)
+                             (widget-editable-list-match widget value)))
+                regexp))
+
 (defcustom message-ignored-cited-headers "."
   "*Delete these headers from the messages you yank."
   :group 'message-insertion
@@ -970,8 +982,8 @@ configuration.  See the variable `gnus-cite-attribution-suffix'."
 (defcustom message-citation-line-format "On %a, %b %d %Y, %N wrote:\n"
   "Format of the \"Whomever writes:\" line.
 
-The string is formatted using `format-spec'.  The following
-constructs are replaced:
+The string is formatted using `format-spec'.  The following constructs
+are replaced:
 
   %f   The full From, e.g. \"John Doe <john.doe@example.invalid>\".
   %n   The mail address, e.g. \"john.doe@example.invalid\".
@@ -979,11 +991,14 @@ constructs are replaced:
        back to the mail address.
   %F   The first name if present, e.g.: \"John\".
   %L   The last name if present, e.g.: \"Doe\".
+  %Z, %z   The time zone in the numeric form, e.g.:\"+0000\".
 
 All other format specifiers are passed to `format-time-string'
-which is called using the date from the article your replying to.
-Extracting the first (%F) and last name (%L) is done
-heuristically, so you should always check it yourself.
+which is called using the date from the article your replying to, but
+the date in the formatted string will be expressed in the author's
+time zone as much as possible.
+Extracting the first (%F) and last name (%L) is done heuristically,
+so you should always check it yourself.
 
 Please also read the note in the documentation of
 `message-citation-line-function'."
@@ -2451,6 +2466,7 @@ With prefix-argument just set Follow-Up, don't cross-post."
   "Remove HEADER in the narrowed buffer.
 If IS-REGEXP, HEADER is a regular expression.
 If FIRST, only remove the first instance of the header.
+If REVERSE, remove headers that doesn't match HEADER.
 Return the number of headers removed."
   (goto-char (point-min))
   (let ((regexp (if is-regexp header (concat "^" (regexp-quote header) ":")))
@@ -3907,9 +3923,13 @@ This function uses `mail-citation-hook' if that is non-nil."
 (defvar gnus-extract-address-components)
 
 (autoload 'format-spec "format-spec")
+(autoload 'gnus-date-get-time "gnus-util")
 
-(defun message-insert-formatted-citation-line (&optional from date)
+(defun message-insert-formatted-citation-line (&optional from date tz)
   "Function that inserts a formatted citation line.
+The optional FROM, and DATE are strings containing the contents of
+the From header and the Date header respectively.  The optional TZ
+is a number of seconds, overrides the time zone of DATE.
 
 See `message-citation-line-format'."
   ;; The optional args are for testing/debugging.  They will disappear later.
@@ -3917,7 +3937,7 @@ See `message-citation-line-format'."
   ;; (with-temp-buffer
   ;;   (message-insert-formatted-citation-line
   ;;    "John Doe <john.doe@example.invalid>"
-  ;;    (current-time))
+  ;;    (message-make-date))
   ;;   (buffer-string))
   (when (or message-reply-headers (and from date))
     (unless from
@@ -3934,28 +3954,43 @@ See `message-citation-line-format'."
           (net (car (cdr data)))
           (name-or-net (or (car data)
                            (car (cdr data)) from))
-          (replydate
-           (or
-            date
-            ;; We need Gnus functionality if the user wants date or time from
-            ;; the original article:
-            (when (string-match "%[^fnNFL]" message-citation-line-format)
-              (autoload 'gnus-date-get-time "gnus-util")
-              (gnus-date-get-time (mail-header-date message-reply-headers)))))
+          (time
+           (when (string-match "%[^fnNFL]" message-citation-line-format)
+             (cond ((numberp (car-safe date)) date) ;; backward compatibility
+                   (date (gnus-date-get-time date))
+                   (t
+                    (gnus-date-get-time
+                     (setq date (mail-header-date message-reply-headers)))))))
+          (tz (or tz
+                  (when (stringp date)
+                    (nth 8 (parse-time-string date)))))
           (flist
            (let ((i ?A) lst)
              (when (stringp name)
                ;; Guess first name and last name:
-                (let* ((names (delq nil (mapcar (lambda (x)
-                                                 (if (string-match "\\`\\(\\w\\|[-.]\\)+\\'" x) x nil))
-                                               (split-string name "[ \t]+"))))
-                      (count (length names)))
-                  (cond ((= count 1) (setq fname (car names)
-                                           lname ""))
-                        ((or (= count 2) (= count 3)) (setq fname (car names)
-                                                            lname (mapconcat 'identity (cdr names) " ")))
-                        ((> count 3) (setq fname (mapconcat 'identity (butlast names (- count 2)) " ")
-                                           lname (mapconcat 'identity (nthcdr 2 names) " "))) )
+               (let* ((names (delq
+                              nil
+                              (mapcar
+                               (lambda (x)
+                                 (if (string-match "\\`\\(\\w\\|[-.]\\)+\\'"
+                                                   x)
+                                     x
+                                   nil))
+                               (split-string name "[ \t]+"))))
+                      (count (length names)))
+                 (cond ((= count 1)
+                        (setq fname (car names)
+                              lname ""))
+                       ((or (= count 2) (= count 3))
+                        (setq fname (car names)
+                              lname (mapconcat 'identity (cdr names) " ")))
+                       ((> count 3)
+                        (setq fname (mapconcat 'identity
+                                               (butlast names (- count 2))
+                                               " ")
+                              lname (mapconcat 'identity
+                                               (nthcdr 2 names)
+                                               " "))))
                   (when (string-match "\\(.*\\),\\'" fname)
                     (let ((newlname (match-string 1 fname)))
                       (setq fname lname lname newlname)))))
@@ -3985,7 +4020,7 @@ See `message-citation-line-format'."
                               (>= i ?a)))
                  (push i lst)
                  (push (condition-case nil
-                           (format-time-string (format "%%%c" i) replydate)
+                           (gmm-format-time-string (format "%%%c" i) time tz)
                          (error (format ">%c<" i)))
                        lst))
                (setq i (1+ i)))
@@ -7374,17 +7409,25 @@ Optional DIGEST will use digest to forward."
     (message-remove-ignored-headers b e)))
 
 (defun message-remove-ignored-headers (b e)
-  (when message-forward-ignored-headers
+  (when (or message-forward-ignored-headers
+           message-forward-included-headers)
     (save-restriction
       (narrow-to-region b e)
       (goto-char b)
       (narrow-to-region (point)
                        (or (search-forward "\n\n" nil t) (point)))
-      (let ((ignored (if (stringp message-forward-ignored-headers)
-                        (list message-forward-ignored-headers)
-                      message-forward-ignored-headers)))
-       (dolist (elem ignored)
-         (message-remove-header elem t))))))
+      (when message-forward-ignored-headers
+       (let ((ignored (if (stringp message-forward-ignored-headers)
+                          (list message-forward-ignored-headers)
+                        message-forward-ignored-headers)))
+         (dolist (elem ignored)
+           (message-remove-header elem t))))
+      (when message-forward-included-headers
+       (message-remove-header
+        (if (listp message-forward-included-headers)
+            (regexp-opt message-forward-included-headers)
+          message-forward-included-headers)
+        t nil t)))))
 
 (defun message-forward-make-body-mime (forward-buffer &optional beg end)
   (let ((b (point)))
@@ -7432,8 +7475,7 @@ Optional DIGEST will use digest to forward."
        (goto-char (point-max))))
     (setq e (point))
     (insert "<#/mml>\n")
-    (when (and (not message-forward-decoded-p)
-              message-forward-ignored-headers)
+    (when (not message-forward-decoded-p)
       (message-remove-ignored-headers b e))))
 
 (defun message-forward-make-body-digest-plain (forward-buffer)
@@ -8421,6 +8463,17 @@ Used in `message-simplify-recipients'."
         (message-fetch-field hdr) t))
       ", "))))
 
+;;; multipart/related and HTML support.
+
+(defun message-make-html-message-with-image-files (files)
+  (interactive (list (dired-get-marked-files nil current-prefix-arg)))
+  (message-mail)
+  (message-goto-body)
+  (insert "<#part type=text/html>\n\n")
+  (dolist (file files)
+    (insert (format "<img src=%S>\n\n" file)))
+  (message-goto-to))
+
 (when (featurep 'xemacs)
   (require 'messagexmas)
   (message-xmas-redefine))
index 49724597382306ed745c2f8024eabf6cd1717ded..c2f6df9c62a69b8d16ab76039302bc53274b959d 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'mm-util)
 (require 'rfc2047)
 (require 'mm-encode)
index 17c8fb1b8dbeaf740ffb0572bedda89a2be47ce6..cde0af036a569949028259b0bbfc4b495ca86768 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'mail-parse)
 (require 'mm-bodies)
 (eval-when-compile (require 'cl))
        ((executable-find "w3m") 'gnus-w3m)
        ((executable-find "links") 'links)
        ((executable-find "lynx") 'lynx)
-       ((locate-library "w3") 'w3)
        ((locate-library "html2text") 'html2text)
        (t nil))
   "Render of HTML contents.
@@ -136,13 +131,11 @@ The defined renderer types are:
 `w3m-standalone': use plain w3m;
 `links': use links;
 `lynx': use lynx;
-`w3': use Emacs/W3;
 `html2text': use html2text;
 nil    : use external viewer (default web browser)."
   :version "24.1"
   :type '(choice (const shr)
                  (const gnus-w3m)
-                 (const w3)
                  (const w3m :tag "emacs-w3m")
                 (const w3m-standalone :tag "standalone w3m" )
                 (const links)
@@ -153,9 +146,9 @@ nil    : use external viewer (default web browser)."
   :group 'mime-display)
 
 (defcustom mm-inline-text-html-with-images nil
-  "If non-nil, Gnus will allow retrieving images in HTML contents with
-the <img> tags.  It has no effect on Emacs/w3.  See also the
-documentation for the `mm-w3m-safe-url-regexp' variable."
+  "If non-nil, Gnus will allow retrieving images in HTML that has <img> tags.
+See also the documentation for the `mm-w3m-safe-url-regexp'
+variable."
   :version "22.1"
   :type 'boolean
   :group 'mime-display)
@@ -828,7 +821,6 @@ external if displayed external."
          'inline)
         ((and (mm-inlinable-p ehandle)
               (mm-inlined-p ehandle))
-         (forward-line 1)
          (mm-display-inline handle)
          'inline)
         ((or method
@@ -1875,7 +1867,7 @@ If RECURSIVE, search recursively."
        handle
        `(lambda ()
          (let ((inhibit-read-only t))
-           (delete-region ,(point-min-marker)
+           (delete-region ,(copy-marker (point-min) t)
                           ,(point-max-marker))))))))
 
 (defvar shr-map)
index 882c8545e595aaad7376eaa212777b600fd204c5..d574b9d51df496a5e4a7df06973d02e237032607 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'mm-util)
index 4b46ab74f526b1f08ebc9f2e61e6b64145858f77..bb342d6b8b120324a44deae5d8c3d09890b3a67d 100644 (file)
@@ -21,7 +21,7 @@
 
 ;;; Commentary:
 
-;; Some codes are stolen from w3 and url packages. Some are moved from
+;; Some code is stolen from w3 and url packages. Some are moved from
 ;; nnweb.
 
 ;; TODO: Support POST, cookie.
@@ -264,8 +264,6 @@ This is taken from RFC 2396.")
                (require 'url-parse)
                (require 'url-vars))
            (error nil))
-    ;; w3-4.0pre0.46 or earlier version.
-    (require 'w3-vars)
     (require 'url)))
 
 ;;;###autoload
index 6433ec969388d1e2992a5f95cb24142627fbde20..31b7d073fbe5ff91e7604dcdd8cb12e329058e04 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 (require 'mail-prsvr)
 
index 423324a86f4ccebca3048aa8b799093acb9d94ed..d91d2a41c8f95e01162c9e64e9045b07d603d0e5 100644 (file)
@@ -673,22 +673,34 @@ value of `mm-uu-text-plain-type'."
                     (goto-char text-start)
                     (re-search-forward "." start-point t)))
              (push
-              (mm-make-handle (mm-uu-copy-to-buffer text-start start-point)
-                              mm-uu-text-plain-type)
+              (mm-make-handle
+               (mm-uu-copy-to-buffer
+                text-start
+                ;; A start-separator is likely accompanied by
+                ;; a leading newline.
+                (if (and (eq (char-before start-point) ?\n)
+                         (eq (char-before (1- start-point)) ?\n))
+                    (1- start-point)
+                  start-point))
+               mm-uu-text-plain-type)
               result))
          (push
           (funcall (mm-uu-function-extract entry))
           result)
          (goto-char (setq text-start end-point))))
       (when result
-       (if (and (> (point-max) (1+ text-start))
-                (save-excursion
-                  (goto-char text-start)
-                  (re-search-forward "." nil t)))
-           (push
-            (mm-make-handle (mm-uu-copy-to-buffer text-start (point-max))
-                            mm-uu-text-plain-type)
-            result))
+       (goto-char text-start)
+       (when (re-search-forward "." nil t)
+         (push (mm-make-handle
+                (mm-uu-copy-to-buffer
+                 ;; An end-separator is likely accompanied by
+                 ;; a trailing newline.
+                 (if (eq (char-after text-start) ?\n)
+                     (1+ text-start)
+                   text-start)
+                 (point-max))
+                mm-uu-text-plain-type)
+               result))
        (setq result (cons "multipart/mixed" (nreverse result))))
       result)))
 
index a764fa51c5d996304ee8adeb59dcae8c4ed9deb9..ecfa2ac958252318cb735ae5fbc4827a0f59be21 100644 (file)
@@ -22,9 +22,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile (require 'cl))
 (require 'mail-parse)
 (require 'mailcap)
@@ -51,7 +48,6 @@
 
 (defvar mm-text-html-renderer-alist
   '((shr . mm-shr)
-    (w3 . mm-inline-text-html-render-with-w3)
     (w3m . mm-inline-text-html-render-with-w3m)
     (w3m-standalone . mm-inline-text-html-render-with-w3m-standalone)
     (gnus-w3m . gnus-article-html)
                                 (- (nth 3 edges) (nth 1 edges)))))))
          image))
      b)
-    (insert "\n\n")
+    (insert "\n")
     (mm-handle-set-undisplayer
      handle
      `(lambda ()
        (let ((b ,b)
              (inhibit-read-only t))
          (remove-images b b)
-         (delete-region b (+ b 2)))))))
+         (delete-region b (1+ b)))))))
 
 (defun mm-inline-image-xemacs (handle)
   (when (featurep 'xemacs)
-    (insert "\n\n")
-    (forward-char -2)
+    (insert "\n")
+    (forward-char -1)
     (let ((annot (make-annotation (mm-get-image handle) nil 'text))
        (inhibit-read-only t))
       (mm-handle-set-undisplayer
          (let ((b ,(point-marker))
              (inhibit-read-only t))
            (delete-annotation ,annot)
-           (delete-region (- b 2) b))))
+           (delete-region (1- b) b))))
       (set-extent-property annot 'mm t)
       (set-extent-property annot 'duplicable t))))
 
       (defalias 'mm-inline-image 'mm-inline-image-xemacs)
     (defalias 'mm-inline-image 'mm-inline-image-emacs)))
 
-;; External.
-(declare-function w3-do-setup       "ext:w3"         ())
-(declare-function w3-region         "ext:w3-display" (st nd))
-(declare-function w3-prepare-buffer "ext:w3-display" (&rest args))
-
-(defvar mm-w3-setup nil)
-(defun mm-setup-w3 ()
-  (unless mm-w3-setup
-    (require 'w3)
-    (w3-do-setup)
-    (require 'url)
-    (require 'w3-vars)
-    (require 'url-vars)
-    (setq mm-w3-setup t)))
-
-(defun mm-inline-text-html-render-with-w3 (handle)
-  (mm-setup-w3)
-  (let ((text (mm-get-part handle))
-       (b (point))
-       (url-standalone-mode t)
-       (url-gateway-unplugged t)
-       (w3-honor-stylesheets nil)
-       (url-current-object
-        (url-generic-parse-url (format "cid:%s" (mm-handle-id handle))))
-       (width (window-width))
-       (charset (mail-content-type-get
-                 (mm-handle-type handle) 'charset)))
-    (save-excursion
-      (insert (if charset (mm-decode-string text charset) text))
-      (save-restriction
-       (narrow-to-region b (point))
-       (unless charset
-         (goto-char (point-min))
-         (when (or (and (boundp 'w3-meta-content-type-charset-regexp)
-                        (re-search-forward
-                         w3-meta-content-type-charset-regexp nil t))
-                   (and (boundp 'w3-meta-charset-content-type-regexp)
-                        (re-search-forward
-                         w3-meta-charset-content-type-regexp nil t)))
-           (setq charset
-                 (let ((bsubstr (buffer-substring-no-properties
-                                 (match-beginning 2)
-                                 (match-end 2))))
-                   (if (fboundp 'w3-coding-system-for-mime-charset)
-                       (w3-coding-system-for-mime-charset bsubstr)
-                     (mm-charset-to-coding-system bsubstr nil t))))
-           (delete-region (point-min) (point-max))
-           (insert (mm-decode-string text charset))))
-       (save-window-excursion
-         (save-restriction
-           (let ((w3-strict-width width)
-                 ;; Don't let w3 set the global version of
-                 ;; this variable.
-                 (fill-column fill-column))
-             (if (or debug-on-error debug-on-quit)
-                 (w3-region (point-min) (point-max))
-               (condition-case ()
-                   (w3-region (point-min) (point-max))
-                 (error
-                  (delete-region (point-min) (point-max))
-                  (let ((b (point))
-                        (charset (mail-content-type-get
-                                  (mm-handle-type handle) 'charset)))
-                    (if (or (eq charset 'gnus-decoded)
-                            (eq mail-parse-charset 'gnus-decoded))
-                      (save-restriction
-                        (narrow-to-region (point) (point))
-                        (mm-insert-part handle)
-                        (goto-char (point-max)))
-                      (insert (mm-decode-string (mm-get-part handle)
-                                                charset))))
-                  (message
-                   "Error while rendering html; showing as text/plain")))))))
-       (mm-handle-set-undisplayer
-        handle
-        `(lambda ()
-           (let ((inhibit-read-only t))
-             ,@(if (functionp 'remove-specifier)
-                    '((dolist (prop '(background background-pixmap foreground))
-                        (remove-specifier
-                         (face-property 'default prop)
-                         (current-buffer)))))
-             (delete-region ,(point-min-marker)
-                            ,(point-max-marker)))))))))
-
 (defvar mm-w3m-setup nil
   "Whether gnus-article-mode has been setup to use emacs-w3m.")
 
         handle
         `(lambda ()
            (let ((inhibit-read-only t))
-             (delete-region ,(point-min-marker)
+             (delete-region ,(copy-marker (point-min) t)
                             ,(point-max-marker)))))))))
 
 (defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided)
        handle
        `(lambda ()
           (let ((inhibit-read-only t))
-           (delete-region ,(point-min-marker)
+           (delete-region ,(copy-marker (point-min) t)
                           ,(point-max-marker))))))))
 
 (defun mm-insert-inline (handle text)
      handle
      `(lambda ()
        (let ((inhibit-read-only t))
-         (delete-region ,(copy-marker b)
-                        ,(copy-marker (point))))))))
+         (delete-region ,(copy-marker b t)
+                        ,(point-marker)))))))
 
 (defun mm-inline-audio (handle)
   (message "Not implemented"))
 
-(defun mm-w3-prepare-buffer ()
-  (require 'w3)
-  (let ((url-standalone-mode t)
-       (url-gateway-unplugged t)
-       (w3-honor-stylesheets nil))
-    (w3-prepare-buffer)))
-
 (defun mm-view-message ()
   (mm-enable-multibyte)
   (let (handles)
@@ -616,9 +520,11 @@ If MODE is not set, try to find mode automatically."
              (set-auto-mode)))
          ;; The mode function might have already turned on font-lock.
          ;; Do not fontify if the guess mode is fundamental.
-         (unless (or (symbol-value 'font-lock-mode)
+         (unless (or font-lock-mode
                      (eq major-mode 'fundamental-mode))
-           (font-lock-fontify-buffer))))
+            (if (fboundp 'font-lock-ensure)
+                (font-lock-ensure)
+              (font-lock-fontify-buffer)))))
       ;; By default, XEmacs font-lock uses non-duplicable text
       ;; properties.  This code forces all the text properties
       ;; to be copied along with the text.
index bd7a50f7184c225fa9f16bc501e8c155c170caef..caa1380a497d70856df487380238006494287c0f 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'smime)
index 439d7c5dc1314499d9410ce81c7df92a7ebbb9ea..726faeed6a066d0bca383a58ab9dbe24929b05e7 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'mm-util)
 (require 'mm-bodies)
 (require 'mm-encode)
 (require 'mm-decode)
 (require 'mml-sec)
 (eval-when-compile (require 'cl))
+(eval-when-compile (require 'url))
 (eval-when-compile
   (when (featurep 'xemacs)
     (require 'easy-mmode))) ; for `define-minor-mode'
@@ -463,6 +460,9 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
 (defvar mml-multipart-number 0)
 (defvar mml-inhibit-compute-boundary nil)
 
+(declare-function libxml-parse-html-region "xml.c"
+                 (start end &optional base-url))
+
 (defun mml-generate-mime (&optional multipart-type)
   "Generate a MIME message based on the current MML document.
 MULTIPART-TYPE defaults to \"mixed\", but can also
@@ -472,19 +472,69 @@ be \"related\" or \"alternate\"."
        (options message-options))
     (if (not cont)
        nil
+      (when (and (consp (car cont))
+                (= (length cont) 1)
+                (fboundp 'libxml-parse-html-region)
+                (equal (cdr (assq 'type (car cont))) "text/html"))
+       (setq cont (mml-expand-html-into-multipart-related (car cont))))
       (prog1
          (mm-with-multibyte-buffer
            (setq message-options options)
-           (if (and (consp (car cont))
-                    (= (length cont) 1))
-               (mml-generate-mime-1 (car cont))
+           (cond
+            ((and (consp (car cont))
+                  (= (length cont) 1))
+             (mml-generate-mime-1 (car cont)))
+            ((eq (car cont) 'multipart)
+             (mml-generate-mime-1 cont))
+            (t
              (mml-generate-mime-1
               (nconc (list 'multipart (cons 'type (or multipart-type "mixed")))
-                     cont)))
+                     cont))))
            (setq options message-options)
            (buffer-string))
        (setq message-options options)))))
 
+(defun mml-expand-html-into-multipart-related (cont)
+  (let ((new-parts nil)
+       (cid 1))
+    (mm-with-multibyte-buffer
+      (insert (cdr (assq 'contents cont)))
+      (goto-char (point-min))
+      (with-syntax-table mml-syntax-table
+       (while (re-search-forward "<img\\b" nil t)
+         (goto-char (match-beginning 0))
+         (let* ((start (point))
+                (img (nth 2
+                          (nth 2
+                               (libxml-parse-html-region
+                                (point) (progn (forward-sexp) (point))))))
+                (end (point))
+                (parsed (url-generic-parse-url (cdr (assq 'src (cadr img))))))
+           (when (and (null (url-type parsed))
+                      (url-filename parsed)
+                      (file-exists-p (url-filename parsed)))
+             (goto-char start)
+             (when (search-forward (url-filename parsed) end t)
+               (let ((cid (format "fsf.%d" cid)))
+                 (replace-match (concat "cid:" cid) t t)
+                 (push (list cid (url-filename parsed)) new-parts))
+               (setq cid (1+ cid)))))))
+      ;; We have local images that we want to include.
+      (if (not new-parts)
+         (list cont)
+       (setcdr (assq 'contents cont) (buffer-string))
+       (setq cont
+             (nconc (list 'multipart (cons 'type "related"))
+                    (list cont)))
+       (dolist (new-part (nreverse new-parts))
+         (setq cont
+               (nconc cont
+                      (list `(part (type . "image/png")
+                                   (filename . ,(nth 1 new-part))
+                                   (id . ,(concat "<" (nth 0 new-part)
+                                                  ">")))))))
+       cont))))
+
 (defun mml-generate-mime-1 (cont)
   (let ((mm-use-ultra-safe-encoding
         (or mm-use-ultra-safe-encoding (assq 'sign cont))))
index 8c698edb06af65520842dc27ac6b95bb18e4c425..2663107133d8c7773036e255c1b8d58ed7e7ad0d 100644 (file)
@@ -26,9 +26,6 @@
 ;;; Code:
 
 (eval-and-compile
-  ;; For Emacs <22.2 and XEmacs.
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
-
   (if (locate-library "password-cache")
       (require 'password-cache)
     (require 'password)))
index 9fc8f6e8c0c31d7a206c8bb98d540804d9080f2b..74290f4546998b5d54f7c4653dc49c19aea7ea78 100644 (file)
@@ -28,9 +28,6 @@
 ;;; Code:
 
 (eval-and-compile
-  ;; For Emacs <22.2 and XEmacs.
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
-
   (if (locate-library "password-cache")
       (require 'password-cache)
     (require 'password)))
 ;; Then mml1991 would not need to require mml2015, and mml1991-use
 ;; could be removed.
 (defvar mml2015-use (or
-                    (condition-case nil
-                        (progn
-                          (require 'epg-config)
-                          (epg-check-configuration (epg-configuration))
-                          'epg)
-                      (error))
+                    (progn
+                      (ignore-errors (require 'epg-config))
+                      (and (fboundp 'epg-check-configuration)
+                          'epg))
                     (progn
                       (let ((abs-file (locate-library "pgg")))
                         ;; Don't load PGG if it is marked as obsolete
@@ -152,6 +147,12 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
   :group 'mime-security
   :type 'integer)
 
+(defcustom mml2015-display-key-image t
+  "If t, try to display key images."
+  :version "24.5"
+  :group 'mime-security
+  :type 'boolean)
+
 ;; Extract plaintext from cleartext signature.  IMO, this kind of task
 ;; should be done by GnuPG rather than Elisp, but older PGP backends
 ;; (such as Mailcrypt, and PGG) discard the output from GnuPG.
@@ -903,7 +904,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
 
 (defun mml2015-epg-signature-to-string (signature)
   (concat (epg-signature-to-string signature)
-         (mml2015-epg-key-image-to-string (epg-signature-key-id signature))))
+          (when mml2015-display-key-image
+            (mml2015-epg-key-image-to-string (epg-signature-key-id signature)))))
 
 (defun mml2015-epg-verify-result-to-string (verify-result)
   (mapconcat #'mml2015-epg-signature-to-string verify-result "\n"))
index 3e917b41b19082dadf502c116b3afef9cd097548..764314de0af201d3ecb57f19b90521646469edfb 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'nnheader)
 (require 'nnmail)
 (require 'gnus-start)
index 1a799d3c5734cf7e1beb705e00d50711135c01c0..a403f3965c0f51da8b37d63db1573fe9890c5f9d 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'nnheader)
 (require 'message)
 (require 'nnmail)
index 3ce3dfa1e75d8c0043723e240a6f5679df37bb73..994c2d022c877fb7f07aa85dbfe25100ee365d8e 100644 (file)
@@ -26,9 +26,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile (require 'cl))
 
 (defvar nnmail-extra-headers)
index 2fc2dd6af79f9a531c07b5c547a60823cef6f2df..1730bd4252c660b41b6f2fad5d94b5fe060cc3be 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-and-compile
   (require 'nnheader)
   ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for
@@ -628,6 +624,26 @@ textual parts.")
            (nnheader-ms-strip-cr)
            (cons group article)))))))
 
+(deffoo nnimap-request-articles (articles &optional group server)
+  (when group
+    (setq group (nnimap-decode-gnus-group group)))
+  (with-current-buffer nntp-server-buffer
+    (let ((result (nnimap-change-group group server)))
+      (when result
+       (erase-buffer)
+       (with-current-buffer (nnimap-buffer)
+         (erase-buffer)
+         (when (nnimap-command
+                (if (nnimap-ver4-p)
+                    "UID FETCH %s BODY.PEEK[]"
+                  "UID FETCH %s RFC822.PEEK")
+                (nnimap-article-ranges (gnus-compress-sequence articles)))
+           (let ((buffer (current-buffer)))
+             (with-current-buffer nntp-server-buffer
+               (nnheader-insert-buffer-substring buffer)
+               (nnheader-ms-strip-cr)))
+           t))))))
+
 (defun nnimap-get-whole-article (article &optional command)
   (let ((result
         (nnimap-command
index 5910cde1c3d1a145b25b7f864c8826532fc39210..e2051dfd315ddb8a40bed0b2027782a2c0266770 100644 (file)
 
 ;;; Setup:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'nnoo)
 (require 'gnus-group)
 (require 'message)
index ac4b638fda0ca41ea882e4aab5606bb4ac4832ae..d1a0455a1b04eb0504354abfc0eec4c17a922c53 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'gnus)                                ; for macro gnus-kill-buffer, at least
index 7d33e511baa11541c57b5ea9e0503ebaea0ed624..21fa5b37aa465de582e7fc5411153c8b1ed25797 100644 (file)
    )
 ]
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (require 'nnheader)
 (require 'gnus)
 (require 'gnus-util)
index 5ef91d0be7b96008ee0528a6f9256531d45da2a2..02a9513d07cbc59029914a9db906716a3f437434 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'gnus)
@@ -398,8 +394,8 @@ otherwise return nil."
                                         nnrss-compatible-encoding-alist)))))
     (mm-coding-system-p 'utf-8)))
 
-(declare-function w3-parse-buffer "ext:w3-parse" (&optional buff))
-
+(declare-function libxml-parse-html-region "xml.c"
+                 (start end &optional base-url))
 (defun nnrss-fetch (url &optional local)
   "Fetch URL and put it in a the expected Lisp structure."
   (mm-with-unibyte-buffer
@@ -426,22 +422,14 @@ otherwise return nil."
                  (mm-enable-multibyte))))
       (goto-char (point-min))
 
-      ;; Because xml-parse-region can't deal with anything that isn't
-      ;; xml and w3-parse-buffer can't deal with some xml, we have to
-      ;; parse with xml-parse-region first and, if that fails, parse
-      ;; with w3-parse-buffer.  Yuck.  Eventually, someone should find out
-      ;; why w3-parse-buffer fails to parse some well-formed xml and
-      ;; fix it.
-
       (condition-case err1
          (setq xmlform (xml-parse-region (point-min) (point-max)))
        (error
         (condition-case err2
-            (setq htmlform (caddar (w3-parse-buffer
-                                    (current-buffer))))
+            (setq htmlform (libxml-parse-html-region (point-min) (point-max)))
           (error
            (message "\
-nnrss: %s: Not valid XML %s and w3-parse doesn't work %s"
+nnrss: %s: Not valid XML %s and libxml-parse-html-region doesn't work %s"
                     url err1 err2)))))
       (if htmlform
          htmlform
@@ -599,7 +587,7 @@ which RSS 2.0 allows."
 (defun nnrss-no-cache (url)
   "")
 
-(defun nnrss-insert-w3 (url)
+(defun nnrss-insert (url)
   (mm-with-unibyte-current-buffer
     (condition-case err
        (mm-url-insert url)
@@ -614,8 +602,6 @@ which RSS 2.0 allows."
        (mm-url-decode-entities-nbsp)
        (buffer-string))))
 
-(defalias 'nnrss-insert 'nnrss-insert-w3)
-
 (defun nnrss-mime-encode-string (string)
   (mm-with-multibyte-buffer
     (insert string)
@@ -880,8 +866,7 @@ Careful with this on large documents!"
 
 (defun nnrss-extract-hrefs (data)
   "Recursively extract hrefs from a page's source.
-DATA should be the output of `xml-parse-region' or
-`w3-parse-buffer'."
+DATA should be the output of `xml-parse-region'."
   (mapcar (lambda (ahref)
            (cdr (assoc 'href (cadr ahref))))
          (nnrss-find-el 'a data)))
index 5ef13984abcd0fb15a284107e1f02a001dbbf242..6035162d2948f63928b1a49c74ac407b0f5a3bea 100644 (file)
@@ -25,9 +25,7 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
 (eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
   ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for
   ;; `make-network-stream'.
   (unless (fboundp 'open-protocol-stream)
index 3fb35b2278d09a12af041676f9d641a30654c13e..e909372e8a742c109ddcf3108d94961d8b5d0e89 100644 (file)
@@ -22,8 +22,6 @@
 
 ;;; Commentary:
 
-;; Note: You need to have `w3' installed for some functions to work.
-
 ;;; Code:
 
 (eval-when-compile (require 'cl))
@@ -38,7 +36,6 @@
 (eval-and-compile
   (ignore-errors
     (require 'url)))
-(autoload 'w3-parse-buffer "w3-parse")
 
 (nnoo-declare nnweb)
 
@@ -527,7 +524,7 @@ Valid types include `google', `dejanews', and `gmane'.")
     url))
 
 ;;;
-;;; General web/w3 interface utility functions
+;;; General web interface utility functions
 ;;;
 
 (defun nnweb-insert-html (parse)
index 09c2b723eb7130ba848948f62fa4f4ba3d096a52..74e8f12fc30eb0dc0a3486eb86b0b4a58117eae1 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 (require 'mm-util)
 
index fd97c7d595b26f6dc750872488bd6558f3baa240..62d185e28571ae3e1a66f135eb2bcda9aa8235cf 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (if (locate-library "password-cache")
     (require 'password-cache)
   (require 'password))
index 4a763caba8e32db6d719d9bc85e4430b29ca8bef..bcebe3ddc38e85f21c0e809015dbdd85566f2f92 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (require 'dig)
 
 (if (locate-library "password-cache")
index 82f98c4294f113ae7f0d6a06abfb39938137891f..664ac53a76f5b99449ecc9c91cbfcc950cc82440 100644 (file)
 
 ;;{{{ compilation directives and autoloads/requires
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))
 
 (require 'message)              ;for the message-fetch-field functions
index 46b7370183554ac788cee4df6315598d38258573..248e505ad79790c4281e2dbe34c1fbed17817ae1 100644 (file)
@@ -1,6 +1,7 @@
 ;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2014
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help, internal
@@ -429,6 +430,28 @@ FILE is the file where FUNCTION was probably defined."
       (setq load-hist (cdr load-hist)))
     found))
 
+(defun help-fns--interactive-only (function)
+  "Insert some help blurb if FUNCTION should only be used interactively."
+  ;; Ignore lambda constructs, keyboard macros, etc.
+  (and (symbolp function)
+       (not (eq (car-safe (symbol-function function)) 'macro))
+       (let* ((interactive-only
+               (or (get function 'interactive-only)
+                   (if (boundp 'byte-compile-interactive-only-functions)
+                       (memq function
+                             byte-compile-interactive-only-functions)))))
+         (when interactive-only
+           (insert "\nThis function is for interactive use only"
+                   ;; Cf byte-compile-form.
+                   (cond ((stringp interactive-only)
+                          (format ";\nin Lisp code %s" interactive-only))
+                         ((and (symbolp 'interactive-only)
+                               (not (eq interactive-only t)))
+                          (format ";\nin Lisp code use `%s' instead."
+                                  interactive-only))
+                         (t "."))
+                   "\n")))))
+
 ;;;###autoload
 (defun describe-function-1 (function)
   (let* ((advised (and (symbolp function)
@@ -553,6 +576,7 @@ FILE is the file where FUNCTION was probably defined."
 
 ;; Add defaults to `help-fns-describe-function-functions'.
 (add-hook 'help-fns-describe-function-functions #'help-fns--obsolete)
+(add-hook 'help-fns-describe-function-functions #'help-fns--interactive-only)
 (add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode)
 (add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro)
 
index fa2a4f207e0157c913675f37f640888fbcc62468..63a658f391c5a215d616fdeabd43cbdab77b4aef 100644 (file)
 ;; or run interpreted, but not when the compiled code is loaded.
 (eval-when-compile (require 'help-macro))
 
-;; This makes `with-output-to-temp-buffer' buffers use `help-mode'.
-(add-hook 'temp-buffer-setup-hook 'help-mode-setup)
-(add-hook 'temp-buffer-show-hook 'help-mode-finish)
-
 ;; `help-window-point-marker' is a marker you can move to a valid
 ;; position of the buffer shown in the help window in order to override
 ;; the standard positioning mechanism (`point-min') chosen by
@@ -296,10 +292,11 @@ If that doesn't give a function, return nil."
   (interactive)
   (view-help-file "COPYING"))
 
+;; Maybe this command should just be removed.
 (defun describe-gnu-project ()
-  "Display info on the GNU project."
+  "Browse online information on the GNU project."
   (interactive)
-  (view-help-file "THE-GNU-PROJECT"))
+  (browse-url "http://www.gnu.org/gnu/thegnuproject.html"))
 
 (define-obsolete-function-alias 'describe-project 'describe-gnu-project "22.2")
 
@@ -520,8 +517,10 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
                (if fn
                    (format "Where is command (default %s): " fn)
                  "Where is command: ")
-               obarray 'commandp t))
-     (list (if (equal val "") fn (intern val)) current-prefix-arg)))
+               obarray 'commandp t nil nil
+               (and fn (symbol-name fn))))
+     (list (unless (equal val "") (intern val))
+          current-prefix-arg)))
   (unless definition (error "No command"))
   (let ((func (indirect-function definition))
         (defs nil)
@@ -647,6 +646,68 @@ temporarily enables it to allow getting help on disabled items and buttons."
        (princ (format "%s%s is undefined" key-desc mouse-msg))
       (princ (format "%s%s runs the command %S" key-desc mouse-msg defn)))))
 
+(defun help--key-binding-keymap (key &optional accept-default no-remap position)
+  "Return a keymap holding a binding for KEY within current keymaps.
+The effect of the arguments KEY, ACCEPT-DEFAULT, NO-REMAP and
+POSITION is as documented in the function `key-binding'."
+  (let* ((active-maps (current-active-maps t position))
+         map found)
+    ;; We loop over active maps like key-binding does.
+    (while (and
+            (not found)
+            (setq map (pop active-maps)))
+      (setq found (lookup-key map key accept-default))
+      (when (integerp found)
+        ;; The first `found' characters of KEY were found but not the
+        ;; whole sequence.
+        (setq found nil)))
+    (when found
+      (if (and (symbolp found)
+               (not no-remap)
+               (command-remapping found))
+          ;; The user might want to know in which map the binding is
+          ;; found, or in which map the remapping is found.  The
+          ;; default is to show the latter.
+          (help--key-binding-keymap (vector 'remap found))
+        map))))
+
+(defun help--binding-locus (key position)
+  "Describe in which keymap KEY is defined.
+Return a symbol pointing to that keymap if one exists ; otherwise
+return nil."
+  (let ((map (help--key-binding-keymap key t nil position)))
+    (when map
+      (catch 'found
+        (let ((advertised-syms (nconc
+                                (list 'overriding-terminal-local-map
+                                      'overriding-local-map)
+                                (delq nil
+                                      (mapcar
+                                       (lambda (mode-and-map)
+                                         (let ((mode (car mode-and-map)))
+                                           (when (symbol-value mode)
+                                             (intern-soft
+                                              (format "%s-map" mode)))))
+                                       minor-mode-map-alist))
+                                (list 'global-map
+                                      (intern-soft (format "%s-map" major-mode)))))
+              found)
+          ;; Look into these advertised symbols first.
+          (dolist (sym advertised-syms)
+            (when (and
+                   (boundp sym)
+                   (eq map (symbol-value sym)))
+              (throw 'found sym)))
+          ;; Only look in other symbols otherwise.
+          (mapatoms
+           (lambda (x)
+             (when (and (boundp x)
+                        ;; Avoid let-bound symbols.
+                        (special-variable-p x)
+                        (eq (symbol-value x) map))
+               (throw 'found x))))
+          nil)))))
+
 (defun describe-key (&optional key untranslated up-event)
   "Display documentation of the function invoked by KEY.
 KEY can be any kind of a key sequence; it can include keyboard events,
@@ -709,6 +770,7 @@ temporarily enables it to allow getting help on disabled items and buttons."
         (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
                            (memq 'drag modifiers)) " at that spot" ""))
         (defn (key-binding key t))
+         key-locus key-locus-up key-locus-up-tricky
         defn-up defn-up-tricky ev-type
         mouse-1-remapped mouse-1-tricky)
 
@@ -747,15 +809,19 @@ temporarily enables it to allow getting help on disabled items and buttons."
                   (setcar up-event (elt mouse-1-remapped 0)))
                  (t (setcar up-event 'mouse-2))))
          (setq defn-up (key-binding sequence nil nil (event-start up-event)))
+          (setq key-locus-up (help--binding-locus sequence (event-start up-event)))
          (when mouse-1-tricky
            (setq sequence (vector up-event))
            (aset sequence 0 'mouse-1)
-           (setq defn-up-tricky (key-binding sequence nil nil (event-start up-event))))))
+           (setq defn-up-tricky (key-binding sequence nil nil (event-start up-event)))
+            (setq key-locus-up-tricky (help--binding-locus sequence (event-start up-event))))))
+      (setq key-locus (help--binding-locus key (event-start event)))
       (with-help-window (help-buffer)
        (princ (help-key-description key untranslated))
-       (princ (format "\
-%s runs the command %S, which is "
-                      mouse-msg defn))
+       (princ (format "%s runs the command %S%s, which is "
+                      mouse-msg defn (if key-locus
+                                          (format " (found in %s)" key-locus)
+                                        "")))
        (describe-function-1 defn)
        (when up-event
          (unless (or (null defn-up)
@@ -765,13 +831,15 @@ temporarily enables it to allow getting help on disabled items and buttons."
 
 ----------------- up-event %s----------------
 
-%s%s%s runs the command %S, which is "
+%s%s%s runs the command %S%s, which is "
                           (if mouse-1-tricky "(short click) " "")
                           (key-description (vector up-event))
                           mouse-msg
                           (if mouse-1-remapped
                                " is remapped to <mouse-2>, which" "")
-                          defn-up))
+                          defn-up (if key-locus-up
+                                       (format " (found in %s)" key-locus-up)
+                                     "")))
            (describe-function-1 defn-up))
          (unless (or (null defn-up-tricky)
                      (integerp defn-up-tricky)
@@ -781,10 +849,12 @@ temporarily enables it to allow getting help on disabled items and buttons."
 ----------------- up-event (long click) ----------------
 
 Pressing <%S>%s for longer than %d milli-seconds
-runs the command %S, which is "
+runs the command %S%s, which is "
                           ev-type mouse-msg
                           mouse-1-click-follows-link
-                          defn-up-tricky))
+                          defn-up-tricky (if key-locus-up-tricky
+                                              (format " (found in %s)" key-locus-up-tricky)
+                                            "")))
            (describe-function-1 defn-up-tricky)))))))
 \f
 (defun describe-mode (&optional buffer)
index 78efd8671c47063515fefe068c4bfa3057f116da..98a26dd463487c855b81024fcff609bd3893ea73 100644 (file)
@@ -391,7 +391,7 @@ versions before 22 use the following in your init file:
        (font-lock-remove-keywords nil hi-lock-file-patterns)
        (setq hi-lock-file-patterns nil))
       (remove-overlays nil nil 'hi-lock-overlay t)
-      (when font-lock-fontified (font-lock-fontify-buffer)))
+      (font-lock-flush))
     (define-key-after menu-bar-edit-menu [hi-lock] nil)
     (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook t)))
 
@@ -601,7 +601,7 @@ then remove all hi-lock highlighting."
             (delq keyword hi-lock-interactive-patterns))
       (remove-overlays
        nil nil 'hi-lock-overlay-regexp (hi-lock--hashcons (car keyword)))
-      (when font-lock-fontified (font-lock-fontify-buffer)))))
+      (font-lock-flush))))
 
 ;;;###autoload
 (defun hi-lock-write-interactive-patterns ()
@@ -695,7 +695,7 @@ with completion and history."
       (if (and font-lock-mode (font-lock-specified-p major-mode))
          (progn
            (font-lock-add-keywords nil (list pattern) t)
-           (font-lock-fontify-buffer))
+           (font-lock-flush))
         (let* ((range-min (- (point) (/ hi-lock-highlight-range 2)))
                (range-max (+ (point) (/ hi-lock-highlight-range 2)))
                (search-start
@@ -719,7 +719,7 @@ with completion and history."
     (font-lock-remove-keywords nil hi-lock-file-patterns)
     (setq hi-lock-file-patterns patterns)
     (font-lock-add-keywords nil hi-lock-file-patterns t)
-    (font-lock-fontify-buffer)))
+    (font-lock-flush)))
 
 (defun hi-lock-find-patterns ()
   "Find patterns in current buffer for hi-lock."
index d3b8a2cf6c5da1f78ddc8fc172bd99d8f8a689ce..ec6007ebf828b4975bb5263722810b1b16311309 100644 (file)
@@ -637,15 +637,27 @@ string).  It returns t if a new completion is found, nil otherwise."
 The argument OLD has to be nil the first call of this function, and t
 for subsequent calls (for further possible completions of the same
 string).  It returns t if a new completion is found, nil otherwise."
+  (he--all-buffers
+   old
+   (lambda () (he-line-beg (and (get-buffer-process (current-buffer))
+                           comint-use-prompt-regexp
+                           comint-prompt-regexp)))
+   (lambda (string)
+     (he-line-search string
+                     (and (get-buffer-process (current-buffer))
+                          comint-use-prompt-regexp
+                          comint-prompt-regexp)
+                     nil))))
+
+(defun he--all-buffers (old beg-function search-function)
   (let ((expansion ())
-       (strip-prompt (and (get-buffer-process (current-buffer))
-                          comint-use-prompt-regexp
-                          comint-prompt-regexp))
-       (buf (current-buffer))
-       (orig-case-fold-search case-fold-search))
+        (buf (current-buffer))
+        (only-buffers hippie-expand-only-buffers)
+        (ignore-buffers hippie-expand-ignore-buffers)
+        (orig-case-fold-search case-fold-search))
     (if (not old)
-       (progn
-         (he-init-string (he-line-beg strip-prompt) (point))
+        (progn
+         (he-init-string (funcall beg-function) (point))
          (setq he-search-bufs (buffer-list))
          (setq he-searched-n-bufs 0)
          (set-marker he-search-loc 1 (car he-search-bufs))))
@@ -654,24 +666,20 @@ string).  It returns t if a new completion is found, nil otherwise."
        (while (and he-search-bufs
                    (not expansion)
                    (or (not hippie-expand-max-buffers)
-                       (< he-searched-n-bufs hippie-expand-max-buffers)))
-         (set-buffer (car he-search-bufs))
-         (if (and (not (eq (current-buffer) buf))
-                  (if hippie-expand-only-buffers
-                      (he-buffer-member hippie-expand-only-buffers)
-                    (not (he-buffer-member hippie-expand-ignore-buffers))))
-             (save-excursion
-               (save-restriction
-                 (if hippie-expand-no-restriction
+                        (< he-searched-n-bufs hippie-expand-max-buffers)))
+          (set-buffer (car he-search-bufs))
+          (if (and (not (eq (current-buffer) buf))
+                   (if only-buffers
+                       (he-buffer-member only-buffers)
+                     (not (he-buffer-member ignore-buffers))))
+              (save-excursion
+                (save-restriction
+                  (if hippie-expand-no-restriction
                      (widen))
                  (goto-char he-search-loc)
-                 (setq strip-prompt (and (get-buffer-process (current-buffer))
-                                         comint-use-prompt-regexp
-                                         comint-prompt-regexp))
                  (setq expansion
                        (let ((case-fold-search orig-case-fold-search))
-                         (he-line-search he-search-string
-                                         strip-prompt nil)))
+                         (funcall search-function he-search-string)))
                  (set-marker he-search-loc (point))
                  (if (not expansion)
                      (progn
@@ -686,9 +694,9 @@ string).  It returns t if a new completion is found, nil otherwise."
        (progn
          (if old (he-reset-string))
          ())
-       (progn
-         (he-substitute-string expansion t)
-         t))))
+      (progn
+        (he-substitute-string expansion t)
+        t))))
 
 (defun he-line-search (str strip-prompt reverse)
   (let ((result ()))
@@ -769,53 +777,9 @@ string).  It returns t if a new completion is found, nil otherwise."
 The argument OLD has to be nil the first call of this function, and t
 for subsequent calls (for further possible completions of the same
 string).  It returns t if a new completion is found, nil otherwise."
-  (let ((expansion ())
-       (buf (current-buffer))
-       (orig-case-fold-search case-fold-search))
-    (if (not old)
-       (progn
-         (he-init-string (he-list-beg) (point))
-         (setq he-search-bufs (buffer-list))
-         (setq he-searched-n-bufs 0)
-         (set-marker he-search-loc 1 (car he-search-bufs))))
-
-    (if (not (equal he-search-string ""))
-       (while (and he-search-bufs
-                   (not expansion)
-                   (or (not hippie-expand-max-buffers)
-                       (< he-searched-n-bufs hippie-expand-max-buffers)))
-         (set-buffer (car he-search-bufs))
-         (if (and (not (eq (current-buffer) buf))
-                  (if hippie-expand-only-buffers
-                      (he-buffer-member hippie-expand-only-buffers)
-                    (not (he-buffer-member hippie-expand-ignore-buffers))))
-             (save-excursion
-               (save-restriction
-                 (if hippie-expand-no-restriction
-                     (widen))
-                 (goto-char he-search-loc)
-                 (setq expansion
-                       (let ((case-fold-search orig-case-fold-search))
-                         (he-list-search he-search-string nil)))
-                 (set-marker he-search-loc (point))
-                 (if (not expansion)
-                     (progn
-                       (setq he-search-bufs (cdr he-search-bufs))
-                       (setq he-searched-n-bufs (1+ he-searched-n-bufs))
-                       (set-marker he-search-loc 1 (car he-search-bufs))))))
-           (setq he-search-bufs (cdr he-search-bufs))
-           (set-marker he-search-loc 1 (car he-search-bufs)))))
-
-    (set-buffer buf)
-    (if (not expansion)
-       (progn
-         (if old (he-reset-string))
-         ())
-       (progn
-         (he-substitute-string expansion t)
-         t))))
+  (he--all-buffers old #'he-list-beg #'he-list-search))
 
-(defun he-list-search (str reverse)
+(defun he-list-search (str &optional reverse)
   (let ((result ())
        beg pos err)
     (while (and (not result)
@@ -924,51 +888,7 @@ string).  It returns t if a new expansion is found, nil otherwise."
 The argument OLD has to be nil the first call of this function, and t
 for subsequent calls (for further possible expansions of the same
 string).  It returns t if a new expansion is found, nil otherwise."
-  (let ((expansion ())
-       (buf (current-buffer))
-       (orig-case-fold-search case-fold-search))
-    (if (not old)
-       (progn
-         (he-init-string (he-dabbrev-beg) (point))
-         (setq he-search-bufs (buffer-list))
-         (setq he-searched-n-bufs 0)
-         (set-marker he-search-loc 1 (car he-search-bufs))))
-
-    (if (not (equal he-search-string ""))
-       (while (and he-search-bufs
-                   (not expansion)
-                   (or (not hippie-expand-max-buffers)
-                       (< he-searched-n-bufs hippie-expand-max-buffers)))
-         (set-buffer (car he-search-bufs))
-         (if (and (not (eq (current-buffer) buf))
-                  (if hippie-expand-only-buffers
-                      (he-buffer-member hippie-expand-only-buffers)
-                    (not (he-buffer-member hippie-expand-ignore-buffers))))
-             (save-excursion
-               (save-restriction
-                 (if hippie-expand-no-restriction
-                     (widen))
-                 (goto-char he-search-loc)
-                 (setq expansion
-                       (let ((case-fold-search orig-case-fold-search))
-                         (he-dabbrev-search he-search-string nil)))
-                 (set-marker he-search-loc (point))
-                 (if (not expansion)
-                     (progn
-                       (setq he-search-bufs (cdr he-search-bufs))
-                       (setq he-searched-n-bufs (1+ he-searched-n-bufs))
-                       (set-marker he-search-loc 1 (car he-search-bufs))))))
-           (setq he-search-bufs (cdr he-search-bufs))
-           (set-marker he-search-loc 1 (car he-search-bufs)))))
-
-    (set-buffer buf)
-    (if (not expansion)
-       (progn
-         (if old (he-reset-string))
-         ())
-       (progn
-         (he-substitute-string expansion t)
-         t))))
+  (he--all-buffers old #'he-dabbrev-beg #'he-dabbrev-search))
 
 ;; Thanks go to Jeff Dairiki <dairiki@faraday.apl.washington.edu> who
 ;; suggested this one.
index 56887f39befdee1176b7b8880819e3972cf9eefa..5128ca8f9c49a4eb99d9f4e928a7ed9dfe0fea93 100644 (file)
@@ -1809,17 +1809,25 @@ fontified.  This is a simple convenience wrapper around
   (eval-and-compile (require 'font-lock))
   (if (boundp 'font-lock-cache-position)
       (or font-lock-cache-position
-          (set 'font-lock-cache-position (make-marker))))
-  (if (not noninteractive)
-      (progn
-        (message "hfy interactive mode (%S %S)" window-system major-mode)
-        (when (and font-lock-defaults
-                   font-lock-mode)
-          (font-lock-fontify-region (point-min) (point-max) nil)))
+          (setq font-lock-cache-position (make-marker))))
+  (cond
+   (noninteractive
     (message "hfy batch mode (%s:%S)"
              (or (buffer-file-name) (buffer-name)) major-mode)
-    (when font-lock-defaults
-      (font-lock-fontify-buffer)) ))
+    (if (fboundp 'font-lock-ensure)
+        (font-lock-ensure)
+      (when font-lock-defaults
+        (font-lock-fontify-buffer))))
+   ((fboundp #'jit-lock-fontify-now)
+    (message "hfy jit-lock mode (%S %S)" window-system major-mode)
+    (jit-lock-fontify-now))
+   (t
+    (message "hfy interactive mode (%S %S)" window-system major-mode)
+    ;; If jit-lock is not in use, then the buffer is already fontified!
+    ;; (when (and font-lock-defaults
+    ;;            font-lock-mode)
+    ;;   (font-lock-fontify-region (point-min) (point-max) nil))
+    )))
 
 ;;;###autoload
 (defun htmlfontify-buffer (&optional srcdir file)
index de6bb85bcb6b8559a25b02950a7d75bcf1fc9584..b75946475dd652fad21168a40893cf4912f8514b 100644 (file)
@@ -90,6 +90,8 @@ otherwise it defaults to t, used for times when the buffer is not displayed."
 
 (defun image-mode-window-put (prop val &optional winprops)
   (unless (consp winprops) (setq winprops (image-mode-winprops winprops)))
+  (unless (eq t (car winprops))
+    (image-mode-window-put prop val t))
   (setcdr winprops (cons (cons prop val)
                          (delq (assq prop (cdr winprops)) (cdr winprops)))))
 
index 2b2490b5bdc11eebdff820073b22a7cb24293bf8..405d6a22449d258b639a7fe3a78dffe278c18e29 100644 (file)
@@ -1,4 +1,4 @@
-;; info.el --- info package for Emacs
+;; info.el --- Info package for Emacs  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1985-1986, 1992-2014 Free Software Foundation, Inc.
 
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
 (defgroup info nil
   "Info subsystem."
   :group 'help
   :group 'docs)
 
 
-(defvar Info-history nil
+(defvar-local Info-history nil
   "Stack of Info nodes user has visited.
 Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
 
-(defvar Info-history-forward nil
+(defvar-local Info-history-forward nil
   "Stack of Info nodes user has visited with `Info-history-back' command.
 Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
 
@@ -375,33 +377,33 @@ with wrapping around the current Info node."
 (make-obsolete-variable 'Info-edit-mode-hook
                        "editing Info nodes by hand is not recommended." "24.4")
 
-(defvar Info-current-file nil
+(defvar-local Info-current-file nil
   "Info file that Info is now looking at, or nil.
 This is the name that was specified in Info, not the actual file name.
 It doesn't contain directory names or file name extensions added by Info.")
 
-(defvar Info-current-subfile nil
+(defvar-local Info-current-subfile nil
   "Info subfile that is actually in the *info* buffer now.
 It is nil if current Info file is not split into subfiles.")
 
-(defvar Info-current-node nil
+(defvar-local Info-current-node nil
   "Name of node that Info is now looking at, or nil.")
 
-(defvar Info-tag-table-marker nil
+(defvar-local Info-tag-table-marker nil
   "Marker pointing at beginning of current Info file's tag table.
 Marker points nowhere if file has no tag table.")
 
-(defvar Info-tag-table-buffer nil
+(defvar-local Info-tag-table-buffer nil
   "Buffer used for indirect tag tables.")
 
-(defvar Info-current-file-completions nil
+(defvar-local Info-current-file-completions nil
   "Cached completion list for current Info file.")
 
 (defvar Info-file-completions nil
   "Cached completion alist of visited Info files.
 Each element of the alist is (FILE . COMPLETIONS)")
 
-(defvar Info-file-supports-index-cookies nil
+(defvar-local Info-file-supports-index-cookies nil
   "Non-nil if current Info file supports index cookies.")
 
 (defvar Info-file-supports-index-cookies-list nil
@@ -409,7 +411,7 @@ Each element of the alist is (FILE . COMPLETIONS)")
 Each element of the list is a list (FILENAME SUPPORTS-INDEX-COOKIES)
 where SUPPORTS-INDEX-COOKIES can be either t or nil.")
 
-(defvar Info-index-alternatives nil
+(defvar-local Info-index-alternatives nil
   "List of possible matches for last `Info-index' command.")
 
 (defvar Info-point-loc nil
@@ -455,7 +457,7 @@ existing node names.  OPERATION is one of the following operation
 symbols `find-node' that define what HANDLER function to call instead
 of calling the default corresponding function to override it.")
 
-(defvar Info-current-node-virtual nil
+(defvar-local Info-current-node-virtual nil
   "Non-nil if the current Info node is virtual.")
 
 (defun Info-virtual-file-p (filename)
@@ -954,10 +956,10 @@ otherwise, that defaults to `Top'."
   (unless nodename (setq nodename "Top"))
   (info-initialize)
   (Info-mode)
-  (set (make-local-variable 'Info-current-file)
-       (or buffer-file-name
-          ;; If called on a non-file buffer, make a fake file name.
-          (concat default-directory (buffer-name))))
+  (setq Info-current-file
+        (or buffer-file-name
+            ;; If called on a non-file buffer, make a fake file name.
+            (concat default-directory (buffer-name))))
   (Info-find-node-2 nil nodename))
 
 (defun Info-revert-find-node (filename nodename)
@@ -1091,7 +1093,7 @@ is non-nil)."
            (set-marker Info-tag-table-marker nil)
            (setq buffer-read-only t)
            (set-buffer-modified-p nil)
-           (set (make-local-variable 'Info-current-node-virtual) t)))
+           (setq Info-current-node-virtual t)))
         ((not (and
                ;; Reread a file when moving from a virtual node.
                (not Info-current-node-virtual)
@@ -1101,7 +1103,7 @@ is non-nil)."
          (let ((inhibit-read-only t))
            (when Info-current-node-virtual
              ;; When moving from a virtual node.
-             (set (make-local-variable 'Info-current-node-virtual) nil)
+             (setq Info-current-node-virtual nil)
              (if (null filename)
                  (setq filename Info-current-file)))
            (setq Info-current-file nil
@@ -1112,7 +1114,7 @@ is non-nil)."
            (info-insert-file-contents filename nil)
            (setq default-directory (file-name-directory filename))
            (set-buffer-modified-p nil)
-           (set (make-local-variable 'Info-file-supports-index-cookies)
+           (setq Info-file-supports-index-cookies
                 (Info-file-supports-index-cookies filename))
 
            ;; See whether file has a tag table.  Record the location if yes.
@@ -1251,17 +1253,17 @@ is non-nil)."
 
 ;; Cache the contents of the (virtual) dir file, once we have merged
 ;; it for the first time, so we can save time subsequently.
-(defvar Info-dir-contents nil)
+(defvar-local Info-dir-contents nil)
 
 ;; Cache for the directory we decided to use for the default-directory
 ;; of the merged dir text.
-(defvar Info-dir-contents-directory nil)
+(defvar-local Info-dir-contents-directory nil)
 
 ;; Record the file attributes of all the files from which we
 ;; constructed Info-dir-contents.
-(defvar Info-dir-file-attributes nil)
+(defvar-local Info-dir-file-attributes nil)
 
-(defvar Info-dir-file-name nil)
+(defvar-local Info-dir-file-name nil)
 
 ;; Construct the Info directory node by merging the files named `dir'
 ;; from various directories.  Set the *info* buffer's
@@ -1334,13 +1336,12 @@ is non-nil)."
                          ;; knows...
                          (let ((inhibit-null-byte-detection t))
                            (insert-file-contents file)
-                           (set (make-local-variable 'Info-dir-file-name)
-                                file)
+                           (setq Info-dir-file-name file)
                            (push (current-buffer) buffers)
                            (push (cons file attrs) dir-file-attrs))
                        (error (kill-buffer (current-buffer))))))))
          (unless (cdr dirs)
-           (set (make-local-variable 'Info-dir-contents-directory)
+           (setq Info-dir-contents-directory
                 (file-name-as-directory (car dirs))))
          (setq dirs (cdr dirs))))
 
@@ -1425,8 +1426,8 @@ is non-nil)."
       (if problems
          (message "Composing main Info directory...problems encountered, see `*Messages*'")
        (message "Composing main Info directory...done"))
-      (set (make-local-variable 'Info-dir-contents) (buffer-string))
-      (set (make-local-variable 'Info-dir-file-attributes) dir-file-attrs)))
+      (setq Info-dir-contents (buffer-string))
+      (setq Info-dir-file-attributes dir-file-attrs)))
   (setq default-directory Info-dir-contents-directory))
 
 (defvar Info-streamline-headings
@@ -1892,7 +1893,7 @@ the Top node in FILENAME."
                        (cons (list (match-string-no-properties 1))
                              compl))))))))
     (setq compl (cons '("*") (nreverse compl)))
-    (set (make-local-variable 'Info-current-file-completions) compl)
+    (setq Info-current-file-completions compl)
     compl))
 
 \f
@@ -2207,7 +2208,7 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat."
          "[" (or allowedchars "^,\t\n") " ]" ;The last char can't be a space.
          "\\|\\)\\)"))                       ;Allow empty node names.
 
-;;; For compatibility; other files have used this name.
+;; For compatibility; other files have used this name.
 (defun Info-following-node-name ()
   (and (looking-at (Info-following-node-name-re))
        (match-string-no-properties 1)))
@@ -2645,7 +2646,7 @@ Because of ambiguities, this should be concatenated with something like
 (defvar Info-complete-menu-buffer)
 (defvar Info-complete-next-re nil)
 (defvar Info-complete-nodes nil)
-(defvar Info-complete-cache nil)
+(defvar-local Info-complete-cache nil)
 
 (defconst Info-node-spec-re
   (concat (Info-following-node-name-re "^.,:") "[,:.]")
@@ -2690,9 +2691,7 @@ Because of ambiguities, this should be concatenated with something like
                      (equal (nth 1 Info-complete-cache) Info-current-node)
                      (equal (nth 2 Info-complete-cache) Info-complete-next-re)
                      (equal (nth 5 Info-complete-cache) Info-complete-nodes)
-                     (let ((prev (nth 3 Info-complete-cache)))
-                       (eq t (compare-strings string 0 (length prev)
-                                              prev 0 nil t))))
+                     (string-prefix-p (nth 3 Info-complete-cache) string) t)
                 ;; We can reuse the previous list.
                 (setq completions (nth 4 Info-complete-cache))
               ;; The cache can't be used.
@@ -2714,7 +2713,7 @@ Because of ambiguities, this should be concatenated with something like
               (unless (equal Info-current-node orignode)
                 (Info-goto-node orignode))
               ;; Update the cache.
-              (set (make-local-variable 'Info-complete-cache)
+              (setq Info-complete-cache
                   (list Info-current-file Info-current-node
                         Info-complete-next-re string completions
                         Info-complete-nodes)))
@@ -3562,9 +3561,9 @@ Return a list of matches where each element is in the format
        (goto-char (point-min))
        (re-search-forward "\\* Menu: *\n" nil t)
        (while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t)
-         ;; add-to-list makes sure we don't have duplicates in `manuals',
+         ;; Make sure we don't have duplicates in `manuals',
          ;; so that the following dolist loop runs faster.
-         (add-to-list 'manuals (match-string 1)))
+         (cl-pushnew (match-string 1) manuals :test #'equal))
        (dolist (manual (nreverse manuals))
          (message "Searching %s" manual)
          (condition-case err
@@ -3633,6 +3632,18 @@ Build a menu of the possible matches."
 (defvar finder-keywords-hash)
 (defvar package--builtins)             ; finder requires package
 
+(defun info--prettify-description (desc)
+  (if (stringp desc)
+      (with-temp-buffer
+       (insert desc)
+       (if (equal ?. (char-before))
+           (delete-char -1))
+       (goto-char (point-min))
+       (or (let (case-fold-search) (looking-at-p "\\.\\|[[:upper:]]"))
+           (capitalize-word 1))
+       (buffer-string))
+    desc))
+
 (defun Info-finder-find-node (_filename nodename &optional _no-going-back)
   "Finder-specific implementation of `Info-find-node-2'."
   (require 'finder)
@@ -3651,7 +3662,7 @@ Build a menu of the possible matches."
        (insert (format "* %s %s.\n"
                        (concat (symbol-name keyword) ": "
                                "Keyword " (symbol-name keyword) ".")
-                       (cdr assoc))))))
+                       (info--prettify-description (cdr assoc)))))))
    ((equal nodename "Keyword unknown")
     ;; Display unknown keywords
     (insert (format "\n\^_\nFile: %s,  Node: %s,  Up: Top\n\n"
@@ -3679,7 +3690,7 @@ Build a menu of the possible matches."
        (when (vectorp desc)
          (insert (format "* %-16s %s.\n"
                          (concat (symbol-name (car package)) "::")
-                         (aref desc 2)))))))
+                         (info--prettify-description (aref desc 2))))))))
    ((string-match "\\`Keyword " nodename)
     (setq nodename (substring nodename (match-end 0)))
     ;; Display packages that match the keyword
@@ -3700,27 +3711,31 @@ Build a menu of the possible matches."
        (push (copy-tree (gethash keyword finder-keywords-hash)) hits))
       (setq hits (delete-dups (apply 'append hits))
            ;; Not a meaningful package.
-           hits (delete 'emacs hits))
+           hits (delete 'emacs hits)
+           hits (sort hits (lambda (a b) (string< (symbol-name a)
+                                                  (symbol-name b)))))
       (dolist (package hits)
        (setq desc (cdr-safe (assq package package--builtins)))
        (when (vectorp desc)
          (insert (format "* %-16s %s.\n"
                          (concat (symbol-name package) "::")
-                         (aref desc 2)))))))
+                         (info--prettify-description (aref desc 2))))))))
    (t
     ;; Display commentary section
     (insert (format "\n\^_\nFile: %s,  Node: %s,  Up: Top\n\n"
                    Info-finder-file nodename))
-    (insert "Finder Commentary\n")
-    (insert "*****************\n\n")
+    (insert "Package Description\n")
+    (insert "*******************\n\n")
     (insert
-     "Commentary section of the package `" nodename "':\n\n")
-    ;; FIXME this assumes that a file named package.el exists,
+     "Description of the package `" nodename "':\n\n")
+    ;; This assumes that a file named package.el exists,
     ;; which is not always true.  E.g. for the nxml package,
     ;; there is no "nxml.el" (it's nxml-mode.el).
-    (let ((str (lm-commentary (find-library-name nodename))))
+    ;; But package.el makes the same assumption.
+    ;; I think nxml is the only exception - maybe it should be just be renamed.
+    (let ((str (ignore-errors (lm-commentary (find-library-name nodename)))))
       (if (null str)
-         (insert "Can't find any Commentary section\n\n")
+         (insert "Can't find package description.\n\n")
        (insert
         (with-temp-buffer
           (insert str)
@@ -4192,9 +4207,16 @@ With a zero prefix arg, put the name inside a function call to `info'."
     st)
   "Syntax table used in `Info-mode'.")
 
+(defface Info-quoted
+  '((t :family "courier"))
+  "Face used for quoted elements.")
+
+(defvar Info-mode-font-lock-keywords
+  '(("‘\\([^’]*\\)’" (1 'Info-quoted))))
+
 ;; Autoload cookie needed by desktop.el
 ;;;###autoload
-(define-derived-mode Info-mode nil "Info"
+(define-derived-mode Info-mode nil "Info" ;FIXME: Derive from special-mode?
   "Info mode provides commands for browsing through the Info documentation tree.
 Documentation in Info is divided into \"nodes\", each of which discusses
 one topic and contains references to other nodes which discuss related
@@ -4262,39 +4284,27 @@ Advanced commands:
   (add-hook 'activate-menubar-hook 'Info-menu-update nil t)
   (setq case-fold-search t)
   (setq buffer-read-only t)
-  (make-local-variable 'Info-current-file)
-  (make-local-variable 'Info-current-subfile)
-  (make-local-variable 'Info-current-node)
-  (set (make-local-variable 'Info-tag-table-marker) (make-marker))
-  (set (make-local-variable 'Info-tag-table-buffer) nil)
-  (make-local-variable 'Info-history)
-  (make-local-variable 'Info-history-forward)
-  (make-local-variable 'Info-index-alternatives)
+  (setq Info-tag-table-marker (make-marker))
   (if Info-use-header-line    ; do not override global header lines
       (setq header-line-format
            '(:eval (get-text-property (point-min) 'header-line))))
-  (set (make-local-variable 'tool-bar-map) info-tool-bar-map)
+  (setq-local tool-bar-map info-tool-bar-map)
   ;; This is for the sake of the invisible text we use handling titles.
-  (set (make-local-variable 'line-move-ignore-invisible) t)
-  (set (make-local-variable 'desktop-save-buffer)
-       'Info-desktop-buffer-misc-data)
-  (set (make-local-variable 'widen-automatically) nil)
+  (setq-local line-move-ignore-invisible t)
+  (setq-local desktop-save-buffer 'Info-desktop-buffer-misc-data)
+  (setq-local widen-automatically nil)
   (add-hook 'kill-buffer-hook 'Info-kill-buffer nil t)
   (add-hook 'clone-buffer-hook 'Info-clone-buffer nil t)
   (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
   (add-hook 'isearch-mode-hook 'Info-isearch-start nil t)
-  (set (make-local-variable 'isearch-search-fun-function)
-       'Info-isearch-search)
-  (set (make-local-variable 'isearch-wrap-function)
-       'Info-isearch-wrap)
-  (set (make-local-variable 'isearch-push-state-function)
-       'Info-isearch-push-state)
-  (set (make-local-variable 'isearch-filter-predicate) #'Info-isearch-filter)
-  (set (make-local-variable 'revert-buffer-function)
-       'Info-revert-buffer-function)
+  (setq-local isearch-search-fun-function #'Info-isearch-search)
+  (setq-local isearch-wrap-function #'Info-isearch-wrap)
+  (setq-local isearch-push-state-function #'Info-isearch-push-state)
+  (setq-local isearch-filter-predicate #'Info-isearch-filter)
+  (setq-local revert-buffer-function #'Info-revert-buffer-function)
+  (setq-local font-lock-defaults '(Info-mode-font-lock-keywords t t))
   (Info-set-mode-line)
-  (set (make-local-variable 'bookmark-make-record-function)
-       'Info-bookmark-make-record))
+  (setq-local bookmark-make-record-function #'Info-bookmark-make-record))
 
 ;; When an Info buffer is killed, make sure the associated tags buffer
 ;; is killed too.
@@ -4323,7 +4333,7 @@ Advanced commands:
                              map)
   "Local keymap used within `e' command of Info.")
 
-(make-obsolete-variable 'Info-edit-map
+(make-obsolete-variable 'Info-edit-mode-map
                        "editing Info nodes by hand is not recommended."
                        "24.4")
 
@@ -4333,8 +4343,7 @@ Advanced commands:
 (define-derived-mode Info-edit-mode text-mode "Info Edit"
   "Major mode for editing the contents of an Info node.
 Like text mode with the addition of `Info-cease-edit'
-which returns to Info mode for browsing.
-\\{Info-edit-map}"
+which returns to Info mode for browsing."
   (setq buffer-read-only nil)
   (force-mode-line-update)
   (buffer-enable-undo (current-buffer)))
@@ -4347,7 +4356,7 @@ which returns to Info mode for browsing.
   (interactive)
   (Info-edit-mode)
   (message "%s" (substitute-command-keys
-                "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
+                "Editing: Type \\<Info-edit-mode-map>\\[Info-cease-edit] to return to info")))
 
 (put 'Info-edit 'disabled "Editing Info nodes by hand is not recommended.
 This feature will be removed in future.")
index 4cab85be1056d694ba6a653cc90b90a64c2320be..067b1c35fa07b8c97699c8273a1b7ed01836e474 100644 (file)
@@ -1389,11 +1389,13 @@ Setup char-width-table appropriate for non-CJK language environment."
 (when (setq unicode-category-table
            (unicode-property-table-internal 'general-category))
   (map-char-table #'(lambda (key val)
-                     (if (and val
-                              (or (and (/= (aref (symbol-name val) 0) ?M)
-                                       (/= (aref (symbol-name val) 0) ?C))
-                                  (eq val 'Zs)))
-                         (modify-category-entry key ?.)))
+                     (if val
+                         (cond ((or (and (/= (aref (symbol-name val) 0) ?M)
+                                         (/= (aref (symbol-name val) 0) ?C))
+                                    (eq val 'Zs))
+                                (modify-category-entry key ?.))
+                               ((eq val 'Mn)
+                                (modify-category-entry key ?^)))))
                  unicode-category-table))
 
 (optimize-char-table (standard-category-table))
index 0a2f09029da153c802fc85f4004c90e3c06bfef3..f6c0719e4c46e8a554d5a48a3ee13c169c808337 100644 (file)
@@ -1,4 +1,4 @@
-;;; mule-cmds.el --- commands for multilingual environment -*-coding: utf-8 -*-
+;;; mule-cmds.el --- commands for multilingual environment  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1997-2014 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -2909,16 +2909,14 @@ on encoding."
 (defun ucs-names ()
   "Return alist of (CHAR-NAME . CHAR-CODE) pairs cached in `ucs-names'."
   (or ucs-names
-      (let ((bmp-ranges
+      (let ((ranges
             '((#x0000 . #x33FF)
               ;; (#x3400 . #x4DBF) CJK Ideographs Extension A
               (#x4DC0 . #x4DFF)
               ;; (#x4E00 . #x9FFF) CJK Unified Ideographs
               (#xA000 . #xD7FF)
               ;; (#xD800 . #xFAFF) Surrogate/Private
-              (#xFB00 . #xFFFD)))
-           (upper-ranges
-            '((#x10000 . #x134FF)
+              (#xFB00 . #x134FF)
               ;; (#x13500 . #x167FF) unused
               (#x16800 . #x16A3F)
               ;; (#x16A40 . #x1AFFF) unused
@@ -2928,23 +2926,20 @@ on encoding."
               ;; (#x20000 . #xDFFFF) CJK Ideograph Extension A, B, etc, unused
               (#xE0000 . #xE01FF)))
            (gc-cons-threshold 10000000)
-           c end name names)
-        (dolist (range bmp-ranges)
-          (setq c (car range)
-                end (cdr range))
+           names)
+       (dolist (range ranges)
+         (let ((c (car range))
+               (end (cdr range)))
          (while (<= c end)
-           (if (setq name (get-char-code-property c 'name))
-               (push (cons name c) names))
-           (if (setq name (get-char-code-property c 'old-name))
-               (push (cons name c) names))
-           (setq c (1+ c))))
-        (dolist (range upper-ranges)
-          (setq c (car range)
-                end (cdr range))
-         (while (<= c end)
-           (if (setq name (get-char-code-property c 'name))
-               (push (cons name c) names))
-           (setq c (1+ c))))
+             (let ((new-name (get-char-code-property c 'name))
+                   (old-name (get-char-code-property c 'old-name)))
+               ;; In theory this code could end up pushing an "old-name" that
+               ;; shadows a "new-name" but in practice every time an
+               ;; `old-name' conflicts with a `new-name', the newer one has a
+               ;; higher code, so it gets pushed later!
+               (if new-name (push (cons new-name c) names))
+               (if old-name (push (cons old-name c) names))
+               (setq c (1+ c))))))
        ;; Special case for "BELL" which is apparently the only char which
        ;; doesn't have a new name and whose old-name is shadowed by a newer
        ;; char with that name.
index efafb96538b5ad30bc0f21b8d57303b4bacda97b..42bc5ef1e5c34448fb4628b35fe62973c3bf93cf 100644 (file)
@@ -56,6 +56,9 @@
        (setq i (1+ i)))))
   string)
 
+(defvar truncate-string-ellipsis "..."  ;"…"
+  "String to use to indicate truncation.")
+
 ;;;###autoload
 (defun truncate-string-to-width (str end-column
                                     &optional start-column padding ellipsis)
@@ -80,11 +83,11 @@ If ELLIPSIS is non-nil, it should be a string which will replace the
 end of STR (including any padding) if it extends beyond END-COLUMN,
 unless the display width of STR is equal to or less than the display
 width of ELLIPSIS.  If it is non-nil and not a string, then ELLIPSIS
-defaults to \"...\"."
+defaults to `truncate-string-ellipsis'."
   (or start-column
       (setq start-column 0))
   (when (and ellipsis (not (stringp ellipsis)))
-    (setq ellipsis "..."))
+    (setq ellipsis truncate-string-ellipsis))
   (let ((str-len (length str))
        (str-width (string-width str))
        (ellipsis-len (if ellipsis (length ellipsis) 0))
index 42e6519e38c77fce1dbe51e005cec162bdab0bd8..d346f050415ef0af2faa37fac81daa9122099d16 100644 (file)
@@ -318,10 +318,6 @@ Only applies to the current buffer."
   (remove-hook 'jit-lock-functions fun t)
   (unless jit-lock-functions (jit-lock-mode nil)))
 
-;; This function is used to prevent font-lock-fontify-buffer from
-;; fontifying eagerly the whole buffer.  This is important for
-;; things like CWarn mode which adds/removes a few keywords and
-;; does a refontify (which takes ages on large files).
 (defun jit-lock-refontify (&optional beg end)
   "Force refontification of the region BEG..END (default whole buffer)."
   (with-buffer-prepared-for-jit-lock
index e185a696a6c112b07dccc5de5ef770bdef960697..3fa7e131d0c337df81045edebb0cb955ccab0471 100644 (file)
@@ -3,7 +3,7 @@
 ;;; Code:
 
 \f
-;;;### (autoloads nil "5x5" "play/5x5.el" (21291 53104 0 0))
+;;;### (autoloads nil "5x5" "play/5x5.el" (21187 63826 213216 0))
 ;;; Generated autoloads from play/5x5.el
 
 (autoload '5x5 "5x5" "\
@@ -65,8 +65,8 @@ should return a grid vector array that is the new solution.
 
 ;;;***
 \f
-;;;### (autoloads nil "ada-mode" "progmodes/ada-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ada-mode" "progmodes/ada-mode.el" (21220 61111
+;;;;;;  156047 0))
 ;;; Generated autoloads from progmodes/ada-mode.el
 
 (autoload 'ada-add-extensions "ada-mode" "\
@@ -85,8 +85,8 @@ Ada mode is the major mode for editing Ada code.
 
 ;;;***
 \f
-;;;### (autoloads nil "ada-stmt" "progmodes/ada-stmt.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ada-stmt" "progmodes/ada-stmt.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/ada-stmt.el
 
 (autoload 'ada-header "ada-stmt" "\
@@ -96,8 +96,8 @@ Insert a descriptive header at the top of the file.
 
 ;;;***
 \f
-;;;### (autoloads nil "ada-xref" "progmodes/ada-xref.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ada-xref" "progmodes/ada-xref.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/ada-xref.el
 
 (autoload 'ada-find-file "ada-xref" "\
@@ -108,7 +108,8 @@ Completion is available.
 
 ;;;***
 \f
-;;;### (autoloads nil "add-log" "vc/add-log.el" (21291 53104 0 0))
+;;;### (autoloads nil "add-log" "vc/add-log.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from vc/add-log.el
 
 (put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
@@ -237,8 +238,8 @@ old-style time formats for entries are supported.
 
 ;;;***
 \f
-;;;### (autoloads nil "advice" "emacs-lisp/advice.el" (21291 53104
-;;;;;;  0))
+;;;### (autoloads nil "advice" "emacs-lisp/advice.el" (21278 229
+;;;;;;  682967 799000))
 ;;; Generated autoloads from emacs-lisp/advice.el
 
 (defvar ad-redefinition-action 'warn "\
@@ -367,13 +368,13 @@ usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...)
 
 \(fn FUNCTION ARGS &rest BODY)" nil t)
 
-(put 'defadvice 'doc-string-elt '3)
+(function-put 'defadvice 'doc-string-elt '3)
 
-(put 'defadvice 'lisp-indent-function '2)
+(function-put 'defadvice 'lisp-indent-function '2)
 
 ;;;***
 \f
-;;;### (autoloads nil "align" "align.el" (21417 24123 550487 0))
+;;;### (autoloads nil "align" "align.el" (21417 20521 870414 0))
 ;;; Generated autoloads from align.el
 
 (autoload 'align "align" "\
@@ -476,7 +477,7 @@ A replacement function for `newline-and-indent', aligning as it goes.
 
 ;;;***
 \f
-;;;### (autoloads nil "allout" "allout.el" (21291 53104 0 0))
+;;;### (autoloads nil "allout" "allout.el" (21187 63826 213216 0))
 ;;; Generated autoloads from allout.el
 (push (purecopy '(allout 2 3)) package--builtin-versions)
 
@@ -836,8 +837,8 @@ for details on preparing Emacs for automatic allout activation.
 
 ;;;***
 \f
-;;;### (autoloads nil "allout-widgets" "allout-widgets.el" (21346
-;;;;;;  62196 0 0))
+;;;### (autoloads nil "allout-widgets" "allout-widgets.el" (21350
+;;;;;;  58112 380040 0))
 ;;; Generated autoloads from allout-widgets.el
 (push (purecopy '(allout-widgets 1 0)) package--builtin-versions)
 
@@ -895,7 +896,7 @@ outline hot-spot navigation (see `allout-mode').
 
 ;;;***
 \f
-;;;### (autoloads nil "ange-ftp" "net/ange-ftp.el" (21291 53104 0
+;;;### (autoloads nil "ange-ftp" "net/ange-ftp.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from net/ange-ftp.el
 
@@ -917,7 +918,7 @@ directory, so that Emacs will know its current contents.
 
 ;;;***
 \f
-;;;### (autoloads nil "animate" "play/animate.el" (21291 53104 0
+;;;### (autoloads nil "animate" "play/animate.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from play/animate.el
 
@@ -950,7 +951,7 @@ the buffer *Birthday-Present-for-Name*.
 
 ;;;***
 \f
-;;;### (autoloads nil "ansi-color" "ansi-color.el" (21291 53104 0
+;;;### (autoloads nil "ansi-color" "ansi-color.el" (21277 37159 898165
 ;;;;;;  0))
 ;;; Generated autoloads from ansi-color.el
 (push (purecopy '(ansi-color 3 4 2)) package--builtin-versions)
@@ -977,8 +978,8 @@ This is a good function to put in `comint-output-filter-functions'.
 
 ;;;***
 \f
-;;;### (autoloads nil "antlr-mode" "progmodes/antlr-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "antlr-mode" "progmodes/antlr-mode.el" (21208
+;;;;;;  39903 471297 312000))
 ;;; Generated autoloads from progmodes/antlr-mode.el
 (push (purecopy '(antlr-mode 2 2 3)) package--builtin-versions)
 
@@ -1014,7 +1015,8 @@ Used in `antlr-mode'.  Also a useful function in `java-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "appt" "calendar/appt.el" (21291 53104 0 0))
+;;;### (autoloads nil "appt" "calendar/appt.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from calendar/appt.el
 
 (autoload 'appt-add "appt" "\
@@ -1035,7 +1037,8 @@ ARG is positive, otherwise off.
 
 ;;;***
 \f
-;;;### (autoloads nil "apropos" "apropos.el" (21291 53104 0 0))
+;;;### (autoloads nil "apropos" "apropos.el" (21259 10807 217062
+;;;;;;  0))
 ;;; Generated autoloads from apropos.el
 
 (autoload 'apropos-read-pattern "apropos" "\
@@ -1150,7 +1153,8 @@ Returns list of symbols and documentation found.
 
 ;;;***
 \f
-;;;### (autoloads nil "arc-mode" "arc-mode.el" (21291 53104 0 0))
+;;;### (autoloads nil "arc-mode" "arc-mode.el" (21207 49087 974317
+;;;;;;  0))
 ;;; Generated autoloads from arc-mode.el
 
 (autoload 'archive-mode "arc-mode" "\
@@ -1170,7 +1174,7 @@ archive.
 
 ;;;***
 \f
-;;;### (autoloads nil "array" "array.el" (21291 53104 0 0))
+;;;### (autoloads nil "array" "array.el" (21240 46395 727291 0))
 ;;; Generated autoloads from array.el
 
 (autoload 'array-mode "array" "\
@@ -1241,8 +1245,8 @@ Entering array mode calls the function `array-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "artist" "textmodes/artist.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "artist" "textmodes/artist.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from textmodes/artist.el
 (push (purecopy '(artist 1 2 6)) package--builtin-versions)
 
@@ -1448,8 +1452,8 @@ Keymap summary
 
 ;;;***
 \f
-;;;### (autoloads nil "asm-mode" "progmodes/asm-mode.el" (21419 27241
-;;;;;;  500420 0))
+;;;### (autoloads nil "asm-mode" "progmodes/asm-mode.el" (21419 62246
+;;;;;;  751914 0))
 ;;; Generated autoloads from progmodes/asm-mode.el
 
 (autoload 'asm-mode "asm-mode" "\
@@ -1476,8 +1480,8 @@ Special commands:
 
 ;;;***
 \f
-;;;### (autoloads nil "auth-source" "gnus/auth-source.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "auth-source" "gnus/auth-source.el" (21342
+;;;;;;  10917 902592 0))
 ;;; Generated autoloads from gnus/auth-source.el
 
 (defvar auth-source-cache-expiry 7200 "\
@@ -1489,7 +1493,8 @@ let-binding.")
 
 ;;;***
 \f
-;;;### (autoloads nil "autoarg" "autoarg.el" (21291 53104 0 0))
+;;;### (autoloads nil "autoarg" "autoarg.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from autoarg.el
 
 (defvar autoarg-mode nil "\
@@ -1549,8 +1554,8 @@ This is similar to `autoarg-mode' but rebinds the keypad keys
 
 ;;;***
 \f
-;;;### (autoloads nil "autoconf" "progmodes/autoconf.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "autoconf" "progmodes/autoconf.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/autoconf.el
 
 (autoload 'autoconf-mode "autoconf" "\
@@ -1560,7 +1565,7 @@ Major mode for editing Autoconf configure.ac files.
 
 ;;;***
 \f
-;;;### (autoloads nil "autoinsert" "autoinsert.el" (21291 53104 0
+;;;### (autoloads nil "autoinsert" "autoinsert.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from autoinsert.el
 
@@ -1599,14 +1604,16 @@ insert a template for the file depending on the mode of the buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "autoload" "emacs-lisp/autoload.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "autoload" "emacs-lisp/autoload.el" (21425
+;;;;;;  43779 760127 645000))
 ;;; Generated autoloads from emacs-lisp/autoload.el
 
 (put 'generated-autoload-file 'safe-local-variable 'stringp)
 
 (put 'generated-autoload-load-name 'safe-local-variable 'stringp)
 
+(put 'autoload-ensure-writable 'risky-local-variable t)
+
 (autoload 'update-file-autoloads "autoload" "\
 Update the autoloads for FILE.
 If prefix arg SAVE-AFTER is non-nil, save the buffer too.
@@ -1649,7 +1656,7 @@ should be non-nil).
 
 ;;;***
 \f
-;;;### (autoloads nil "autorevert" "autorevert.el" (21310 8261 0
+;;;### (autoloads nil "autorevert" "autorevert.el" (21315 5521 187938
 ;;;;;;  0))
 ;;; Generated autoloads from autorevert.el
 
@@ -1738,7 +1745,7 @@ specifies in the mode line.
 
 ;;;***
 \f
-;;;### (autoloads nil "avoid" "avoid.el" (21372 35662 356409 0))
+;;;### (autoloads nil "avoid" "avoid.el" (21379 5287 607434 0))
 ;;; Generated autoloads from avoid.el
 
 (defvar mouse-avoidance-mode nil "\
@@ -1776,8 +1783,8 @@ definition of \"random distance\".)
 
 ;;;***
 \f
-;;;### (autoloads nil "bat-mode" "progmodes/bat-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "bat-mode" "progmodes/bat-mode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/bat-mode.el
 
 (add-to-list 'auto-mode-alist '("\\.\\(bat\\|cmd\\)\\'" . bat-mode))
@@ -1795,7 +1802,7 @@ Run script using `bat-run' and `bat-run-args'.
 
 ;;;***
 \f
-;;;### (autoloads nil "battery" "battery.el" (21341 23900 0 0))
+;;;### (autoloads nil "battery" "battery.el" (21346 7974 405729 0))
 ;;; Generated autoloads from battery.el
  (put 'battery-mode-line-string 'risky-local-variable t)
 
@@ -1830,8 +1837,8 @@ seconds.
 
 ;;;***
 \f
-;;;### (autoloads nil "benchmark" "emacs-lisp/benchmark.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "benchmark" "emacs-lisp/benchmark.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/benchmark.el
 
 (autoload 'benchmark-run "benchmark" "\
@@ -1845,7 +1852,7 @@ See also `benchmark-run-compiled'.
 
 \(fn &optional REPETITIONS &rest FORMS)" nil t)
 
-(put 'benchmark-run 'lisp-indent-function '1)
+(function-put 'benchmark-run 'lisp-indent-function '1)
 
 (autoload 'benchmark-run-compiled "benchmark" "\
 Time execution of compiled version of FORMS.
@@ -1855,7 +1862,7 @@ result.  The overhead of the `lambda's is accounted for.
 
 \(fn &optional REPETITIONS &rest FORMS)" nil t)
 
-(put 'benchmark-run-compiled 'lisp-indent-function '1)
+(function-put 'benchmark-run-compiled 'lisp-indent-function '1)
 
 (autoload 'benchmark "benchmark" "\
 Print the time taken for REPETITIONS executions of FORM.
@@ -1867,8 +1874,8 @@ For non-interactive use see also `benchmark-run' and
 
 ;;;***
 \f
-;;;### (autoloads nil "bibtex" "textmodes/bibtex.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "bibtex" "textmodes/bibtex.el" (21414 44327
+;;;;;;  790846 0))
 ;;; Generated autoloads from textmodes/bibtex.el
 
 (autoload 'bibtex-initialize "bibtex" "\
@@ -1960,7 +1967,7 @@ A prefix arg negates the value of `bibtex-search-entry-globally'.
 ;;;***
 \f
 ;;;### (autoloads nil "bibtex-style" "textmodes/bibtex-style.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from textmodes/bibtex-style.el
 
 (autoload 'bibtex-style-mode "bibtex-style" "\
@@ -1970,7 +1977,8 @@ Major mode for editing BibTeX style files.
 
 ;;;***
 \f
-;;;### (autoloads nil "binhex" "mail/binhex.el" (21291 53104 0 0))
+;;;### (autoloads nil "binhex" "mail/binhex.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from mail/binhex.el
 
 (defconst binhex-begin-line "^:...............................................................$" "\
@@ -1994,8 +2002,8 @@ Binhex decode region between START and END.
 
 ;;;***
 \f
-;;;### (autoloads nil "blackbox" "play/blackbox.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "blackbox" "play/blackbox.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from play/blackbox.el
 
 (autoload 'blackbox "blackbox" "\
@@ -2114,7 +2122,7 @@ a reflection.
 
 ;;;***
 \f
-;;;### (autoloads nil "bookmark" "bookmark.el" (21396 17985 27631
+;;;### (autoloads nil "bookmark" "bookmark.el" (21397 35239 170099
 ;;;;;;  0))
 ;;; Generated autoloads from bookmark.el
  (define-key ctl-x-r-map "b" 'bookmark-jump)
@@ -2241,10 +2249,11 @@ probably because we were called from there.
 
 (autoload 'bookmark-write "bookmark" "\
 Write bookmarks to a file (reading the file name with the minibuffer).
-Don't use this in Lisp programs; use `bookmark-save' instead.
 
 \(fn)" t nil)
 
+(function-put 'bookmark-write 'interactive-only 'bookmark-save)
+
 (autoload 'bookmark-save "bookmark" "\
 Save currently defined bookmarks.
 Saves by default in the file defined by the variable
@@ -2307,8 +2316,8 @@ Incremental search of bookmarks, hiding the non-matches as we go.
 
 ;;;***
 \f
-;;;### (autoloads nil "browse-url" "net/browse-url.el" (21361 65337
-;;;;;;  555586 0))
+;;;### (autoloads nil "browse-url" "net/browse-url.el" (21364 37926
+;;;;;;  837230 0))
 ;;; Generated autoloads from net/browse-url.el
 
 (defvar browse-url-browser-function 'browse-url-default-browser "\
@@ -2623,7 +2632,7 @@ from `browse-url-elinks-wrapper'.
 
 ;;;***
 \f
-;;;### (autoloads nil "bs" "bs.el" (21452 63160 995987 0))
+;;;### (autoloads nil "bs" "bs.el" (21452 59559 901066 0))
 ;;; Generated autoloads from bs.el
 (push (purecopy '(bs 1 17)) package--builtin-versions)
 
@@ -2664,7 +2673,7 @@ name of buffer configuration.
 
 ;;;***
 \f
-;;;### (autoloads nil "bubbles" "play/bubbles.el" (21291 53104 0
+;;;### (autoloads nil "bubbles" "play/bubbles.el" (21410 47268 609529
 ;;;;;;  0))
 ;;; Generated autoloads from play/bubbles.el
 
@@ -2687,7 +2696,7 @@ columns on its right towards the left.
 ;;;***
 \f
 ;;;### (autoloads nil "bug-reference" "progmodes/bug-reference.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from progmodes/bug-reference.el
 
 (put 'bug-reference-url-format 'safe-local-variable (lambda (s) (or (stringp s) (and (symbolp s) (get s 'bug-reference-url-format)))))
@@ -2707,8 +2716,8 @@ Like `bug-reference-mode', but only buttonize in comments and strings.
 
 ;;;***
 \f
-;;;### (autoloads nil "bytecomp" "emacs-lisp/bytecomp.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "bytecomp" "emacs-lisp/bytecomp.el" (21334
+;;;;;;  16805 699731 0))
 ;;; Generated autoloads from emacs-lisp/bytecomp.el
 (put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
 (put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@@ -2828,8 +2837,8 @@ and corresponding effects.
 
 ;;;***
 \f
-;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (21350
+;;;;;;  5031 352444 0))
 ;;; Generated autoloads from calendar/cal-china.el
 
 (put 'calendar-chinese-time-zone 'risky-local-variable t)
@@ -2838,8 +2847,8 @@ and corresponding effects.
 
 ;;;***
 \f
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from calendar/cal-dst.el
 
 (put 'calendar-daylight-savings-starts 'risky-local-variable t)
@@ -2850,8 +2859,8 @@ and corresponding effects.
 
 ;;;***
 \f
-;;;### (autoloads nil "cal-hebrew" "calendar/cal-hebrew.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cal-hebrew" "calendar/cal-hebrew.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from calendar/cal-hebrew.el
 
 (autoload 'calendar-hebrew-list-yahrzeits "cal-hebrew" "\
@@ -2865,7 +2874,7 @@ from the cursor position.
 
 ;;;***
 \f
-;;;### (autoloads nil "calc" "calc/calc.el" (21421 21182 542043 0))
+;;;### (autoloads nil "calc" "calc/calc.el" (21377 49959 896066 0))
 ;;; Generated autoloads from calc/calc.el
  (define-key ctl-x-map "*" 'calc-dispatch)
 
@@ -2945,12 +2954,12 @@ See Info node `(calc)Defining Functions'.
 
 \(fn FUNC ARGS &rest BODY)" nil t)
 
-(put 'defmath 'doc-string-elt '3)
+(function-put 'defmath 'doc-string-elt '3)
 
 ;;;***
 \f
-;;;### (autoloads nil "calc-undo" "calc/calc-undo.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "calc-undo" "calc/calc-undo.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from calc/calc-undo.el
 
 (autoload 'calc-undo "calc-undo" "\
@@ -2960,7 +2969,7 @@ See Info node `(calc)Defining Functions'.
 
 ;;;***
 \f
-;;;### (autoloads nil "calculator" "calculator.el" (21291 53104 0
+;;;### (autoloads nil "calculator" "calculator.el" (21417 20521 870414
 ;;;;;;  0))
 ;;; Generated autoloads from calculator.el
 
@@ -2972,8 +2981,8 @@ See the documentation for `calculator-mode' for more information.
 
 ;;;***
 \f
-;;;### (autoloads nil "calendar" "calendar/calendar.el" (21291 53104
-;;;;;;  0))
+;;;### (autoloads nil "calendar" "calendar/calendar.el" (21403 21198
+;;;;;;  190145 203000))
 ;;; Generated autoloads from calendar/calendar.el
 
 (autoload 'calendar "calendar" "\
@@ -3016,7 +3025,7 @@ This function is suitable for execution in an init file.
 
 ;;;***
 \f
-;;;### (autoloads nil "canlock" "gnus/canlock.el" (21291 53104 0
+;;;### (autoloads nil "canlock" "gnus/canlock.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from gnus/canlock.el
 
@@ -3034,55 +3043,15 @@ it fails.
 
 ;;;***
 \f
-;;;### (autoloads nil "cap-words" "progmodes/cap-words.el" (21291
-;;;;;;  53104 0 0))
-;;; Generated autoloads from progmodes/cap-words.el
-
-(autoload 'capitalized-words-mode "cap-words" "\
-Toggle Capitalized Words mode.
-With a prefix argument ARG, enable Capitalized Words mode if ARG
-is positive, and disable it otherwise.  If called from Lisp,
-enable the mode if ARG is omitted or nil.
-
-Capitalized Words mode is a buffer-local minor mode.  When
-enabled, a word boundary occurs immediately before an uppercase
-letter in a symbol.  This is in addition to all the normal
-boundaries given by the syntax and category tables.  There is no
-restriction to ASCII.
-
-E.g. the beginning of words in the following identifier are as marked:
-
-  capitalizedWorDD
-  ^          ^  ^^
-
-Note that these word boundaries only apply for word motion and
-marking commands such as \\[forward-word].  This mode does not affect word
-boundaries found by regexp matching (`\\>', `\\w' &c).
-
-This style of identifiers is common in environments like Java ones,
-where underscores aren't trendy enough.  Capitalization rules are
-sometimes part of the language, e.g. Haskell, which may thus encourage
-such a style.  It is appropriate to add `capitalized-words-mode' to
-the mode hook for programming language modes in which you encounter
-variables like this, e.g. `java-mode-hook'.  It's unlikely to cause
-trouble if such identifiers aren't used.
-
-See also `glasses-mode' and `studlify-word'.
-Obsoletes `c-forward-into-nomenclature'.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from progmodes/cc-compat.el
 (put 'c-indent-level 'safe-local-variable 'integerp)
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-engine" "progmodes/cc-engine.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cc-engine" "progmodes/cc-engine.el" (21425
+;;;;;;  14635 268306 0))
 ;;; Generated autoloads from progmodes/cc-engine.el
 
 (autoload 'c-guess-basic-syntax "cc-engine" "\
@@ -3092,8 +3061,8 @@ Return the syntactic context of the current line.
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-guess" "progmodes/cc-guess.el" (21307 46976
-;;;;;;  0 0))
+;;;### (autoloads nil "cc-guess" "progmodes/cc-guess.el" (21419 62246
+;;;;;;  751914 0))
 ;;; Generated autoloads from progmodes/cc-guess.el
 
 (defvar c-guess-guessed-offsets-alist nil "\
@@ -3191,8 +3160,8 @@ the absolute file name of the file if STYLE-NAME is nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-mode" "progmodes/cc-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cc-mode" "progmodes/cc-mode.el" (21269 46645
+;;;;;;  763684 0))
 ;;; Generated autoloads from progmodes/cc-mode.el
 
 (autoload 'c-initialize-cc-mode "cc-mode" "\
@@ -3349,8 +3318,8 @@ Key bindings:
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-styles" "progmodes/cc-styles.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cc-styles" "progmodes/cc-styles.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from progmodes/cc-styles.el
 
 (autoload 'c-set-style "cc-styles" "\
@@ -3401,8 +3370,8 @@ and exists only for compatibility reasons.
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/cc-vars.el
 (put 'c-basic-offset 'safe-local-variable 'integerp)
 (put 'c-backslash-column 'safe-local-variable 'integerp)
@@ -3410,7 +3379,7 @@ and exists only for compatibility reasons.
 
 ;;;***
 \f
-;;;### (autoloads nil "ccl" "international/ccl.el" (21291 53104 0
+;;;### (autoloads nil "ccl" "international/ccl.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from international/ccl.el
 
@@ -3650,7 +3619,7 @@ MAP-ID := integer
 
 \(fn NAME CCL-PROGRAM &optional DOC)" nil t)
 
-(put 'define-ccl-program 'doc-string-elt '3)
+(function-put 'define-ccl-program 'doc-string-elt '3)
 
 (autoload 'check-ccl-program "ccl" "\
 Check validity of CCL-PROGRAM.
@@ -3671,8 +3640,8 @@ See the documentation of `define-ccl-program' for the detail of CCL program.
 
 ;;;***
 \f
-;;;### (autoloads nil "cconv" "emacs-lisp/cconv.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cconv" "emacs-lisp/cconv.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from emacs-lisp/cconv.el
 
 (autoload 'cconv-closure-convert "cconv" "\
@@ -3691,14 +3660,15 @@ Add the warnings that closure conversion would encounter.
 
 ;;;***
 \f
-;;;### (autoloads nil "cedet" "cedet/cedet.el" (21291 53104 0 0))
+;;;### (autoloads nil "cedet" "cedet/cedet.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from cedet/cedet.el
 (push (purecopy '(cedet 2 0)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "cfengine" "progmodes/cfengine.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cfengine" "progmodes/cfengine.el" (21226 13501
+;;;;;;  706948 0))
 ;;; Generated autoloads from progmodes/cfengine.el
 (push (purecopy '(cfengine 1 3)) package--builtin-versions)
 
@@ -3728,15 +3698,15 @@ on the buffer contents
 
 ;;;***
 \f
-;;;### (autoloads nil "chart" "emacs-lisp/chart.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "chart" "emacs-lisp/chart.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from emacs-lisp/chart.el
 (push (purecopy '(chart 0 2)) package--builtin-versions)
 
 ;;;***
 \f
 ;;;### (autoloads nil "check-declare" "emacs-lisp/check-declare.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/check-declare.el
 
 (autoload 'check-declare-file "check-declare" "\
@@ -3753,8 +3723,8 @@ Returns non-nil if any false statements are found.
 
 ;;;***
 \f
-;;;### (autoloads nil "checkdoc" "emacs-lisp/checkdoc.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "checkdoc" "emacs-lisp/checkdoc.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/checkdoc.el
 (push (purecopy '(checkdoc 0 6 2)) package--builtin-versions)
 (put 'checkdoc-force-docstrings-flag 'safe-local-variable #'booleanp)
@@ -3954,8 +3924,8 @@ checking of documentation strings.
 
 ;;;***
 \f
-;;;### (autoloads nil "china-util" "language/china-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "china-util" "language/china-util.el" (21197
+;;;;;;  43194 200483 0))
 ;;; Generated autoloads from language/china-util.el
 
 (autoload 'decode-hz-region "china-util" "\
@@ -3992,7 +3962,8 @@ Encode the text in the current buffer to HZ.
 
 ;;;***
 \f
-;;;### (autoloads nil "chistory" "chistory.el" (21291 53104 0 0))
+;;;### (autoloads nil "chistory" "chistory.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from chistory.el
 
 (autoload 'repeat-matching-complex-command "chistory" "\
@@ -4031,8 +4002,8 @@ and runs the normal hook `command-history-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "cl-indent" "emacs-lisp/cl-indent.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cl-indent" "emacs-lisp/cl-indent.el" (21318
+;;;;;;  28582 821557 0))
 ;;; Generated autoloads from emacs-lisp/cl-indent.el
 
 (autoload 'common-lisp-indent-function "cl-indent" "\
@@ -4106,12 +4077,17 @@ For example, the function `case' has an indent property
     of them.  The first list element has an offset of 2, all the rest
     have an offset of 2+1=3.
 
+If the current mode is actually `emacs-lisp-mode', look for a
+`common-lisp-indent-function-for-elisp' property before looking
+at `common-lisp-indent-function' and, if set, use its value
+instead.
+
 \(fn INDENT-POINT STATE)" nil nil)
 
 ;;;***
 \f
-;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (21372 32036
+;;;;;;  731951 0))
 ;;; Generated autoloads from emacs-lisp/cl-lib.el
 (push (purecopy '(cl-lib 1 0)) package--builtin-versions)
 
@@ -4141,8 +4117,8 @@ a future Emacs interpreter will be able to use it.")
 
 ;;;***
 \f
-;;;### (autoloads nil "cmacexp" "progmodes/cmacexp.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cmacexp" "progmodes/cmacexp.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/cmacexp.el
 
 (autoload 'c-macro-expand "cmacexp" "\
@@ -4162,7 +4138,8 @@ For use inside Lisp programs, see also `c-macro-expansion'.
 
 ;;;***
 \f
-;;;### (autoloads nil "cmuscheme" "cmuscheme.el" (21291 53104 0 0))
+;;;### (autoloads nil "cmuscheme" "cmuscheme.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from cmuscheme.el
 
 (autoload 'run-scheme "cmuscheme" "\
@@ -4182,7 +4159,7 @@ is run).
 
 ;;;***
 \f
-;;;### (autoloads nil "color" "color.el" (21291 53104 0 0))
+;;;### (autoloads nil "color" "color.el" (21187 63826 213216 0))
 ;;; Generated autoloads from color.el
 
 (autoload 'color-name-to-rgb "color" "\
@@ -4201,7 +4178,7 @@ If FRAME cannot display COLOR, return nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "comint" "comint.el" (21341 23900 0 0))
+;;;### (autoloads nil "comint" "comint.el" (21339 34726 39547 0))
 ;;; Generated autoloads from comint.el
 
 (defvar comint-output-filter-functions '(ansi-color-process-output comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
@@ -4263,6 +4240,8 @@ See `make-comint' and `comint-exec'.
 
 \(fn PROGRAM)" t nil)
 
+(function-put 'comint-run 'interactive-only 'make-comint)
+
 (defvar comint-file-name-prefix (purecopy "") "\
 Prefix prepended to absolute file names taken from process input.
 This is used by Comint's and shell's completion functions, and by shell's
@@ -4300,8 +4279,8 @@ REGEXP-GROUP is the regular expression group in REGEXP to use.
 
 ;;;***
 \f
-;;;### (autoloads nil "compare-w" "vc/compare-w.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "compare-w" "vc/compare-w.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from vc/compare-w.el
 
 (autoload 'compare-windows "compare-w" "\
@@ -4334,8 +4313,8 @@ on third call it again advances points to the next difference and so on.
 
 ;;;***
 \f
-;;;### (autoloads nil "compile" "progmodes/compile.el" (21356 47422
-;;;;;;  369946 0))
+;;;### (autoloads nil "compile" "progmodes/compile.el" (21383 2343
+;;;;;;  498187 0))
 ;;; Generated autoloads from progmodes/compile.el
 
 (defvar compilation-mode-hook nil "\
@@ -4516,7 +4495,7 @@ This is the value of `next-error-function' in Compilation buffers.
 
 ;;;***
 \f
-;;;### (autoloads nil "completion" "completion.el" (21291 53104 0
+;;;### (autoloads nil "completion" "completion.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from completion.el
 
@@ -4539,8 +4518,8 @@ if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "conf-mode" "textmodes/conf-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "conf-mode" "textmodes/conf-mode.el" (21383
+;;;;;;  2343 498187 0))
 ;;; Generated autoloads from textmodes/conf-mode.el
 
 (autoload 'conf-mode "conf-mode" "\
@@ -4695,7 +4674,7 @@ For details see `conf-mode'.  Example:
 
 ;;;***
 \f
-;;;### (autoloads nil "cookie1" "play/cookie1.el" (21291 53104 0
+;;;### (autoloads nil "cookie1" "play/cookie1.el" (21245 64312 799897
 ;;;;;;  0))
 ;;; Generated autoloads from play/cookie1.el
 
@@ -4724,8 +4703,8 @@ and subsequent calls on the same file won't go to disk.
 
 ;;;***
 \f
-;;;### (autoloads nil "copyright" "emacs-lisp/copyright.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "copyright" "emacs-lisp/copyright.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/copyright.el
 (put 'copyright-at-end-flag 'safe-local-variable 'booleanp)
 (put 'copyright-names-regexp 'safe-local-variable 'stringp)
@@ -4763,8 +4742,8 @@ If FIX is non-nil, run `copyright-fix-years' instead.
 
 ;;;***
 \f
-;;;### (autoloads nil "cperl-mode" "progmodes/cperl-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cperl-mode" "progmodes/cperl-mode.el" (21438
+;;;;;;  26670 609361 0))
 ;;; Generated autoloads from progmodes/cperl-mode.el
 (put 'cperl-indent-level 'safe-local-variable 'integerp)
 (put 'cperl-brace-offset 'safe-local-variable 'integerp)
@@ -4962,7 +4941,8 @@ Run a `perldoc' on the word around point.
 
 ;;;***
 \f
-;;;### (autoloads nil "cpp" "progmodes/cpp.el" (21291 53104 0 0))
+;;;### (autoloads nil "cpp" "progmodes/cpp.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from progmodes/cpp.el
 
 (autoload 'cpp-highlight-buffer "cpp" "\
@@ -4980,33 +4960,8 @@ Edit display information for cpp conditionals.
 
 ;;;***
 \f
-;;;### (autoloads nil "crisp" "emulation/crisp.el" (21291 53104 0
+;;;### (autoloads nil "crm" "emacs-lisp/crm.el" (21263 7861 493097
 ;;;;;;  0))
-;;; Generated autoloads from emulation/crisp.el
-
-(defvar crisp-mode nil "\
-Track status of CRiSP emulation mode.
-A value of nil means CRiSP mode is not enabled.  A value of t
-indicates CRiSP mode is enabled.
-
-Setting this variable directly does not take effect;
-use either M-x customize or the function `crisp-mode'.")
-
-(custom-autoload 'crisp-mode "crisp" nil)
-
-(autoload 'crisp-mode "crisp" "\
-Toggle CRiSP/Brief emulation (CRiSP mode).
-With a prefix argument ARG, enable CRiSP mode if ARG is positive,
-and disable it otherwise.  If called from Lisp, enable the mode
-if ARG is omitted or nil.
-
-\(fn &optional ARG)" t nil)
-
-(defalias 'brief-mode 'crisp-mode)
-
-;;;***
-\f
-;;;### (autoloads nil "crm" "emacs-lisp/crm.el" (21291 53104 0 0))
 ;;; Generated autoloads from emacs-lisp/crm.el
 
 (autoload 'completing-read-multiple "crm" "\
@@ -5032,8 +4987,8 @@ with empty strings removed.
 
 ;;;***
 \f
-;;;### (autoloads nil "css-mode" "textmodes/css-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "css-mode" "textmodes/css-mode.el" (21285 31272
+;;;;;;  331063 0))
 ;;; Generated autoloads from textmodes/css-mode.el
 
 (autoload 'css-mode "css-mode" "\
@@ -5043,8 +4998,8 @@ Major mode to edit Cascading Style Sheets.
 
 ;;;***
 \f
-;;;### (autoloads nil "cua-base" "emulation/cua-base.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cua-base" "emulation/cua-base.el" (21319 49445
+;;;;;;  508378 0))
 ;;; Generated autoloads from emulation/cua-base.el
 
 (defvar cua-mode nil "\
@@ -5089,8 +5044,8 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings.
 
 ;;;***
 \f
-;;;### (autoloads nil "cua-rect" "emulation/cua-rect.el" (21434 33208
-;;;;;;  30457 0))
+;;;### (autoloads nil "cua-rect" "emulation/cua-rect.el" (21437 5802
+;;;;;;  125919 0))
 ;;; Generated autoloads from emulation/cua-rect.el
 
 (autoload 'cua-rectangle-mark-mode "cua-rect" "\
@@ -5101,7 +5056,7 @@ Activates the region if needed.  Only lasts until the region is deactivated.
 
 ;;;***
 \f
-;;;### (autoloads nil "cus-edit" "cus-edit.el" (21423 62909 33477
+;;;### (autoloads nil "cus-edit" "cus-edit.el" (21429 11690 49391
 ;;;;;;  0))
 ;;; Generated autoloads from cus-edit.el
 
@@ -5414,7 +5369,8 @@ The format is suitable for use with `easy-menu-define'.
 
 ;;;***
 \f
-;;;### (autoloads nil "cus-theme" "cus-theme.el" (21291 53104 0 0))
+;;;### (autoloads nil "cus-theme" "cus-theme.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from cus-theme.el
 
 (autoload 'customize-create-theme "cus-theme" "\
@@ -5447,8 +5403,8 @@ omitted, a buffer named *Custom Themes* is used.
 
 ;;;***
 \f
-;;;### (autoloads nil "cvs-status" "vc/cvs-status.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "cvs-status" "vc/cvs-status.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from vc/cvs-status.el
 
 (autoload 'cvs-status-mode "cvs-status" "\
@@ -5458,7 +5414,7 @@ Mode used for cvs status output.
 
 ;;;***
 \f
-;;;### (autoloads nil "cwarn" "progmodes/cwarn.el" (21291 53104 0
+;;;### (autoloads nil "cwarn" "progmodes/cwarn.el" (21383 2343 498187
 ;;;;;;  0))
 ;;; Generated autoloads from progmodes/cwarn.el
 (push (purecopy '(cwarn 1 3 1)) package--builtin-versions)
@@ -5503,8 +5459,8 @@ See `cwarn-mode' for more information on Cwarn mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "cyril-util" "language/cyril-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "cyril-util" "language/cyril-util.el" (21193
+;;;;;;  16180 875828 0))
 ;;; Generated autoloads from language/cyril-util.el
 
 (autoload 'cyrillic-encode-koi8-r-char "cyril-util" "\
@@ -5532,7 +5488,8 @@ If the argument is nil, we return the display table to its standard state.
 
 ;;;***
 \f
-;;;### (autoloads nil "dabbrev" "dabbrev.el" (21291 53104 0 0))
+;;;### (autoloads nil "dabbrev" "dabbrev.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from dabbrev.el
 (put 'dabbrev-case-fold-search 'risky-local-variable t)
 (put 'dabbrev-case-replace 'risky-local-variable t)
@@ -5578,8 +5535,8 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion].
 
 ;;;***
 \f
-;;;### (autoloads nil "data-debug" "cedet/data-debug.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "data-debug" "cedet/data-debug.el" (21197 43194
+;;;;;;  200483 0))
 ;;; Generated autoloads from cedet/data-debug.el
 
 (autoload 'data-debug-new-buffer "data-debug" "\
@@ -5589,7 +5546,7 @@ Create a new data-debug buffer with NAME.
 
 ;;;***
 \f
-;;;### (autoloads nil "dbus" "net/dbus.el" (21406 53815 191813 0))
+;;;### (autoloads nil "dbus" "net/dbus.el" (21430 32550 215986 0))
 ;;; Generated autoloads from net/dbus.el
 
 (autoload 'dbus-handle-event "dbus" "\
@@ -5602,8 +5559,8 @@ If the HANDLER returns a `dbus-error', it is propagated as return message.
 
 ;;;***
 \f
-;;;### (autoloads nil "dcl-mode" "progmodes/dcl-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "dcl-mode" "progmodes/dcl-mode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/dcl-mode.el
 
 (autoload 'dcl-mode "dcl-mode" "\
@@ -5729,8 +5686,8 @@ There is some minimal font-lock support (see vars
 
 ;;;***
 \f
-;;;### (autoloads nil "debug" "emacs-lisp/debug.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "debug" "emacs-lisp/debug.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from emacs-lisp/debug.el
 
 (setq debugger 'debug)
@@ -5773,8 +5730,8 @@ To specify a nil argument interactively, exit with an empty minibuffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "decipher" "play/decipher.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "decipher" "play/decipher.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from play/decipher.el
 
 (autoload 'decipher "decipher" "\
@@ -5802,7 +5759,8 @@ The most useful commands are:
 
 ;;;***
 \f
-;;;### (autoloads nil "delim-col" "delim-col.el" (21291 53104 0 0))
+;;;### (autoloads nil "delim-col" "delim-col.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from delim-col.el
 (push (purecopy '(delim-col 2 1)) package--builtin-versions)
 
@@ -5827,7 +5785,7 @@ START and END delimits the corners of text rectangle.
 
 ;;;***
 \f
-;;;### (autoloads nil "delsel" "delsel.el" (21409 30011 484411 0))
+;;;### (autoloads nil "delsel" "delsel.el" (21414 44327 790846 0))
 ;;; Generated autoloads from delsel.el
 
 (defalias 'pending-delete-mode 'delete-selection-mode)
@@ -5855,8 +5813,8 @@ point regardless of any selection.
 
 ;;;***
 \f
-;;;### (autoloads nil "derived" "emacs-lisp/derived.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "derived" "emacs-lisp/derived.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from emacs-lisp/derived.el
 
 (autoload 'define-derived-mode "derived" "\
@@ -5910,7 +5868,7 @@ See Info node `(elisp)Derived Modes' for more details.
 
 \(fn CHILD PARENT NAME &optional DOCSTRING &rest BODY)" nil t)
 
-(put 'define-derived-mode 'doc-string-elt '4)
+(function-put 'define-derived-mode 'doc-string-elt '4)
 
 (autoload 'derived-mode-init-mode-variables "derived" "\
 Initialize variables for a new MODE.
@@ -5922,7 +5880,7 @@ the first time the mode is used.
 
 ;;;***
 \f
-;;;### (autoloads nil "descr-text" "descr-text.el" (21291 53104 0
+;;;### (autoloads nil "descr-text" "descr-text.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from descr-text.el
 
@@ -5957,7 +5915,7 @@ relevant to POS.
 
 ;;;***
 \f
-;;;### (autoloads nil "desktop" "desktop.el" (21446 24405 165302
+;;;### (autoloads nil "desktop" "desktop.el" (21446 45134 152348
 ;;;;;;  0))
 ;;; Generated autoloads from desktop.el
 
@@ -6163,8 +6121,8 @@ Revert to the last loaded desktop.
 
 ;;;***
 \f
-;;;### (autoloads nil "deuglify" "gnus/deuglify.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "deuglify" "gnus/deuglify.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/deuglify.el
 
 (autoload 'gnus-article-outlook-unwrap-lines "deuglify" "\
@@ -6196,8 +6154,8 @@ Deuglify broken Outlook (Express) articles and redisplay.
 
 ;;;***
 \f
-;;;### (autoloads nil "diary-lib" "calendar/diary-lib.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "diary-lib" "calendar/diary-lib.el" (21350
+;;;;;;  58112 380040 0))
 ;;; Generated autoloads from calendar/diary-lib.el
 
 (autoload 'diary "diary-lib" "\
@@ -6239,7 +6197,7 @@ Major mode for editing the diary file.
 
 ;;;***
 \f
-;;;### (autoloads nil "diff" "vc/diff.el" (21291 53104 0 0))
+;;;### (autoloads nil "diff" "vc/diff.el" (21240 46395 727291 0))
 ;;; Generated autoloads from vc/diff.el
 
 (defvar diff-switches (purecopy "-c") "\
@@ -6287,8 +6245,8 @@ This requires the external program `diff' to be in your `exec-path'.
 
 ;;;***
 \f
-;;;### (autoloads nil "diff-mode" "vc/diff-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "diff-mode" "vc/diff-mode.el" (21409 26408
+;;;;;;  607647 0))
 ;;; Generated autoloads from vc/diff-mode.el
 
 (autoload 'diff-mode "diff-mode" "\
@@ -6320,7 +6278,7 @@ the mode if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "dig" "net/dig.el" (21291 53104 0 0))
+;;;### (autoloads nil "dig" "net/dig.el" (21187 63826 213216 0))
 ;;; Generated autoloads from net/dig.el
 
 (autoload 'dig "dig" "\
@@ -6331,7 +6289,7 @@ Optional arguments are passed to `dig-invoke'.
 
 ;;;***
 \f
-;;;### (autoloads nil "dired" "dired.el" (21452 63160 995987 0))
+;;;### (autoloads nil "dired" "dired.el" (21452 59559 901066 0))
 ;;; Generated autoloads from dired.el
 
 (defvar dired-listing-switches (purecopy "-al") "\
@@ -6407,7 +6365,7 @@ Type \\[dired-mark] to Mark a file or subdirectory for later commands.
   to see why something went wrong.
 Type \\[dired-unmark] to Unmark a file or all files of an inserted subdirectory.
 Type \\[dired-unmark-backward] to back up one line and unmark or unflag.
-Type \\[dired-do-flagged-delete] to delete (eXecute) the files flagged `D'.
+Type \\[dired-do-flagged-delete] to delete (eXpunge) the files flagged `D'.
 Type \\[dired-find-file] to Find the current line's file
   (or dired it in another buffer, if it is a directory).
 Type \\[dired-find-file-other-window] to find file or Dired directory in Other window.
@@ -6451,7 +6409,8 @@ Keybindings:
 
 ;;;***
 \f
-;;;### (autoloads nil "dirtrack" "dirtrack.el" (21291 53104 0 0))
+;;;### (autoloads nil "dirtrack" "dirtrack.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from dirtrack.el
 
 (autoload 'dirtrack-mode "dirtrack" "\
@@ -6481,8 +6440,8 @@ from `default-directory'.
 
 ;;;***
 \f
-;;;### (autoloads nil "disass" "emacs-lisp/disass.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "disass" "emacs-lisp/disass.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from emacs-lisp/disass.el
 
 (autoload 'disassemble "disass" "\
@@ -6496,7 +6455,7 @@ redefine OBJECT if it is a symbol.
 
 ;;;***
 \f
-;;;### (autoloads nil "disp-table" "disp-table.el" (21291 53104 0
+;;;### (autoloads nil "disp-table" "disp-table.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from disp-table.el
 
@@ -6618,8 +6577,8 @@ in `.emacs'.
 
 ;;;***
 \f
-;;;### (autoloads nil "dissociate" "play/dissociate.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "dissociate" "play/dissociate.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from play/dissociate.el
 
 (autoload 'dissociated-press "dissociate" "\
@@ -6635,7 +6594,7 @@ Default is 2.
 
 ;;;***
 \f
-;;;### (autoloads nil "dnd" "dnd.el" (21291 53104 0 0))
+;;;### (autoloads nil "dnd" "dnd.el" (21240 46395 727291 0))
 ;;; Generated autoloads from dnd.el
 
 (defvar dnd-protocol-alist `((,(purecopy "^file:///") . dnd-open-local-file) (,(purecopy "^file://") . dnd-open-file) (,(purecopy "^file:") . dnd-open-local-file) (,(purecopy "^\\(https?\\|ftp\\|file\\|nfs\\)://") . dnd-open-file)) "\
@@ -6655,8 +6614,8 @@ if some action was made, or nil if the URL is ignored.")
 
 ;;;***
 \f
-;;;### (autoloads nil "dns-mode" "textmodes/dns-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "dns-mode" "textmodes/dns-mode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from textmodes/dns-mode.el
 
 (autoload 'dns-mode "dns-mode" "\
@@ -6679,7 +6638,7 @@ Locate SOA record and increment the serial field.
 
 ;;;***
 \f
-;;;### (autoloads nil "doc-view" "doc-view.el" (21462 12596 577539
+;;;### (autoloads nil "doc-view" "doc-view.el" (21462 9001 456449
 ;;;;;;  0))
 ;;; Generated autoloads from doc-view.el
 
@@ -6726,7 +6685,8 @@ See the command `doc-view-mode' for more information on this mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "doctor" "play/doctor.el" (21291 53104 0 0))
+;;;### (autoloads nil "doctor" "play/doctor.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from play/doctor.el
 
 (autoload 'doctor "doctor" "\
@@ -6736,7 +6696,7 @@ Switch to *doctor* buffer and start giving psychotherapy.
 
 ;;;***
 \f
-;;;### (autoloads nil "double" "double.el" (21291 53104 0 0))
+;;;### (autoloads nil "double" "double.el" (21187 63826 213216 0))
 ;;; Generated autoloads from double.el
 
 (autoload 'double-mode "double" "\
@@ -6752,7 +6712,8 @@ strings when pressed twice.  See `double-map' for details.
 
 ;;;***
 \f
-;;;### (autoloads nil "dunnet" "play/dunnet.el" (21291 53104 0 0))
+;;;### (autoloads nil "dunnet" "play/dunnet.el" (21406 50214 284651
+;;;;;;  0))
 ;;; Generated autoloads from play/dunnet.el
 (push (purecopy '(dunnet 2 1)) package--builtin-versions)
 
@@ -6763,8 +6724,8 @@ Switch to *dungeon* buffer and start game.
 
 ;;;***
 \f
-;;;### (autoloads nil "easy-mmode" "emacs-lisp/easy-mmode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "easy-mmode" "emacs-lisp/easy-mmode.el" (21259
+;;;;;;  10807 217062 0))
 ;;; Generated autoloads from emacs-lisp/easy-mmode.el
 
 (defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
@@ -6836,7 +6797,7 @@ For example, you could write
 
 \(fn MODE DOC &optional INIT-VALUE LIGHTER KEYMAP &rest BODY)" nil t)
 
-(put 'define-minor-mode 'doc-string-elt '2)
+(function-put 'define-minor-mode 'doc-string-elt '2)
 
 (defalias 'easy-mmode-define-global-mode 'define-globalized-minor-mode)
 
@@ -6867,7 +6828,7 @@ on if the hook has explicitly disabled it.
 
 \(fn GLOBAL-MODE MODE TURN-ON &rest KEYS)" nil t)
 
-(put 'define-globalized-minor-mode 'doc-string-elt '2)
+(function-put 'define-globalized-minor-mode 'doc-string-elt '2)
 
 (autoload 'easy-mmode-define-keymap "easy-mmode" "\
 Return a keymap built from bindings BS.
@@ -6903,8 +6864,8 @@ CSS contains a list of syntax specifications of the form (CHAR . SYNTAX).
 
 ;;;***
 \f
-;;;### (autoloads nil "easymenu" "emacs-lisp/easymenu.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "easymenu" "emacs-lisp/easymenu.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/easymenu.el
 
 (autoload 'easy-menu-define "easymenu" "\
@@ -7006,7 +6967,7 @@ MENU.  This is a submenu.
 
 \(fn SYMBOL MAPS DOC MENU)" nil t)
 
-(put 'easy-menu-define 'lisp-indent-function 'defun)
+(function-put 'easy-menu-define 'lisp-indent-function 'defun)
 
 (autoload 'easy-menu-do-define "easymenu" "\
 
@@ -7042,8 +7003,8 @@ To implement dynamic menus, either call this from
 
 ;;;***
 \f
-;;;### (autoloads nil "ebnf2ps" "progmodes/ebnf2ps.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ebnf2ps" "progmodes/ebnf2ps.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/ebnf2ps.el
 (push (purecopy '(ebnf2ps 4 4)) package--builtin-versions)
 
@@ -7308,8 +7269,8 @@ See `ebnf-style-database' documentation.
 
 ;;;***
 \f
-;;;### (autoloads nil "ebrowse" "progmodes/ebrowse.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ebrowse" "progmodes/ebrowse.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from progmodes/ebrowse.el
 
 (autoload 'ebrowse-tree-mode "ebrowse" "\
@@ -7457,7 +7418,7 @@ Display statistics for a class tree.
 
 ;;;***
 \f
-;;;### (autoloads nil "ebuff-menu" "ebuff-menu.el" (21291 53104 0
+;;;### (autoloads nil "ebuff-menu" "ebuff-menu.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from ebuff-menu.el
 
@@ -7490,7 +7451,8 @@ Run hooks in `electric-buffer-menu-mode-hook' on entry.
 
 ;;;***
 \f
-;;;### (autoloads nil "echistory" "echistory.el" (21291 53104 0 0))
+;;;### (autoloads nil "echistory" "echistory.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from echistory.el
 
 (autoload 'Electric-command-history-redo-expression "echistory" "\
@@ -7501,8 +7463,8 @@ With prefix arg NOCONFIRM, execute current line as-is without editing.
 
 ;;;***
 \f
-;;;### (autoloads nil "ecomplete" "gnus/ecomplete.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ecomplete" "gnus/ecomplete.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/ecomplete.el
 
 (autoload 'ecomplete-setup "ecomplete" "\
@@ -7512,7 +7474,7 @@ With prefix arg NOCONFIRM, execute current line as-is without editing.
 
 ;;;***
 \f
-;;;### (autoloads nil "ede" "cedet/ede.el" (21346 62196 0 0))
+;;;### (autoloads nil "ede" "cedet/ede.el" (21350 58112 380040 0))
 ;;; Generated autoloads from cedet/ede.el
 (push (purecopy '(ede 1 2)) package--builtin-versions)
 
@@ -7538,8 +7500,8 @@ an EDE controlled project.
 
 ;;;***
 \f
-;;;### (autoloads nil "edebug" "emacs-lisp/edebug.el" (21433 12343
-;;;;;;  302925 0))
+;;;### (autoloads nil "edebug" "emacs-lisp/edebug.el" (21452 59559
+;;;;;;  901066 0))
 ;;; Generated autoloads from emacs-lisp/edebug.el
 
 (defvar edebug-all-defs nil "\
@@ -7603,7 +7565,7 @@ Toggle edebugging of all forms.
 
 ;;;***
 \f
-;;;### (autoloads nil "ediff" "vc/ediff.el" (21423 62909 33477 0))
+;;;### (autoloads nil "ediff" "vc/ediff.el" (21429 11690 49391 0))
 ;;; Generated autoloads from vc/ediff.el
 (push (purecopy '(ediff 2 81 4)) package--builtin-versions)
 
@@ -7875,8 +7837,8 @@ With optional NODE, goes to that node.
 
 ;;;***
 \f
-;;;### (autoloads nil "ediff-help" "vc/ediff-help.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ediff-help" "vc/ediff-help.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from vc/ediff-help.el
 
 (autoload 'ediff-customize "ediff-help" "\
@@ -7886,8 +7848,8 @@ With optional NODE, goes to that node.
 
 ;;;***
 \f
-;;;### (autoloads nil "ediff-mult" "vc/ediff-mult.el" (21423 62909
-;;;;;;  33477 0))
+;;;### (autoloads nil "ediff-mult" "vc/ediff-mult.el" (21429 11690
+;;;;;;  49391 0))
 ;;; Generated autoloads from vc/ediff-mult.el
 
 (autoload 'ediff-show-registry "ediff-mult" "\
@@ -7899,8 +7861,8 @@ Display Ediff's registry.
 
 ;;;***
 \f
-;;;### (autoloads nil "ediff-util" "vc/ediff-util.el" (21349 10841
-;;;;;;  0 0))
+;;;### (autoloads nil "ediff-util" "vc/ediff-util.el" (21458 11942
+;;;;;;  975332 0))
 ;;; Generated autoloads from vc/ediff-util.el
 
 (autoload 'ediff-toggle-multiframe "ediff-util" "\
@@ -7919,7 +7881,8 @@ To change the default, set the variable `ediff-use-toolbar-p', which see.
 
 ;;;***
 \f
-;;;### (autoloads nil "edmacro" "edmacro.el" (21291 53104 0 0))
+;;;### (autoloads nil "edmacro" "edmacro.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from edmacro.el
 (push (purecopy '(edmacro 2 1)) package--builtin-versions)
 
@@ -7968,7 +7931,8 @@ or nil, use a compact 80-column format.
 
 ;;;***
 \f
-;;;### (autoloads nil "edt" "emulation/edt.el" (21291 53104 0 0))
+;;;### (autoloads nil "edt" "emulation/edt.el" (21417 20521 870414
+;;;;;;  0))
 ;;; Generated autoloads from emulation/edt.el
 
 (autoload 'edt-set-scroll-margins "edt" "\
@@ -7985,7 +7949,7 @@ Turn on EDT Emulation.
 
 ;;;***
 \f
-;;;### (autoloads nil "ehelp" "ehelp.el" (21423 62909 33477 0))
+;;;### (autoloads nil "ehelp" "ehelp.el" (21429 11690 49391 0))
 ;;; Generated autoloads from ehelp.el
 
 (autoload 'with-electric-help "ehelp" "\
@@ -8021,15 +7985,15 @@ BUFFER is put back into its original major mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "eieio" "emacs-lisp/eieio.el" (21364 41525
-;;;;;;  730218 0))
+;;;### (autoloads nil "eieio" "emacs-lisp/eieio.el" (21379 5529 990138
+;;;;;;  255000))
 ;;; Generated autoloads from emacs-lisp/eieio.el
 (push (purecopy '(eieio 1 4)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "eieio-core" "emacs-lisp/eieio-core.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "eieio-core" "emacs-lisp/eieio-core.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/eieio-core.el
 (push (purecopy '(eieio-core 1 4)) package--builtin-versions)
 
@@ -8045,8 +8009,8 @@ It creates an autoload function for CNAME's constructor.
 
 ;;;***
 \f
-;;;### (autoloads nil "eldoc" "emacs-lisp/eldoc.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "eldoc" "emacs-lisp/eldoc.el" (21305 16557
+;;;;;;  836987 0))
 ;;; Generated autoloads from emacs-lisp/eldoc.el
 
 (defvar eldoc-minor-mode-string (purecopy " ElDoc") "\
@@ -8071,8 +8035,8 @@ expression point is on.
 
 (define-obsolete-function-alias 'turn-on-eldoc-mode 'eldoc-mode "24.4")
 
-(defvar eldoc-documentation-function nil "\
-If non-nil, function to call to return doc string.
+(defvar eldoc-documentation-function #'eldoc-documentation-function-default "\
+Function to call to return doc string.
 The function of no args should return a one-line string for displaying
 doc about a function etc. appropriate to the context around point.
 It should return nil if there's no doc appropriate for the context.
@@ -8089,7 +8053,8 @@ Emacs Lisp mode) that support ElDoc.")
 
 ;;;***
 \f
-;;;### (autoloads nil "elec-pair" "elec-pair.el" (21341 23900 0 0))
+;;;### (autoloads nil "elec-pair" "elec-pair.el" (21327 43559 923043
+;;;;;;  0))
 ;;; Generated autoloads from elec-pair.el
 
 (defvar electric-pair-text-pairs '((34 . 34)) "\
@@ -8124,7 +8089,7 @@ closing parenthesis.  (Likewise for brackets, etc.).
 
 ;;;***
 \f
-;;;### (autoloads nil "elide-head" "elide-head.el" (21291 53104 0
+;;;### (autoloads nil "elide-head" "elide-head.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from elide-head.el
 
@@ -8140,8 +8105,8 @@ This is suitable as an entry on `find-file-hook' or appropriate mode hooks.
 
 ;;;***
 \f
-;;;### (autoloads nil "elint" "emacs-lisp/elint.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "elint" "emacs-lisp/elint.el" (21195 23530
+;;;;;;  495420 0))
 ;;; Generated autoloads from emacs-lisp/elint.el
 
 (autoload 'elint-file "elint" "\
@@ -8176,7 +8141,8 @@ optional prefix argument REINIT is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "elp" "emacs-lisp/elp.el" (21291 53104 0 0))
+;;;### (autoloads nil "elp" "emacs-lisp/elp.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/elp.el
 
 (autoload 'elp-instrument-function "elp" "\
@@ -8210,7 +8176,7 @@ displayed.
 
 ;;;***
 \f
-;;;### (autoloads nil "emacs-lock" "emacs-lock.el" (21291 53104 0
+;;;### (autoloads nil "emacs-lock" "emacs-lock.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from emacs-lock.el
 
@@ -8238,8 +8204,8 @@ Other values are interpreted as usual.
 
 ;;;***
 \f
-;;;### (autoloads nil "emacsbug" "mail/emacsbug.el" (21295 7741 0
-;;;;;;  0))
+;;;### (autoloads nil "emacsbug" "mail/emacsbug.el" (21302 89 140834
+;;;;;;  615000))
 ;;; Generated autoloads from mail/emacsbug.el
 
 (autoload 'report-emacs-bug "emacsbug" "\
@@ -8250,7 +8216,7 @@ Prompts for bug subject.  Leaves you in a mail buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "emerge" "vc/emerge.el" (21363 20664 637808
+;;;### (autoloads nil "emerge" "vc/emerge.el" (21364 37926 837230
 ;;;;;;  0))
 ;;; Generated autoloads from vc/emerge.el
 
@@ -8311,8 +8277,8 @@ Emerge two RCS revisions of a file, with another revision as ancestor.
 
 ;;;***
 \f
-;;;### (autoloads nil "enriched" "textmodes/enriched.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "enriched" "textmodes/enriched.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from textmodes/enriched.el
 
 (autoload 'enriched-mode "enriched" "\
@@ -8347,7 +8313,7 @@ Commands:
 
 ;;;***
 \f
-;;;### (autoloads nil "epa" "epa.el" (21291 53104 0 0))
+;;;### (autoloads nil "epa" "epa.el" (21294 46247 414129 0))
 ;;; Generated autoloads from epa.el
 
 (autoload 'epa-list-keys "epa" "\
@@ -8424,6 +8390,8 @@ See the reason described in the `epa-decrypt-region' documentation.
 
 \(fn START END)" t nil)
 
+(function-put 'epa-decrypt-armor-in-region 'interactive-only 't)
+
 (autoload 'epa-verify-region "epa" "\
 Verify the current region between START and END.
 
@@ -8444,6 +8412,8 @@ For example:
 
 \(fn START END)" t nil)
 
+(function-put 'epa-verify-region 'interactive-only 't)
+
 (autoload 'epa-verify-cleartext-in-region "epa" "\
 Verify OpenPGP cleartext signed messages in the current region
 between START and END.
@@ -8453,6 +8423,8 @@ See the reason described in the `epa-verify-region' documentation.
 
 \(fn START END)" t nil)
 
+(function-put 'epa-verify-cleartext-in-region 'interactive-only 't)
+
 (autoload 'epa-sign-region "epa" "\
 Sign the current region between START and END by SIGNERS keys selected.
 
@@ -8472,6 +8444,8 @@ For example:
 
 \(fn START END SIGNERS MODE)" t nil)
 
+(function-put 'epa-sign-region 'interactive-only 't)
+
 (autoload 'epa-encrypt-region "epa" "\
 Encrypt the current region between START and END for RECIPIENTS.
 
@@ -8492,6 +8466,8 @@ For example:
 
 \(fn START END RECIPIENTS SIGN SIGNERS)" t nil)
 
+(function-put 'epa-encrypt-region 'interactive-only 't)
+
 (autoload 'epa-delete-keys "epa" "\
 Delete selected KEYS.
 
@@ -8525,7 +8501,8 @@ Insert selected KEYS after the point.
 
 ;;;***
 \f
-;;;### (autoloads nil "epa-dired" "epa-dired.el" (21291 53104 0 0))
+;;;### (autoloads nil "epa-dired" "epa-dired.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from epa-dired.el
 
 (autoload 'epa-dired-do-decrypt "epa-dired" "\
@@ -8550,7 +8527,8 @@ Encrypt marked files.
 
 ;;;***
 \f
-;;;### (autoloads nil "epa-file" "epa-file.el" (21291 53104 0 0))
+;;;### (autoloads nil "epa-file" "epa-file.el" (21205 7349 58947
+;;;;;;  0))
 ;;; Generated autoloads from epa-file.el
 
 (autoload 'epa-file-handler "epa-file" "\
@@ -8570,7 +8548,8 @@ Encrypt marked files.
 
 ;;;***
 \f
-;;;### (autoloads nil "epa-mail" "epa-mail.el" (21291 53104 0 0))
+;;;### (autoloads nil "epa-mail" "epa-mail.el" (21294 46247 414129
+;;;;;;  0))
 ;;; Generated autoloads from epa-mail.el
 
 (autoload 'epa-mail-mode "epa-mail" "\
@@ -8585,26 +8564,26 @@ if ARG is omitted or nil.
 Decrypt OpenPGP armors in the current buffer.
 The buffer is expected to contain a mail message.
 
-Don't use this command in Lisp programs!
-
 \(fn)" t nil)
 
+(function-put 'epa-mail-decrypt 'interactive-only 't)
+
 (autoload 'epa-mail-verify "epa-mail" "\
 Verify OpenPGP cleartext signed messages in the current buffer.
 The buffer is expected to contain a mail message.
 
-Don't use this command in Lisp programs!
-
 \(fn)" t nil)
 
+(function-put 'epa-mail-verify 'interactive-only 't)
+
 (autoload 'epa-mail-sign "epa-mail" "\
 Sign the current buffer.
 The buffer is expected to contain a mail message.
 
-Don't use this command in Lisp programs!
-
 \(fn START END SIGNERS MODE)" t nil)
 
+(function-put 'epa-mail-sign 'interactive-only 't)
+
 (autoload 'epa-mail-encrypt "epa-mail" "\
 Encrypt the outgoing mail message in the current buffer.
 Takes the recipients from the text in the header in the buffer
@@ -8624,10 +8603,10 @@ SIGNERS is a list of keys to sign the message with.
 Import keys in the OpenPGP armor format in the current buffer.
 The buffer is expected to contain a mail message.
 
-Don't use this command in Lisp programs!
-
 \(fn)" t nil)
 
+(function-put 'epa-mail-import-keys 'interactive-only 't)
+
 (defvar epa-global-mail-mode nil "\
 Non-nil if Epa-Global-Mail mode is enabled.
 See the command `epa-global-mail-mode' for a description of this minor mode.
@@ -8647,7 +8626,7 @@ if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "epg" "epg.el" (21291 53104 0 0))
+;;;### (autoloads nil "epg" "epg.el" (21364 37926 837230 0))
 ;;; Generated autoloads from epg.el
 (push (purecopy '(epg 1 0 0)) package--builtin-versions)
 
@@ -8658,7 +8637,7 @@ Return a context object.
 
 ;;;***
 \f
-;;;### (autoloads nil "epg-config" "epg-config.el" (21291 53104 0
+;;;### (autoloads nil "epg-config" "epg-config.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from epg-config.el
 
@@ -8679,7 +8658,7 @@ Look at CONFIG and try to expand GROUP.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc" "erc/erc.el" (21291 53104 0 0))
+;;;### (autoloads nil "erc" "erc/erc.el" (21437 5802 125919 0))
 ;;; Generated autoloads from erc/erc.el
 (push (purecopy '(erc 5 3)) package--builtin-versions)
 
@@ -8728,35 +8707,36 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-autoaway.el
  (autoload 'erc-autoaway-mode "erc-autoaway")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-button.el
  (autoload 'erc-button-mode "erc-button" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-capab.el
  (autoload 'erc-capab-identify-mode "erc-capab" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-compat.el
  (autoload 'erc-define-minor-mode "erc-compat")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-dcc" "erc/erc-dcc.el" (21291 53104 0 0))
+;;;### (autoloads nil "erc-dcc" "erc/erc-dcc.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from erc/erc-dcc.el
  (autoload 'erc-dcc-mode "erc-dcc")
 
@@ -8786,14 +8766,14 @@ that subcommand.
 ;;;***
 \f
 ;;;### (autoloads nil "erc-desktop-notifications" "erc/erc-desktop-notifications.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from erc/erc-desktop-notifications.el
 (autoload 'erc-notifications-mode "erc-desktop-notifications" "" t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-ezbounce" "erc/erc-ezbounce.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-ezbounce" "erc/erc-ezbounce.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-ezbounce.el
 
 (autoload 'erc-cmd-ezb "erc-ezbounce" "\
@@ -8855,7 +8835,7 @@ Add EZBouncer convenience functions to ERC.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-fill" "erc/erc-fill.el" (21291 53104 0
+;;;### (autoloads nil "erc-fill" "erc/erc-fill.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from erc/erc-fill.el
  (autoload 'erc-fill-mode "erc-fill" nil t)
@@ -8868,8 +8848,8 @@ You can put this on `erc-insert-modify-hook' and/or `erc-send-modify-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-identd" "erc/erc-identd.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-identd" "erc/erc-identd.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-identd.el
  (autoload 'erc-identd-mode "erc-identd")
 
@@ -8890,8 +8870,8 @@ system.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-imenu" "erc/erc-imenu.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-imenu" "erc/erc-imenu.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-imenu.el
 
 (autoload 'erc-create-imenu-index "erc-imenu" "\
@@ -8901,21 +8881,22 @@ system.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-join" "erc/erc-join.el" (21291 53104 0
+;;;### (autoloads nil "erc-join" "erc/erc-join.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from erc/erc-join.el
  (autoload 'erc-autojoin-mode "erc-join" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-list" "erc/erc-list.el" (21307 46976 0
+;;;### (autoloads nil "erc-list" "erc/erc-list.el" (21308 46599 181916
 ;;;;;;  0))
 ;;; Generated autoloads from erc/erc-list.el
  (autoload 'erc-list-mode "erc-list")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-log" "erc/erc-log.el" (21291 53104 0 0))
+;;;### (autoloads nil "erc-log" "erc/erc-log.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from erc/erc-log.el
  (autoload 'erc-log-mode "erc-log" nil t)
 
@@ -8944,8 +8925,8 @@ You can save every individual message by putting this function on
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-match" "erc/erc-match.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-match" "erc/erc-match.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-match.el
  (autoload 'erc-match-mode "erc-match")
 
@@ -8991,15 +8972,15 @@ Delete dangerous-host interactively to `erc-dangerous-hosts'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (21291 53104 0
+;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from erc/erc-menu.el
  (autoload 'erc-menu-mode "erc-menu" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-netsplit" "erc/erc-netsplit.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-netsplit" "erc/erc-netsplit.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-netsplit.el
  (autoload 'erc-netsplit-mode "erc-netsplit")
 
@@ -9010,8 +8991,8 @@ Show who's gone.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-networks" "erc/erc-networks.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-networks" "erc/erc-networks.el" (21260
+;;;;;;  55795 711190 0))
 ;;; Generated autoloads from erc/erc-networks.el
 
 (autoload 'erc-determine-network "erc-networks" "\
@@ -9028,8 +9009,8 @@ Interactively select a server to connect to using `erc-server-alist'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-notify" "erc/erc-notify.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-notify" "erc/erc-notify.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-notify.el
  (autoload 'erc-notify-mode "erc-notify" nil t)
 
@@ -9047,36 +9028,36 @@ with args, toggle notify status of people.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-page" "erc/erc-page.el" (21291 53104 0
+;;;### (autoloads nil "erc-page" "erc/erc-page.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from erc/erc-page.el
  (autoload 'erc-page-mode "erc-page")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-pcomplete.el
  (autoload 'erc-completion-mode "erc-pcomplete" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-replace.el
  (autoload 'erc-replace-mode "erc-replace")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (21291 53104 0
+;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from erc/erc-ring.el
  (autoload 'erc-ring-mode "erc-ring" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-services" "erc/erc-services.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-services" "erc/erc-services.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-services.el
  (autoload 'erc-services-mode "erc-services" nil t)
 
@@ -9093,15 +9074,15 @@ When called interactively, read the password using `read-passwd'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-sound.el
  (autoload 'erc-sound-mode "erc-sound")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-speedbar" "erc/erc-speedbar.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-speedbar" "erc/erc-speedbar.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-speedbar.el
 
 (autoload 'erc-speedbar-browser "erc-speedbar" "\
@@ -9112,22 +9093,22 @@ This will add a speedbar major display mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-spelling.el
  (autoload 'erc-spelling-mode "erc-spelling" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-stamp.el
  (autoload 'erc-timestamp-mode "erc-stamp" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-track" "erc/erc-track.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "erc-track" "erc/erc-track.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from erc/erc-track.el
 
 (defvar erc-track-minor-mode nil "\
@@ -9152,8 +9133,8 @@ keybindings will not do anything useful.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-truncate" "erc/erc-truncate.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "erc-truncate" "erc/erc-truncate.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from erc/erc-truncate.el
  (autoload 'erc-truncate-mode "erc-truncate" nil t)
 
@@ -9172,7 +9153,7 @@ Meant to be used in hooks, like `erc-insert-post-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-xdcc" "erc/erc-xdcc.el" (21291 53104 0
+;;;### (autoloads nil "erc-xdcc" "erc/erc-xdcc.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from erc/erc-xdcc.el
  (autoload 'erc-xdcc-mode "erc-xdcc")
@@ -9184,7 +9165,8 @@ Add a file to `erc-xdcc-files'.
 
 ;;;***
 \f
-;;;### (autoloads nil "ert" "emacs-lisp/ert.el" (21291 53104 0 0))
+;;;### (autoloads nil "ert" "emacs-lisp/ert.el" (21419 62246 751914
+;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/ert.el
 
 (autoload 'ert-deftest "ert" "\
@@ -9249,8 +9231,8 @@ Display the documentation for TEST-OR-TEST-NAME (a symbol or ert-test).
 
 ;;;***
 \f
-;;;### (autoloads nil "ert-x" "emacs-lisp/ert-x.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ert-x" "emacs-lisp/ert-x.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from emacs-lisp/ert-x.el
 
 (put 'ert-with-test-buffer 'lisp-indent-function 1)
@@ -9262,8 +9244,8 @@ Kill all test buffers that are still live.
 
 ;;;***
 \f
-;;;### (autoloads nil "esh-mode" "eshell/esh-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "esh-mode" "eshell/esh-mode.el" (21213 1461
+;;;;;;  513511 0))
 ;;; Generated autoloads from eshell/esh-mode.el
 
 (autoload 'eshell-mode "esh-mode" "\
@@ -9273,8 +9255,8 @@ Emacs shell interactive mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "eshell" "eshell/eshell.el" (21291 53104 0
-;;;;;;  0))
+;;;### (autoloads nil "eshell" "eshell/eshell.el" (21403 21396 190131
+;;;;;;  14000))
 ;;; Generated autoloads from eshell/eshell.el
 (push (purecopy '(eshell 2 4 2)) package--builtin-versions)
 
@@ -9309,7 +9291,7 @@ corresponding to a successful execution.
 
 ;;;***
 \f
-;;;### (autoloads nil "etags" "progmodes/etags.el" (21291 53104 0
+;;;### (autoloads nil "etags" "progmodes/etags.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from progmodes/etags.el
 
@@ -9618,8 +9600,8 @@ for \\[find-tag] (which see).
 
 ;;;***
 \f
-;;;### (autoloads nil "ethio-util" "language/ethio-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "ethio-util" "language/ethio-util.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from language/ethio-util.el
 
 (autoload 'setup-ethiopic-environment-internal "ethio-util" "\
@@ -9787,7 +9769,7 @@ With ARG, insert that many delimiters.
 
 ;;;***
 \f
-;;;### (autoloads nil "eudc" "net/eudc.el" (21291 53104 0 0))
+;;;### (autoloads nil "eudc" "net/eudc.el" (21187 63826 213216 0))
 ;;; Generated autoloads from net/eudc.el
 
 (autoload 'eudc-set-server "eudc" "\
@@ -9841,7 +9823,7 @@ This does nothing except loading eudc by autoload side-effect.
 
 ;;;***
 \f
-;;;### (autoloads nil "eudc-bob" "net/eudc-bob.el" (21291 53104 0
+;;;### (autoloads nil "eudc-bob" "net/eudc-bob.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from net/eudc-bob.el
 
@@ -9877,8 +9859,8 @@ Display a button for the JPEG DATA.
 
 ;;;***
 \f
-;;;### (autoloads nil "eudc-export" "net/eudc-export.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "eudc-export" "net/eudc-export.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from net/eudc-export.el
 
 (autoload 'eudc-insert-record-at-point-into-bbdb "eudc-export" "\
@@ -9894,8 +9876,8 @@ Call `eudc-insert-record-at-point-into-bbdb' if on a record.
 
 ;;;***
 \f
-;;;### (autoloads nil "eudc-hotlist" "net/eudc-hotlist.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "eudc-hotlist" "net/eudc-hotlist.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from net/eudc-hotlist.el
 
 (autoload 'eudc-edit-hotlist "eudc-hotlist" "\
@@ -9905,7 +9887,7 @@ Edit the hotlist of directory servers in a specialized buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "ewoc" "emacs-lisp/ewoc.el" (21291 53104 0
+;;;### (autoloads nil "ewoc" "emacs-lisp/ewoc.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/ewoc.el
 
@@ -9932,7 +9914,7 @@ fourth arg NOSEP non-nil inhibits this.
 
 ;;;***
 \f
-;;;### (autoloads nil "eww" "net/eww.el" (21420 48935 113702 389000))
+;;;### (autoloads nil "eww" "net/eww.el" (21423 59302 489365 0))
 ;;; Generated autoloads from net/eww.el
 
 (autoload 'eww "eww" "\
@@ -9955,8 +9937,8 @@ Render a file using EWW.
 
 ;;;***
 \f
-;;;### (autoloads nil "executable" "progmodes/executable.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "executable" "progmodes/executable.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from progmodes/executable.el
 
 (autoload 'executable-command-find-posix-p "executable" "\
@@ -9997,7 +9979,7 @@ file modes.
 
 ;;;***
 \f
-;;;### (autoloads nil "expand" "expand.el" (21291 53104 0 0))
+;;;### (autoloads nil "expand" "expand.el" (21187 63826 213216 0))
 ;;; Generated autoloads from expand.el
 
 (autoload 'expand-add-abbrevs "expand" "\
@@ -10046,7 +10028,7 @@ This is used only in conjunction with `expand-add-abbrevs'.
 
 ;;;***
 \f
-;;;### (autoloads nil "f90" "progmodes/f90.el" (21423 62909 33477
+;;;### (autoloads nil "f90" "progmodes/f90.el" (21429 11690 49391
 ;;;;;;  0))
 ;;; Generated autoloads from progmodes/f90.el
 
@@ -10114,7 +10096,7 @@ with no args, if that value is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "face-remap" "face-remap.el" (21291 53104 0
+;;;### (autoloads nil "face-remap" "face-remap.el" (21241 18251 378509
 ;;;;;;  0))
 ;;; Generated autoloads from face-remap.el
 
@@ -10274,8 +10256,8 @@ Besides the choice of face, it is the same as `buffer-face-mode'.
 
 ;;;***
 \f
-;;;### (autoloads nil "feedmail" "mail/feedmail.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "feedmail" "mail/feedmail.el" (21002 1963 769129
+;;;;;;  0))
 ;;; Generated autoloads from mail/feedmail.el
 (push (purecopy '(feedmail 11)) package--builtin-versions)
 
@@ -10329,7 +10311,7 @@ you can set `feedmail-queue-reminder-alist' to nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "ffap" "ffap.el" (21291 53104 0 0))
+;;;### (autoloads nil "ffap" "ffap.el" (21401 32300 989919 0))
 ;;; Generated autoloads from ffap.el
 
 (autoload 'ffap-next "ffap" "\
@@ -10392,7 +10374,8 @@ Evaluate the forms in variable `ffap-bindings'.
 
 ;;;***
 \f
-;;;### (autoloads nil "filecache" "filecache.el" (21291 53104 0 0))
+;;;### (autoloads nil "filecache" "filecache.el" (21265 49588 918402
+;;;;;;  0))
 ;;; Generated autoloads from filecache.el
 
 (autoload 'file-cache-add-directory "filecache" "\
@@ -10449,7 +10432,7 @@ the name is considered already unique; only the second substitution
 
 ;;;***
 \f
-;;;### (autoloads nil "filenotify" "filenotify.el" (21291 53104 0
+;;;### (autoloads nil "filenotify" "filenotify.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from filenotify.el
 
@@ -10462,7 +10445,8 @@ Otherwise, signal a `file-notify-error'.
 
 ;;;***
 \f
-;;;### (autoloads nil "files-x" "files-x.el" (21291 53104 0 0))
+;;;### (autoloads nil "files-x" "files-x.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from files-x.el
 
 (autoload 'add-file-local-variable "files-x" "\
@@ -10527,7 +10511,8 @@ Copy directory-local variables to the -*- line.
 
 ;;;***
 \f
-;;;### (autoloads nil "filesets" "filesets.el" (21291 53104 0 0))
+;;;### (autoloads nil "filesets" "filesets.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from filesets.el
 
 (autoload 'filesets-init "filesets" "\
@@ -10538,7 +10523,8 @@ Set up hooks, load the cache file -- if existing -- and build the menu.
 
 ;;;***
 \f
-;;;### (autoloads nil "find-cmd" "find-cmd.el" (21291 53104 0 0))
+;;;### (autoloads nil "find-cmd" "find-cmd.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from find-cmd.el
 (push (purecopy '(find-cmd 0 6)) package--builtin-versions)
 
@@ -10558,7 +10544,7 @@ result is a string that should be ready for the command line.
 
 ;;;***
 \f
-;;;### (autoloads nil "find-dired" "find-dired.el" (21291 53104 0
+;;;### (autoloads nil "find-dired" "find-dired.el" (21264 57319 597552
 ;;;;;;  0))
 ;;; Generated autoloads from find-dired.el
 
@@ -10599,7 +10585,8 @@ use in place of \"-ls\" as the final argument.
 
 ;;;***
 \f
-;;;### (autoloads nil "find-file" "find-file.el" (21291 53104 0 0))
+;;;### (autoloads nil "find-file" "find-file.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from find-file.el
 
 (defvar ff-special-constructs `((,(purecopy "^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") lambda nil (buffer-substring (match-beginning 2) (match-end 2)))) "\
@@ -10689,8 +10676,8 @@ Visit the file you click on in another window.
 
 ;;;***
 \f
-;;;### (autoloads nil "find-func" "emacs-lisp/find-func.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "find-func" "emacs-lisp/find-func.el" (21419
+;;;;;;  62246 751914 0))
 ;;; Generated autoloads from emacs-lisp/find-func.el
 
 (autoload 'find-library "find-func" "\
@@ -10848,7 +10835,8 @@ Define some key bindings for the find-function family of functions.
 
 ;;;***
 \f
-;;;### (autoloads nil "find-lisp" "find-lisp.el" (21291 53104 0 0))
+;;;### (autoloads nil "find-lisp" "find-lisp.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from find-lisp.el
 
 (autoload 'find-lisp-find-dired "find-lisp" "\
@@ -10868,7 +10856,7 @@ Change the filter on a `find-lisp-find-dired' buffer to REGEXP.
 
 ;;;***
 \f
-;;;### (autoloads nil "finder" "finder.el" (21423 62909 33477 0))
+;;;### (autoloads nil "finder" "finder.el" (21429 11690 49391 0))
 ;;; Generated autoloads from finder.el
 (push (purecopy '(finder 1 0)) package--builtin-versions)
 
@@ -10890,7 +10878,8 @@ Find packages matching a given keyword.
 
 ;;;***
 \f
-;;;### (autoloads nil "flow-ctrl" "flow-ctrl.el" (21291 53104 0 0))
+;;;### (autoloads nil "flow-ctrl" "flow-ctrl.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from flow-ctrl.el
 
 (autoload 'enable-flow-control "flow-ctrl" "\
@@ -10911,8 +10900,8 @@ to get the effect of a C-q.
 
 ;;;***
 \f
-;;;### (autoloads nil "flow-fill" "gnus/flow-fill.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "flow-fill" "gnus/flow-fill.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/flow-fill.el
 
 (autoload 'fill-flowed-encode "flow-fill" "\
@@ -10927,8 +10916,8 @@ to get the effect of a C-q.
 
 ;;;***
 \f
-;;;### (autoloads nil "flymake" "progmodes/flymake.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "flymake" "progmodes/flymake.el" (21245 64312
+;;;;;;  799897 0))
 ;;; Generated autoloads from progmodes/flymake.el
 (push (purecopy '(flymake 0 3)) package--builtin-versions)
 
@@ -10958,8 +10947,8 @@ Turn flymake mode off.
 
 ;;;***
 \f
-;;;### (autoloads nil "flyspell" "textmodes/flyspell.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "flyspell" "textmodes/flyspell.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from textmodes/flyspell.el
 
 (autoload 'flyspell-prog-mode "flyspell" "\
@@ -11029,13 +11018,14 @@ Flyspell whole buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "foldout" "foldout.el" (21291 53104 0 0))
+;;;### (autoloads nil "foldout" "foldout.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from foldout.el
 (push (purecopy '(foldout 1 10)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "follow" "follow.el" (21291 53104 0 0))
+;;;### (autoloads nil "follow" "follow.el" (21240 46395 727291 0))
 ;;; Generated autoloads from follow.el
 
 (autoload 'turn-on-follow-mode "follow" "\
@@ -11103,8 +11093,8 @@ selected if the original window is the first one in the frame.
 
 ;;;***
 \f
-;;;### (autoloads nil "footnote" "mail/footnote.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "footnote" "mail/footnote.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from mail/footnote.el
 (push (purecopy '(footnote 0 19)) package--builtin-versions)
 
@@ -11123,7 +11113,7 @@ play around with the following keys:
 
 ;;;***
 \f
-;;;### (autoloads nil "forms" "forms.el" (21291 53104 0 0))
+;;;### (autoloads nil "forms" "forms.el" (21187 63826 213216 0))
 ;;; Generated autoloads from forms.el
 
 (autoload 'forms-mode "forms" "\
@@ -11159,8 +11149,8 @@ Visit a file in Forms mode in other window.
 
 ;;;***
 \f
-;;;### (autoloads nil "fortran" "progmodes/fortran.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "fortran" "progmodes/fortran.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/fortran.el
 
 (autoload 'fortran-mode "fortran" "\
@@ -11237,7 +11227,7 @@ with no args, if that value is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "fortune" "play/fortune.el" (21291 53104 0
+;;;### (autoloads nil "fortune" "play/fortune.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from play/fortune.el
 
@@ -11286,7 +11276,8 @@ and choose the directory as the fortune-file.
 
 ;;;***
 \f
-;;;### (autoloads nil "frameset" "frameset.el" (21300 58261 0 0))
+;;;### (autoloads nil "frameset" "frameset.el" (21300 27302 473448
+;;;;;;  0))
 ;;; Generated autoloads from frameset.el
 
 (defvar frameset-session-filter-alist '((name . :never) (left . frameset-filter-iconified) (minibuffer . frameset-filter-minibuffer) (top . frameset-filter-iconified)) "\
@@ -11455,6 +11446,12 @@ Called from `jump-to-register'.  Internal use only.
 
 \(fn DATA)" nil nil)
 
+(autoload 'frameset--print-register "frameset" "\
+Print basic info about frameset stored in DATA.
+Called from `list-registers' and `view-register'.  Internal use only.
+
+\(fn DATA)" nil nil)
+
 (autoload 'frameset-to-register "frameset" "\
 Store the current frameset in register REGISTER.
 Use \\[jump-to-register] to restore the frameset.
@@ -11466,15 +11463,15 @@ Interactively, reads the register using `register-read-with-preview'.
 
 ;;;***
 \f
-;;;### (autoloads nil "gamegrid" "play/gamegrid.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gamegrid" "play/gamegrid.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from play/gamegrid.el
 (push (purecopy '(gamegrid 1 2)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "gdb-mi" "progmodes/gdb-mi.el" (21346 62196
-;;;;;;  0 0))
+;;;### (autoloads nil "gdb-mi" "progmodes/gdb-mi.el" (21350 58112
+;;;;;;  380040 0))
 ;;; Generated autoloads from progmodes/gdb-mi.el
 
 (defvar gdb-enable-debug nil "\
@@ -11551,8 +11548,8 @@ detailed description of this mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "generic" "emacs-lisp/generic.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "generic" "emacs-lisp/generic.el" (21202 31159
+;;;;;;  541460 0))
 ;;; Generated autoloads from emacs-lisp/generic.el
 
 (defvar generic-mode-list nil "\
@@ -11596,9 +11593,9 @@ See the file generic-x.el for some examples of `define-generic-mode'.
 
 \(fn MODE COMMENT-LIST KEYWORD-LIST FONT-LOCK-LIST AUTO-MODE-LIST FUNCTION-LIST &optional DOCSTRING)" nil t)
 
-(put 'define-generic-mode 'lisp-indent-function '1)
+(function-put 'define-generic-mode 'lisp-indent-function '1)
 
-(put 'define-generic-mode 'doc-string-elt '7)
+(function-put 'define-generic-mode 'doc-string-elt '7)
 
 (autoload 'generic-mode-internal "generic" "\
 Go into the generic mode MODE.
@@ -11632,8 +11629,8 @@ regular expression that can be used as an element of
 
 ;;;***
 \f
-;;;### (autoloads nil "glasses" "progmodes/glasses.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "glasses" "progmodes/glasses.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/glasses.el
 
 (autoload 'glasses-mode "glasses" "\
@@ -11647,8 +11644,8 @@ add virtual separators (like underscores) at places they belong to.
 
 ;;;***
 \f
-;;;### (autoloads nil "gmm-utils" "gnus/gmm-utils.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gmm-utils" "gnus/gmm-utils.el" (21326 22692
+;;;;;;  123234 0))
 ;;; Generated autoloads from gnus/gmm-utils.el
 
 (autoload 'gmm-regexp-concat "gmm-utils" "\
@@ -11702,7 +11699,7 @@ DEFAULT-MAP specifies the default key map for ICON-LIST.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus" "gnus/gnus.el" (21291 53104 0 0))
+;;;### (autoloads nil "gnus" "gnus/gnus.el" (21296 1575 438327 0))
 ;;; Generated autoloads from gnus/gnus.el
 (push (purecopy '(gnus 5 13)) package--builtin-versions)
 (when (fboundp 'custom-autoload)
@@ -11752,8 +11749,8 @@ prompt the user for the name of an NNTP server to use.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-agent" "gnus/gnus-agent.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-agent" "gnus/gnus-agent.el" (21274 64565
+;;;;;;  737222 0))
 ;;; Generated autoloads from gnus/gnus-agent.el
 
 (autoload 'gnus-unplugged "gnus-agent" "\
@@ -11843,8 +11840,8 @@ CLEAN is obsolete and ignored.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-art" "gnus/gnus-art.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-art" "gnus/gnus-art.el" (21393 38187
+;;;;;;  675040 0))
 ;;; Generated autoloads from gnus/gnus-art.el
 
 (autoload 'gnus-article-prepare-display "gnus-art" "\
@@ -11854,8 +11851,8 @@ Make the current buffer look like a nice article.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-bookmark" "gnus/gnus-bookmark.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "gnus-bookmark" "gnus/gnus-bookmark.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from gnus/gnus-bookmark.el
 
 (autoload 'gnus-bookmark-set "gnus-bookmark" "\
@@ -11878,8 +11875,8 @@ deletion, or > if it is flagged for displaying.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-cache" "gnus/gnus-cache.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-cache" "gnus/gnus-cache.el" (21296 1575
+;;;;;;  438327 0))
 ;;; Generated autoloads from gnus/gnus-cache.el
 
 (autoload 'gnus-jog-cache "gnus-cache" "\
@@ -11920,8 +11917,8 @@ supported.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-delay" "gnus/gnus-delay.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-delay" "gnus/gnus-delay.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-delay.el
 
 (autoload 'gnus-delay-article "gnus-delay" "\
@@ -11956,8 +11953,8 @@ Checking delayed messages is skipped if optional arg NO-CHECK is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-diary" "gnus/gnus-diary.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-diary" "gnus/gnus-diary.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-diary.el
 
 (autoload 'gnus-user-format-function-d "gnus-diary" "\
@@ -11972,8 +11969,8 @@ Checking delayed messages is skipped if optional arg NO-CHECK is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-dired" "gnus/gnus-dired.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-dired" "gnus/gnus-dired.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-dired.el
 
 (autoload 'turn-on-gnus-dired-mode "gnus-dired" "\
@@ -11983,8 +11980,8 @@ Convenience method to turn on gnus-dired-mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-draft" "gnus/gnus-draft.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-draft" "gnus/gnus-draft.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-draft.el
 
 (autoload 'gnus-draft-reminder "gnus-draft" "\
@@ -11994,13 +11991,22 @@ Reminder user if there are unsent drafts.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-fun" "gnus/gnus-fun.el" (21352 50356
-;;;;;;  891885 0))
+;;;### (autoloads nil "gnus-fun" "gnus/gnus-fun.el" (21355 22953
+;;;;;;  61816 0))
 ;;; Generated autoloads from gnus/gnus-fun.el
 
+(autoload 'gnus--random-face-with-type "gnus-fun" "\
+Return file from DIR with extension EXT, omitting matches of OMIT, processed by FUN.
+
+\(fn DIR EXT OMIT FUN)" nil nil)
+
+(autoload 'message-goto-eoh "message" nil t)
+
 (autoload 'gnus-random-x-face "gnus-fun" "\
 Return X-Face header data chosen randomly from `gnus-x-face-directory'.
 
+Files matching `gnus-x-face-omit-files' are not considered.
+
 \(fn)" t nil)
 
 (autoload 'gnus-insert-random-x-face-header "gnus-fun" "\
@@ -12009,7 +12015,7 @@ Insert a random X-Face header from `gnus-x-face-directory'.
 \(fn)" t nil)
 
 (autoload 'gnus-x-face-from-file "gnus-fun" "\
-Insert an X-Face header based on an image file.
+Insert an X-Face header based on an image FILE.
 
 Depending on `gnus-convert-image-to-x-face-command' it may accept
 different input formats.
@@ -12017,7 +12023,7 @@ different input formats.
 \(fn FILE)" t nil)
 
 (autoload 'gnus-face-from-file "gnus-fun" "\
-Return a Face header based on an image file.
+Return a Face header based on an image FILE.
 
 Depending on `gnus-convert-image-to-face-command' it may accept
 different input formats.
@@ -12037,10 +12043,22 @@ FILE should be a PNG file that's 48x48 and smaller than or equal to
 
 \(fn FILE)" nil nil)
 
+(autoload 'gnus-random-face "gnus-fun" "\
+Return randomly chosen Face from `gnus-face-directory'.
+
+Files matching `gnus-face-omit-files' are not considered.
+
+\(fn)" t nil)
+
+(autoload 'gnus-insert-random-face-header "gnus-fun" "\
+Insert a randome Face header from `gnus-face-directory'.
+
+\(fn)" nil nil)
+
 ;;;***
 \f
-;;;### (autoloads nil "gnus-gravatar" "gnus/gnus-gravatar.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "gnus-gravatar" "gnus/gnus-gravatar.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from gnus/gnus-gravatar.el
 
 (autoload 'gnus-treat-from-gravatar "gnus-gravatar" "\
@@ -12057,8 +12075,8 @@ If gravatars are already displayed, remove them.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-group" "gnus/gnus-group.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-group" "gnus/gnus-group.el" (21296 1575
+;;;;;;  438327 0))
 ;;; Generated autoloads from gnus/gnus-group.el
 
 (autoload 'gnus-fetch-group "gnus-group" "\
@@ -12075,8 +12093,8 @@ Pop up a frame and enter GROUP.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-html" "gnus/gnus-html.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-html" "gnus/gnus-html.el" (21296 1575
+;;;;;;  438327 0))
 ;;; Generated autoloads from gnus/gnus-html.el
 
 (autoload 'gnus-article-html "gnus-html" "\
@@ -12091,8 +12109,8 @@ Pop up a frame and enter GROUP.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-kill" "gnus/gnus-kill.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-kill" "gnus/gnus-kill.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-kill.el
 
 (defalias 'gnus-batch-kill 'gnus-batch-score)
@@ -12105,7 +12123,7 @@ Usage: emacs -batch -l ~/.emacs -l gnus -f gnus-batch-score
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-ml" "gnus/gnus-ml.el" (21291 53104 0
+;;;### (autoloads nil "gnus-ml" "gnus/gnus-ml.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from gnus/gnus-ml.el
 
@@ -12129,8 +12147,8 @@ Minor mode for providing mailing-list commands.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-mlspl" "gnus/gnus-mlspl.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-mlspl" "gnus/gnus-mlspl.el" (21296 1575
+;;;;;;  438327 0))
 ;;; Generated autoloads from gnus/gnus-mlspl.el
 
 (autoload 'gnus-group-split-setup "gnus-mlspl" "\
@@ -12230,8 +12248,8 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns:
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-msg" "gnus/gnus-msg.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-msg" "gnus/gnus-msg.el" (21467 26920
+;;;;;;  243336 0))
 ;;; Generated autoloads from gnus/gnus-msg.el
 
 (autoload 'gnus-msg-mail "gnus-msg" "\
@@ -12258,7 +12276,7 @@ Like `message-reply'.
 ;;;***
 \f
 ;;;### (autoloads nil "gnus-notifications" "gnus/gnus-notifications.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21296 1575 438327 0))
 ;;; Generated autoloads from gnus/gnus-notifications.el
 
 (autoload 'gnus-notifications "gnus-notifications" "\
@@ -12274,8 +12292,8 @@ This is typically a function to add in
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-picon" "gnus/gnus-picon.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-picon" "gnus/gnus-picon.el" (21296 1575
+;;;;;;  438327 0))
 ;;; Generated autoloads from gnus/gnus-picon.el
 
 (autoload 'gnus-treat-from-picon "gnus-picon" "\
@@ -12298,8 +12316,8 @@ If picons are already displayed, remove them.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-range" "gnus/gnus-range.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-range" "gnus/gnus-range.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-range.el
 
 (autoload 'gnus-sorted-difference "gnus-range" "\
@@ -12366,8 +12384,8 @@ Add NUM into sorted LIST by side effect.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-registry" "gnus/gnus-registry.el" (21346
-;;;;;;  62196 0 0))
+;;;### (autoloads nil "gnus-registry" "gnus/gnus-registry.el" (21350
+;;;;;;  58112 380040 0))
 ;;; Generated autoloads from gnus/gnus-registry.el
 
 (autoload 'gnus-registry-initialize "gnus-registry" "\
@@ -12382,8 +12400,8 @@ Install the registry hooks.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-sieve" "gnus/gnus-sieve.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-sieve" "gnus/gnus-sieve.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-sieve.el
 
 (autoload 'gnus-sieve-update "gnus-sieve" "\
@@ -12410,8 +12428,8 @@ See the documentation for these variables and functions for details.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-spec" "gnus/gnus-spec.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-spec" "gnus/gnus-spec.el" (21296 1575
+;;;;;;  438327 0))
 ;;; Generated autoloads from gnus/gnus-spec.el
 
 (autoload 'gnus-update-format "gnus-spec" "\
@@ -12421,8 +12439,8 @@ Update the format specification near point.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-start" "gnus/gnus-start.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-start" "gnus/gnus-start.el" (21434 29609
+;;;;;;  547282 0))
 ;;; Generated autoloads from gnus/gnus-start.el
 
 (autoload 'gnus-declare-backend "gnus-start" "\
@@ -12432,8 +12450,8 @@ Declare back end NAME with ABILITIES as a Gnus back end.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-sum" "gnus/gnus-sum.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-sum" "gnus/gnus-sum.el" (21414 44327
+;;;;;;  790846 0))
 ;;; Generated autoloads from gnus/gnus-sum.el
 
 (autoload 'gnus-summary-bookmark-jump "gnus-sum" "\
@@ -12444,8 +12462,8 @@ BOOKMARK is a bookmark name or a bookmark record.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-sync" "gnus/gnus-sync.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-sync" "gnus/gnus-sync.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-sync.el
 
 (autoload 'gnus-sync-initialize "gnus-sync" "\
@@ -12460,8 +12478,8 @@ Install the sync hooks.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnus-win" "gnus/gnus-win.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gnus-win" "gnus/gnus-win.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/gnus-win.el
 
 (autoload 'gnus-add-configuration "gnus-win" "\
@@ -12471,7 +12489,8 @@ Add the window configuration CONF to `gnus-buffer-configuration'.
 
 ;;;***
 \f
-;;;### (autoloads nil "gnutls" "net/gnutls.el" (21291 53104 0 0))
+;;;### (autoloads nil "gnutls" "net/gnutls.el" (21427 56357 771874
+;;;;;;  0))
 ;;; Generated autoloads from net/gnutls.el
 
 (defvar gnutls-min-prime-bits 256 "\
@@ -12487,7 +12506,8 @@ A value of nil says to use the default GnuTLS value.")
 
 ;;;***
 \f
-;;;### (autoloads nil "gomoku" "play/gomoku.el" (21291 53104 0 0))
+;;;### (autoloads nil "gomoku" "play/gomoku.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from play/gomoku.el
 
 (autoload 'gomoku "gomoku" "\
@@ -12513,8 +12533,8 @@ Use \\[describe-mode] for more info.
 
 ;;;***
 \f
-;;;### (autoloads nil "goto-addr" "net/goto-addr.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "goto-addr" "net/goto-addr.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from net/goto-addr.el
 
 (define-obsolete-function-alias 'goto-address-at-mouse 'goto-address-at-point "22.1")
@@ -12555,8 +12575,8 @@ Like `goto-address-mode', but only for comments and strings.
 
 ;;;***
 \f
-;;;### (autoloads nil "gravatar" "gnus/gravatar.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "gravatar" "gnus/gravatar.el" (21296 1575 438327
+;;;;;;  0))
 ;;; Generated autoloads from gnus/gravatar.el
 
 (autoload 'gravatar-retrieve "gravatar" "\
@@ -12572,7 +12592,8 @@ Retrieve MAIL-ADDRESS gravatar and returns it.
 
 ;;;***
 \f
-;;;### (autoloads nil "grep" "progmodes/grep.el" (21291 53104 0 0))
+;;;### (autoloads nil "grep" "progmodes/grep.el" (21356 43818 957743
+;;;;;;  0))
 ;;; Generated autoloads from progmodes/grep.el
 
 (defvar grep-window-height nil "\
@@ -12730,13 +12751,13 @@ Recursively grep for REGEXP in gzipped FILES in tree rooted at DIR.
 Like `rgrep' but uses `zgrep' for `grep-program', sets the default
 file name to `*.gz', and sets `grep-highlight-matches' to `always'.
 
-\(fn REGEXP &optional FILES DIR CONFIRM GREP-FIND-TEMPLATE)" t nil)
+\(fn REGEXP &optional FILES DIR CONFIRM TEMPLATE)" t nil)
 
 (defalias 'rzgrep 'zrgrep)
 
 ;;;***
 \f
-;;;### (autoloads nil "gs" "gs.el" (21291 53104 0 0))
+;;;### (autoloads nil "gs" "gs.el" (21240 46395 727291 0))
 ;;; Generated autoloads from gs.el
 
 (autoload 'gs-load-image "gs" "\
@@ -12749,7 +12770,8 @@ the form \"WINDOW-ID PIXMAP-ID\".  Value is non-nil if successful.
 
 ;;;***
 \f
-;;;### (autoloads nil "gud" "progmodes/gud.el" (21291 53104 0 0))
+;;;### (autoloads nil "gud" "progmodes/gud.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from progmodes/gud.el
 
 (autoload 'gud-gdb "gud" "\
@@ -12837,7 +12859,7 @@ it if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "gv" "emacs-lisp/gv.el" (21387 3002 678518
+;;;### (autoloads nil "gv" "emacs-lisp/gv.el" (21388 20265 495157
 ;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/gv.el
 
@@ -12866,7 +12888,7 @@ all the parts of PLACE that can be evaluated and then runs E.
 
 \(fn (GETTER SETTER) PLACE &rest BODY)" nil t)
 
-(put 'gv-letplace 'lisp-indent-function '2)
+(function-put 'gv-letplace 'lisp-indent-function '2)
 
 (autoload 'gv-define-expander "gv" "\
 Use HANDLER to handle NAME as a generalized var.
@@ -12876,7 +12898,7 @@ arguments as NAME.  DO is a function as defined in `gv-get'.
 
 \(fn NAME HANDLER)" nil t)
 
-(put 'gv-define-expander 'lisp-indent-function '1)
+(function-put 'gv-define-expander 'lisp-indent-function '1)
 
 (autoload 'gv--defun-declaration "gv" "\
 
@@ -12901,7 +12923,7 @@ to be pure and copyable.  Example use:
 
 \(fn NAME ARGLIST &rest BODY)" nil t)
 
-(put 'gv-define-setter 'lisp-indent-function '2)
+(function-put 'gv-define-setter 'lisp-indent-function '2)
 
 (autoload 'gv-define-simple-setter "gv" "\
 Define a simple setter method for generalized variable NAME.
@@ -12940,8 +12962,8 @@ binding mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "handwrite" "play/handwrite.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "handwrite" "play/handwrite.el" (21207 49087
+;;;;;;  974317 0))
 ;;; Generated autoloads from play/handwrite.el
 
 (autoload 'handwrite "handwrite" "\
@@ -12958,7 +12980,8 @@ Variables: `handwrite-linespace'     (default 12)
 
 ;;;***
 \f
-;;;### (autoloads nil "hanoi" "play/hanoi.el" (21291 53104 0 0))
+;;;### (autoloads nil "hanoi" "play/hanoi.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from play/hanoi.el
 
 (autoload 'hanoi "hanoi" "\
@@ -12985,8 +13008,8 @@ to be updated.
 
 ;;;***
 \f
-;;;### (autoloads nil "hashcash" "mail/hashcash.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "hashcash" "mail/hashcash.el" (21296 1575 438327
+;;;;;;  0))
 ;;; Generated autoloads from mail/hashcash.el
 
 (autoload 'hashcash-insert-payment "hashcash" "\
@@ -13028,7 +13051,7 @@ Prefix arg sets default accept amount temporarily.
 
 ;;;***
 \f
-;;;### (autoloads nil "help-at-pt" "help-at-pt.el" (21291 53104 0
+;;;### (autoloads nil "help-at-pt" "help-at-pt.el" (21231 31415 579137
 ;;;;;;  0))
 ;;; Generated autoloads from help-at-pt.el
 
@@ -13156,7 +13179,7 @@ different regions.  With numeric argument ARG, behaves like
 
 ;;;***
 \f
-;;;### (autoloads nil "help-fns" "help-fns.el" (21418 44988 932893
+;;;### (autoloads nil "help-fns" "help-fns.el" (21419 62246 751914
 ;;;;;;  0))
 ;;; Generated autoloads from help-fns.el
 
@@ -13236,7 +13259,7 @@ Produce a texinfo buffer with sorted doc-strings from the DOC file.
 
 ;;;***
 \f
-;;;### (autoloads nil "help-macro" "help-macro.el" (21291 53104 0
+;;;### (autoloads nil "help-macro" "help-macro.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from help-macro.el
 
@@ -13251,7 +13274,8 @@ gives the window that lists the options.")
 
 ;;;***
 \f
-;;;### (autoloads nil "help-mode" "help-mode.el" (21291 53104 0 0))
+;;;### (autoloads nil "help-mode" "help-mode.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from help-mode.el
 
 (autoload 'help-mode "help-mode" "\
@@ -13350,8 +13374,8 @@ BOOKMARK is a bookmark name or a bookmark record.
 
 ;;;***
 \f
-;;;### (autoloads nil "helper" "emacs-lisp/helper.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "helper" "emacs-lisp/helper.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from emacs-lisp/helper.el
 
 (autoload 'Helper-describe-bindings "helper" "\
@@ -13366,7 +13390,7 @@ Provide help for current mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "hexl" "hexl.el" (21291 53104 0 0))
+;;;### (autoloads nil "hexl" "hexl.el" (21271 1974 113743 0))
 ;;; Generated autoloads from hexl.el
 
 (autoload 'hexl-mode "hexl" "\
@@ -13460,7 +13484,7 @@ This discards the buffer's undo information.
 
 ;;;***
 \f
-;;;### (autoloads nil "hi-lock" "hi-lock.el" (21291 53104 0 0))
+;;;### (autoloads nil "hi-lock" "hi-lock.el" (21383 2343 498187 0))
 ;;; Generated autoloads from hi-lock.el
 
 (autoload 'hi-lock-mode "hi-lock" "\
@@ -13627,8 +13651,8 @@ be found in variable `hi-lock-interactive-patterns'.
 
 ;;;***
 \f
-;;;### (autoloads nil "hideif" "progmodes/hideif.el" (21452 63160
-;;;;;;  995987 0))
+;;;### (autoloads nil "hideif" "progmodes/hideif.el" (21452 59559
+;;;;;;  901066 0))
 ;;; Generated autoloads from progmodes/hideif.el
 
 (autoload 'hide-ifdef-mode "hideif" "\
@@ -13643,27 +13667,31 @@ that the C preprocessor would eliminate may be hidden from view.
 Several variables affect how the hiding is done:
 
 `hide-ifdef-env'
-       An association list of defined and undefined symbols for the
-       current buffer.  Initially, the global value of `hide-ifdef-env'
-       is used.
+        An association list of defined and undefined symbols for the
+        current project.  Initially, the global value of `hide-ifdef-env'
+        is used.  This variable was a buffer-local variable, which limits
+        hideif to parse only one C/C++ file at a time.  We've extended
+        hideif to support parsing a C/C++ project containing multiple C/C++
+        source files opened simultaneously in different buffers.  Therefore
+        `hide-ifdef-env' can no longer be buffer local but must be global.
 
 `hide-ifdef-define-alist'
-       An association list of defined symbol lists.
+        An association list of defined symbol lists.
         Use `hide-ifdef-set-define-alist' to save the current `hide-ifdef-env'
         and `hide-ifdef-use-define-alist' to set the current `hide-ifdef-env'
         from one of the lists in `hide-ifdef-define-alist'.
 
 `hide-ifdef-lines'
-       Set to non-nil to not show #if, #ifdef, #ifndef, #else, and
-       #endif lines when hiding.
+        Set to non-nil to not show #if, #ifdef, #ifndef, #else, and
+        #endif lines when hiding.
 
 `hide-ifdef-initially'
-       Indicates whether `hide-ifdefs' should be called when Hide-Ifdef mode
-       is activated.
+        Indicates whether `hide-ifdefs' should be called when Hide-Ifdef mode
+        is activated.
 
 `hide-ifdef-read-only'
-       Set to non-nil if you want to make buffers read only while hiding.
-       After `show-ifdefs', read-only status is restored to previous value.
+        Set to non-nil if you want to make buffers read only while hiding.
+        After `show-ifdefs', read-only status is restored to previous value.
 
 \\{hide-ifdef-mode-map}
 
@@ -13671,8 +13699,8 @@ Several variables affect how the hiding is done:
 
 ;;;***
 \f
-;;;### (autoloads nil "hideshow" "progmodes/hideshow.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "hideshow" "progmodes/hideshow.el" (21460 53672
+;;;;;;  48319 0))
 ;;; Generated autoloads from progmodes/hideshow.el
 
 (defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil))) "\
@@ -13734,7 +13762,8 @@ Unconditionally turn off `hs-minor-mode'.
 
 ;;;***
 \f
-;;;### (autoloads nil "hilit-chg" "hilit-chg.el" (21291 53104 0 0))
+;;;### (autoloads nil "hilit-chg" "hilit-chg.el" (21271 1974 113743
+;;;;;;  0))
 ;;; Generated autoloads from hilit-chg.el
 
 (autoload 'highlight-changes-mode "hilit-chg" "\
@@ -13865,8 +13894,8 @@ See `highlight-changes-mode' for more information on Highlight-Changes mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "hippie-exp" "hippie-exp.el" (21375 36695 783701
-;;;;;;  621000))
+;;;### (autoloads nil "hippie-exp" "hippie-exp.el" (21402 53158 293492
+;;;;;;  0))
 ;;; Generated autoloads from hippie-exp.el
 (push (purecopy '(hippie-exp 1 6)) package--builtin-versions)
 
@@ -13898,7 +13927,8 @@ argument VERBOSE non-nil makes the function verbose.
 
 ;;;***
 \f
-;;;### (autoloads nil "hl-line" "hl-line.el" (21291 53104 0 0))
+;;;### (autoloads nil "hl-line" "hl-line.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from hl-line.el
 
 (autoload 'hl-line-mode "hl-line" "\
@@ -13947,8 +13977,8 @@ Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and
 
 ;;;***
 \f
-;;;### (autoloads nil "holidays" "calendar/holidays.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "holidays" "calendar/holidays.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from calendar/holidays.el
 
 (define-obsolete-variable-alias 'general-holidays 'holiday-general-holidays "23.1")
@@ -14096,8 +14126,8 @@ The optional LABEL is used to label the buffer created.
 
 ;;;***
 \f
-;;;### (autoloads nil "html2text" "gnus/html2text.el" (21416 3260
-;;;;;;  930862 0))
+;;;### (autoloads nil "html2text" "gnus/html2text.el" (21417 20521
+;;;;;;  870414 0))
 ;;; Generated autoloads from gnus/html2text.el
 
 (autoload 'html2text "html2text" "\
@@ -14107,8 +14137,8 @@ Convert HTML to plain text in the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "htmlfontify" "htmlfontify.el" (21341 23900
-;;;;;;  0 0))
+;;;### (autoloads nil "htmlfontify" "htmlfontify.el" (21383 2343
+;;;;;;  498187 0))
 ;;; Generated autoloads from htmlfontify.el
 (push (purecopy '(htmlfontify 0 21)) package--builtin-versions)
 
@@ -14141,7 +14171,8 @@ You may also want to set `hfy-page-header' and `hfy-page-footer'.
 
 ;;;***
 \f
-;;;### (autoloads nil "ibuf-macs" "ibuf-macs.el" (21291 53104 0 0))
+;;;### (autoloads nil "ibuf-macs" "ibuf-macs.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from ibuf-macs.el
 
 (autoload 'define-ibuffer-column "ibuf-macs" "\
@@ -14229,7 +14260,8 @@ bound to the current value of the filter.
 
 ;;;***
 \f
-;;;### (autoloads nil "ibuffer" "ibuffer.el" (21291 53104 0 0))
+;;;### (autoloads nil "ibuffer" "ibuffer.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from ibuffer.el
 
 (autoload 'ibuffer-list-buffers "ibuffer" "\
@@ -14268,8 +14300,8 @@ FORMATS is the value to use for `ibuffer-formats'.
 
 ;;;***
 \f
-;;;### (autoloads nil "icalendar" "calendar/icalendar.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "icalendar" "calendar/icalendar.el" (21466
+;;;;;;  6053 9002 0))
 ;;; Generated autoloads from calendar/icalendar.el
 (push (purecopy '(icalendar 0 19)) package--builtin-versions)
 
@@ -14322,7 +14354,8 @@ buffer `*icalendar-errors*'.
 
 ;;;***
 \f
-;;;### (autoloads nil "icomplete" "icomplete.el" (21291 53104 0 0))
+;;;### (autoloads nil "icomplete" "icomplete.el" (21268 25782 576189
+;;;;;;  0))
 ;;; Generated autoloads from icomplete.el
 
 (defvar icomplete-mode nil "\
@@ -14357,7 +14390,8 @@ completions:
 
 ;;;***
 \f
-;;;### (autoloads nil "icon" "progmodes/icon.el" (21291 53104 0 0))
+;;;### (autoloads nil "icon" "progmodes/icon.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from progmodes/icon.el
 
 (autoload 'icon-mode "icon" "\
@@ -14397,8 +14431,8 @@ with no args, if that value is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "idlw-shell" "progmodes/idlw-shell.el" (21423
-;;;;;;  62909 33477 0))
+;;;### (autoloads nil "idlw-shell" "progmodes/idlw-shell.el" (21429
+;;;;;;  11690 49391 0))
 ;;; Generated autoloads from progmodes/idlw-shell.el
 
 (autoload 'idlwave-shell "idlw-shell" "\
@@ -14423,8 +14457,8 @@ See also the variable `idlwave-shell-prompt-pattern'.
 
 ;;;***
 \f
-;;;### (autoloads nil "idlwave" "progmodes/idlwave.el" (21423 62909
-;;;;;;  33477 0))
+;;;### (autoloads nil "idlwave" "progmodes/idlwave.el" (21429 11690
+;;;;;;  49391 0))
 ;;; Generated autoloads from progmodes/idlwave.el
 (push (purecopy '(idlwave 6 1 22)) package--builtin-versions)
 
@@ -14553,7 +14587,7 @@ The main features of this mode are
 
 ;;;***
 \f
-;;;### (autoloads nil "ido" "ido.el" (21291 53104 0 0))
+;;;### (autoloads nil "ido" "ido.el" (21268 25782 576189 0))
 ;;; Generated autoloads from ido.el
 
 (defvar ido-mode nil "\
@@ -14815,7 +14849,7 @@ DEF, if non-nil, is the default value.
 
 ;;;***
 \f
-;;;### (autoloads nil "ielm" "ielm.el" (21291 53104 0 0))
+;;;### (autoloads nil "ielm" "ielm.el" (21240 46395 727291 0))
 ;;; Generated autoloads from ielm.el
 
 (autoload 'ielm "ielm" "\
@@ -14827,7 +14861,7 @@ See `inferior-emacs-lisp-mode' for details.
 
 ;;;***
 \f
-;;;### (autoloads nil "iimage" "iimage.el" (21291 53104 0 0))
+;;;### (autoloads nil "iimage" "iimage.el" (21289 28325 826818 0))
 ;;; Generated autoloads from iimage.el
 
 (define-obsolete-function-alias 'turn-on-iimage-mode 'iimage-mode "24.1")
@@ -14843,7 +14877,7 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
 
 ;;;***
 \f
-;;;### (autoloads nil "image" "image.el" (21291 53104 0 0))
+;;;### (autoloads nil "image" "image.el" (21261 4487 230861 399000))
 ;;; Generated autoloads from image.el
 
 (autoload 'image-type-from-data "image" "\
@@ -15018,7 +15052,7 @@ Example:
 
 \(fn SYMBOL SPECS &optional DOC)" nil t)
 
-(put 'defimage 'doc-string-elt '3)
+(function-put 'defimage 'doc-string-elt '3)
 
 (autoload 'imagemagick-register-types "image" "\
 Register file types that can be handled by ImageMagick.
@@ -15036,8 +15070,8 @@ If Emacs is compiled without ImageMagick support, this does nothing.
 
 ;;;***
 \f
-;;;### (autoloads nil "image-dired" "image-dired.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "image-dired" "image-dired.el" (21194 37048
+;;;;;;  599945 0))
 ;;; Generated autoloads from image-dired.el
 (push (purecopy '(image-dired 0 4 11)) package--builtin-versions)
 
@@ -15174,7 +15208,7 @@ easy-to-use form.
 
 ;;;***
 \f
-;;;### (autoloads nil "image-file" "image-file.el" (21291 53104 0
+;;;### (autoloads nil "image-file" "image-file.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from image-file.el
 
@@ -15237,7 +15271,7 @@ An image file is one whose name has an extension in
 
 ;;;***
 \f
-;;;### (autoloads nil "image-mode" "image-mode.el" (21291 53104 0
+;;;### (autoloads nil "image-mode" "image-mode.el" (21334 16805 699731
 ;;;;;;  0))
 ;;; Generated autoloads from image-mode.el
 
@@ -15285,7 +15319,7 @@ on these modes.
 
 ;;;***
 \f
-;;;### (autoloads nil "imenu" "imenu.el" (21291 53104 0 0))
+;;;### (autoloads nil "imenu" "imenu.el" (21257 55477 969423 0))
 ;;; Generated autoloads from imenu.el
 
 (defvar imenu-sort-function nil "\
@@ -15423,8 +15457,8 @@ for more information.
 
 ;;;***
 \f
-;;;### (autoloads nil "ind-util" "language/ind-util.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ind-util" "language/ind-util.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from language/ind-util.el
 
 (autoload 'indian-compose-region "ind-util" "\
@@ -15454,8 +15488,8 @@ Convert old Emacs Devanagari characters to UCS.
 
 ;;;***
 \f
-;;;### (autoloads nil "inf-lisp" "progmodes/inf-lisp.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "inf-lisp" "progmodes/inf-lisp.el" (21437 5802
+;;;;;;  125919 0))
 ;;; Generated autoloads from progmodes/inf-lisp.el
 
 (autoload 'inferior-lisp "inf-lisp" "\
@@ -15473,7 +15507,7 @@ of `inferior-lisp-program').  Runs the hooks from
 
 ;;;***
 \f
-;;;### (autoloads nil "info" "info.el" (21291 53104 0 0))
+;;;### (autoloads nil "info" "info.el" (21419 7843 195974 0))
 ;;; Generated autoloads from info.el
 
 (defcustom Info-default-directory-list (let* ((config-dir (file-name-as-directory (or (and (featurep 'ns) (let ((dir (expand-file-name "../info" data-directory))) (if (file-directory-p dir) dir))) configure-info-directory))) (prefixes (prune-directory-list '("/usr/local/" "/usr/" "/opt/" "/"))) (suffixes '("share/" "" "gnu/" "gnu/lib/" "gnu/lib/emacs/" "emacs/" "lib/" "lib/emacs/")) (standard-info-dirs (apply #'nconc (mapcar (lambda (pfx) (let ((dirs (mapcar (lambda (sfx) (concat pfx sfx "info/")) suffixes))) (prune-directory-list dirs))) prefixes))) (dirs (if (member config-dir standard-info-dirs) (nconc standard-info-dirs (list config-dir)) (cons config-dir standard-info-dirs)))) (if (not (eq system-type 'windows-nt)) dirs (let* ((instdir (file-name-directory invocation-directory)) (dir1 (expand-file-name "../info/" instdir)) (dir2 (expand-file-name "../../../info/" instdir))) (cond ((file-exists-p dir1) (append dirs (list dir1))) ((file-exists-p dir2) (append dirs (list dir2))) (t dirs))))) "\
@@ -15684,7 +15718,8 @@ Otherwise, visit the manual in a new Info buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "info-look" "info-look.el" (21291 53104 0 0))
+;;;### (autoloads nil "info-look" "info-look.el" (21238 4664 559807
+;;;;;;  0))
 ;;; Generated autoloads from info-look.el
 
 (autoload 'info-lookup-reset "info-look" "\
@@ -15731,7 +15766,8 @@ Perform completion on file preceding point.
 
 ;;;***
 \f
-;;;### (autoloads nil "info-xref" "info-xref.el" (21291 53104 0 0))
+;;;### (autoloads nil "info-xref" "info-xref.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from info-xref.el
 (push (purecopy '(info-xref 3)) package--builtin-versions)
 
@@ -15814,7 +15850,8 @@ the sources handy.
 
 ;;;***
 \f
-;;;### (autoloads nil "informat" "informat.el" (21291 53104 0 0))
+;;;### (autoloads nil "informat" "informat.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from informat.el
 
 (autoload 'Info-tagify "informat" "\
@@ -15859,8 +15896,8 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\"
 
 ;;;***
 \f
-;;;### (autoloads nil "inversion" "cedet/inversion.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "inversion" "cedet/inversion.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from cedet/inversion.el
 (push (purecopy '(inversion 1 3)) package--builtin-versions)
 
@@ -15872,8 +15909,8 @@ Only checks one based on which kind of Emacs is being run.
 
 ;;;***
 \f
-;;;### (autoloads nil "isearch-x" "international/isearch-x.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "isearch-x" "international/isearch-x.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from international/isearch-x.el
 
 (autoload 'isearch-toggle-specified-input-method "isearch-x" "\
@@ -15893,7 +15930,8 @@ Toggle input method in interactive search.
 
 ;;;***
 \f
-;;;### (autoloads nil "isearchb" "isearchb.el" (21291 53104 0 0))
+;;;### (autoloads nil "isearchb" "isearchb.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from isearchb.el
 (push (purecopy '(isearchb 1 5)) package--builtin-versions)
 
@@ -15907,8 +15945,8 @@ accessed via isearchb.
 
 ;;;***
 \f
-;;;### (autoloads nil "iso-cvt" "international/iso-cvt.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "iso-cvt" "international/iso-cvt.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from international/iso-cvt.el
 
 (autoload 'iso-spanish "iso-cvt" "\
@@ -15999,15 +16037,15 @@ Add submenus to the File menu, to convert to and from various formats.
 ;;;***
 \f
 ;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21240 46395 727291 0))
 ;;; Generated autoloads from international/iso-transl.el
  (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
  (autoload 'iso-transl-ctl-x-8-map "iso-transl" "Keymap for C-x 8 prefix." t 'keymap)
 
 ;;;***
 \f
-;;;### (autoloads nil "ispell" "textmodes/ispell.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ispell" "textmodes/ispell.el" (21356 43818
+;;;;;;  957743 0))
 ;;; Generated autoloads from textmodes/ispell.el
 
 (put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
@@ -16240,8 +16278,36 @@ You can bind this to the key C-c i in GNUS or mail by adding to
 
 ;;;***
 \f
-;;;### (autoloads nil "japan-util" "language/japan-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "iswitchb" "obsolete/iswitchb.el" (21300 29848
+;;;;;;  351552 156000))
+;;; Generated autoloads from obsolete/iswitchb.el
+
+(defvar iswitchb-mode nil "\
+Non-nil if Iswitchb mode is enabled.
+See the command `iswitchb-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `iswitchb-mode'.")
+
+(custom-autoload 'iswitchb-mode "iswitchb" nil)
+
+(autoload 'iswitchb-mode "iswitchb" "\
+Toggle Iswitchb mode.
+With a prefix argument ARG, enable Iswitchb mode if ARG is
+positive, and disable it otherwise.  If called from Lisp, enable
+the mode if ARG is omitted or nil.
+
+Iswitchb mode is a global minor mode that enables switching
+between buffers using substrings.  See `iswitchb' for details.
+
+\(fn &optional ARG)" t nil)
+
+(make-obsolete 'iswitchb-mode "use `icomplete-mode' or `ido-mode' instead." "24.4")
+
+;;;***
+\f
+;;;### (autoloads nil "japan-util" "language/japan-util.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from language/japan-util.el
 
 (autoload 'setup-japanese-environment-internal "japan-util" "\
@@ -16318,7 +16384,8 @@ If non-nil, second arg INITIAL-INPUT is a string to insert before reading.
 
 ;;;***
 \f
-;;;### (autoloads nil "jka-compr" "jka-compr.el" (21291 53104 0 0))
+;;;### (autoloads nil "jka-compr" "jka-compr.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from jka-compr.el
 
 (defvar jka-compr-inhibit nil "\
@@ -16341,7 +16408,8 @@ by `jka-compr-installed'.
 
 ;;;***
 \f
-;;;### (autoloads nil "js" "progmodes/js.el" (21387 3002 678518 0))
+;;;### (autoloads nil "js" "progmodes/js.el" (21388 20265 495157
+;;;;;;  0))
 ;;; Generated autoloads from progmodes/js.el
 (push (purecopy '(js 9)) package--builtin-versions)
 
@@ -16353,14 +16421,14 @@ Major mode for editing JavaScript.
 
 ;;;***
 \f
-;;;### (autoloads nil "json" "json.el" (21291 53104 0 0))
+;;;### (autoloads nil "json" "json.el" (21187 63826 213216 0))
 ;;; Generated autoloads from json.el
 (push (purecopy '(json 1 4)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "keypad" "emulation/keypad.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "keypad" "emulation/keypad.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from emulation/keypad.el
 
 (defvar keypad-setup nil "\
@@ -16415,8 +16483,8 @@ the decimal key on the keypad is mapped to DECIMAL instead of `.'
 
 ;;;***
 \f
-;;;### (autoloads nil "kinsoku" "international/kinsoku.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "kinsoku" "international/kinsoku.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from international/kinsoku.el
 
 (autoload 'kinsoku "kinsoku" "\
@@ -16437,7 +16505,7 @@ the context of text formatting.
 
 ;;;***
 \f
-;;;### (autoloads nil "kkc" "international/kkc.el" (21291 53104 0
+;;;### (autoloads nil "kkc" "international/kkc.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from international/kkc.el
 
@@ -16460,7 +16528,7 @@ and the return value is the length of the conversion.
 
 ;;;***
 \f
-;;;### (autoloads nil "kmacro" "kmacro.el" (21291 53104 0 0))
+;;;### (autoloads nil "kmacro" "kmacro.el" (21244 11875 194797 0))
 ;;; Generated autoloads from kmacro.el
  (global-set-key "\C-x(" 'kmacro-start-macro)
  (global-set-key "\C-x)" 'kmacro-end-macro)
@@ -16572,8 +16640,8 @@ If kbd macro currently being defined end it before activating it.
 
 ;;;***
 \f
-;;;### (autoloads nil "korea-util" "language/korea-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "korea-util" "language/korea-util.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from language/korea-util.el
 
 (defvar default-korean-keyboard (purecopy (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "")) "\
@@ -16587,9 +16655,10 @@ The kind of Korean keyboard for Korean input method.
 
 ;;;***
 \f
-;;;### (autoloads nil "landmark" "play/landmark.el" (21414 47927
-;;;;;;  641973 0))
+;;;### (autoloads nil "landmark" "play/landmark.el" (21419 7843 195974
+;;;;;;  0))
 ;;; Generated autoloads from play/landmark.el
+(push (purecopy '(landmark 1 0)) package--builtin-versions)
 
 (defalias 'landmark-repeat 'landmark-test-run)
 
@@ -16618,8 +16687,8 @@ Use \\[describe-mode] for more info.
 
 ;;;***
 \f
-;;;### (autoloads nil "lao-util" "language/lao-util.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "lao-util" "language/lao-util.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from language/lao-util.el
 
 (autoload 'lao-compose-string "lao-util" "\
@@ -16656,8 +16725,8 @@ Transcribe Romanized Lao string STR to Lao character string.
 
 ;;;***
 \f
-;;;### (autoloads nil "latexenc" "international/latexenc.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "latexenc" "international/latexenc.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from international/latexenc.el
 
 (defvar latex-inputenc-coding-alist (purecopy '(("ansinew" . windows-1252) ("applemac" . mac-roman) ("ascii" . us-ascii) ("cp1250" . windows-1250) ("cp1252" . windows-1252) ("cp1257" . cp1257) ("cp437de" . cp437) ("cp437" . cp437) ("cp850" . cp850) ("cp852" . cp852) ("cp858" . cp858) ("cp865" . cp865) ("latin1" . iso-8859-1) ("latin2" . iso-8859-2) ("latin3" . iso-8859-3) ("latin4" . iso-8859-4) ("latin5" . iso-8859-5) ("latin9" . iso-8859-15) ("next" . next) ("utf8" . utf-8) ("utf8x" . utf-8))) "\
@@ -16689,7 +16758,7 @@ coding system names is determined from `latex-inputenc-coding-alist'.
 ;;;***
 \f
 ;;;### (autoloads nil "latin1-disp" "international/latin1-disp.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from international/latin1-disp.el
 
 (defvar latin1-display nil "\
@@ -16730,8 +16799,8 @@ use either \\[customize] or the function `latin1-display'.")
 
 ;;;***
 \f
-;;;### (autoloads nil "ld-script" "progmodes/ld-script.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "ld-script" "progmodes/ld-script.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from progmodes/ld-script.el
 
 (autoload 'ld-script-mode "ld-script" "\
@@ -16741,7 +16810,7 @@ A major mode to edit GNU ld script files
 
 ;;;***
 \f
-;;;### (autoloads nil "life" "play/life.el" (21291 53104 0 0))
+;;;### (autoloads nil "life" "play/life.el" (21240 46395 727291 0))
 ;;; Generated autoloads from play/life.el
 
 (autoload 'life "life" "\
@@ -16754,7 +16823,7 @@ generations (this defaults to 1).
 
 ;;;***
 \f
-;;;### (autoloads nil "linum" "linum.el" (21291 53104 0 0))
+;;;### (autoloads nil "linum" "linum.el" (21437 5802 125919 0))
 ;;; Generated autoloads from linum.el
 (push (purecopy '(linum 0 9 24)) package--builtin-versions)
 
@@ -16791,7 +16860,8 @@ See `linum-mode' for more information on Linum mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "loadhist" "loadhist.el" (21291 53104 0 0))
+;;;### (autoloads nil "loadhist" "loadhist.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from loadhist.el
 
 (autoload 'unload-feature "loadhist" "\
@@ -16822,7 +16892,7 @@ something strange, such as redefining an Emacs function.
 
 ;;;***
 \f
-;;;### (autoloads nil "locate" "locate.el" (21291 53104 0 0))
+;;;### (autoloads nil "locate" "locate.el" (21187 63826 213216 0))
 ;;; Generated autoloads from locate.el
 
 (defvar locate-ls-subdir-switches (purecopy "-al") "\
@@ -16874,8 +16944,8 @@ except that FILTER is not optional.
 
 ;;;***
 \f
-;;;### (autoloads nil "log-edit" "vc/log-edit.el" (21438 54848 741535
-;;;;;;  566000))
+;;;### (autoloads nil "log-edit" "vc/log-edit.el" (21442 23723 6983
+;;;;;;  0))
 ;;; Generated autoloads from vc/log-edit.el
 
 (autoload 'log-edit "log-edit" "\
@@ -16906,7 +16976,7 @@ done.  Otherwise, it uses the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "log-view" "vc/log-view.el" (21291 53104 0
+;;;### (autoloads nil "log-view" "vc/log-view.el" (21195 57908 940910
 ;;;;;;  0))
 ;;; Generated autoloads from vc/log-view.el
 
@@ -16917,7 +16987,7 @@ Major mode for browsing CVS log output.
 
 ;;;***
 \f
-;;;### (autoloads nil "lpr" "lpr.el" (21291 53104 0 0))
+;;;### (autoloads nil "lpr" "lpr.el" (21240 46395 727291 0))
 ;;; Generated autoloads from lpr.el
 
 (defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)) "\
@@ -17012,7 +17082,8 @@ for further customization of the printer command.
 
 ;;;***
 \f
-;;;### (autoloads nil "ls-lisp" "ls-lisp.el" (21291 53104 0 0))
+;;;### (autoloads nil "ls-lisp" "ls-lisp.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from ls-lisp.el
 
 (defvar ls-lisp-support-shell-wildcards t "\
@@ -17023,7 +17094,7 @@ Otherwise they are treated as Emacs regexps (for backward compatibility).")
 
 ;;;***
 \f
-;;;### (autoloads nil "lunar" "calendar/lunar.el" (21291 53104 0
+;;;### (autoloads nil "lunar" "calendar/lunar.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from calendar/lunar.el
 
@@ -17038,8 +17109,8 @@ This function is suitable for execution in an init file.
 
 ;;;***
 \f
-;;;### (autoloads nil "m4-mode" "progmodes/m4-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "m4-mode" "progmodes/m4-mode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/m4-mode.el
 
 (autoload 'm4-mode "m4-mode" "\
@@ -17049,7 +17120,7 @@ A major mode to edit m4 macro files.
 
 ;;;***
 \f
-;;;### (autoloads nil "macros" "macros.el" (21291 53104 0 0))
+;;;### (autoloads nil "macros" "macros.el" (21240 46395 727291 0))
 ;;; Generated autoloads from macros.el
 
 (autoload 'name-last-kbd-macro "macros" "\
@@ -17138,8 +17209,8 @@ and then select the region of un-tablified names and use
 
 ;;;***
 \f
-;;;### (autoloads nil "mail-extr" "mail/mail-extr.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mail-extr" "mail/mail-extr.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/mail-extr.el
 
 (autoload 'mail-extract-address-components "mail-extr" "\
@@ -17169,8 +17240,8 @@ Convert mail domain DOMAIN to the country it corresponds to.
 
 ;;;***
 \f
-;;;### (autoloads nil "mail-hist" "mail/mail-hist.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mail-hist" "mail/mail-hist.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from mail/mail-hist.el
 
 (autoload 'mail-hist-define-keys "mail-hist" "\
@@ -17199,8 +17270,8 @@ This function normally would be called when the message is sent.
 
 ;;;***
 \f
-;;;### (autoloads nil "mail-utils" "mail/mail-utils.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mail-utils" "mail/mail-utils.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/mail-utils.el
 
 (defvar mail-use-rfc822 nil "\
@@ -17274,8 +17345,8 @@ matches may be returned from the message body.
 
 ;;;***
 \f
-;;;### (autoloads nil "mailabbrev" "mail/mailabbrev.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mailabbrev" "mail/mailabbrev.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/mailabbrev.el
 
 (defvar mail-abbrevs-mode nil "\
@@ -17324,8 +17395,8 @@ double-quotes.
 
 ;;;***
 \f
-;;;### (autoloads nil "mailalias" "mail/mailalias.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mailalias" "mail/mailalias.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/mailalias.el
 
 (defvar mail-complete-style 'angles "\
@@ -17378,8 +17449,8 @@ current header, calls `mail-complete-function' and passes prefix ARG if any.
 
 ;;;***
 \f
-;;;### (autoloads nil "mailclient" "mail/mailclient.el" (21291 53104
-;;;;;;  0))
+;;;### (autoloads nil "mailclient" "mail/mailclient.el" (21215 8898
+;;;;;;  840126 623000))
 ;;; Generated autoloads from mail/mailclient.el
 
 (autoload 'mailclient-send-it "mailclient" "\
@@ -17391,8 +17462,8 @@ The mail client is taken to be the handler of mailto URLs.
 
 ;;;***
 \f
-;;;### (autoloads nil "make-mode" "progmodes/make-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "make-mode" "progmodes/make-mode.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from progmodes/make-mode.el
 
 (autoload 'makefile-mode "make-mode" "\
@@ -17509,7 +17580,8 @@ An adapted `makefile-mode' that knows about imake.
 
 ;;;***
 \f
-;;;### (autoloads nil "makesum" "makesum.el" (21291 53104 0 0))
+;;;### (autoloads nil "makesum" "makesum.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from makesum.el
 
 (autoload 'make-command-summary "makesum" "\
@@ -17520,19 +17592,21 @@ Previous contents of that buffer are killed first.
 
 ;;;***
 \f
-;;;### (autoloads nil "man" "man.el" (21291 53104 0 0))
+;;;### (autoloads nil "man" "man.el" (21427 56357 771874 0))
 ;;; Generated autoloads from man.el
 
 (defalias 'manual-entry 'man)
 
 (autoload 'man "man" "\
 Get a Un*x manual page and put it in a buffer.
-This command is the top-level command in the man package.  It
-runs a Un*x command to retrieve and clean a manpage in the
+This command is the top-level command in the man package.
+It runs a Un*x command to retrieve and clean a manpage in the
 background and places the results in a `Man-mode' browsing
-buffer.  See variable `Man-notify-method' for what happens when
-the buffer is ready.  If a buffer already exists for this man
-page, it will display immediately.
+buffer.  The variable `Man-width' defines the number of columns in
+formatted manual pages.  The buffer is displayed immediately.
+The variable `Man-notify-method' defines how the buffer is displayed.
+If a buffer already exists for this man page, it will be displayed
+without running the man command.
 
 For a manpage from a particular section, use either of the
 following.  \"cat(1)\" is how cross-references appear and is
@@ -17574,7 +17648,7 @@ Default bookmark handler for Man buffers.
 
 ;;;***
 \f
-;;;### (autoloads nil "master" "master.el" (21291 53104 0 0))
+;;;### (autoloads nil "master" "master.el" (21187 63826 213216 0))
 ;;; Generated autoloads from master.el
 (push (purecopy '(master 1 0 2)) package--builtin-versions)
 
@@ -17597,7 +17671,8 @@ yourself the value of `master-of' by calling `master-show-slave'.
 
 ;;;***
 \f
-;;;### (autoloads nil "mb-depth" "mb-depth.el" (21291 53104 0 0))
+;;;### (autoloads nil "mb-depth" "mb-depth.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from mb-depth.el
 
 (defvar minibuffer-depth-indicate-mode nil "\
@@ -17624,13 +17699,13 @@ recursion depth in the minibuffer prompt.  This is only useful if
 
 ;;;***
 \f
-;;;### (autoloads nil "md4" "md4.el" (21291 53104 0 0))
+;;;### (autoloads nil "md4" "md4.el" (21187 63826 213216 0))
 ;;; Generated autoloads from md4.el
 (push (purecopy '(md4 1 0)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "message" "gnus/message.el" (21291 53104 0
+;;;### (autoloads nil "message" "gnus/message.el" (21326 22692 123234
 ;;;;;;  0))
 ;;; Generated autoloads from gnus/message.el
 
@@ -17796,8 +17871,8 @@ which specify the range to operate on.
 
 ;;;***
 \f
-;;;### (autoloads nil "meta-mode" "progmodes/meta-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "meta-mode" "progmodes/meta-mode.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from progmodes/meta-mode.el
 (push (purecopy '(meta-mode 1 0)) package--builtin-versions)
 
@@ -17813,8 +17888,8 @@ Major mode for editing MetaPost sources.
 
 ;;;***
 \f
-;;;### (autoloads nil "metamail" "mail/metamail.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "metamail" "mail/metamail.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from mail/metamail.el
 
 (autoload 'metamail-interpret-header "metamail" "\
@@ -17857,7 +17932,7 @@ redisplayed as output is inserted.
 
 ;;;***
 \f
-;;;### (autoloads nil "mh-comp" "mh-e/mh-comp.el" (21291 53104 0
+;;;### (autoloads nil "mh-comp" "mh-e/mh-comp.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from mh-e/mh-comp.el
 
@@ -17948,7 +18023,7 @@ delete the draft message.
 
 ;;;***
 \f
-;;;### (autoloads nil "mh-e" "mh-e/mh-e.el" (21291 53104 0 0))
+;;;### (autoloads nil "mh-e" "mh-e/mh-e.el" (21356 43818 957743 0))
 ;;; Generated autoloads from mh-e/mh-e.el
 (push (purecopy '(mh-e 8 5 -4)) package--builtin-versions)
 
@@ -17965,8 +18040,8 @@ Display version information about MH-E and the MH mail handling system.
 
 ;;;***
 \f
-;;;### (autoloads nil "mh-folder" "mh-e/mh-folder.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mh-folder" "mh-e/mh-folder.el" (21286 52150
+;;;;;;  476720 0))
 ;;; Generated autoloads from mh-e/mh-folder.el
 
 (autoload 'mh-rmail "mh-folder" "\
@@ -18047,7 +18122,8 @@ perform the operation on all messages in that region.
 
 ;;;***
 \f
-;;;### (autoloads nil "midnight" "midnight.el" (21291 53104 0 0))
+;;;### (autoloads nil "midnight" "midnight.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from midnight.el
 
 (autoload 'clean-buffer-list "midnight" "\
@@ -18073,8 +18149,8 @@ to its second argument TM.
 
 ;;;***
 \f
-;;;### (autoloads nil "minibuf-eldef" "minibuf-eldef.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "minibuf-eldef" "minibuf-eldef.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from minibuf-eldef.el
 
 (defvar minibuffer-electric-default-mode nil "\
@@ -18103,7 +18179,7 @@ is modified to remove the default indication.
 
 ;;;***
 \f
-;;;### (autoloads nil "misc" "misc.el" (21291 53104 0 0))
+;;;### (autoloads nil "misc" "misc.el" (21240 46395 727291 0))
 ;;; Generated autoloads from misc.el
 
 (autoload 'butterfly "misc" "\
@@ -18131,7 +18207,8 @@ The return value is always nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "misearch" "misearch.el" (21291 53104 0 0))
+;;;### (autoloads nil "misearch" "misearch.el" (21245 64312 799897
+;;;;;;  0))
 ;;; Generated autoloads from misearch.el
  (add-hook 'isearch-mode-hook 'multi-isearch-setup)
 
@@ -18212,8 +18289,8 @@ whose file names match the specified wildcard.
 
 ;;;***
 \f
-;;;### (autoloads nil "mixal-mode" "progmodes/mixal-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "mixal-mode" "progmodes/mixal-mode.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from progmodes/mixal-mode.el
 (push (purecopy '(mixal-mode 0 1)) package--builtin-versions)
 
@@ -18224,8 +18301,8 @@ Major mode for the mixal asm language.
 
 ;;;***
 \f
-;;;### (autoloads nil "mm-encode" "gnus/mm-encode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mm-encode" "gnus/mm-encode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/mm-encode.el
 
 (autoload 'mm-default-file-encoding "mm-encode" "\
@@ -18235,8 +18312,8 @@ Return a default encoding for FILE.
 
 ;;;***
 \f
-;;;### (autoloads nil "mm-extern" "gnus/mm-extern.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mm-extern" "gnus/mm-extern.el" (21296 1575
+;;;;;;  438327 0))
 ;;; Generated autoloads from gnus/mm-extern.el
 
 (autoload 'mm-extern-cache-contents "mm-extern" "\
@@ -18254,8 +18331,8 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing.
 
 ;;;***
 \f
-;;;### (autoloads nil "mm-partial" "gnus/mm-partial.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mm-partial" "gnus/mm-partial.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/mm-partial.el
 
 (autoload 'mm-inline-partial "mm-partial" "\
@@ -18268,7 +18345,8 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing.
 
 ;;;***
 \f
-;;;### (autoloads nil "mm-url" "gnus/mm-url.el" (21291 53104 0 0))
+;;;### (autoloads nil "mm-url" "gnus/mm-url.el" (21296 1575 438327
+;;;;;;  0))
 ;;; Generated autoloads from gnus/mm-url.el
 
 (autoload 'mm-url-insert-file-contents "mm-url" "\
@@ -18284,7 +18362,8 @@ Insert file contents of URL using `mm-url-program'.
 
 ;;;***
 \f
-;;;### (autoloads nil "mm-uu" "gnus/mm-uu.el" (21291 53104 0 0))
+;;;### (autoloads nil "mm-uu" "gnus/mm-uu.el" (21363 17065 850322
+;;;;;;  0))
 ;;; Generated autoloads from gnus/mm-uu.el
 
 (autoload 'mm-uu-dissect "mm-uu" "\
@@ -18303,7 +18382,7 @@ Assume text has been decoded if DECODED is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "mml" "gnus/mml.el" (21291 53104 0 0))
+;;;### (autoloads nil "mml" "gnus/mml.el" (21296 1575 438327 0))
 ;;; Generated autoloads from gnus/mml.el
 
 (autoload 'mml-to-mime "mml" "\
@@ -18328,7 +18407,7 @@ body) or \"attachment\" (separate from the body).
 
 ;;;***
 \f
-;;;### (autoloads nil "mml1991" "gnus/mml1991.el" (21291 53104 0
+;;;### (autoloads nil "mml1991" "gnus/mml1991.el" (21296 1575 438327
 ;;;;;;  0))
 ;;; Generated autoloads from gnus/mml1991.el
 
@@ -18344,7 +18423,7 @@ body) or \"attachment\" (separate from the body).
 
 ;;;***
 \f
-;;;### (autoloads nil "mml2015" "gnus/mml2015.el" (21291 53104 0
+;;;### (autoloads nil "mml2015" "gnus/mml2015.el" (21356 43818 957743
 ;;;;;;  0))
 ;;; Generated autoloads from gnus/mml2015.el
 
@@ -18385,16 +18464,16 @@ body) or \"attachment\" (separate from the body).
 
 ;;;***
 \f
-;;;### (autoloads nil "mode-local" "cedet/mode-local.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "mode-local" "cedet/mode-local.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from cedet/mode-local.el
 
 (put 'define-overloadable-function 'doc-string-elt 3)
 
 ;;;***
 \f
-;;;### (autoloads nil "modula2" "progmodes/modula2.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "modula2" "progmodes/modula2.el" (21282 19826
+;;;;;;  403614 0))
 ;;; Generated autoloads from progmodes/modula2.el
 
 (defalias 'modula-2-mode 'm2-mode)
@@ -18427,7 +18506,8 @@ followed by the first character of the construct.
 
 ;;;***
 \f
-;;;### (autoloads nil "morse" "play/morse.el" (21291 53104 0 0))
+;;;### (autoloads nil "morse" "play/morse.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from play/morse.el
 
 (autoload 'morse-region "morse" "\
@@ -18452,7 +18532,7 @@ Convert NATO phonetic alphabet in region to ordinary ASCII text.
 
 ;;;***
 \f
-;;;### (autoloads nil "mouse-drag" "mouse-drag.el" (21291 53104 0
+;;;### (autoloads nil "mouse-drag" "mouse-drag.el" (21202 31159 541460
 ;;;;;;  0))
 ;;; Generated autoloads from mouse-drag.el
 
@@ -18500,7 +18580,7 @@ To test this function, evaluate:
 
 ;;;***
 \f
-;;;### (autoloads nil "mpc" "mpc.el" (21346 62196 0 0))
+;;;### (autoloads nil "mpc" "mpc.el" (21361 61732 646433 0))
 ;;; Generated autoloads from mpc.el
 
 (autoload 'mpc "mpc" "\
@@ -18510,7 +18590,7 @@ Main entry point for MPC.
 
 ;;;***
 \f
-;;;### (autoloads nil "mpuz" "play/mpuz.el" (21291 53104 0 0))
+;;;### (autoloads nil "mpuz" "play/mpuz.el" (21187 63826 213216 0))
 ;;; Generated autoloads from play/mpuz.el
 
 (autoload 'mpuz "mpuz" "\
@@ -18520,7 +18600,7 @@ Multiplication puzzle with GNU Emacs.
 
 ;;;***
 \f
-;;;### (autoloads nil "msb" "msb.el" (21291 53104 0 0))
+;;;### (autoloads nil "msb" "msb.el" (21240 46395 727291 0))
 ;;; Generated autoloads from msb.el
 
 (defvar msb-mode nil "\
@@ -18545,8 +18625,8 @@ different buffer menu using the function `msb'.
 
 ;;;***
 \f
-;;;### (autoloads nil "mule-diag" "international/mule-diag.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "mule-diag" "international/mule-diag.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from international/mule-diag.el
 
 (autoload 'list-character-sets "mule-diag" "\
@@ -18678,8 +18758,8 @@ The default is 20.  If LIMIT is negative, do not limit the listing.
 
 ;;;***
 \f
-;;;### (autoloads nil "mule-util" "international/mule-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "mule-util" "international/mule-util.el" (21412
+;;;;;;  2598 318409 0))
 ;;; Generated autoloads from international/mule-util.el
 
 (defsubst string-to-list (string) "\
@@ -18715,7 +18795,7 @@ If ELLIPSIS is non-nil, it should be a string which will replace the
 end of STR (including any padding) if it extends beyond END-COLUMN,
 unless the display width of STR is equal to or less than the display
 width of ELLIPSIS.  If it is non-nil and not a string, then ELLIPSIS
-defaults to \"...\".
+defaults to `truncate-string-ellipsis'.
 
 \(fn STR END-COLUMN &optional START-COLUMN PADDING ELLIPSIS)" nil nil)
 
@@ -18810,8 +18890,8 @@ per-character basis, this may not be accurate.
 
 ;;;***
 \f
-;;;### (autoloads nil "net-utils" "net/net-utils.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "net-utils" "net/net-utils.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from net/net-utils.el
 
 (autoload 'ifconfig "net-utils" "\
@@ -18905,7 +18985,8 @@ Open a network connection to HOST on PORT.
 
 ;;;***
 \f
-;;;### (autoloads nil "netrc" "net/netrc.el" (21291 53104 0 0))
+;;;### (autoloads nil "netrc" "net/netrc.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from net/netrc.el
 
 (autoload 'netrc-credentials "netrc" "\
@@ -18917,8 +18998,8 @@ listed in the PORTS list.
 
 ;;;***
 \f
-;;;### (autoloads nil "network-stream" "net/network-stream.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "network-stream" "net/network-stream.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from net/network-stream.el
 
 (autoload 'open-network-stream "network-stream" "\
@@ -19011,8 +19092,8 @@ a greeting from the server.
 
 ;;;***
 \f
-;;;### (autoloads nil "newst-backend" "net/newst-backend.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "newst-backend" "net/newst-backend.el" (21260
+;;;;;;  57908 370145 500000))
 ;;; Generated autoloads from net/newst-backend.el
 
 (autoload 'newsticker-running-p "newst-backend" "\
@@ -19034,7 +19115,7 @@ Run `newsticker-start-hook' if newsticker was not running already.
 ;;;***
 \f
 ;;;### (autoloads nil "newst-plainview" "net/newst-plainview.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from net/newst-plainview.el
 
 (autoload 'newsticker-plainview "newst-plainview" "\
@@ -19044,8 +19125,8 @@ Start newsticker plainview.
 
 ;;;***
 \f
-;;;### (autoloads nil "newst-reader" "net/newst-reader.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "newst-reader" "net/newst-reader.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from net/newst-reader.el
 
 (autoload 'newsticker-show-news "newst-reader" "\
@@ -19055,8 +19136,8 @@ Start reading news.  You may want to bind this to a key.
 
 ;;;***
 \f
-;;;### (autoloads nil "newst-ticker" "net/newst-ticker.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "newst-ticker" "net/newst-ticker.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from net/newst-ticker.el
 
 (autoload 'newsticker-ticker-running-p "newst-ticker" "\
@@ -19076,8 +19157,8 @@ running already.
 
 ;;;***
 \f
-;;;### (autoloads nil "newst-treeview" "net/newst-treeview.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "newst-treeview" "net/newst-treeview.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from net/newst-treeview.el
 
 (autoload 'newsticker-treeview "newst-treeview" "\
@@ -19087,14 +19168,14 @@ Start newsticker treeview.
 
 ;;;***
 \f
-;;;### (autoloads nil "newsticker" "net/newsticker.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "newsticker" "net/newsticker.el" (21194 37048
+;;;;;;  599945 0))
 ;;; Generated autoloads from net/newsticker.el
 (push (purecopy '(newsticker 1 99)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "nndiary" "gnus/nndiary.el" (21291 53104 0
+;;;### (autoloads nil "nndiary" "gnus/nndiary.el" (21204 37210 187838
 ;;;;;;  0))
 ;;; Generated autoloads from gnus/nndiary.el
 
@@ -19105,7 +19186,8 @@ Generate NOV databases in all nndiary directories.
 
 ;;;***
 \f
-;;;### (autoloads nil "nndoc" "gnus/nndoc.el" (21291 53104 0 0))
+;;;### (autoloads nil "nndoc" "gnus/nndoc.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from gnus/nndoc.el
 
 (autoload 'nndoc-add-type "nndoc" "\
@@ -19119,8 +19201,8 @@ symbol in the alist.
 
 ;;;***
 \f
-;;;### (autoloads nil "nnfolder" "gnus/nnfolder.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "nnfolder" "gnus/nnfolder.el" (21296 1575 438327
+;;;;;;  0))
 ;;; Generated autoloads from gnus/nnfolder.el
 
 (autoload 'nnfolder-generate-active-file "nnfolder" "\
@@ -19131,7 +19213,7 @@ This command does not work if you use short group names.
 
 ;;;***
 \f
-;;;### (autoloads nil "nnml" "gnus/nnml.el" (21291 53104 0 0))
+;;;### (autoloads nil "nnml" "gnus/nnml.el" (21187 63826 213216 0))
 ;;; Generated autoloads from gnus/nnml.el
 
 (autoload 'nnml-generate-nov-databases "nnml" "\
@@ -19141,7 +19223,7 @@ Generate NOV databases in all nnml directories.
 
 ;;;***
 \f
-;;;### (autoloads nil "novice" "novice.el" (21291 53104 0 0))
+;;;### (autoloads nil "novice" "novice.el" (21240 46395 727291 0))
 ;;; Generated autoloads from novice.el
 
 (define-obsolete-variable-alias 'disabled-command-hook 'disabled-command-function "22.1")
@@ -19173,8 +19255,8 @@ future sessions.
 
 ;;;***
 \f
-;;;### (autoloads nil "nroff-mode" "textmodes/nroff-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "nroff-mode" "textmodes/nroff-mode.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from textmodes/nroff-mode.el
 
 (autoload 'nroff-mode "nroff-mode" "\
@@ -19188,14 +19270,14 @@ closing requests for requests that are used in matched pairs.
 
 ;;;***
 \f
-;;;### (autoloads nil "ntlm" "net/ntlm.el" (21291 53104 0 0))
+;;;### (autoloads nil "ntlm" "net/ntlm.el" (21187 63826 213216 0))
 ;;; Generated autoloads from net/ntlm.el
 (push (purecopy '(ntlm 1 0)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "nxml-glyph" "nxml/nxml-glyph.el" (21291 57968
-;;;;;;  0 0))
+;;;### (autoloads nil "nxml-glyph" "nxml/nxml-glyph.el" (21293 25385
+;;;;;;  120083 0))
 ;;; Generated autoloads from nxml/nxml-glyph.el
 
 (autoload 'nxml-glyph-display-string "nxml-glyph" "\
@@ -19207,8 +19289,8 @@ Return nil if the face cannot display a glyph for N.
 
 ;;;***
 \f
-;;;### (autoloads nil "nxml-mode" "nxml/nxml-mode.el" (21373 1839
-;;;;;;  721535 649000))
+;;;### (autoloads nil "nxml-mode" "nxml/nxml-mode.el" (21383 2343
+;;;;;;  498187 0))
 ;;; Generated autoloads from nxml/nxml-mode.el
 
 (autoload 'nxml-mode "nxml-mode" "\
@@ -19268,8 +19350,8 @@ Many aspects this mode can be customized using
 
 ;;;***
 \f
-;;;### (autoloads nil "nxml-uchnm" "nxml/nxml-uchnm.el" (21291 57968
-;;;;;;  0 0))
+;;;### (autoloads nil "nxml-uchnm" "nxml/nxml-uchnm.el" (21293 25385
+;;;;;;  120083 0))
 ;;; Generated autoloads from nxml/nxml-uchnm.el
 
 (autoload 'nxml-enable-unicode-char-name-sets "nxml-uchnm" "\
@@ -19281,8 +19363,8 @@ the variable `nxml-enabled-unicode-blocks'.
 
 ;;;***
 \f
-;;;### (autoloads nil "octave" "progmodes/octave.el" (21430 36152
-;;;;;;  122368 0))
+;;;### (autoloads nil "octave" "progmodes/octave.el" (21437 5802
+;;;;;;  125919 0))
 ;;; Generated autoloads from progmodes/octave.el
 
 (autoload 'octave-mode "octave" "\
@@ -19319,8 +19401,8 @@ startup file, `~/.emacs-octave'.
 
 ;;;***
 \f
-;;;### (autoloads nil "opascal" "progmodes/opascal.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "opascal" "progmodes/opascal.el" (21282 19826
+;;;;;;  403614 0))
 ;;; Generated autoloads from progmodes/opascal.el
 
 (define-obsolete-function-alias 'delphi-mode 'opascal-mode "24.4")
@@ -19355,7 +19437,7 @@ Coloring:
 
 ;;;***
 \f
-;;;### (autoloads nil "org" "org/org.el" (21341 23900 0 0))
+;;;### (autoloads nil "org" "org/org.el" (21383 2343 498187 0))
 ;;; Generated autoloads from org/org.el
 
 (autoload 'org-babel-do-load-languages "org" "\
@@ -19576,8 +19658,8 @@ Call the customize function with org as argument.
 
 ;;;***
 \f
-;;;### (autoloads nil "org-agenda" "org/org-agenda.el" (21341 23900
-;;;;;;  0 0))
+;;;### (autoloads nil "org-agenda" "org/org-agenda.el" (21335 37672
+;;;;;;  97862 0))
 ;;; Generated autoloads from org/org-agenda.el
 
 (autoload 'org-toggle-sticky-agenda "org-agenda" "\
@@ -19850,8 +19932,8 @@ to override `appt-message-warning-time'.
 
 ;;;***
 \f
-;;;### (autoloads nil "org-capture" "org/org-capture.el" (21341 23900
-;;;;;;  0 0))
+;;;### (autoloads nil "org-capture" "org/org-capture.el" (21335 37672
+;;;;;;  97862 0))
 ;;; Generated autoloads from org/org-capture.el
 
 (autoload 'org-capture-string "org-capture" "\
@@ -19893,8 +19975,8 @@ Set `org-capture-templates' to be similar to `org-remember-templates'.
 
 ;;;***
 \f
-;;;### (autoloads nil "org-colview" "org/org-colview.el" (21341 23900
-;;;;;;  0 0))
+;;;### (autoloads nil "org-colview" "org/org-colview.el" (21335 37672
+;;;;;;  97862 0))
 ;;; Generated autoloads from org/org-colview.el
 
 (autoload 'org-columns-remove-overlays "org-colview" "\
@@ -19957,8 +20039,8 @@ Turn on or update column view in the agenda.
 
 ;;;***
 \f
-;;;### (autoloads nil "org-compat" "org/org-compat.el" (21341 23900
-;;;;;;  0 0))
+;;;### (autoloads nil "org-compat" "org/org-compat.el" (21417 20521
+;;;;;;  870414 0))
 ;;; Generated autoloads from org/org-compat.el
 
 (autoload 'org-check-version "org-compat" "\
@@ -19968,7 +20050,7 @@ Try very hard to provide sensible version strings.
 
 ;;;***
 \f
-;;;### (autoloads nil "org-macs" "org/org-macs.el" (21291 53104 0
+;;;### (autoloads nil "org-macs" "org/org-macs.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from org/org-macs.el
 
@@ -19979,8 +20061,8 @@ Load FILE with optional arguments NOERROR and MUSTSUFFIX.  Drop the MUSTSUFFIX a
 
 ;;;***
 \f
-;;;### (autoloads nil "org-version" "org/org-version.el" (21341 23900
-;;;;;;  0 0))
+;;;### (autoloads nil "org-version" "org/org-version.el" (21335 37672
+;;;;;;  97862 0))
 ;;; Generated autoloads from org/org-version.el
 
 (autoload 'org-release "org-version" "\
@@ -19997,7 +20079,8 @@ The Git version of org-mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "outline" "outline.el" (21291 53104 0 0))
+;;;### (autoloads nil "outline" "outline.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from outline.el
 (put 'outline-regexp 'safe-local-variable 'stringp)
 (put 'outline-heading-end-regexp 'safe-local-variable 'stringp)
@@ -20058,8 +20141,8 @@ See the command `outline-mode' for more information on this mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "package" "emacs-lisp/package.el" (21420 27972
-;;;;;;  753649 0))
+;;;### (autoloads nil "package" "emacs-lisp/package.el" (21419 62246
+;;;;;;  751914 0))
 ;;; Generated autoloads from emacs-lisp/package.el
 (push (purecopy '(package 1 0 1)) package--builtin-versions)
 
@@ -20131,7 +20214,7 @@ The list is displayed in a buffer named `*Packages*'.
 
 ;;;***
 \f
-;;;### (autoloads nil "paren" "paren.el" (21291 53104 0 0))
+;;;### (autoloads nil "paren" "paren.el" (21240 46395 727291 0))
 ;;; Generated autoloads from paren.el
 
 (defvar show-paren-mode nil "\
@@ -20157,8 +20240,8 @@ matching parenthesis is highlighted in `show-paren-style' after
 
 ;;;***
 \f
-;;;### (autoloads nil "parse-time" "calendar/parse-time.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "parse-time" "calendar/parse-time.el" (21296
+;;;;;;  1575 438327 0))
 ;;; Generated autoloads from calendar/parse-time.el
 (put 'parse-time-rules 'risky-local-variable t)
 
@@ -20171,8 +20254,8 @@ unknown are returned as nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "pascal" "progmodes/pascal.el" (21423 62909
-;;;;;;  33477 0))
+;;;### (autoloads nil "pascal" "progmodes/pascal.el" (21429 11690
+;;;;;;  49391 0))
 ;;; Generated autoloads from progmodes/pascal.el
 
 (autoload 'pascal-mode "pascal" "\
@@ -20221,8 +20304,8 @@ See also the user variables `pascal-type-keywords', `pascal-start-keywords' and
 
 ;;;***
 \f
-;;;### (autoloads nil "password-cache" "password-cache.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "password-cache" "password-cache.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from password-cache.el
 
 (defvar password-cache t "\
@@ -20243,8 +20326,8 @@ Check if KEY is in the cache.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcase" "emacs-lisp/pcase.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "pcase" "emacs-lisp/pcase.el" (21190 39993
+;;;;;;  744837 0))
 ;;; Generated autoloads from emacs-lisp/pcase.el
 
 (autoload 'pcase "pcase" "\
@@ -20283,7 +20366,7 @@ like `(,a . ,(pred (< a))) or, with more checks:
 
 \(fn EXP &rest CASES)" nil t)
 
-(put 'pcase 'lisp-indent-function '1)
+(function-put 'pcase 'lisp-indent-function '1)
 
 (autoload 'pcase-let* "pcase" "\
 Like `let*' but where you can use `pcase' patterns for bindings.
@@ -20292,7 +20375,7 @@ of the form (UPAT EXP).
 
 \(fn BINDINGS &rest BODY)" nil t)
 
-(put 'pcase-let* 'lisp-indent-function '1)
+(function-put 'pcase-let* 'lisp-indent-function '1)
 
 (autoload 'pcase-let "pcase" "\
 Like `let' but where you can use `pcase' patterns for bindings.
@@ -20301,11 +20384,12 @@ of the form (UPAT EXP).
 
 \(fn BINDINGS &rest BODY)" nil t)
 
-(put 'pcase-let 'lisp-indent-function '1)
+(function-put 'pcase-let 'lisp-indent-function '1)
 
 ;;;***
 \f
-;;;### (autoloads nil "pcmpl-cvs" "pcmpl-cvs.el" (21291 53104 0 0))
+;;;### (autoloads nil "pcmpl-cvs" "pcmpl-cvs.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from pcmpl-cvs.el
 
 (autoload 'pcomplete/cvs "pcmpl-cvs" "\
@@ -20315,7 +20399,8 @@ Completion rules for the `cvs' command.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcmpl-gnu" "pcmpl-gnu.el" (21291 53104 0 0))
+;;;### (autoloads nil "pcmpl-gnu" "pcmpl-gnu.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from pcmpl-gnu.el
 
 (autoload 'pcomplete/gzip "pcmpl-gnu" "\
@@ -20342,8 +20427,8 @@ Completion for the GNU tar utility.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcmpl-linux" "pcmpl-linux.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "pcmpl-linux" "pcmpl-linux.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from pcmpl-linux.el
 
 (autoload 'pcomplete/kill "pcmpl-linux" "\
@@ -20363,7 +20448,8 @@ Completion for GNU/Linux `mount'.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcmpl-rpm" "pcmpl-rpm.el" (21291 53104 0 0))
+;;;### (autoloads nil "pcmpl-rpm" "pcmpl-rpm.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from pcmpl-rpm.el
 
 (autoload 'pcomplete/rpm "pcmpl-rpm" "\
@@ -20373,7 +20459,7 @@ Completion for the `rpm' command.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcmpl-unix" "pcmpl-unix.el" (21291 53104 0
+;;;### (autoloads nil "pcmpl-unix" "pcmpl-unix.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from pcmpl-unix.el
 
@@ -20429,7 +20515,8 @@ Includes files as well as host names followed by a colon.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcmpl-x" "pcmpl-x.el" (21291 53104 0 0))
+;;;### (autoloads nil "pcmpl-x" "pcmpl-x.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from pcmpl-x.el
 
 (autoload 'pcomplete/tlmgr "pcmpl-x" "\
@@ -20453,7 +20540,8 @@ Completion for the `ag' command.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcomplete" "pcomplete.el" (21291 53104 0 0))
+;;;### (autoloads nil "pcomplete" "pcomplete.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from pcomplete.el
 
 (autoload 'pcomplete "pcomplete" "\
@@ -20510,7 +20598,7 @@ Setup `shell-mode' to use pcomplete.
 
 ;;;***
 \f
-;;;### (autoloads nil "pcvs" "vc/pcvs.el" (21291 53104 0 0))
+;;;### (autoloads nil "pcvs" "vc/pcvs.el" (21280 13349 392544 0))
 ;;; Generated autoloads from vc/pcvs.el
 
 (autoload 'cvs-checkout "pcvs" "\
@@ -20585,8 +20673,8 @@ The exact behavior is determined also by `cvs-dired-use-hook'." (when (stringp d
 
 ;;;***
 \f
-;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "pcvs-defs" "vc/pcvs-defs.el" (21280 13349
+;;;;;;  392544 0))
 ;;; Generated autoloads from vc/pcvs-defs.el
 
 (defvar cvs-global-menu (let ((m (make-sparse-keymap "PCL-CVS"))) (define-key m [status] `(menu-item ,(purecopy "Directory Status") cvs-status :help ,(purecopy "A more verbose status of a workarea"))) (define-key m [checkout] `(menu-item ,(purecopy "Checkout Module") cvs-checkout :help ,(purecopy "Check out a module from the repository"))) (define-key m [update] `(menu-item ,(purecopy "Update Directory") cvs-update :help ,(purecopy "Fetch updates from the repository"))) (define-key m [examine] `(menu-item ,(purecopy "Examine Directory") cvs-examine :help ,(purecopy "Examine the current state of a workarea"))) (fset 'cvs-global-menu m)) "\
@@ -20594,8 +20682,8 @@ Global menu used by PCL-CVS.")
 
 ;;;***
 \f
-;;;### (autoloads nil "perl-mode" "progmodes/perl-mode.el" (21341
-;;;;;;  23900 0 0))
+;;;### (autoloads nil "perl-mode" "progmodes/perl-mode.el" (21437
+;;;;;;  5802 125919 0))
 ;;; Generated autoloads from progmodes/perl-mode.el
 (put 'perl-indent-level 'safe-local-variable 'integerp)
 (put 'perl-continued-statement-offset 'safe-local-variable 'integerp)
@@ -20656,8 +20744,8 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "picture" "textmodes/picture.el" (21419 27241
-;;;;;;  500420 0))
+;;;### (autoloads nil "picture" "textmodes/picture.el" (21419 62246
+;;;;;;  751914 0))
 ;;; Generated autoloads from textmodes/picture.el
 
 (autoload 'picture-mode "picture" "\
@@ -20737,7 +20825,7 @@ they are not by default assigned to keys.
 
 ;;;***
 \f
-;;;### (autoloads nil "plstore" "gnus/plstore.el" (21291 53104 0
+;;;### (autoloads nil "plstore" "gnus/plstore.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from gnus/plstore.el
 
@@ -20753,7 +20841,8 @@ Major mode for editing PLSTORE files.
 
 ;;;***
 \f
-;;;### (autoloads nil "po" "textmodes/po.el" (21291 53104 0 0))
+;;;### (autoloads nil "po" "textmodes/po.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from textmodes/po.el
 
 (autoload 'po-find-file-coding-system "po" "\
@@ -20764,7 +20853,7 @@ Called through `file-coding-system-alist', before the file is visited for real.
 
 ;;;***
 \f
-;;;### (autoloads nil "pong" "play/pong.el" (21291 53104 0 0))
+;;;### (autoloads nil "pong" "play/pong.el" (21187 63826 213216 0))
 ;;; Generated autoloads from play/pong.el
 
 (autoload 'pong "pong" "\
@@ -20780,7 +20869,7 @@ pong-mode keybindings:\\<pong-mode-map>
 
 ;;;***
 \f
-;;;### (autoloads nil "pop3" "gnus/pop3.el" (21291 53104 0 0))
+;;;### (autoloads nil "pop3" "gnus/pop3.el" (21240 46395 727291 0))
 ;;; Generated autoloads from gnus/pop3.el
 
 (autoload 'pop3-movemail "pop3" "\
@@ -20791,7 +20880,7 @@ Use streaming commands.
 
 ;;;***
 \f
-;;;### (autoloads nil "pp" "emacs-lisp/pp.el" (21427 59969 217865
+;;;### (autoloads nil "pp" "emacs-lisp/pp.el" (21429 11690 49391
 ;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/pp.el
 
@@ -20842,7 +20931,7 @@ Ignores leading comment characters.
 
 ;;;***
 \f
-;;;### (autoloads nil "printing" "printing.el" (21359 23622 725850
+;;;### (autoloads nil "printing" "printing.el" (21364 37926 837230
 ;;;;;;  0))
 ;;; Generated autoloads from printing.el
 (push (purecopy '(printing 6 9 3)) package--builtin-versions)
@@ -21431,7 +21520,7 @@ are both set to t.
 
 ;;;***
 \f
-;;;### (autoloads nil "proced" "proced.el" (21291 53104 0 0))
+;;;### (autoloads nil "proced" "proced.el" (21187 63826 213216 0))
 ;;; Generated autoloads from proced.el
 
 (autoload 'proced "proced" "\
@@ -21449,7 +21538,8 @@ Proced buffers.
 
 ;;;***
 \f
-;;;### (autoloads nil "profiler" "profiler.el" (21291 53104 0 0))
+;;;### (autoloads nil "profiler" "profiler.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from profiler.el
 
 (autoload 'profiler-start "profiler" "\
@@ -21477,8 +21567,8 @@ Open profile FILENAME.
 
 ;;;***
 \f
-;;;### (autoloads nil "prolog" "progmodes/prolog.el" (21458 15546
-;;;;;;  437191 0))
+;;;### (autoloads nil "prolog" "progmodes/prolog.el" (21462 9001
+;;;;;;  456449 0))
 ;;; Generated autoloads from progmodes/prolog.el
 
 (autoload 'prolog-mode "prolog" "\
@@ -21511,7 +21601,7 @@ With prefix argument ARG, restart the Prolog process if running before.
 
 ;;;***
 \f
-;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (21291 53104 0 0))
+;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (21187 63826 213216 0))
 ;;; Generated autoloads from ps-bdf.el
 
 (defvar bdf-directory-list (if (memq system-type '(ms-dos windows-nt)) (list (expand-file-name "fonts/bdf" installation-directory)) '("/usr/local/share/emacs/fonts/bdf")) "\
@@ -21522,8 +21612,8 @@ The default value is '(\"/usr/local/share/emacs/fonts/bdf\").")
 
 ;;;***
 \f
-;;;### (autoloads nil "ps-mode" "progmodes/ps-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "ps-mode" "progmodes/ps-mode.el" (21342 10917
+;;;;;;  902592 0))
 ;;; Generated autoloads from progmodes/ps-mode.el
 (push (purecopy '(ps-mode 1 1 9)) package--builtin-versions)
 
@@ -21535,7 +21625,6 @@ Entry to this mode calls `ps-mode-hook'.
 The following variables hold user options, and can
 be set through the `customize' command:
 
-  `ps-mode-auto-indent'
   `ps-mode-tab'
   `ps-mode-paper-size'
   `ps-mode-print-function'
@@ -21570,7 +21659,7 @@ Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number
 
 ;;;***
 \f
-;;;### (autoloads nil "ps-print" "ps-print.el" (21359 23622 725850
+;;;### (autoloads nil "ps-print" "ps-print.el" (21360 40869 887231
 ;;;;;;  0))
 ;;; Generated autoloads from ps-print.el
 (push (purecopy '(ps-print 7 3 5)) package--builtin-versions)
@@ -21768,14 +21857,15 @@ If EXTENSION is any other symbol, it is ignored.
 
 ;;;***
 \f
-;;;### (autoloads nil "pulse" "cedet/pulse.el" (21291 53104 0 0))
+;;;### (autoloads nil "pulse" "cedet/pulse.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from cedet/pulse.el
 (push (purecopy '(pulse 1 0)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "python" "progmodes/python.el" (21460 57274
-;;;;;;  131108 0))
+;;;### (autoloads nil "python" "progmodes/python.el" (21467 26920
+;;;;;;  243336 0))
 ;;; Generated autoloads from progmodes/python.el
 (push (purecopy '(python 0 24 4)) package--builtin-versions)
 
@@ -21809,7 +21899,7 @@ Major mode for editing Python files.
 
 ;;;***
 \f
-;;;### (autoloads nil "qp" "gnus/qp.el" (21291 53104 0 0))
+;;;### (autoloads nil "qp" "gnus/qp.el" (21187 63826 213216 0))
 ;;; Generated autoloads from gnus/qp.el
 
 (autoload 'quoted-printable-decode-region "qp" "\
@@ -21828,8 +21918,8 @@ them into characters should be done separately.
 
 ;;;***
 \f
-;;;### (autoloads nil "quail" "international/quail.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "quail" "international/quail.el" (21215 43189
+;;;;;;  822371 0))
 ;;; Generated autoloads from international/quail.el
 
 (autoload 'quail-title "quail" "\
@@ -22059,8 +22149,8 @@ of each directory.
 
 ;;;***
 \f
-;;;### (autoloads nil "quail/hangul" "leim/quail/hangul.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "quail/hangul" "leim/quail/hangul.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from leim/quail/hangul.el
 
 (autoload 'hangul-input-method-activate "quail/hangul" "\
@@ -22073,7 +22163,7 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'.
 ;;;***
 \f
 ;;;### (autoloads nil "quail/uni-input" "leim/quail/uni-input.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from leim/quail/uni-input.el
 
 (autoload 'ucs-input-activate "quail/uni-input" "\
@@ -22087,7 +22177,7 @@ While this input method is active, the variable
 
 ;;;***
 \f
-;;;### (autoloads nil "quickurl" "net/quickurl.el" (21291 53104 0
+;;;### (autoloads nil "quickurl" "net/quickurl.el" (21222 16439 978802
 ;;;;;;  0))
 ;;; Generated autoloads from net/quickurl.el
 
@@ -22159,7 +22249,8 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'.
 
 ;;;***
 \f
-;;;### (autoloads nil "rcirc" "net/rcirc.el" (21291 53104 0 0))
+;;;### (autoloads nil "rcirc" "net/rcirc.el" (21452 59559 901066
+;;;;;;  0))
 ;;; Generated autoloads from net/rcirc.el
 
 (autoload 'rcirc "rcirc" "\
@@ -22197,8 +22288,8 @@ if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "re-builder" "emacs-lisp/re-builder.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "re-builder" "emacs-lisp/re-builder.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/re-builder.el
 
 (defalias 'regexp-builder 're-builder)
@@ -22216,7 +22307,8 @@ matching parts of the target buffer will be highlighted.
 
 ;;;***
 \f
-;;;### (autoloads nil "recentf" "recentf.el" (21291 53104 0 0))
+;;;### (autoloads nil "recentf" "recentf.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from recentf.el
 
 (defvar recentf-mode nil "\
@@ -22242,7 +22334,7 @@ were operated on recently.
 
 ;;;***
 \f
-;;;### (autoloads nil "rect" "rect.el" (21291 53104 0 0))
+;;;### (autoloads nil "rect" "rect.el" (21450 17830 135996 0))
 ;;; Generated autoloads from rect.el
 
 (autoload 'delete-rectangle "rect" "\
@@ -22382,8 +22474,8 @@ Activates the region if needed.  Only lasts until the region is deactivated.
 
 ;;;***
 \f
-;;;### (autoloads nil "refill" "textmodes/refill.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "refill" "textmodes/refill.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from textmodes/refill.el
 
 (autoload 'refill-mode "refill" "\
@@ -22403,9 +22495,13 @@ For true \"word wrap\" behavior, use `visual-line-mode' instead.
 
 ;;;***
 \f
-;;;### (autoloads nil "reftex" "textmodes/reftex.el" (21291 53104
-;;;;;;  0))
+;;;### (autoloads nil "reftex" "textmodes/reftex.el" (21418 41409
+;;;;;;  280143 158000))
 ;;; Generated autoloads from textmodes/reftex.el
+(autoload 'reftex-citation "reftex-cite" nil t)
+(autoload 'reftex-all-document-files "reftex-parse")
+(autoload 'reftex-isearch-minor-mode "reftex-global" nil t)
+(autoload 'reftex-index-phrases-mode "reftex-index" nil t)
 
 (autoload 'turn-on-reftex "reftex" "\
 Turn on RefTeX mode.
@@ -22453,101 +22549,8 @@ This enforces rescanning the buffer on next use.
 
 ;;;***
 \f
-;;;### (autoloads nil "reftex-cite" "textmodes/reftex-cite.el" (21291
-;;;;;;  53104 0 0))
-;;; Generated autoloads from textmodes/reftex-cite.el
-
-(autoload 'reftex-citation "reftex-cite" "\
-Make a citation using BibTeX database files.
-After prompting for a regular expression, scans the buffers with
-bibtex entries (taken from the \\bibliography command) and offers the
-matching entries for selection.  The selected entry is formatted according
-to `reftex-cite-format' and inserted into the buffer.
-
-If NO-INSERT is non-nil, nothing is inserted, only the selected key returned.
-
-FORMAT-KEY can be used to pre-select a citation format.
-
-When called with a `C-u' prefix, prompt for optional arguments in
-cite macros.  When called with a numeric prefix, make that many
-citations.  When called with point inside the braces of a `\\cite'
-command, it will add another key, ignoring the value of
-`reftex-cite-format'.
-
-The regular expression uses an expanded syntax: && is interpreted as `and'.
-Thus, `aaaa&&bbb' matches entries which contain both `aaaa' and `bbb'.
-While entering the regexp, completion on knows citation keys is possible.
-`=' is a good regular expression to match all entries in all files.
-
-\(fn &optional NO-INSERT FORMAT-KEY)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "reftex-global" "textmodes/reftex-global.el"
-;;;;;;  (21291 53104 0 0))
-;;; Generated autoloads from textmodes/reftex-global.el
-
-(autoload 'reftex-isearch-minor-mode "reftex-global" "\
-When on, isearch searches the whole document, not only the current file.
-This minor mode allows isearch to search through all the files of
-the current TeX document.
-
-With no argument, this command toggles
-`reftex-isearch-minor-mode'.  With a prefix argument ARG, turn
-`reftex-isearch-minor-mode' on if ARG is positive, otherwise turn it off.
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "reftex-index" "textmodes/reftex-index.el"
-;;;;;;  (21291 53104 0 0))
-;;; Generated autoloads from textmodes/reftex-index.el
-
-(autoload 'reftex-index-phrases-mode "reftex-index" "\
-Major mode for managing the Index phrases of a LaTeX document.
-This buffer was created with RefTeX.
-
-To insert new phrases, use
- - `C-c \\' in the LaTeX document to copy selection or word
- - `\\[reftex-index-new-phrase]' in the phrases buffer.
-
-To index phrases use one of:
-
-\\[reftex-index-this-phrase]     index current phrase
-\\[reftex-index-next-phrase]     index next phrase (or N with prefix arg)
-\\[reftex-index-all-phrases]     index all phrases
-\\[reftex-index-remaining-phrases]     index current and following phrases
-\\[reftex-index-region-phrases]     index the phrases in the region
-
-You can sort the phrases in this buffer with \\[reftex-index-sort-phrases].
-To display information about the phrase at point, use \\[reftex-index-phrases-info].
-
-For more information see the RefTeX User Manual.
-
-Here are all local bindings.
-
-\\{reftex-index-phrases-mode-map}
-
-\(fn)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "reftex-parse" "textmodes/reftex-parse.el"
-;;;;;;  (21346 62196 0 0))
-;;; Generated autoloads from textmodes/reftex-parse.el
-
-(autoload 'reftex-all-document-files "reftex-parse" "\
-Return a list of all files belonging to the current document.
-When RELATIVE is non-nil, give file names relative to directory
-of master file.
-
-\(fn &optional RELATIVE)" nil nil)
-
-;;;***
-\f
-;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (21194
+;;;;;;  37048 599945 0))
 ;;; Generated autoloads from textmodes/reftex-vars.el
 (put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
 (put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
@@ -22556,8 +22559,8 @@ of master file.
 
 ;;;***
 \f
-;;;### (autoloads nil "regexp-opt" "emacs-lisp/regexp-opt.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "regexp-opt" "emacs-lisp/regexp-opt.el" (21376
+;;;;;;  29092 815151 0))
 ;;; Generated autoloads from emacs-lisp/regexp-opt.el
 
 (autoload 'regexp-opt "regexp-opt" "\
@@ -22586,15 +22589,15 @@ This means the number of non-shy regexp grouping constructs
 
 ;;;***
 \f
-;;;### (autoloads nil "regi" "emacs-lisp/regi.el" (21291 53104 0
+;;;### (autoloads nil "regi" "emacs-lisp/regi.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/regi.el
 (push (purecopy '(regi 1 8)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "remember" "textmodes/remember.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "remember" "textmodes/remember.el" (21252 37559
+;;;;;;  125878 0))
 ;;; Generated autoloads from textmodes/remember.el
 (push (purecopy '(remember 2 0)) package--builtin-versions)
 
@@ -22648,7 +22651,7 @@ to turn the *scratch* buffer into your notes buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "repeat" "repeat.el" (21291 53104 0 0))
+;;;### (autoloads nil "repeat" "repeat.el" (21239 25528 651427 0))
 ;;; Generated autoloads from repeat.el
 (push (purecopy '(repeat 0 51)) package--builtin-versions)
 
@@ -22671,8 +22674,8 @@ recently executed command not bound to an input event\".
 
 ;;;***
 \f
-;;;### (autoloads nil "reporter" "mail/reporter.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "reporter" "mail/reporter.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/reporter.el
 
 (autoload 'reporter-submit-bug-report "reporter" "\
@@ -22703,7 +22706,7 @@ mail-sending package is used for editing and sending the message.
 
 ;;;***
 \f
-;;;### (autoloads nil "reposition" "reposition.el" (21291 53104 0
+;;;### (autoloads nil "reposition" "reposition.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from reposition.el
 
@@ -22730,7 +22733,7 @@ first comment line visible (if point is in a comment).
 
 ;;;***
 \f
-;;;### (autoloads nil "reveal" "reveal.el" (21291 53104 0 0))
+;;;### (autoloads nil "reveal" "reveal.el" (21359 20005 772941 0))
 ;;; Generated autoloads from reveal.el
 
 (autoload 'reveal-mode "reveal" "\
@@ -22765,7 +22768,7 @@ the mode if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "ring" "emacs-lisp/ring.el" (21291 53104 0
+;;;### (autoloads nil "ring" "emacs-lisp/ring.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/ring.el
 
@@ -22781,7 +22784,8 @@ Make a ring that can contain SIZE elements.
 
 ;;;***
 \f
-;;;### (autoloads nil "rlogin" "net/rlogin.el" (21291 53104 0 0))
+;;;### (autoloads nil "rlogin" "net/rlogin.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from net/rlogin.el
 
 (autoload 'rlogin "rlogin" "\
@@ -22825,7 +22829,8 @@ variable.
 
 ;;;***
 \f
-;;;### (autoloads nil "rmail" "mail/rmail.el" (21349 10841 0 0))
+;;;### (autoloads nil "rmail" "mail/rmail.el" (21384 23211 329821
+;;;;;;  0))
 ;;; Generated autoloads from mail/rmail.el
 
 (defvar rmail-file-name (purecopy "~/RMAIL") "\
@@ -23022,8 +23027,8 @@ Set PASSWORD to be used for retrieving mail from a POP or IMAP server.
 
 ;;;***
 \f
-;;;### (autoloads nil "rmailout" "mail/rmailout.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "rmailout" "mail/rmailout.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/rmailout.el
 (put 'rmail-output-file-alist 'risky-local-variable t)
 
@@ -23087,8 +23092,8 @@ than appending to it.  Deletes the message after writing if
 
 ;;;***
 \f
-;;;### (autoloads nil "rng-cmpct" "nxml/rng-cmpct.el" (21319 19378
-;;;;;;  0 0))
+;;;### (autoloads nil "rng-cmpct" "nxml/rng-cmpct.el" (21319 49445
+;;;;;;  508378 0))
 ;;; Generated autoloads from nxml/rng-cmpct.el
 
 (autoload 'rng-c-load-schema "rng-cmpct" "\
@@ -23099,8 +23104,8 @@ Return a pattern.
 
 ;;;***
 \f
-;;;### (autoloads nil "rng-nxml" "nxml/rng-nxml.el" (21291 57968
-;;;;;;  0 0))
+;;;### (autoloads nil "rng-nxml" "nxml/rng-nxml.el" (21293 25385
+;;;;;;  120083 0))
 ;;; Generated autoloads from nxml/rng-nxml.el
 
 (autoload 'rng-nxml-mode-init "rng-nxml" "\
@@ -23112,8 +23117,8 @@ Validation will be enabled if `rng-nxml-auto-validate-flag' is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "rng-valid" "nxml/rng-valid.el" (21291 57968
-;;;;;;  0 0))
+;;;### (autoloads nil "rng-valid" "nxml/rng-valid.el" (21293 25385
+;;;;;;  120083 0))
 ;;; Generated autoloads from nxml/rng-valid.el
 
 (autoload 'rng-validate-mode "rng-valid" "\
@@ -23143,7 +23148,7 @@ to use for finding the schema.
 
 ;;;***
 \f
-;;;### (autoloads nil "rng-xsd" "nxml/rng-xsd.el" (21291 57968 0
+;;;### (autoloads nil "rng-xsd" "nxml/rng-xsd.el" (21293 25385 120083
 ;;;;;;  0))
 ;;; Generated autoloads from nxml/rng-xsd.el
 
@@ -23171,8 +23176,8 @@ must be equal.
 
 ;;;***
 \f
-;;;### (autoloads nil "robin" "international/robin.el" (20627 28607
-;;;;;;  0 0))
+;;;### (autoloads nil "robin" "international/robin.el" (20523 62082
+;;;;;;  997685 0))
 ;;; Generated autoloads from international/robin.el
 
 (autoload 'robin-define-package "robin" "\
@@ -23204,7 +23209,7 @@ Start using robin package NAME, which is a string.
 
 ;;;***
 \f
-;;;### (autoloads nil "rot13" "rot13.el" (21291 53104 0 0))
+;;;### (autoloads nil "rot13" "rot13.el" (21240 46395 727291 0))
 ;;; Generated autoloads from rot13.el
 
 (autoload 'rot13 "rot13" "\
@@ -23241,7 +23246,8 @@ Toggle the use of ROT13 encoding for the current window.
 
 ;;;***
 \f
-;;;### (autoloads nil "rst" "textmodes/rst.el" (21343 47921 0 0))
+;;;### (autoloads nil "rst" "textmodes/rst.el" (21415 65191 692645
+;;;;;;  0))
 ;;; Generated autoloads from textmodes/rst.el
  (add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode)))
 
@@ -23271,8 +23277,8 @@ for modes derived from Text mode, like Mail mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "ruby-mode" "progmodes/ruby-mode.el" (21433
-;;;;;;  12343 302925 0))
+;;;### (autoloads nil "ruby-mode" "progmodes/ruby-mode.el" (21437
+;;;;;;  5802 125919 0))
 ;;; Generated autoloads from progmodes/ruby-mode.el
 (push (purecopy '(ruby-mode 1 2)) package--builtin-versions)
 
@@ -23289,7 +23295,7 @@ Major mode for editing Ruby code.
 
 ;;;***
 \f
-;;;### (autoloads nil "ruler-mode" "ruler-mode.el" (21419 27241 500420
+;;;### (autoloads nil "ruler-mode" "ruler-mode.el" (21419 62246 751914
 ;;;;;;  0))
 ;;; Generated autoloads from ruler-mode.el
 (push (purecopy '(ruler-mode 1 6)) package--builtin-versions)
@@ -23308,7 +23314,8 @@ if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "rx" "emacs-lisp/rx.el" (21291 53104 0 0))
+;;;### (autoloads nil "rx" "emacs-lisp/rx.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/rx.el
 
 (autoload 'rx-to-string "rx" "\
@@ -23619,14 +23626,15 @@ enclosed in `(and ...)'.
 
 ;;;***
 \f
-;;;### (autoloads nil "sasl-ntlm" "net/sasl-ntlm.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "sasl-ntlm" "net/sasl-ntlm.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from net/sasl-ntlm.el
 (push (purecopy '(sasl 1 0)) package--builtin-versions)
 
 ;;;***
 \f
-;;;### (autoloads nil "savehist" "savehist.el" (21291 53104 0 0))
+;;;### (autoloads nil "savehist" "savehist.el" (21326 22692 123234
+;;;;;;  0))
 ;;; Generated autoloads from savehist.el
 (push (purecopy '(savehist 24)) package--builtin-versions)
 
@@ -23658,8 +23666,8 @@ histories, which is probably undesirable.
 
 ;;;***
 \f
-;;;### (autoloads nil "scheme" "progmodes/scheme.el" (21372 35662
-;;;;;;  356409 0))
+;;;### (autoloads nil "scheme" "progmodes/scheme.el" (21379 5287
+;;;;;;  607434 0))
 ;;; Generated autoloads from progmodes/scheme.el
 
 (autoload 'scheme-mode "scheme" "\
@@ -23698,8 +23706,8 @@ that variable's value is a string.
 
 ;;;***
 \f
-;;;### (autoloads nil "score-mode" "gnus/score-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "score-mode" "gnus/score-mode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/score-mode.el
 
 (autoload 'gnus-score-mode "score-mode" "\
@@ -23712,7 +23720,7 @@ This mode is an extended emacs-lisp mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "scroll-all" "scroll-all.el" (21291 53104 0
+;;;### (autoloads nil "scroll-all" "scroll-all.el" (21388 20265 495157
 ;;;;;;  0))
 ;;; Generated autoloads from scroll-all.el
 
@@ -23738,8 +23746,8 @@ one window apply to all visible windows in the same frame.
 
 ;;;***
 \f
-;;;### (autoloads nil "scroll-lock" "scroll-lock.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "scroll-lock" "scroll-lock.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from scroll-lock.el
 
 (autoload 'scroll-lock-mode "scroll-lock" "\
@@ -23755,15 +23763,16 @@ vertically fixed relative to window boundaries during scrolling.
 
 ;;;***
 \f
-;;;### (autoloads nil "secrets" "net/secrets.el" (21291 53104 0 0))
+;;;### (autoloads nil "secrets" "net/secrets.el" (21256 34613 967717
+;;;;;;  0))
 ;;; Generated autoloads from net/secrets.el
 (when (featurep 'dbusbind)
  (autoload 'secrets-show-secrets "secrets" nil t))
 
 ;;;***
 \f
-;;;### (autoloads nil "semantic" "cedet/semantic.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "semantic" "cedet/semantic.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from cedet/semantic.el
 (push (purecopy '(semantic 2 2)) package--builtin-versions)
 
@@ -23821,7 +23830,7 @@ Semantic mode.
 ;;;***
 \f
 ;;;### (autoloads nil "semantic/bovine/grammar" "cedet/semantic/bovine/grammar.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from cedet/semantic/bovine/grammar.el
 
 (autoload 'bovine-grammar-mode "semantic/bovine/grammar" "\
@@ -23832,7 +23841,7 @@ Major mode for editing Bovine grammars.
 ;;;***
 \f
 ;;;### (autoloads nil "semantic/wisent/grammar" "cedet/semantic/wisent/grammar.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from cedet/semantic/wisent/grammar.el
 
 (autoload 'wisent-grammar-mode "semantic/wisent/grammar" "\
@@ -23842,8 +23851,8 @@ Major mode for editing Wisent grammars.
 
 ;;;***
 \f
-;;;### (autoloads nil "sendmail" "mail/sendmail.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "sendmail" "mail/sendmail.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/sendmail.el
 
 (defvar mail-from-style 'default "\
@@ -24124,7 +24133,7 @@ Like `mail' command, but display mail buffer in another frame.
 
 ;;;***
 \f
-;;;### (autoloads nil "server" "server.el" (21291 53104 0 0))
+;;;### (autoloads nil "server" "server.el" (21437 5802 125919 0))
 ;;; Generated autoloads from server.el
 
 (put 'server-host 'risky-local-variable t)
@@ -24191,7 +24200,7 @@ only these files will be asked to be saved.
 
 ;;;***
 \f
-;;;### (autoloads nil "ses" "ses.el" (21291 53104 0 0))
+;;;### (autoloads nil "ses" "ses.el" (21454 14892 338155 0))
 ;;; Generated autoloads from ses.el
 
 (autoload 'ses-mode "ses" "\
@@ -24235,8 +24244,8 @@ formula:
 
 ;;;***
 \f
-;;;### (autoloads nil "sgml-mode" "textmodes/sgml-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "sgml-mode" "textmodes/sgml-mode.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from textmodes/sgml-mode.el
 
 (autoload 'sgml-mode "sgml-mode" "\
@@ -24301,8 +24310,8 @@ To work around that, do:
 
 ;;;***
 \f
-;;;### (autoloads nil "sh-script" "progmodes/sh-script.el" (21437
-;;;;;;  9401 747944 0))
+;;;### (autoloads nil "sh-script" "progmodes/sh-script.el" (21452
+;;;;;;  59559 901066 0))
 ;;; Generated autoloads from progmodes/sh-script.el
 (push (purecopy '(sh-script 2 0 6)) package--builtin-versions)
 (put 'sh-shell 'safe-local-variable 'symbolp)
@@ -24366,8 +24375,8 @@ with your script for an edit-interpret-debug cycle.
 
 ;;;***
 \f
-;;;### (autoloads nil "shadow" "emacs-lisp/shadow.el" (21291 53104
-;;;;;;  0))
+;;;### (autoloads nil "shadow" "emacs-lisp/shadow.el" (21271 54940
+;;;;;;  492268 31000))
 ;;; Generated autoloads from emacs-lisp/shadow.el
 
 (autoload 'list-load-path-shadows "shadow" "\
@@ -24416,7 +24425,7 @@ function, `load-path-shadows-find'.
 
 ;;;***
 \f
-;;;### (autoloads nil "shadowfile" "shadowfile.el" (21291 53104 0
+;;;### (autoloads nil "shadowfile" "shadowfile.el" (21222 16439 978802
 ;;;;;;  0))
 ;;; Generated autoloads from shadowfile.el
 
@@ -24455,7 +24464,7 @@ Set up file shadowing.
 
 ;;;***
 \f
-;;;### (autoloads nil "shell" "shell.el" (21313 65162 0 0))
+;;;### (autoloads nil "shell" "shell.el" (21374 22080 740835 768000))
 ;;; Generated autoloads from shell.el
 
 (defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
@@ -24503,7 +24512,7 @@ Otherwise, one argument `-i' is passed to the shell.
 
 ;;;***
 \f
-;;;### (autoloads nil "shr" "net/shr.el" (21341 23900 0 0))
+;;;### (autoloads nil "shr" "net/shr.el" (21327 43559 923043 0))
 ;;; Generated autoloads from net/shr.el
 
 (autoload 'shr-render-region "shr" "\
@@ -24520,7 +24529,8 @@ DOM should be a parse tree as generated by
 
 ;;;***
 \f
-;;;### (autoloads nil "sieve" "gnus/sieve.el" (21291 53104 0 0))
+;;;### (autoloads nil "sieve" "gnus/sieve.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from gnus/sieve.el
 
 (autoload 'sieve-manage "sieve" "\
@@ -24545,8 +24555,8 @@ DOM should be a parse tree as generated by
 
 ;;;***
 \f
-;;;### (autoloads nil "sieve-mode" "gnus/sieve-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "sieve-mode" "gnus/sieve-mode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/sieve-mode.el
 
 (autoload 'sieve-mode "sieve-mode" "\
@@ -24561,8 +24571,8 @@ Turning on Sieve mode runs `sieve-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "simula" "progmodes/simula.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "simula" "progmodes/simula.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from progmodes/simula.el
 
 (autoload 'simula-mode "simula" "\
@@ -24610,7 +24620,7 @@ with no arguments, if that value is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "skeleton" "skeleton.el" (21416 3260 930862
+;;;### (autoloads nil "skeleton" "skeleton.el" (21420 38312 308000
 ;;;;;;  0))
 ;;; Generated autoloads from skeleton.el
 
@@ -24624,7 +24634,7 @@ SKELETON is as defined under `skeleton-insert'.
 
 \(fn COMMAND DOCUMENTATION &rest SKELETON)" nil t)
 
-(put 'define-skeleton 'doc-string-elt '2)
+(function-put 'define-skeleton 'doc-string-elt '2)
 
 (autoload 'skeleton-proxy-new "skeleton" "\
 Insert SKELETON.
@@ -24729,8 +24739,8 @@ symmetrical ones, and the same character twice for the others.
 
 ;;;***
 \f
-;;;### (autoloads nil "smerge-mode" "vc/smerge-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "smerge-mode" "vc/smerge-mode.el" (21409 26408
+;;;;;;  607647 0))
 ;;; Generated autoloads from vc/smerge-mode.el
 
 (autoload 'smerge-ediff "smerge-mode" "\
@@ -24757,7 +24767,8 @@ If no conflict maker is found, turn off `smerge-mode'.
 
 ;;;***
 \f
-;;;### (autoloads nil "smiley" "gnus/smiley.el" (21291 53104 0 0))
+;;;### (autoloads nil "smiley" "gnus/smiley.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from gnus/smiley.el
 
 (autoload 'smiley-region "smiley" "\
@@ -24774,8 +24785,8 @@ interactively.  If there's no argument, do it at the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "smtpmail" "mail/smtpmail.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "smtpmail" "mail/smtpmail.el" (21322 25639
+;;;;;;  363230 0))
 ;;; Generated autoloads from mail/smtpmail.el
 
 (autoload 'smtpmail-send-it "smtpmail" "\
@@ -24790,7 +24801,8 @@ Send mail that was queued as a result of setting `smtpmail-queue-mail'.
 
 ;;;***
 \f
-;;;### (autoloads nil "snake" "play/snake.el" (21291 53104 0 0))
+;;;### (autoloads nil "snake" "play/snake.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from play/snake.el
 
 (autoload 'snake "snake" "\
@@ -24813,8 +24825,8 @@ Snake mode keybindings:
 
 ;;;***
 \f
-;;;### (autoloads nil "snmp-mode" "net/snmp-mode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "snmp-mode" "net/snmp-mode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from net/snmp-mode.el
 
 (autoload 'snmp-mode "snmp-mode" "\
@@ -24843,7 +24855,7 @@ then `snmpv2-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "solar" "calendar/solar.el" (21291 53104 0
+;;;### (autoloads nil "solar" "calendar/solar.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from calendar/solar.el
 
@@ -24859,8 +24871,8 @@ This function is suitable for execution in an init file.
 
 ;;;***
 \f
-;;;### (autoloads nil "solitaire" "play/solitaire.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "solitaire" "play/solitaire.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from play/solitaire.el
 
 (autoload 'solitaire "solitaire" "\
@@ -24935,7 +24947,7 @@ Pick your favorite shortcuts:
 
 ;;;***
 \f
-;;;### (autoloads nil "sort" "sort.el" (21291 53104 0 0))
+;;;### (autoloads nil "sort" "sort.el" (21240 46395 727291 0))
 ;;; Generated autoloads from sort.el
 (put 'sort-fold-case 'safe-local-variable 'booleanp)
 
@@ -25110,7 +25122,7 @@ is non-nil, it also prints a message describing the number of deletions.
 
 ;;;***
 \f
-;;;### (autoloads nil "spam" "gnus/spam.el" (21291 53104 0 0))
+;;;### (autoloads nil "spam" "gnus/spam.el" (21296 1575 438327 0))
 ;;; Generated autoloads from gnus/spam.el
 
 (autoload 'spam-initialize "spam" "\
@@ -25124,8 +25136,8 @@ installed through `spam-necessary-extra-headers'.
 
 ;;;***
 \f
-;;;### (autoloads nil "spam-report" "gnus/spam-report.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "spam-report" "gnus/spam-report.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from gnus/spam-report.el
 
 (autoload 'spam-report-process-queue "spam-report" "\
@@ -25167,7 +25179,8 @@ Spam reports will be queued with the method used when
 
 ;;;***
 \f
-;;;### (autoloads nil "speedbar" "speedbar.el" (21341 23900 0 0))
+;;;### (autoloads nil "speedbar" "speedbar.el" (21335 37672 97862
+;;;;;;  0))
 ;;; Generated autoloads from speedbar.el
 
 (defalias 'speedbar 'speedbar-frame-mode)
@@ -25191,7 +25204,8 @@ selected.  If the speedbar frame is active, then select the attached frame.
 
 ;;;***
 \f
-;;;### (autoloads nil "spook" "play/spook.el" (21291 53104 0 0))
+;;;### (autoloads nil "spook" "play/spook.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from play/spook.el
 
 (autoload 'spook "spook" "\
@@ -25206,7 +25220,8 @@ Return a vector containing the lines from `spook-phrases-file'.
 
 ;;;***
 \f
-;;;### (autoloads nil "sql" "progmodes/sql.el" (21291 53104 0 0))
+;;;### (autoloads nil "sql" "progmodes/sql.el" (21263 60346 30834
+;;;;;;  928000))
 ;;; Generated autoloads from progmodes/sql.el
 (push (purecopy '(sql 3 4)) package--builtin-versions)
 
@@ -25667,7 +25682,7 @@ buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "srecode" "cedet/srecode.el" (21291 53104 0
+;;;### (autoloads nil "srecode" "cedet/srecode.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from cedet/srecode.el
 (push (purecopy '(srecode 1 2)) package--builtin-versions)
@@ -25675,7 +25690,7 @@ buffer.
 ;;;***
 \f
 ;;;### (autoloads nil "srecode/srt-mode" "cedet/srecode/srt-mode.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from cedet/srecode/srt-mode.el
 
 (autoload 'srecode-template-mode "srecode/srt-mode" "\
@@ -25687,8 +25702,8 @@ Major-mode for writing SRecode macros.
 
 ;;;***
 \f
-;;;### (autoloads nil "starttls" "gnus/starttls.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "starttls" "gnus/starttls.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from gnus/starttls.el
 
 (autoload 'starttls-open-stream "starttls" "\
@@ -25711,7 +25726,7 @@ GnuTLS requires a port number.
 
 ;;;***
 \f
-;;;### (autoloads nil "strokes" "strokes.el" (21291 53104 0 0))
+;;;### (autoloads nil "strokes" "strokes.el" (21271 1974 113743 0))
 ;;; Generated autoloads from strokes.el
 
 (autoload 'strokes-global-set-stroke "strokes" "\
@@ -25824,7 +25839,8 @@ Read a complex stroke and insert its glyph into the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "studly" "play/studly.el" (21291 53104 0 0))
+;;;### (autoloads nil "studly" "play/studly.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from play/studly.el
 
 (autoload 'studlify-region "studly" "\
@@ -25844,18 +25860,20 @@ Studlify-case the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "subword" "progmodes/subword.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "subword" "progmodes/subword.el" (21377 49959
+;;;;;;  896066 0))
 ;;; Generated autoloads from progmodes/subword.el
 
+(define-obsolete-function-alias 'capitalized-words-mode 'subword-mode "24.5")
+
 (autoload 'subword-mode "subword" "\
 Toggle subword movement and editing (Subword mode).
 With a prefix argument ARG, enable Subword mode if ARG is
 positive, and disable it otherwise.  If called from Lisp, enable
 the mode if ARG is omitted or nil.
 
-Subword mode is a buffer-local minor mode.  Enabling it remaps
-word-based editing commands to subword-based commands that handle
+Subword mode is a buffer-local minor mode.  Enabling it changes
+the definition of a word so that word-based commands stop inside
 symbols with mixed uppercase and lowercase letters,
 e.g. \"GtkWidget\", \"EmacsFrameClass\", \"NSGraphicsContext\".
 
@@ -25869,9 +25887,8 @@ called a `subword'.  Here are some examples:
   EmacsFrameClass    =>  \"Emacs\", \"Frame\" and \"Class\"
   NSGraphicsContext  =>  \"NS\", \"Graphics\" and \"Context\"
 
-The subword oriented commands activated in this minor mode recognize
-subwords in a nomenclature to move between subwords and to edit them
-as words.
+This mode changes the definition of a word so that word commands
+treat nomenclature boundaries as word bounaries.
 
 \\{subword-mode-map}
 
@@ -25904,13 +25921,10 @@ With a prefix argument ARG, enable Superword mode if ARG is
 positive, and disable it otherwise.  If called from Lisp, enable
 the mode if ARG is omitted or nil.
 
-Superword mode is a buffer-local minor mode.  Enabling it remaps
-word-based editing commands to superword-based commands that
-treat symbols as words, e.g. \"this_is_a_symbol\".
-
-The superword oriented commands activated in this minor mode
-recognize symbols as superwords to move between superwords and to
-edit them as words.
+Superword mode is a buffer-local minor mode.  Enabling it changes
+the definition of words such that symbols characters are treated
+as parts of words: e.g., in `superword-mode',
+\"this_is_a_symbol\" counts as one word.
 
 \\{superword-mode-map}
 
@@ -25939,8 +25953,8 @@ See `superword-mode' for more information on Superword mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "supercite" "mail/supercite.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "supercite" "mail/supercite.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from mail/supercite.el
 
 (autoload 'sc-cite-original "supercite" "\
@@ -25972,7 +25986,8 @@ and `sc-post-hook' is run after the guts of this function.
 
 ;;;***
 \f
-;;;### (autoloads nil "t-mouse" "t-mouse.el" (21291 53104 0 0))
+;;;### (autoloads nil "t-mouse" "t-mouse.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from t-mouse.el
 
 (define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
@@ -26000,7 +26015,7 @@ It relies on the `gpm' daemon being activated.
 
 ;;;***
 \f
-;;;### (autoloads nil "tabify" "tabify.el" (21291 53104 0 0))
+;;;### (autoloads nil "tabify" "tabify.el" (21240 46395 727291 0))
 ;;; Generated autoloads from tabify.el
 
 (autoload 'untabify "tabify" "\
@@ -26029,7 +26044,7 @@ The variable `tab-width' controls the spacing of tab stops.
 
 ;;;***
 \f
-;;;### (autoloads nil "table" "textmodes/table.el" (21291 53104 0
+;;;### (autoloads nil "table" "textmodes/table.el" (21194 37048 599945
 ;;;;;;  0))
 ;;; Generated autoloads from textmodes/table.el
 
@@ -26622,7 +26637,7 @@ converts a table into plain text without frames.  It is a companion to
 
 ;;;***
 \f
-;;;### (autoloads nil "talk" "talk.el" (21291 53104 0 0))
+;;;### (autoloads nil "talk" "talk.el" (21240 46395 727291 0))
 ;;; Generated autoloads from talk.el
 
 (autoload 'talk-connect "talk" "\
@@ -26637,7 +26652,8 @@ Connect to the Emacs talk group from the current X display or tty frame.
 
 ;;;***
 \f
-;;;### (autoloads nil "tar-mode" "tar-mode.el" (21291 53104 0 0))
+;;;### (autoloads nil "tar-mode" "tar-mode.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from tar-mode.el
 
 (autoload 'tar-mode "tar-mode" "\
@@ -26660,7 +26676,8 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
 
 ;;;***
 \f
-;;;### (autoloads nil "tcl" "progmodes/tcl.el" (21291 53104 0 0))
+;;;### (autoloads nil "tcl" "progmodes/tcl.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from progmodes/tcl.el
 
 (autoload 'tcl-mode "tcl" "\
@@ -26708,7 +26725,8 @@ Prefix argument means invert sense of `tcl-use-smart-word-finder'.
 
 ;;;***
 \f
-;;;### (autoloads nil "telnet" "net/telnet.el" (21291 53104 0 0))
+;;;### (autoloads nil "telnet" "net/telnet.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from net/telnet.el
 
 (autoload 'telnet "telnet" "\
@@ -26733,7 +26751,7 @@ Normally input is edited in Emacs and sent a line at a time.
 
 ;;;***
 \f
-;;;### (autoloads nil "term" "term.el" (21341 23900 0 0))
+;;;### (autoloads nil "term" "term.el" (21437 5802 125919 0))
 ;;; Generated autoloads from term.el
 
 (autoload 'make-term "term" "\
@@ -26775,8 +26793,8 @@ use in that buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "testcover" "emacs-lisp/testcover.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "testcover" "emacs-lisp/testcover.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from emacs-lisp/testcover.el
 
 (autoload 'testcover-this-defun "testcover" "\
@@ -26786,7 +26804,8 @@ Start coverage on function under point.
 
 ;;;***
 \f
-;;;### (autoloads nil "tetris" "play/tetris.el" (21291 53104 0 0))
+;;;### (autoloads nil "tetris" "play/tetris.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from play/tetris.el
 (push (purecopy '(tetris 2 1)) package--builtin-versions)
 
@@ -26811,8 +26830,8 @@ tetris-mode keybindings:
 
 ;;;***
 \f
-;;;### (autoloads nil "tex-mode" "textmodes/tex-mode.el" (21462 12596
-;;;;;;  577539 0))
+;;;### (autoloads nil "tex-mode" "textmodes/tex-mode.el" (21462 9001
+;;;;;;  456449 0))
 ;;; Generated autoloads from textmodes/tex-mode.el
 
 (defvar tex-shell-file-name nil "\
@@ -27113,8 +27132,8 @@ Major mode to edit DocTeX files.
 
 ;;;***
 \f
-;;;### (autoloads nil "texinfmt" "textmodes/texinfmt.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "texinfmt" "textmodes/texinfmt.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from textmodes/texinfmt.el
 
 (autoload 'texinfo-format-buffer "texinfmt" "\
@@ -27153,8 +27172,8 @@ if large.  You can use `Info-split' to do this manually.
 
 ;;;***
 \f
-;;;### (autoloads nil "texinfo" "textmodes/texinfo.el" (21412 6211
-;;;;;;  413773 0))
+;;;### (autoloads nil "texinfo" "textmodes/texinfo.el" (21414 44327
+;;;;;;  790846 0))
 ;;; Generated autoloads from textmodes/texinfo.el
 
 (defvar texinfo-open-quote (purecopy "``") "\
@@ -27238,8 +27257,8 @@ value of `texinfo-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "thai-util" "language/thai-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "thai-util" "language/thai-util.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from language/thai-util.el
 
 (autoload 'thai-compose-region "thai-util" "\
@@ -27266,7 +27285,8 @@ Compose Thai characters in the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "thingatpt" "thingatpt.el" (21291 53104 0 0))
+;;;### (autoloads nil "thingatpt" "thingatpt.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from thingatpt.el
 
 (autoload 'forward-thing "thingatpt" "\
@@ -27330,7 +27350,7 @@ Return the Lisp list at point, or nil if none is found.
 
 ;;;***
 \f
-;;;### (autoloads nil "thumbs" "thumbs.el" (21291 53104 0 0))
+;;;### (autoloads nil "thumbs" "thumbs.el" (21240 46395 727291 0))
 ;;; Generated autoloads from thumbs.el
 
 (autoload 'thumbs-find-thumb "thumbs" "\
@@ -27364,8 +27384,8 @@ In dired, call the setroot program on the image at point.
 
 ;;;***
 \f
-;;;### (autoloads nil "tibet-util" "language/tibet-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "tibet-util" "language/tibet-util.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from language/tibet-util.el
 
 (autoload 'tibetan-char-p "tibet-util" "\
@@ -27438,10 +27458,10 @@ See also docstring of the function tibetan-compose-region.
 
 ;;;***
 \f
-;;;### (autoloads nil "tildify" "textmodes/tildify.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "tildify" "textmodes/tildify.el" (21393 38187
+;;;;;;  675040 0))
 ;;; Generated autoloads from textmodes/tildify.el
-(push (purecopy '(tildify 4 5)) package--builtin-versions)
+(push (purecopy '(tildify 4 5 3)) package--builtin-versions)
 
 (autoload 'tildify-region "tildify" "\
 Add hard spaces in the region between BEG and END.
@@ -27449,8 +27469,10 @@ See variables `tildify-pattern-alist', `tildify-string-alist', and
 `tildify-ignored-environments-alist' for information about configuration
 parameters.
 This function performs no refilling of the changed text.
+If DONT-ASK is set, or called interactively with prefix argument, user
+won't be prompted for confirmation of each substitution.
 
-\(fn BEG END)" t nil)
+\(fn BEG END &optional DONT-ASK)" t nil)
 
 (autoload 'tildify-buffer "tildify" "\
 Add hard spaces in the current buffer.
@@ -27458,12 +27480,14 @@ See variables `tildify-pattern-alist', `tildify-string-alist', and
 `tildify-ignored-environments-alist' for information about configuration
 parameters.
 This function performs no refilling of the changed text.
+If DONT-ASK is set, or called interactively with prefix argument, user
+won't be prompted for confirmation of each substitution.
 
-\(fn)" t nil)
+\(fn &optional DONT-ASK)" t nil)
 
 ;;;***
 \f
-;;;### (autoloads nil "time" "time.el" (21291 53104 0 0))
+;;;### (autoloads nil "time" "time.el" (21240 46395 727291 0))
 ;;; Generated autoloads from time.el
 
 (defvar display-time-day-and-date nil "\
@@ -27525,8 +27549,8 @@ Return a string giving the duration of the Emacs initialization.
 
 ;;;***
 \f
-;;;### (autoloads nil "time-date" "calendar/time-date.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "time-date" "calendar/time-date.el" (21361
+;;;;;;  61732 646433 0))
 ;;; Generated autoloads from calendar/time-date.el
 
 (autoload 'date-to-time "time-date" "\
@@ -27635,9 +27659,14 @@ This function does not work for SECONDS greater than `most-positive-fixnum'.
 
 \(fn STRING SECONDS)" nil nil)
 
+(autoload 'seconds-to-string "time-date" "\
+Convert the time interval in seconds to a short string.
+
+\(fn DELAY)" nil nil)
+
 ;;;***
 \f
-;;;### (autoloads nil "time-stamp" "time-stamp.el" (21291 53104 0
+;;;### (autoloads nil "time-stamp" "time-stamp.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from time-stamp.el
 (put 'time-stamp-format 'safe-local-variable 'stringp)
@@ -27678,8 +27707,8 @@ With ARG, turn time stamping on if and only if arg is positive.
 
 ;;;***
 \f
-;;;### (autoloads nil "timeclock" "calendar/timeclock.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "timeclock" "calendar/timeclock.el" (21222
+;;;;;;  16439 978802 0))
 ;;; Generated autoloads from calendar/timeclock.el
 (push (purecopy '(timeclock 2 6 1)) package--builtin-versions)
 
@@ -27789,7 +27818,7 @@ relative only to the time worked today, and not to past time.
 ;;;***
 \f
 ;;;### (autoloads nil "titdic-cnv" "international/titdic-cnv.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21187 63826 213216 0))
 ;;; Generated autoloads from international/titdic-cnv.el
 
 (autoload 'titdic-convert "titdic-cnv" "\
@@ -27811,7 +27840,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\".
 
 ;;;***
 \f
-;;;### (autoloads nil "tmm" "tmm.el" (21291 53104 0 0))
+;;;### (autoloads nil "tmm" "tmm.el" (21240 46395 727291 0))
 ;;; Generated autoloads from tmm.el
  (define-key global-map "\M-`" 'tmm-menubar)
  (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
@@ -27853,8 +27882,8 @@ Its value should be an event that has a binding in MENU.
 
 ;;;***
 \f
-;;;### (autoloads nil "todo-mode" "calendar/todo-mode.el" (21459
-;;;;;;  36408 264096 0))
+;;;### (autoloads nil "todo-mode" "calendar/todo-mode.el" (21462
+;;;;;;  9001 456449 0))
 ;;; Generated autoloads from calendar/todo-mode.el
 
 (autoload 'todo-show "todo-mode" "\
@@ -27921,7 +27950,8 @@ Mode for displaying and reprioritizing top priority Todo.
 
 ;;;***
 \f
-;;;### (autoloads nil "tool-bar" "tool-bar.el" (21291 53104 0 0))
+;;;### (autoloads nil "tool-bar" "tool-bar.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from tool-bar.el
 
 (autoload 'toggle-tool-bar-mode-from-frame "tool-bar" "\
@@ -27991,73 +28021,8 @@ holds a keymap.
 
 ;;;***
 \f
-;;;### (autoloads nil "tpu-edt" "emulation/tpu-edt.el" (21291 53104
-;;;;;;  0 0))
-;;; Generated autoloads from emulation/tpu-edt.el
-(push (purecopy '(tpu-edt 4 5)) package--builtin-versions)
-
-(defvar tpu-edt-mode nil "\
-Non-nil if Tpu-Edt mode is enabled.
-See the command `tpu-edt-mode' for a description of this minor mode.
-Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `tpu-edt-mode'.")
-
-(custom-autoload 'tpu-edt-mode "tpu-edt" nil)
-
-(autoload 'tpu-edt-mode "tpu-edt" "\
-Toggle TPU/edt emulation on or off.
-With a prefix argument ARG, enable the mode if ARG is positive,
-and disable it otherwise.  If called from Lisp, enable the mode
-if ARG is omitted or nil.
-
-\(fn &optional ARG)" t nil)
-
-(defalias 'tpu-edt 'tpu-edt-on)
-
-(autoload 'tpu-edt-on "tpu-edt" "\
-Turn on TPU/edt emulation.
-
-\(fn)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "tpu-mapper" "emulation/tpu-mapper.el" (21291
-;;;;;;  53104 0 0))
-;;; Generated autoloads from emulation/tpu-mapper.el
-
-(autoload 'tpu-mapper "tpu-mapper" "\
-Create an Emacs lisp file defining the TPU-edt keypad for X-windows.
-
-This command displays an instruction screen showing the TPU-edt keypad
-and asks you to press the TPU-edt editing keys.  It uses the keys you
-press to create an Emacs Lisp file that will define a TPU-edt keypad
-for your X server.  You can even re-arrange the standard EDT keypad to
-suit your tastes (or to cope with those silly Sun and PC keypads).
-
-Finally, you will be prompted for the name of the file to store the key
-definitions.  If you chose the default, TPU-edt will find it and load it
-automatically.  If you specify a different file name, you will need to
-set the variable ``tpu-xkeys-file'' before starting TPU-edt.  Here's how
-you might go about doing that in your init file.
-
-  (setq tpu-xkeys-file (expand-file-name \"~/.my-emacs-x-keys\"))
-  (tpu-edt)
-
-Known Problems:
-
-Sometimes, tpu-mapper will ignore a key you press, and just continue to
-prompt for the same key.  This can happen when your window manager sucks
-up the key and doesn't pass it on to Emacs, or it could be an Emacs bug.
-Either way, there's nothing that tpu-mapper can do about it.  You must
-press RETURN, to skip the current key and continue.  Later, you and/or
-your local X guru can try to figure out why the key is being ignored.
-
-\(fn)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "tq" "emacs-lisp/tq.el" (21291 53104 0 0))
+;;;### (autoloads nil "tq" "emacs-lisp/tq.el" (21240 46395 727291
+;;;;;;  0))
 ;;; Generated autoloads from emacs-lisp/tq.el
 
 (autoload 'tq-create "tq" "\
@@ -28070,8 +28035,8 @@ to a tcp server on another machine.
 
 ;;;***
 \f
-;;;### (autoloads nil "trace" "emacs-lisp/trace.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "trace" "emacs-lisp/trace.el" (21240 46395
+;;;;;;  727291 0))
 ;;; Generated autoloads from emacs-lisp/trace.el
 
 (defvar trace-buffer "*trace-output*" "\
@@ -28116,8 +28081,7 @@ the output buffer or changing the window configuration.
 
 ;;;***
 \f
-;;;### (autoloads nil "tramp" "net/tramp.el" (21389 44725 461529
-;;;;;;  0))
+;;;### (autoloads nil "tramp" "net/tramp.el" (21429 11690 49391 0))
 ;;; Generated autoloads from net/tramp.el
 
 (defvar tramp-mode t "\
@@ -28232,8 +28196,8 @@ Discard Tramp from loading remote files.
 
 ;;;***
 \f
-;;;### (autoloads nil "tramp-ftp" "net/tramp-ftp.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "tramp-ftp" "net/tramp-ftp.el" (21406 50214
+;;;;;;  284651 0))
 ;;; Generated autoloads from net/tramp-ftp.el
 
 (autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\
@@ -28243,7 +28207,7 @@ Discard Tramp from loading remote files.
 
 ;;;***
 \f
-;;;### (autoloads nil "tutorial" "tutorial.el" (21464 54324 409040
+;;;### (autoloads nil "tutorial" "tutorial.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from tutorial.el
 
@@ -28268,8 +28232,8 @@ resumed later.
 
 ;;;***
 \f
-;;;### (autoloads nil "tv-util" "language/tv-util.el" (20352 35897
-;;;;;;  0 0))
+;;;### (autoloads nil "tv-util" "language/tv-util.el" (20355 10021
+;;;;;;  546955 0))
 ;;; Generated autoloads from language/tv-util.el
 
 (autoload 'tai-viet-composition-function "tv-util" "\
@@ -28279,8 +28243,8 @@ resumed later.
 
 ;;;***
 \f
-;;;### (autoloads nil "two-column" "textmodes/two-column.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "two-column" "textmodes/two-column.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from textmodes/two-column.el
  (autoload '2C-command "two-column" () t 'keymap)
  (global-set-key "\C-x6" '2C-command)
@@ -28327,7 +28291,7 @@ First column's text    sSs  Second column's text
 
 ;;;***
 \f
-;;;### (autoloads nil "type-break" "type-break.el" (21291 53104 0
+;;;### (autoloads nil "type-break" "type-break.el" (21222 16439 978802
 ;;;;;;  0))
 ;;; Generated autoloads from type-break.el
 
@@ -28460,7 +28424,7 @@ FRAC should be the inverse of the fractional value; for example, a value of
 
 ;;;***
 \f
-;;;### (autoloads nil "uce" "mail/uce.el" (21291 53104 0 0))
+;;;### (autoloads nil "uce" "mail/uce.el" (21199 54969 178188 0))
 ;;; Generated autoloads from mail/uce.el
 
 (autoload 'uce-reply-to-uce "uce" "\
@@ -28474,7 +28438,7 @@ You might need to set `uce-mail-reader' before using this.
 ;;;***
 \f
 ;;;### (autoloads nil "ucs-normalize" "international/ucs-normalize.el"
-;;;;;;  (21291 53104 0 0))
+;;;;;;  (21194 37048 599945 0))
 ;;; Generated autoloads from international/ucs-normalize.el
 
 (autoload 'ucs-normalize-NFD-region "ucs-normalize" "\
@@ -28539,8 +28503,8 @@ Normalize the string STR by the Unicode NFC and Mac OS's HFS Plus.
 
 ;;;***
 \f
-;;;### (autoloads nil "underline" "textmodes/underline.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "underline" "textmodes/underline.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from textmodes/underline.el
 
 (autoload 'underline-region "underline" "\
@@ -28560,7 +28524,7 @@ which specify the range to operate on.
 
 ;;;***
 \f
-;;;### (autoloads nil "unrmail" "mail/unrmail.el" (21291 53104 0
+;;;### (autoloads nil "unrmail" "mail/unrmail.el" (21240 46395 727291
 ;;;;;;  0))
 ;;; Generated autoloads from mail/unrmail.el
 
@@ -28581,8 +28545,8 @@ The variable `unrmail-mbox-format' controls which mbox format to use.
 
 ;;;***
 \f
-;;;### (autoloads nil "unsafep" "emacs-lisp/unsafep.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "unsafep" "emacs-lisp/unsafep.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from emacs-lisp/unsafep.el
 
 (autoload 'unsafep "unsafep" "\
@@ -28594,7 +28558,7 @@ UNSAFEP-VARS is a list of symbols with local bindings.
 
 ;;;***
 \f
-;;;### (autoloads nil "url" "url/url.el" (21291 53104 0 0))
+;;;### (autoloads nil "url" "url/url.el" (21302 6641 882267 783000))
 ;;; Generated autoloads from url/url.el
 
 (autoload 'url-retrieve "url" "\
@@ -28641,7 +28605,7 @@ no further processing).  URL is either a string or a parsed URL.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-auth" "url/url-auth.el" (21291 53104 0
+;;;### (autoloads nil "url-auth" "url/url-auth.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from url/url-auth.el
 
@@ -28683,8 +28647,8 @@ RATING   a rating between 1 and 10 of the strength of the authentication.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-cache" "url/url-cache.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "url-cache" "url/url-cache.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from url/url-cache.el
 
 (autoload 'url-store-in-cache "url-cache" "\
@@ -28705,7 +28669,8 @@ Extract FNAM from the local disk cache.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-cid" "url/url-cid.el" (21291 53104 0 0))
+;;;### (autoloads nil "url-cid" "url/url-cid.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from url/url-cid.el
 
 (autoload 'url-cid "url-cid" "\
@@ -28715,7 +28680,8 @@ Extract FNAM from the local disk cache.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-dav" "url/url-dav.el" (21291 53104 0 0))
+;;;### (autoloads nil "url-dav" "url/url-dav.el" (21302 6606 390237
+;;;;;;  377000))
 ;;; Generated autoloads from url/url-dav.el
 
 (autoload 'url-dav-supported-p "url-dav" "\
@@ -28749,7 +28715,7 @@ added to this list, so most requests can just pass in nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-file" "url/url-file.el" (21291 53104 0
+;;;### (autoloads nil "url-file" "url/url-file.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from url/url-file.el
 
@@ -28760,7 +28726,8 @@ Handle file: and ftp: URLs.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-gw" "url/url-gw.el" (21291 53104 0 0))
+;;;### (autoloads nil "url-gw" "url/url-gw.el" (21302 6606 390237
+;;;;;;  377000))
 ;;; Generated autoloads from url/url-gw.el
 
 (autoload 'url-gateway-nslookup-host "url-gw" "\
@@ -28778,8 +28745,8 @@ Might do a non-blocking connection; use `process-status' to check.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-handlers" "url/url-handlers.el" (21420
-;;;;;;  315 511456 0))
+;;;### (autoloads nil "url-handlers" "url/url-handlers.el" (21419
+;;;;;;  62246 751914 0))
 ;;; Generated autoloads from url/url-handlers.el
 
 (defvar url-handler-mode nil "\
@@ -28833,7 +28800,7 @@ accessible.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-http" "url/url-http.el" (21420 315 511456
+;;;### (autoloads nil "url-http" "url/url-http.el" (21419 62246 751914
 ;;;;;;  0))
 ;;; Generated autoloads from url/url-http.el
  (autoload 'url-default-expander "url-expand")
@@ -28846,7 +28813,8 @@ accessible.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-irc" "url/url-irc.el" (21291 53104 0 0))
+;;;### (autoloads nil "url-irc" "url/url-irc.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from url/url-irc.el
 
 (autoload 'url-irc "url-irc" "\
@@ -28856,7 +28824,7 @@ accessible.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-ldap" "url/url-ldap.el" (21291 53104 0
+;;;### (autoloads nil "url-ldap" "url/url-ldap.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from url/url-ldap.el
 
@@ -28870,8 +28838,8 @@ URL can be a URL string, or a URL vector of the type returned by
 
 ;;;***
 \f
-;;;### (autoloads nil "url-mailto" "url/url-mailto.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "url-mailto" "url/url-mailto.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from url/url-mailto.el
 
 (autoload 'url-mail "url-mailto" "\
@@ -28886,7 +28854,7 @@ Handle the mailto: URL syntax.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-misc" "url/url-misc.el" (21291 53104 0
+;;;### (autoloads nil "url-misc" "url/url-misc.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from url/url-misc.el
 
@@ -28918,8 +28886,8 @@ Fetch a data URL (RFC 2397).
 
 ;;;***
 \f
-;;;### (autoloads nil "url-news" "url/url-news.el" (21291 53104 0
-;;;;;;  0))
+;;;### (autoloads nil "url-news" "url/url-news.el" (21301 65237 320114
+;;;;;;  350000))
 ;;; Generated autoloads from url/url-news.el
 
 (autoload 'url-news "url-news" "\
@@ -28934,7 +28902,8 @@ Fetch a data URL (RFC 2397).
 
 ;;;***
 \f
-;;;### (autoloads nil "url-ns" "url/url-ns.el" (21291 53104 0 0))
+;;;### (autoloads nil "url-ns" "url/url-ns.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from url/url-ns.el
 
 (autoload 'isPlainHostName "url-ns" "\
@@ -28974,8 +28943,8 @@ Fetch a data URL (RFC 2397).
 
 ;;;***
 \f
-;;;### (autoloads nil "url-parse" "url/url-parse.el" (21346 62196
-;;;;;;  0 0))
+;;;### (autoloads nil "url-parse" "url/url-parse.el" (21350 58112
+;;;;;;  380040 0))
 ;;; Generated autoloads from url/url-parse.el
 
 (autoload 'url-recreate-url "url-parse" "\
@@ -29026,8 +28995,8 @@ parses to
 
 ;;;***
 \f
-;;;### (autoloads nil "url-privacy" "url/url-privacy.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "url-privacy" "url/url-privacy.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from url/url-privacy.el
 
 (autoload 'url-setup-privacy-info "url-privacy" "\
@@ -29037,8 +29006,8 @@ Setup variables that expose info about you and your system.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-queue" "url/url-queue.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "url-queue" "url/url-queue.el" (21193 16180
+;;;;;;  875828 0))
 ;;; Generated autoloads from url/url-queue.el
 
 (autoload 'url-queue-retrieve "url-queue" "\
@@ -29052,7 +29021,26 @@ The variable `url-queue-timeout' sets a timeout.
 
 ;;;***
 \f
-;;;### (autoloads nil "url-util" "url/url-util.el" (21291 53104 0
+;;;### (autoloads nil "url-tramp" "url/url-tramp.el" (21307 58279
+;;;;;;  19956 0))
+;;; Generated autoloads from url/url-tramp.el
+
+(defvar url-tramp-protocols '("ftp" "ssh" "scp" "rsync" "telnet") "\
+List of URL protocols the work is handled by Tramp.
+They must also be covered by `url-handler-regexp'.")
+
+(custom-autoload 'url-tramp-protocols "url-tramp" t)
+
+(autoload 'url-tramp-file-handler "url-tramp" "\
+Function called from the `file-name-handler-alist' routines.
+OPERATION is what needs to be done.  ARGS are the arguments that
+would have been passed to OPERATION.
+
+\(fn OPERATION &rest ARGS)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads nil "url-util" "url/url-util.el" (21364 37926 837230
 ;;;;;;  0))
 ;;; Generated autoloads from url/url-util.el
 
@@ -29221,7 +29209,8 @@ This uses `url-current-object', set locally to the buffer.
 
 ;;;***
 \f
-;;;### (autoloads nil "userlock" "userlock.el" (21291 53104 0 0))
+;;;### (autoloads nil "userlock" "userlock.el" (21260 57764 872288
+;;;;;;  374000))
 ;;; Generated autoloads from userlock.el
 
 (autoload 'ask-user-about-lock "userlock" "\
@@ -29249,8 +29238,8 @@ The buffer in question is current when this function is called.
 
 ;;;***
 \f
-;;;### (autoloads nil "utf-7" "international/utf-7.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "utf-7" "international/utf-7.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from international/utf-7.el
 
 (autoload 'utf-7-post-read-conversion "utf-7" "\
@@ -29275,7 +29264,7 @@ The buffer in question is current when this function is called.
 
 ;;;***
 \f
-;;;### (autoloads nil "utf7" "gnus/utf7.el" (21291 53104 0 0))
+;;;### (autoloads nil "utf7" "gnus/utf7.el" (21187 63826 213216 0))
 ;;; Generated autoloads from gnus/utf7.el
 
 (autoload 'utf7-encode "utf7" "\
@@ -29285,8 +29274,8 @@ Encode UTF-7 STRING.  Use IMAP modification if FOR-IMAP is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "uudecode" "mail/uudecode.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "uudecode" "mail/uudecode.el" (21187 63826
+;;;;;;  213216 0))
 ;;; Generated autoloads from mail/uudecode.el
 
 (autoload 'uudecode-decode-region-external "uudecode" "\
@@ -29310,7 +29299,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc" "vc/vc.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc" "vc/vc.el" (21332 61483 90708 0))
 ;;; Generated autoloads from vc/vc.el
 
 (defvar vc-checkout-hook nil "\
@@ -29418,6 +29407,12 @@ saving the buffer.
 
 \(fn HISTORIC &optional NOT-URGENT)" t nil)
 
+(autoload 'vc-root-dir "vc" "\
+Return the root directory for the current VC tree.
+Return nil if the root directory cannot be identified.
+
+\(fn)" nil nil)
+
 (autoload 'vc-revision-other-window "vc" "\
 Visit revision REV of the current file in another window.
 If the current file is named `F', the revision is named `F.~REV~'.
@@ -29591,8 +29586,8 @@ Return the branch part of a revision number REV.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-annotate" "vc/vc-annotate.el" (21291 53104
-;;;;;;  0 0))
+;;;### (autoloads nil "vc-annotate" "vc/vc-annotate.el" (21435 50471
+;;;;;;  547961 0))
 ;;; Generated autoloads from vc/vc-annotate.el
 
 (autoload 'vc-annotate "vc-annotate" "\
@@ -29624,12 +29619,15 @@ Customization variables:
 mode-specific menu.  `vc-annotate-color-map' and
 `vc-annotate-very-old-color' define the mapping of time to colors.
 `vc-annotate-background' specifies the background color.
+`vc-annotate-background-mode' specifies whether the color map
+should be applied to the background or to the foreground.
 
 \(fn FILE REV &optional DISPLAY-MODE BUF MOVE-POINT-TO VC-BK)" t nil)
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc-arch" "vc/vc-arch.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from vc/vc-arch.el
  (defun vc-arch-registered (file)
   (if (vc-find-root file "{arch}/=tagging-method")
@@ -29639,7 +29637,8 @@ mode-specific menu.  `vc-annotate-color-map' and
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc-bzr" "vc/vc-bzr.el" (21452 59559 901066
+;;;;;;  0))
 ;;; Generated autoloads from vc/vc-bzr.el
 
 (defconst vc-bzr-admin-dirname ".bzr" "\
@@ -29655,7 +29654,8 @@ Name of the format file in a .bzr directory.")
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc-cvs" "vc/vc-cvs.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from vc/vc-cvs.el
 (defun vc-cvs-registered (f)
   "Return non-nil if file F is registered with CVS."
@@ -29666,7 +29666,8 @@ Name of the format file in a .bzr directory.")
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-dir" "vc/vc-dir.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc-dir" "vc/vc-dir.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from vc/vc-dir.el
 
 (autoload 'vc-dir "vc-dir" "\
@@ -29690,8 +29691,8 @@ These are the commands available for use in the file status buffer:
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-dispatcher" "vc/vc-dispatcher.el" (21444
-;;;;;;  12002 871574 911000))
+;;;### (autoloads nil "vc-dispatcher" "vc/vc-dispatcher.el" (21446
+;;;;;;  45134 152348 0))
 ;;; Generated autoloads from vc/vc-dispatcher.el
 
 (autoload 'vc-do-command "vc-dispatcher" "\
@@ -29714,7 +29715,7 @@ case, and the process object in the asynchronous case.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-git" "vc/vc-git.el" (21425 18234 73199
+;;;### (autoloads nil "vc-git" "vc/vc-git.el" (21429 11690 49391
 ;;;;;;  0))
 ;;; Generated autoloads from vc/vc-git.el
  (defun vc-git-registered (file)
@@ -29726,7 +29727,7 @@ case, and the process object in the asynchronous case.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (21394 62654 575695 0))
+;;;### (autoloads nil "vc-hg" "vc/vc-hg.el" (21396 14374 24888 0))
 ;;; Generated autoloads from vc/vc-hg.el
  (defun vc-hg-registered (file)
   "Return non-nil if FILE is registered with hg."
@@ -29737,7 +29738,8 @@ case, and the process object in the asynchronous case.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc-mtn" "vc/vc-mtn.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from vc/vc-mtn.el
 
 (defconst vc-mtn-admin-dir "_MTN" "\
@@ -29753,7 +29755,7 @@ Name of the monotone directory's format file.")
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-rcs" "vc/vc-rcs.el" (21372 35662 356409
+;;;### (autoloads nil "vc-rcs" "vc/vc-rcs.el" (21379 5287 607434
 ;;;;;;  0))
 ;;; Generated autoloads from vc/vc-rcs.el
 
@@ -29767,7 +29769,8 @@ For a description of possible values, see `vc-check-master-templates'.")
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-sccs" "vc/vc-sccs.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc-sccs" "vc/vc-sccs.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from vc/vc-sccs.el
 
 (defvar vc-sccs-master-templates (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\
@@ -29785,7 +29788,8 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (21291 53104 0 0))
+;;;### (autoloads nil "vc-svn" "vc/vc-svn.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from vc/vc-svn.el
  (defun vc-svn-registered (f)
   (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
@@ -29798,8 +29802,8 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
 
 ;;;***
 \f
-;;;### (autoloads nil "vera-mode" "progmodes/vera-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "vera-mode" "progmodes/vera-mode.el" (21383
+;;;;;;  2343 498187 0))
 ;;; Generated autoloads from progmodes/vera-mode.el
 (push (purecopy '(vera-mode 2 28)) package--builtin-versions)
  (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'")  'vera-mode))
@@ -29858,7 +29862,7 @@ Key bindings:
 ;;;***
 \f
 ;;;### (autoloads nil "verilog-mode" "progmodes/verilog-mode.el"
-;;;;;;  (21346 62196 0 0))
+;;;;;;  (21388 20265 495157 0))
 ;;; Generated autoloads from progmodes/verilog-mode.el
 
 (autoload 'verilog-mode "verilog-mode" "\
@@ -29997,8 +30001,8 @@ Key bindings specific to `verilog-mode-map' are:
 
 ;;;***
 \f
-;;;### (autoloads nil "vhdl-mode" "progmodes/vhdl-mode.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "vhdl-mode" "progmodes/vhdl-mode.el" (21305
+;;;;;;  16557 836987 0))
 ;;; Generated autoloads from progmodes/vhdl-mode.el
 
 (autoload 'vhdl-mode "vhdl-mode" "\
@@ -30552,60 +30556,8 @@ Key bindings:
 
 ;;;***
 \f
-;;;### (autoloads nil "vi" "emulation/vi.el" (21291 53104 0 0))
-;;; Generated autoloads from emulation/vi.el
-
-(autoload 'vi-mode "vi" "\
-Major mode that acts like the `vi' editor.
-The purpose of this mode is to provide you the combined power of vi (namely,
-the \"cross product\" effect of commands and repeat last changes) and Emacs.
-
-This command redefines nearly all keys to look like vi commands.
-It records the previous major mode, and any vi command for input
-\(`i', `a', `s', etc.) switches back to that mode.
-Thus, ordinary Emacs (in whatever major mode you had been using)
-is \"input\" mode as far as vi is concerned.
-
-To get back into vi from \"input\" mode, you must issue this command again.
-Therefore, it is recommended that you assign it to a key.
-
-Major differences between this mode and real vi :
-
-* Limitations and unsupported features
-  - Search patterns with line offset (e.g. /pat/+3 or /pat/z.) are
-    not supported.
-  - Ex commands are not implemented; try ':' to get some hints.
-  - No line undo (i.e. the 'U' command), but multi-undo is a standard feature.
-
-* Modifications
-  - The stopping positions for some point motion commands (word boundary,
-    pattern search) are slightly different from standard 'vi'.
-    Also, no automatic wrap around at end of buffer for pattern searching.
-  - Since changes are done in two steps (deletion then insertion), you need
-    to undo twice to completely undo a change command.  But this is not needed
-    for undoing a repeated change command.
-  - No need to set/unset 'magic', to search for a string with regular expr
-    in it just put a prefix arg for the search commands.  Replace cmds too.
-  - ^R is bound to incremental backward search, so use ^L to redraw screen.
-
-* Extensions
-  - Some standard (or modified) Emacs commands were integrated, such as
-    incremental search, query replace, transpose objects, and keyboard macros.
-  - In command state, ^X links to the 'ctl-x-map', and ESC can be linked to
-    esc-map or set undefined.  These can give you the full power of Emacs.
-  - See vi-com-map for those keys that are extensions to standard vi, e.g.
-    `vi-name-last-change-or-macro', `vi-verify-spelling', `vi-locate-def',
-    `vi-mark-region', and 'vi-quote-words'.  Some of them are quite handy.
-  - Use \\[vi-switch-mode] to switch among different modes quickly.
-
-Syntax table and abbrevs while in vi mode remain as they were in Emacs.
-
-\(fn)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "viet-util" "language/viet-util.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "viet-util" "language/viet-util.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from language/viet-util.el
 
 (autoload 'viet-encode-viscii-char "viet-util" "\
@@ -30649,7 +30601,7 @@ Convert Vietnamese characters of the current buffer to `VIQR' mnemonics.
 
 ;;;***
 \f
-;;;### (autoloads nil "view" "view.el" (21452 63160 995987 0))
+;;;### (autoloads nil "view" "view.el" (21452 59559 901066 0))
 ;;; Generated autoloads from view.el
 
 (defvar view-remove-frame-by-deleting t "\
@@ -30905,22 +30857,7 @@ Exit View mode and make the current buffer editable.
 
 ;;;***
 \f
-;;;### (autoloads nil "vip" "emulation/vip.el" (21291 53104 0 0))
-;;; Generated autoloads from emulation/vip.el
-
-(autoload 'vip-setup "vip" "\
-Set up bindings for C-x 7 and C-z that are useful for VIP users.
-
-\(fn)" nil nil)
-
-(autoload 'vip-mode "vip" "\
-Turn on VIP emulation of VI.
-
-\(fn)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "viper" "emulation/viper.el" (21423 62909 33477
+;;;### (autoloads nil "viper" "emulation/viper.el" (21429 11690 49391
 ;;;;;;  0))
 ;;; Generated autoloads from emulation/viper.el
 (push (purecopy '(viper 3 14 1)) package--builtin-versions)
@@ -30938,8 +30875,8 @@ Turn on Viper emulation of Vi in Emacs. See Info node `(viper)Top'.
 
 ;;;***
 \f
-;;;### (autoloads nil "warnings" "emacs-lisp/warnings.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "warnings" "emacs-lisp/warnings.el" (21240
+;;;;;;  46395 727291 0))
 ;;; Generated autoloads from emacs-lisp/warnings.el
 
 (defvar warning-prefix-function nil "\
@@ -31029,7 +30966,7 @@ this is equivalent to `display-warning', using
 
 ;;;***
 \f
-;;;### (autoloads nil "wdired" "wdired.el" (21291 53104 0 0))
+;;;### (autoloads nil "wdired" "wdired.el" (21187 63826 213216 0))
 ;;; Generated autoloads from wdired.el
 (push (purecopy '(wdired 2 0)) package--builtin-versions)
 
@@ -31047,7 +30984,8 @@ See `wdired-mode'.
 
 ;;;***
 \f
-;;;### (autoloads nil "webjump" "net/webjump.el" (21291 53104 0 0))
+;;;### (autoloads nil "webjump" "net/webjump.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from net/webjump.el
 
 (autoload 'webjump "webjump" "\
@@ -31063,8 +31001,8 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
 
 ;;;***
 \f
-;;;### (autoloads nil "which-func" "progmodes/which-func.el" (21291
-;;;;;;  53104 0 0))
+;;;### (autoloads nil "which-func" "progmodes/which-func.el" (21187
+;;;;;;  63826 213216 0))
 ;;; Generated autoloads from progmodes/which-func.el
  (put 'which-func-format 'risky-local-variable t)
  (put 'which-func-current 'risky-local-variable t)
@@ -31094,7 +31032,7 @@ in certain major modes.
 
 ;;;***
 \f
-;;;### (autoloads nil "whitespace" "whitespace.el" (21291 53104 0
+;;;### (autoloads nil "whitespace" "whitespace.el" (21384 23211 329821
 ;;;;;;  0))
 ;;; Generated autoloads from whitespace.el
 (push (purecopy '(whitespace 13 2 2)) package--builtin-versions)
@@ -31409,43 +31347,7 @@ documentation.
 (autoload 'whitespace-report "whitespace" "\
 Report some whitespace problems in buffer.
 
-Return nil if there is no whitespace problem; otherwise, return
-non-nil.
-
-If FORCE is non-nil or \\[universal-argument] was pressed just
-before calling `whitespace-report' interactively, it forces
-`whitespace-style' to have:
-
-   empty
-   trailing
-   indentation
-   space-before-tab
-   space-after-tab
-
-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
-
-Report if some of the following whitespace problems exist:
-
-* If `indent-tabs-mode' is non-nil:
-   empty               1. empty lines at beginning of buffer.
-   empty               2. empty lines at end of buffer.
-   trailing            3. SPACEs or TABs at end of line.
-   indentation         4. 8 or more SPACEs at beginning of line.
-   space-before-tab    5. SPACEs before TAB.
-   space-after-tab     6. 8 or more SPACEs after TAB.
-
-* If `indent-tabs-mode' is nil:
-   empty               1. empty lines at beginning of buffer.
-   empty               2. empty lines at end of buffer.
-   trailing            3. SPACEs or TABs at end of line.
-   indentation         4. TABS at beginning of line.
-   space-before-tab    5. SPACEs before TAB.
-   space-after-tab     6. 8 or more SPACEs after TAB.
-
-See `whitespace-style' for documentation.
-See also `whitespace-cleanup' and `whitespace-cleanup-region' for
-cleaning up these problems.
+Perform `whitespace-report-region' on the current buffer.
 
 \(fn &optional FORCE REPORT-IF-BOGUS)" t nil)
 
@@ -31460,13 +31362,14 @@ before calling `whitespace-report-region' interactively, it
 forces `whitespace-style' to have:
 
    empty
+   trailing
    indentation
    space-before-tab
-   trailing
    space-after-tab
 
-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
+If REPORT-IF-BOGUS is t, it reports only when there are any
+whitespace problems in buffer; if it is `never', it does not
+report problems.
 
 Report if some of the following whitespace problems exist:
 
@@ -31494,7 +31397,7 @@ cleaning up these problems.
 
 ;;;***
 \f
-;;;### (autoloads nil "wid-browse" "wid-browse.el" (21291 53104 0
+;;;### (autoloads nil "wid-browse" "wid-browse.el" (21187 63826 213216
 ;;;;;;  0))
 ;;; Generated autoloads from wid-browse.el
 
@@ -31523,7 +31426,8 @@ if ARG is omitted or nil.
 
 ;;;***
 \f
-;;;### (autoloads nil "wid-edit" "wid-edit.el" (21291 53104 0 0))
+;;;### (autoloads nil "wid-edit" "wid-edit.el" (21414 44327 790846
+;;;;;;  0))
 ;;; Generated autoloads from wid-edit.el
 
 (autoload 'widgetp "wid-edit" "\
@@ -31565,7 +31469,8 @@ Setup current buffer so editing string widgets works.
 
 ;;;***
 \f
-;;;### (autoloads nil "windmove" "windmove.el" (21291 53104 0 0))
+;;;### (autoloads nil "windmove" "windmove.el" (21187 63826 213216
+;;;;;;  0))
 ;;; Generated autoloads from windmove.el
 
 (autoload 'windmove-left "windmove" "\
@@ -31617,7 +31522,7 @@ Default MODIFIER is 'shift.
 
 ;;;***
 \f
-;;;### (autoloads nil "winner" "winner.el" (21291 53104 0 0))
+;;;### (autoloads nil "winner" "winner.el" (21187 63826 213216 0))
 ;;; Generated autoloads from winner.el
 
 (defvar winner-mode nil "\
@@ -31640,7 +31545,7 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
 
 ;;;***
 \f
-;;;### (autoloads nil "woman" "woman.el" (21291 53104 0 0))
+;;;### (autoloads nil "woman" "woman.el" (21393 38187 675040 0))
 ;;; Generated autoloads from woman.el
 (push (purecopy '(woman 0 551)) package--builtin-versions)
 
@@ -31689,29 +31594,7 @@ Default bookmark handler for Woman buffers.
 
 ;;;***
 \f
-;;;### (autoloads nil "ws-mode" "emulation/ws-mode.el" (21291 53104
-;;;;;;  0 0))
-;;; Generated autoloads from emulation/ws-mode.el
-(push (purecopy '(ws-mode 0 7)) package--builtin-versions)
-
-(autoload 'wordstar-mode "ws-mode" "\
-Major mode with WordStar-like key bindings.
-
-BUGS:
- - Help menus with WordStar commands (C-j just calls help-for-help)
-   are not implemented
- - Options for search and replace
- - Show markers (C-k h) is somewhat strange
- - Search and replace (C-q a) is only available in forward direction
-
-No key bindings beginning with ESC are installed, they will work
-Emacs-like.
-
-\(fn)" t nil)
-
-;;;***
-\f
-;;;### (autoloads nil "xml" "xml.el" (21291 53104 0 0))
+;;;### (autoloads nil "xml" "xml.el" (21187 63826 213216 0))
 ;;; Generated autoloads from xml.el
 
 (autoload 'xml-parse-file "xml" "\
@@ -31767,7 +31650,8 @@ Both features can be combined by providing a cons cell
 
 ;;;***
 \f
-;;;### (autoloads nil "xmltok" "nxml/xmltok.el" (21341 23900 0 0))
+;;;### (autoloads nil "xmltok" "nxml/xmltok.el" (21327 43559 923043
+;;;;;;  0))
 ;;; Generated autoloads from nxml/xmltok.el
 
 (autoload 'xmltok-get-declared-encoding-position "xmltok" "\
@@ -31785,7 +31669,7 @@ If LIMIT is non-nil, then do not consider characters beyond LIMIT.
 
 ;;;***
 \f
-;;;### (autoloads nil "xt-mouse" "xt-mouse.el" (21410 50877 492638
+;;;### (autoloads nil "xt-mouse" "xt-mouse.el" (21451 38694 880517
 ;;;;;;  0))
 ;;; Generated autoloads from xt-mouse.el
 
@@ -31815,7 +31699,7 @@ down the SHIFT key while pressing the mouse button.
 
 ;;;***
 \f
-;;;### (autoloads nil "yenc" "gnus/yenc.el" (21291 53104 0 0))
+;;;### (autoloads nil "yenc" "gnus/yenc.el" (21187 63826 213216 0))
 ;;; Generated autoloads from gnus/yenc.el
 
 (autoload 'yenc-decode-region "yenc" "\
@@ -31830,7 +31714,7 @@ Extract file name from an yenc header.
 
 ;;;***
 \f
-;;;### (autoloads nil "zone" "play/zone.el" (21291 53104 0 0))
+;;;### (autoloads nil "zone" "play/zone.el" (21187 63826 213216 0))
 ;;; Generated autoloads from play/zone.el
 
 (autoload 'zone "zone" "\
@@ -31876,16 +31760,14 @@ Zone out, completely.
 ;;;;;;  "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el"
 ;;;;;;  "cedet/semantic/analyze/debug.el" "cedet/semantic/analyze/fcn.el"
 ;;;;;;  "cedet/semantic/analyze/refs.el" "cedet/semantic/bovine.el"
-;;;;;;  "cedet/semantic/bovine/c-by.el" "cedet/semantic/bovine/c.el"
-;;;;;;  "cedet/semantic/bovine/debug.el" "cedet/semantic/bovine/el.el"
-;;;;;;  "cedet/semantic/bovine/gcc.el" "cedet/semantic/bovine/make-by.el"
-;;;;;;  "cedet/semantic/bovine/make.el" "cedet/semantic/bovine/scm-by.el"
-;;;;;;  "cedet/semantic/bovine/scm.el" "cedet/semantic/chart.el"
-;;;;;;  "cedet/semantic/complete.el" "cedet/semantic/ctxt.el" "cedet/semantic/db-debug.el"
-;;;;;;  "cedet/semantic/db-ebrowse.el" "cedet/semantic/db-el.el"
-;;;;;;  "cedet/semantic/db-file.el" "cedet/semantic/db-find.el" "cedet/semantic/db-global.el"
-;;;;;;  "cedet/semantic/db-javascript.el" "cedet/semantic/db-mode.el"
-;;;;;;  "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
+;;;;;;  "cedet/semantic/bovine/c.el" "cedet/semantic/bovine/debug.el"
+;;;;;;  "cedet/semantic/bovine/el.el" "cedet/semantic/bovine/gcc.el"
+;;;;;;  "cedet/semantic/bovine/make.el" "cedet/semantic/bovine/scm.el"
+;;;;;;  "cedet/semantic/chart.el" "cedet/semantic/complete.el" "cedet/semantic/ctxt.el"
+;;;;;;  "cedet/semantic/db-debug.el" "cedet/semantic/db-ebrowse.el"
+;;;;;;  "cedet/semantic/db-el.el" "cedet/semantic/db-file.el" "cedet/semantic/db-find.el"
+;;;;;;  "cedet/semantic/db-global.el" "cedet/semantic/db-javascript.el"
+;;;;;;  "cedet/semantic/db-mode.el" "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
 ;;;;;;  "cedet/semantic/db.el" "cedet/semantic/debug.el" "cedet/semantic/decorate.el"
 ;;;;;;  "cedet/semantic/decorate/include.el" "cedet/semantic/decorate/mode.el"
 ;;;;;;  "cedet/semantic/dep.el" "cedet/semantic/doc.el" "cedet/semantic/ede-grammar.el"
@@ -31903,74 +31785,63 @@ Zone out, completely.
 ;;;;;;  "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el"
 ;;;;;;  "cedet/semantic/util.el" "cedet/semantic/wisent.el" "cedet/semantic/wisent/comp.el"
 ;;;;;;  "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el"
-;;;;;;  "cedet/semantic/wisent/javat-wy.el" "cedet/semantic/wisent/js-wy.el"
-;;;;;;  "cedet/semantic/wisent/python-wy.el" "cedet/semantic/wisent/python.el"
-;;;;;;  "cedet/semantic/wisent/wisent.el" "cedet/srecode/args.el"
-;;;;;;  "cedet/srecode/compile.el" "cedet/srecode/cpp.el" "cedet/srecode/ctxt.el"
-;;;;;;  "cedet/srecode/dictionary.el" "cedet/srecode/document.el"
+;;;;;;  "cedet/semantic/wisent/python.el" "cedet/semantic/wisent/wisent.el"
+;;;;;;  "cedet/srecode/args.el" "cedet/srecode/compile.el" "cedet/srecode/cpp.el"
+;;;;;;  "cedet/srecode/ctxt.el" "cedet/srecode/dictionary.el" "cedet/srecode/document.el"
 ;;;;;;  "cedet/srecode/el.el" "cedet/srecode/expandproto.el" "cedet/srecode/extract.el"
 ;;;;;;  "cedet/srecode/fields.el" "cedet/srecode/filters.el" "cedet/srecode/find.el"
 ;;;;;;  "cedet/srecode/getset.el" "cedet/srecode/insert.el" "cedet/srecode/java.el"
 ;;;;;;  "cedet/srecode/loaddefs.el" "cedet/srecode/map.el" "cedet/srecode/mode.el"
-;;;;;;  "cedet/srecode/semantic.el" "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el"
-;;;;;;  "cedet/srecode/table.el" "cedet/srecode/template.el" "cedet/srecode/texi.el"
-;;;;;;  "cus-dep.el" "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el"
-;;;;;;  "dos-vars.el" "dos-w32.el" "dynamic-setting.el" "emacs-lisp/authors.el"
-;;;;;;  "emacs-lisp/avl-tree.el" "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el"
-;;;;;;  "emacs-lisp/cl-extra.el" "emacs-lisp/cl-loaddefs.el" "emacs-lisp/cl-macs.el"
-;;;;;;  "emacs-lisp/cl-seq.el" "emacs-lisp/cl.el" "emacs-lisp/eieio-base.el"
-;;;;;;  "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-datadebug.el"
-;;;;;;  "emacs-lisp/eieio-opt.el" "emacs-lisp/eieio-speedbar.el"
-;;;;;;  "emacs-lisp/gulp.el" "emacs-lisp/lisp-mnt.el" "emacs-lisp/package-x.el"
+;;;;;;  "cedet/srecode/semantic.el" "cedet/srecode/srt.el" "cedet/srecode/table.el"
+;;;;;;  "cedet/srecode/template.el" "cedet/srecode/texi.el" "cus-dep.el"
+;;;;;;  "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el" "dos-vars.el"
+;;;;;;  "dos-w32.el" "dynamic-setting.el" "emacs-lisp/avl-tree.el"
+;;;;;;  "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el" "emacs-lisp/cl-extra.el"
+;;;;;;  "emacs-lisp/cl-loaddefs.el" "emacs-lisp/cl-macs.el" "emacs-lisp/cl-seq.el"
+;;;;;;  "emacs-lisp/cl.el" "emacs-lisp/eieio-base.el" "emacs-lisp/eieio-custom.el"
+;;;;;;  "emacs-lisp/eieio-datadebug.el" "emacs-lisp/eieio-opt.el"
+;;;;;;  "emacs-lisp/eieio-speedbar.el" "emacs-lisp/lisp-mnt.el" "emacs-lisp/package-x.el"
 ;;;;;;  "emacs-lisp/smie.el" "emacs-lisp/subr-x.el" "emacs-lisp/tcover-ses.el"
 ;;;;;;  "emacs-lisp/tcover-unsafep.el" "emulation/cua-gmrk.el" "emulation/edt-lk201.el"
 ;;;;;;  "emulation/edt-mapper.el" "emulation/edt-pc.el" "emulation/edt-vt100.el"
-;;;;;;  "emulation/tpu-extras.el" "emulation/viper-cmd.el" "emulation/viper-ex.el"
-;;;;;;  "emulation/viper-init.el" "emulation/viper-keym.el" "emulation/viper-macs.el"
-;;;;;;  "emulation/viper-mous.el" "emulation/viper-util.el" "erc/erc-backend.el"
-;;;;;;  "erc/erc-goodies.el" "erc/erc-ibuffer.el" "erc/erc-lang.el"
-;;;;;;  "eshell/em-alias.el" "eshell/em-banner.el" "eshell/em-basic.el"
-;;;;;;  "eshell/em-cmpl.el" "eshell/em-dirs.el" "eshell/em-glob.el"
-;;;;;;  "eshell/em-hist.el" "eshell/em-ls.el" "eshell/em-pred.el"
-;;;;;;  "eshell/em-prompt.el" "eshell/em-rebind.el" "eshell/em-script.el"
-;;;;;;  "eshell/em-smart.el" "eshell/em-term.el" "eshell/em-tramp.el"
-;;;;;;  "eshell/em-unix.el" "eshell/em-xtra.el" "eshell/esh-arg.el"
-;;;;;;  "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-groups.el"
-;;;;;;  "eshell/esh-io.el" "eshell/esh-module.el" "eshell/esh-opt.el"
-;;;;;;  "eshell/esh-proc.el" "eshell/esh-util.el" "eshell/esh-var.el"
-;;;;;;  "ezimage.el" "format-spec.el" "fringe.el" "generic-x.el"
-;;;;;;  "gnus/compface.el" "gnus/gnus-async.el" "gnus/gnus-bcklg.el"
-;;;;;;  "gnus/gnus-cite.el" "gnus/gnus-cus.el" "gnus/gnus-demon.el"
-;;;;;;  "gnus/gnus-dup.el" "gnus/gnus-eform.el" "gnus/gnus-ems.el"
-;;;;;;  "gnus/gnus-icalendar.el" "gnus/gnus-int.el" "gnus/gnus-logic.el"
-;;;;;;  "gnus/gnus-mh.el" "gnus/gnus-salt.el" "gnus/gnus-score.el"
-;;;;;;  "gnus/gnus-setup.el" "gnus/gnus-srvr.el" "gnus/gnus-topic.el"
-;;;;;;  "gnus/gnus-undo.el" "gnus/gnus-util.el" "gnus/gnus-uu.el"
-;;;;;;  "gnus/gnus-vm.el" "gnus/gssapi.el" "gnus/ietf-drums.el" "gnus/legacy-gnus-agent.el"
-;;;;;;  "gnus/mail-parse.el" "gnus/mail-prsvr.el" "gnus/mail-source.el"
-;;;;;;  "gnus/mailcap.el" "gnus/messcompat.el" "gnus/mm-archive.el"
-;;;;;;  "gnus/mm-bodies.el" "gnus/mm-decode.el" "gnus/mm-util.el"
-;;;;;;  "gnus/mm-view.el" "gnus/mml-sec.el" "gnus/mml-smime.el" "gnus/nnagent.el"
-;;;;;;  "gnus/nnbabyl.el" "gnus/nndir.el" "gnus/nndraft.el" "gnus/nneething.el"
-;;;;;;  "gnus/nngateway.el" "gnus/nnheader.el" "gnus/nnimap.el" "gnus/nnir.el"
-;;;;;;  "gnus/nnmail.el" "gnus/nnmaildir.el" "gnus/nnmairix.el" "gnus/nnmbox.el"
-;;;;;;  "gnus/nnmh.el" "gnus/nnnil.el" "gnus/nnoo.el" "gnus/nnregistry.el"
-;;;;;;  "gnus/nnrss.el" "gnus/nnspool.el" "gnus/nntp.el" "gnus/nnvirtual.el"
-;;;;;;  "gnus/nnweb.el" "gnus/registry.el" "gnus/rfc1843.el" "gnus/rfc2045.el"
-;;;;;;  "gnus/rfc2047.el" "gnus/rfc2104.el" "gnus/rfc2231.el" "gnus/rtree.el"
-;;;;;;  "gnus/sieve-manage.el" "gnus/smime.el" "gnus/spam-stat.el"
-;;;;;;  "gnus/spam-wash.el" "hex-util.el" "hfy-cmap.el" "ibuf-ext.el"
-;;;;;;  "international/cp51932.el" "international/eucjp-ms.el" "international/fontset.el"
-;;;;;;  "international/iso-ascii.el" "international/ja-dic-cnv.el"
-;;;;;;  "international/ja-dic-utl.el" "international/ogonek.el" "international/uni-bidi.el"
-;;;;;;  "international/uni-category.el" "international/uni-combining.el"
-;;;;;;  "international/uni-comment.el" "international/uni-decimal.el"
-;;;;;;  "international/uni-decomposition.el" "international/uni-digit.el"
-;;;;;;  "international/uni-lowercase.el" "international/uni-mirrored.el"
-;;;;;;  "international/uni-name.el" "international/uni-numeric.el"
-;;;;;;  "international/uni-old-name.el" "international/uni-titlecase.el"
-;;;;;;  "international/uni-uppercase.el" "kermit.el" "language/hanja-util.el"
-;;;;;;  "language/thai-word.el" "ldefs-boot.el" "leim/ja-dic/ja-dic.el"
+;;;;;;  "emulation/viper-cmd.el" "emulation/viper-ex.el" "emulation/viper-init.el"
+;;;;;;  "emulation/viper-keym.el" "emulation/viper-macs.el" "emulation/viper-mous.el"
+;;;;;;  "emulation/viper-util.el" "erc/erc-backend.el" "erc/erc-goodies.el"
+;;;;;;  "erc/erc-ibuffer.el" "erc/erc-lang.el" "eshell/em-alias.el"
+;;;;;;  "eshell/em-banner.el" "eshell/em-basic.el" "eshell/em-cmpl.el"
+;;;;;;  "eshell/em-dirs.el" "eshell/em-glob.el" "eshell/em-hist.el"
+;;;;;;  "eshell/em-ls.el" "eshell/em-pred.el" "eshell/em-prompt.el"
+;;;;;;  "eshell/em-rebind.el" "eshell/em-script.el" "eshell/em-smart.el"
+;;;;;;  "eshell/em-term.el" "eshell/em-tramp.el" "eshell/em-unix.el"
+;;;;;;  "eshell/em-xtra.el" "eshell/esh-arg.el" "eshell/esh-cmd.el"
+;;;;;;  "eshell/esh-ext.el" "eshell/esh-groups.el" "eshell/esh-io.el"
+;;;;;;  "eshell/esh-module.el" "eshell/esh-opt.el" "eshell/esh-proc.el"
+;;;;;;  "eshell/esh-util.el" "eshell/esh-var.el" "ezimage.el" "format-spec.el"
+;;;;;;  "fringe.el" "generic-x.el" "gnus/compface.el" "gnus/gnus-async.el"
+;;;;;;  "gnus/gnus-bcklg.el" "gnus/gnus-cite.el" "gnus/gnus-cloud.el"
+;;;;;;  "gnus/gnus-cus.el" "gnus/gnus-demon.el" "gnus/gnus-dup.el"
+;;;;;;  "gnus/gnus-eform.el" "gnus/gnus-ems.el" "gnus/gnus-icalendar.el"
+;;;;;;  "gnus/gnus-int.el" "gnus/gnus-logic.el" "gnus/gnus-mh.el"
+;;;;;;  "gnus/gnus-salt.el" "gnus/gnus-score.el" "gnus/gnus-srvr.el"
+;;;;;;  "gnus/gnus-topic.el" "gnus/gnus-undo.el" "gnus/gnus-util.el"
+;;;;;;  "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/gssapi.el" "gnus/ietf-drums.el"
+;;;;;;  "gnus/legacy-gnus-agent.el" "gnus/mail-parse.el" "gnus/mail-prsvr.el"
+;;;;;;  "gnus/mail-source.el" "gnus/mailcap.el" "gnus/messcompat.el"
+;;;;;;  "gnus/mm-archive.el" "gnus/mm-bodies.el" "gnus/mm-decode.el"
+;;;;;;  "gnus/mm-util.el" "gnus/mm-view.el" "gnus/mml-sec.el" "gnus/mml-smime.el"
+;;;;;;  "gnus/nnagent.el" "gnus/nnbabyl.el" "gnus/nndir.el" "gnus/nndraft.el"
+;;;;;;  "gnus/nneething.el" "gnus/nngateway.el" "gnus/nnheader.el"
+;;;;;;  "gnus/nnimap.el" "gnus/nnir.el" "gnus/nnmail.el" "gnus/nnmaildir.el"
+;;;;;;  "gnus/nnmairix.el" "gnus/nnmbox.el" "gnus/nnmh.el" "gnus/nnnil.el"
+;;;;;;  "gnus/nnoo.el" "gnus/nnregistry.el" "gnus/nnrss.el" "gnus/nnspool.el"
+;;;;;;  "gnus/nntp.el" "gnus/nnvirtual.el" "gnus/nnweb.el" "gnus/registry.el"
+;;;;;;  "gnus/rfc1843.el" "gnus/rfc2045.el" "gnus/rfc2047.el" "gnus/rfc2104.el"
+;;;;;;  "gnus/rfc2231.el" "gnus/rtree.el" "gnus/sieve-manage.el"
+;;;;;;  "gnus/smime.el" "gnus/spam-stat.el" "gnus/spam-wash.el" "hex-util.el"
+;;;;;;  "hfy-cmap.el" "ibuf-ext.el" "international/cp51932.el" "international/eucjp-ms.el"
+;;;;;;  "international/fontset.el" "international/iso-ascii.el" "international/ja-dic-cnv.el"
+;;;;;;  "international/ja-dic-utl.el" "international/ogonek.el" "kermit.el"
+;;;;;;  "language/hanja-util.el" "language/thai-word.el" "ldefs-boot.el"
 ;;;;;;  "leim/quail/arabic.el" "leim/quail/croatian.el" "leim/quail/cyril-jis.el"
 ;;;;;;  "leim/quail/cyrillic.el" "leim/quail/czech.el" "leim/quail/ethiopic.el"
 ;;;;;;  "leim/quail/georgian.el" "leim/quail/greek.el" "leim/quail/hanja-jis.el"
@@ -31994,42 +31865,59 @@ Zone out, completely.
 ;;;;;;  "mh-e/mh-loaddefs.el" "mh-e/mh-mime.el" "mh-e/mh-print.el"
 ;;;;;;  "mh-e/mh-scan.el" "mh-e/mh-search.el" "mh-e/mh-seq.el" "mh-e/mh-show.el"
 ;;;;;;  "mh-e/mh-speed.el" "mh-e/mh-thread.el" "mh-e/mh-tool-bar.el"
-;;;;;;  "mh-e/mh-utils.el" "mh-e/mh-xface.el" "mouse-copy.el" "mouse.el"
-;;;;;;  "mwheel.el" "net/dns.el" "net/eudc-vars.el" "net/eudcb-bbdb.el"
-;;;;;;  "net/eudcb-ldap.el" "net/eudcb-mab.el" "net/eudcb-ph.el"
-;;;;;;  "net/hmac-def.el" "net/hmac-md5.el" "net/imap.el" "net/ldap.el"
-;;;;;;  "net/mairix.el" "net/sasl-cram.el" "net/sasl-digest.el" "net/sasl.el"
-;;;;;;  "net/shr-color.el" "net/soap-client.el" "net/soap-inspect.el"
-;;;;;;  "net/socks.el" "net/tls.el" "net/tramp-adb.el" "net/tramp-cache.el"
-;;;;;;  "net/tramp-cmds.el" "net/tramp-compat.el" "net/tramp-gvfs.el"
-;;;;;;  "net/tramp-gw.el" "net/tramp-loaddefs.el" "net/tramp-sh.el"
-;;;;;;  "net/tramp-smb.el" "net/tramp-uu.el" "net/trampver.el" "net/zeroconf.el"
-;;;;;;  "notifications.el" "nxml/nxml-enc.el" "nxml/nxml-maint.el"
+;;;;;;  "mh-e/mh-utils.el" "mh-e/mh-xface.el" "mouse-copy.el" "mwheel.el"
+;;;;;;  "net/dns.el" "net/eudc-vars.el" "net/eudcb-bbdb.el" "net/eudcb-ldap.el"
+;;;;;;  "net/eudcb-mab.el" "net/eudcb-ph.el" "net/hmac-def.el" "net/hmac-md5.el"
+;;;;;;  "net/imap.el" "net/ldap.el" "net/mairix.el" "net/sasl-cram.el"
+;;;;;;  "net/sasl-digest.el" "net/sasl.el" "net/shr-color.el" "net/soap-client.el"
+;;;;;;  "net/soap-inspect.el" "net/socks.el" "net/tls.el" "net/tramp-adb.el"
+;;;;;;  "net/tramp-cache.el" "net/tramp-cmds.el" "net/tramp-compat.el"
+;;;;;;  "net/tramp-gvfs.el" "net/tramp-gw.el" "net/tramp-loaddefs.el"
+;;;;;;  "net/tramp-sh.el" "net/tramp-smb.el" "net/tramp-uu.el" "net/trampver.el"
+;;;;;;  "net/zeroconf.el" "notifications.el" "nxml/nxml-enc.el" "nxml/nxml-maint.el"
 ;;;;;;  "nxml/nxml-ns.el" "nxml/nxml-outln.el" "nxml/nxml-parse.el"
 ;;;;;;  "nxml/nxml-rap.el" "nxml/nxml-util.el" "nxml/rng-dt.el" "nxml/rng-loc.el"
 ;;;;;;  "nxml/rng-maint.el" "nxml/rng-match.el" "nxml/rng-parse.el"
 ;;;;;;  "nxml/rng-pttrn.el" "nxml/rng-uri.el" "nxml/rng-util.el"
-;;;;;;  "nxml/xsd-regexp.el" "org/ob-C.el" "org/ob-R.el" "org/ob-asymptote.el"
-;;;;;;  "org/ob-awk.el" "org/ob-calc.el" "org/ob-clojure.el" "org/ob-comint.el"
-;;;;;;  "org/ob-core.el" "org/ob-css.el" "org/ob-ditaa.el" "org/ob-dot.el"
-;;;;;;  "org/ob-emacs-lisp.el" "org/ob-eval.el" "org/ob-exp.el" "org/ob-fortran.el"
-;;;;;;  "org/ob-gnuplot.el" "org/ob-haskell.el" "org/ob-io.el" "org/ob-java.el"
-;;;;;;  "org/ob-js.el" "org/ob-keys.el" "org/ob-latex.el" "org/ob-ledger.el"
-;;;;;;  "org/ob-lilypond.el" "org/ob-lisp.el" "org/ob-lob.el" "org/ob-makefile.el"
-;;;;;;  "org/ob-matlab.el" "org/ob-maxima.el" "org/ob-mscgen.el"
-;;;;;;  "org/ob-ocaml.el" "org/ob-octave.el" "org/ob-org.el" "org/ob-perl.el"
-;;;;;;  "org/ob-picolisp.el" "org/ob-plantuml.el" "org/ob-python.el"
-;;;;;;  "org/ob-ref.el" "org/ob-ruby.el" "org/ob-sass.el" "org/ob-scala.el"
-;;;;;;  "org/ob-scheme.el" "org/ob-screen.el" "org/ob-sh.el" "org/ob-shen.el"
-;;;;;;  "org/ob-sql.el" "org/ob-sqlite.el" "org/ob-table.el" "org/ob-tangle.el"
-;;;;;;  "org/ob.el" "org/org-archive.el" "org/org-attach.el" "org/org-bbdb.el"
-;;;;;;  "org/org-bibtex.el" "org/org-clock.el" "org/org-crypt.el"
-;;;;;;  "org/org-ctags.el" "org/org-datetree.el" "org/org-docview.el"
-;;;;;;  "org/org-element.el" "org/org-entities.el" "org/org-eshell.el"
-;;;;;;  "org/org-faces.el" "org/org-feed.el" "org/org-footnote.el"
-;;;;;;  "org/org-gnus.el" "org/org-habit.el" "org/org-id.el" "org/org-indent.el"
-;;;;;;  "org/org-info.el" "org/org-inlinetask.el" "org/org-install.el"
-;;;;;;  "org/org-irc.el" "org/org-list.el" "org/org-loaddefs.el"
+;;;;;;  "nxml/xsd-regexp.el" "obsolete/abbrevlist.el" "obsolete/assoc.el"
+;;;;;;  "obsolete/awk-mode.el" "obsolete/bruce.el" "obsolete/cl-compat.el"
+;;;;;;  "obsolete/complete.el" "obsolete/crisp.el" "obsolete/cust-print.el"
+;;;;;;  "obsolete/erc-hecomplete.el" "obsolete/fast-lock.el" "obsolete/gulp.el"
+;;;;;;  "obsolete/iso-acc.el" "obsolete/iso-insert.el" "obsolete/iso-swed.el"
+;;;;;;  "obsolete/keyswap.el" "obsolete/lazy-lock.el" "obsolete/ledit.el"
+;;;;;;  "obsolete/levents.el" "obsolete/lmenu.el" "obsolete/longlines.el"
+;;;;;;  "obsolete/lucid.el" "obsolete/mailpost.el" "obsolete/meese.el"
+;;;;;;  "obsolete/mouse-sel.el" "obsolete/old-emacs-lock.el" "obsolete/old-whitespace.el"
+;;;;;;  "obsolete/options.el" "obsolete/otodo-mode.el" "obsolete/patcomp.el"
+;;;;;;  "obsolete/pc-mode.el" "obsolete/pc-select.el" "obsolete/pgg-def.el"
+;;;;;;  "obsolete/pgg-gpg.el" "obsolete/pgg-parse.el" "obsolete/pgg-pgp.el"
+;;;;;;  "obsolete/pgg-pgp5.el" "obsolete/pgg.el" "obsolete/rcompile.el"
+;;;;;;  "obsolete/resume.el" "obsolete/s-region.el" "obsolete/scribe.el"
+;;;;;;  "obsolete/spell.el" "obsolete/sregex.el" "obsolete/sup-mouse.el"
+;;;;;;  "obsolete/swedish.el" "obsolete/sym-comp.el" "obsolete/terminal.el"
+;;;;;;  "obsolete/tpu-edt.el" "obsolete/tpu-extras.el" "obsolete/tpu-mapper.el"
+;;;;;;  "obsolete/vc-mcvs.el" "obsolete/vi.el" "obsolete/vip.el"
+;;;;;;  "obsolete/ws-mode.el" "obsolete/xesam.el" "obsolete/yow.el"
+;;;;;;  "org/ob-C.el" "org/ob-R.el" "org/ob-asymptote.el" "org/ob-awk.el"
+;;;;;;  "org/ob-calc.el" "org/ob-clojure.el" "org/ob-comint.el" "org/ob-core.el"
+;;;;;;  "org/ob-css.el" "org/ob-ditaa.el" "org/ob-dot.el" "org/ob-emacs-lisp.el"
+;;;;;;  "org/ob-eval.el" "org/ob-exp.el" "org/ob-fortran.el" "org/ob-gnuplot.el"
+;;;;;;  "org/ob-haskell.el" "org/ob-io.el" "org/ob-java.el" "org/ob-js.el"
+;;;;;;  "org/ob-keys.el" "org/ob-latex.el" "org/ob-ledger.el" "org/ob-lilypond.el"
+;;;;;;  "org/ob-lisp.el" "org/ob-lob.el" "org/ob-makefile.el" "org/ob-matlab.el"
+;;;;;;  "org/ob-maxima.el" "org/ob-mscgen.el" "org/ob-ocaml.el" "org/ob-octave.el"
+;;;;;;  "org/ob-org.el" "org/ob-perl.el" "org/ob-picolisp.el" "org/ob-plantuml.el"
+;;;;;;  "org/ob-python.el" "org/ob-ref.el" "org/ob-ruby.el" "org/ob-sass.el"
+;;;;;;  "org/ob-scala.el" "org/ob-scheme.el" "org/ob-screen.el" "org/ob-sh.el"
+;;;;;;  "org/ob-shen.el" "org/ob-sql.el" "org/ob-sqlite.el" "org/ob-table.el"
+;;;;;;  "org/ob-tangle.el" "org/ob.el" "org/org-archive.el" "org/org-attach.el"
+;;;;;;  "org/org-bbdb.el" "org/org-bibtex.el" "org/org-clock.el"
+;;;;;;  "org/org-crypt.el" "org/org-ctags.el" "org/org-datetree.el"
+;;;;;;  "org/org-docview.el" "org/org-element.el" "org/org-entities.el"
+;;;;;;  "org/org-eshell.el" "org/org-faces.el" "org/org-feed.el"
+;;;;;;  "org/org-footnote.el" "org/org-gnus.el" "org/org-habit.el"
+;;;;;;  "org/org-id.el" "org/org-indent.el" "org/org-info.el" "org/org-inlinetask.el"
+;;;;;;  "org/org-install.el" "org/org-irc.el" "org/org-list.el" "org/org-loaddefs.el"
 ;;;;;;  "org/org-macro.el" "org/org-mhe.el" "org/org-mobile.el" "org/org-mouse.el"
 ;;;;;;  "org/org-pcomplete.el" "org/org-plot.el" "org/org-protocol.el"
 ;;;;;;  "org/org-rmail.el" "org/org-src.el" "org/org-table.el" "org/org-timer.el"
@@ -32044,22 +31932,23 @@ Zone out, completely.
 ;;;;;;  "progmodes/ebnf-otz.el" "progmodes/ebnf-yac.el" "progmodes/idlw-complete-structtag.el"
 ;;;;;;  "progmodes/idlw-help.el" "progmodes/idlw-toolbar.el" "progmodes/mantemp.el"
 ;;;;;;  "progmodes/xscheme.el" "ps-def.el" "ps-mule.el" "ps-samp.el"
-;;;;;;  "saveplace.el" "sb-image.el" "scroll-bar.el" "select.el"
-;;;;;;  "soundex.el" "subdirs.el" "tempo.el" "textmodes/bib-mode.el"
-;;;;;;  "textmodes/makeinfo.el" "textmodes/page-ext.el" "textmodes/refbib.el"
-;;;;;;  "textmodes/refer.el" "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el"
-;;;;;;  "textmodes/reftex-ref.el" "textmodes/reftex-sel.el" "textmodes/reftex-toc.el"
-;;;;;;  "textmodes/texnfo-upd.el" "timezone.el" "tooltip.el" "tree-widget.el"
-;;;;;;  "url/url-about.el" "url/url-cookie.el" "url/url-dired.el"
-;;;;;;  "url/url-domsuf.el" "url/url-expand.el" "url/url-ftp.el"
-;;;;;;  "url/url-future.el" "url/url-history.el" "url/url-imap.el"
-;;;;;;  "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
+;;;;;;  "saveplace.el" "sb-image.el" "scroll-bar.el" "soundex.el"
+;;;;;;  "subdirs.el" "tempo.el" "textmodes/bib-mode.el" "textmodes/makeinfo.el"
+;;;;;;  "textmodes/page-ext.el" "textmodes/refbib.el" "textmodes/refer.el"
+;;;;;;  "textmodes/reftex-auc.el" "textmodes/reftex-cite.el" "textmodes/reftex-dcr.el"
+;;;;;;  "textmodes/reftex-global.el" "textmodes/reftex-index.el"
+;;;;;;  "textmodes/reftex-parse.el" "textmodes/reftex-ref.el" "textmodes/reftex-sel.el"
+;;;;;;  "textmodes/reftex-toc.el" "textmodes/texnfo-upd.el" "timezone.el"
+;;;;;;  "tooltip.el" "tree-widget.el" "url/url-about.el" "url/url-cookie.el"
+;;;;;;  "url/url-dired.el" "url/url-domsuf.el" "url/url-expand.el"
+;;;;;;  "url/url-ftp.el" "url/url-future.el" "url/url-history.el"
+;;;;;;  "url/url-imap.el" "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
 ;;;;;;  "url/url-vars.el" "vc/ediff-diff.el" "vc/ediff-init.el" "vc/ediff-merg.el"
 ;;;;;;  "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
 ;;;;;;  "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el"
 ;;;;;;  "vcursor.el" "vt-control.el" "vt100-led.el" "w32-common-fns.el"
-;;;;;;  "w32-fns.el" "w32-vars.el" "x-dnd.el") (21467 30610 282100
-;;;;;;  377000))
+;;;;;;  "w32-fns.el" "w32-vars.el" "x-dnd.el") (21467 27179 976956
+;;;;;;  799000))
 
 ;;;***
 \f
index 35a5f41f323a4495b0a7fb7961688180c7d2e455..324188e88e801ecf1c900847edfff9f65455ea84 100644 (file)
@@ -249,42 +249,39 @@ Example:  nve5    -> nüe
 
 ;; Call quail-make-sisheng-rules for all syllables in sisheng-syllable-table.
 ;;
-(let ((case-table-save (current-case-table))
-      sisheng-list)
-  (set-case-table (standard-case-table))
+(let (sisheng-list)
   (dolist (syllable sisheng-syllable-table)
     (setq sisheng-list
-         (append (quail-make-sisheng-rules syllable)
-                 sisheng-list)))
+          (append (quail-make-sisheng-rules syllable)
+                  sisheng-list)))
 
   (dolist (syllable sisheng-syllable-table)
     (setq sisheng-list
-         (append (quail-make-sisheng-rules (upcase-initials syllable))
-                 sisheng-list)))
+          (append (quail-make-sisheng-rules (upcase-initials syllable))
+                  sisheng-list)))
 
   (dolist (syllable sisheng-syllable-table)
     (setq sisheng-list
-         (append (quail-make-sisheng-rules (upcase syllable))
-                 sisheng-list)))
+          (append (quail-make-sisheng-rules (upcase syllable))
+                  sisheng-list)))
 
   (eval `(quail-define-rules
-         ,@sisheng-list
-
-         ("lv5" ["lü"])
-         ("lve5" ["lüe"])
-         ("nv5" ["nü"])
-         ("nve5" ["nüe"])
-
-         ("Lv5" ["Lü"])
-         ("Lve5" ["Lüe"])
-         ("Nv5" ["Nü"])
-         ("Nve5" ["Nüe"])
-
-         ("LV5" ["LÜ"])
-         ("LVE5" ["LÜE"])
-         ("NV5" ["NÜ"])
-         ("NVE5" ["NÜE"])))
-  (set-case-table case-table-save))
+          ,@sisheng-list
+
+          ("lv5" ["lü"])
+          ("lve5" ["lüe"])
+          ("nv5" ["nü"])
+          ("nve5" ["nüe"])
+
+          ("Lv5" ["Lü"])
+          ("Lve5" ["Lüe"])
+          ("Nv5" ["Nü"])
+          ("Nve5" ["Nüe"])
+
+          ("LV5" ["LÜ"])
+          ("LVE5" ["LÜE"])
+          ("NV5" ["NÜ"])
+          ("NVE5" ["NÜE"]))))
 
 ;; Local Variables:
 ;; coding: utf-8
index bbf7ebec3998e6b2d45054e239400f9949b9be7f..b13bd8dbbb6ad5780feeaff6788a2f9f424ade40 100644 (file)
@@ -138,6 +138,9 @@ Linum mode is a buffer-local minor mode."
       (mapc #'delete-overlay linum-available)
       (setq linum-available nil))))
 
+(defun linum--face-height (face)
+  (aref (font-info (face-font face)) 2))
+
 (defun linum-update-window (win)
   "Update line numbers for the portion visible in window WIN."
   (goto-char (window-start win))
@@ -178,6 +181,12 @@ Linum mode is a buffer-local minor mode."
       (let ((inhibit-point-motion-hooks t))
         (forward-line))
       (setq line (1+ line)))
+    (when (display-graphic-p)
+      (setq width (ceiling
+                   ;; We'd really want to check the widths rather than the
+                   ;; heights, but it's a start.
+                   (/ (* width 1.0 (linum--face-height 'linum))
+                      (frame-char-height)))))
     (set-window-margins win width (cdr (window-margins win)))))
 
 (defun linum-after-change (beg end _len)
index 8d009ed5165bf26be027af5ce05e2bea82a29037..b911e9f1768659befa8910ade8489eeef27d3136 100644 (file)
@@ -1,7 +1,7 @@
 ;;; loadup.el --- load up standardly loaded Lisp files for Emacs
 
-;; Copyright (C) 1985-1986, 1992, 1994, 2001-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992, 1994, 2001-2014
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: internal
@@ -46,8 +46,7 @@
 ;; Add subdirectories to the load-path for files that might get
 ;; autoloaded when bootstrapping.
 ;; This is because PATH_DUMPLOADSEARCH is just "../lisp".
-(if (or (equal (nth 3 command-line-args) "bootstrap")
-       (equal (nth 4 command-line-args) "bootstrap")
+(if (or (equal (member "bootstrap" command-line-args) '("bootstrap"))
        ;; FIXME this is irritatingly fragile.
        (equal (nth 4 command-line-args) "unidata-gen.el")
        (equal (nth 7 command-line-args) "unidata-gen-files")
 
 (message "Using load-path %s" load-path)
 
-(if (or (member (nth 3 command-line-args) '("dump" "bootstrap"))
-       (member (nth 4 command-line-args) '("dump" "bootstrap")))
-    ;; To reduce the size of dumped Emacs, we avoid making huge
-    ;; char-tables.
-    (setq inhibit-load-charset-map t))
+;; This is a poor man's `last', since we haven't loaded subr.el yet.
+(if (or (equal (member "bootstrap" command-line-args) '("bootstrap"))
+       (equal (member "dump" command-line-args) '("dump")))
+    (progn
+      ;; To reduce the size of dumped Emacs, we avoid making huge char-tables.
+      (setq inhibit-load-charset-map t)
+      ;; --eval gets handled too late.
+      (defvar load--prefer-newer load-prefer-newer)
+      (setq load-prefer-newer t)))
 
 ;; We don't want to have any undo records in the dumped Emacs.
 (set-buffer "*scratch*")
 (load "font-lock")
 (load "jit-lock")
 
-(if (fboundp 'track-mouse)
-    (progn
-      (load "mouse")
-      (and (boundp 'x-toolkit-scroll-bars)
-          (load "scroll-bar"))
-      (load "select")))
+(load "mouse")
+(if (boundp 'x-toolkit-scroll-bars)
+    (load "scroll-bar"))
+(load "select")
 (load "emacs-lisp/timer")
 (load "isearch")
 (load "rfn-eshadow")
@@ -308,17 +309,13 @@ lost after dumping")))
 ;; file primitive.  So the only workable solution to support building
 ;; in non-ASCII directories is to manipulate unibyte strings in the
 ;; current locale's encoding.
-(if (and (or (equal (nth 3 command-line-args) "dump")
-            (equal (nth 4 command-line-args) "dump")
-            (equal (nth 3 command-line-args) "bootstrap")
-            (equal (nth 4 command-line-args) "bootstrap"))
+(if (and (member (car (last command-line-args)) '("dump" "bootstrap"))
         (multibyte-string-p default-directory))
     (error "default-directory must be unibyte when dumping Emacs!"))
 
 ;; Determine which last version number to use
 ;; based on the executables that now exist.
-(if (and (or (equal (nth 3 command-line-args) "dump")
-            (equal (nth 4 command-line-args) "dump"))
+(if (and (equal (last command-line-args) '("dump"))
         (not (eq system-type 'ms-dos)))
     (let* ((base (concat "emacs-" emacs-version "."))
           (exelen (if (eq system-type 'windows-nt) -4))
@@ -337,8 +334,7 @@ lost after dumping")))
 
 
 (message "Finding pointers to doc strings...")
-(if (or (equal (nth 3 command-line-args) "dump")
-       (equal (nth 4 command-line-args) "dump"))
+(if (equal (last command-line-args) '("dump"))
     (Snarf-documentation "DOC")
   (condition-case nil
       (Snarf-documentation "DOC")
@@ -365,6 +361,12 @@ lost after dumping")))
 
 (remove-hook 'after-load-functions (lambda (f) (garbage-collect)))
 
+(if (boundp 'load--prefer-newer)
+    (progn
+      (setq load-prefer-newer load--prefer-newer)
+      (put 'load-prefer-newer 'standard-value load--prefer-newer)
+      (makunbound 'load--prefer-newer)))
+
 (setq inhibit-load-charset-map nil)
 (clear-charset-maps)
 (garbage-collect)
@@ -396,8 +398,7 @@ lost after dumping")))
 (if (null (garbage-collect))
     (setq pure-space-overflow t))
 
-(if (or (member (nth 3 command-line-args) '("dump" "bootstrap"))
-       (member (nth 4 command-line-args) '("dump" "bootstrap")))
+(if (member (car (last command-line-args)) '("dump" "bootstrap"))
     (progn
       (message "Dumping under the name emacs")
       (condition-case ()
@@ -413,8 +414,7 @@ lost after dumping")))
       (if (not (or (eq system-type 'ms-dos)
                    ;; Don't bother adding another name if we're just
                    ;; building bootstrap-emacs.
-                   (equal (nth 3 command-line-args) "bootstrap")
-                   (equal (nth 4 command-line-args) "bootstrap")))
+                   (equal (last command-line-args) '("bootstrap"))))
          (let ((name (concat "emacs-" emacs-version))
                (exe (if (eq system-type 'windows-nt) ".exe" "")))
            (while (string-match "[^-+_.a-zA-Z0-9]+" name)
@@ -435,7 +435,7 @@ lost after dumping")))
 ;; this file must be loaded each time Emacs is run.
 ;; So run the startup code now.  First, remove `-l loadup' from args.
 
-(if (and (equal (nth 1 command-line-args) "-l")
+(if (and (member (nth 1 command-line-args) '("-l" "--load"))
         (equal (nth 2 command-line-args) "loadup"))
     (setcdr command-line-args (nthcdr 3 command-line-args)))
 
index b994949e94d825f71b19ce8514bd5d25fd92a167..91451504cab29fdc0f15a277c2c13df2ada60de3 100644 (file)
@@ -1,7 +1,7 @@
 ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list
 
-;; Copyright (C) 1985, 1994, 1997-1998, 2000-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985, 1994, 1997-1998, 2000-2014
+;;   Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: emacs-devel@gnu.org
 (define-obsolete-variable-alias 'report-emacs-bug-pretest-address
   'report-emacs-bug-address "24.1")
 
-(defcustom report-emacs-bug-address "bug-gnu-emacs@gnu.org"
-  "Address of mailing list for GNU Emacs bugs."
-  :group 'emacsbug
-  :type 'string)
-
 (defcustom report-emacs-bug-no-confirmation nil
   "If non-nil, suppress the confirmations asked for the sake of novice users."
   :group 'emacsbug
@@ -251,6 +246,8 @@ usually do not have translators for other languages.\n\n")))
       (insert "Configured using:\n `configure "
              system-configuration-options "'\n\n")
       (fill-region (line-beginning-position -1) (point)))
+    (insert "Configured features:\n" system-configuration-features "\n\n")
+    (fill-region (line-beginning-position -1) (point))
     (insert "Important settings:\n")
     (mapc
      (lambda (var)
index 2224884eede8d31a878d3e7988ab082e2304cbeb..fb8dfba8554010eab33bfc9586835dfac3add050 100644 (file)
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (eval-when-compile (require 'cl))      ; for case
 
 (defgroup hashcash nil
index 52f4845eecb6da5f36d8b3dbc482791191b5dd41..f76920449f2321afa744ab03ac0310f01896e9f7 100644 (file)
@@ -1507,8 +1507,7 @@ If so restore the actual mbox message collection."
        '(rmail-font-lock-keywords
          t t nil nil
          (font-lock-maximum-size . nil)
-         (font-lock-fontify-buffer-function . rmail-fontify-buffer-function)
-         (font-lock-unfontify-buffer-function . rmail-unfontify-buffer-function)
+          (font-lock-dont-widen . t)
          (font-lock-inhibit-thing-lock . (lazy-lock-mode fast-lock-mode))))
   (make-local-variable 'require-final-newline)
   (setq require-final-newline nil)
@@ -3448,47 +3447,66 @@ STATE non-nil means mark as deleted."
   "Delete this message and stay on it."
   (interactive)
   (rmail-set-attribute rmail-deleted-attr-index t)
-  (run-hooks 'rmail-delete-message-hook))
+  (run-hooks 'rmail-delete-message-hook)
+  (let ((del-msg rmail-current-message))
+    (if (rmail-summary-exists)
+       (rmail-select-summary
+        (rmail-summary-mark-deleted del-msg)))))
 
-(defun rmail-undelete-previous-message ()
+(defun rmail-undelete-previous-message (count)
   "Back up to deleted message, select it, and undelete it."
-  (interactive)
+  (interactive "p")
   (set-buffer rmail-buffer)
-  (let ((msg rmail-current-message))
-    (while (and (> msg 0)
-               (not (rmail-message-deleted-p msg)))
-      (setq msg (1- msg)))
-    (if (= msg 0)
-       (error "No previous deleted message")
-      (if (/= msg rmail-current-message)
-         (rmail-show-message msg))
-      (rmail-set-attribute rmail-deleted-attr-index nil)
-      (if (rmail-summary-exists)
-         (with-current-buffer rmail-summary-buffer
-           (rmail-summary-mark-undeleted msg)))
-      (rmail-maybe-display-summary))))
-
-(defun rmail-delete-forward (&optional backward)
+  (let (value)
+    (dotimes (i count)
+      (let ((msg rmail-current-message))
+       (while (and (> msg 0)
+                   (not (rmail-message-deleted-p msg)))
+         (setq msg (1- msg)))
+       (if (= msg 0)
+           (error "No previous deleted message")
+         (if (/= msg rmail-current-message)
+             (rmail-show-message msg))
+         (rmail-set-attribute rmail-deleted-attr-index nil)
+         (if (rmail-summary-exists)
+             (with-current-buffer rmail-summary-buffer
+               (rmail-summary-mark-undeleted msg))))))
+    (rmail-maybe-display-summary)))
+
+(defun rmail-delete-forward (&optional count)
   "Delete this message and move to next nondeleted one.
 Deleted messages stay in the file until the \\[rmail-expunge] command is given.
-With prefix argument, delete and move backward.
+Optional argument COUNT (interactively, prefix argument) is a repeat count;
+negative argument means move backwards instead of forwards.
 
 Returns t if a new message is displayed after the delete, or nil otherwise."
-  (interactive "P")
-  (rmail-set-attribute rmail-deleted-attr-index t)
-  (run-hooks 'rmail-delete-message-hook)
-  (let ((del-msg rmail-current-message))
-    (if (rmail-summary-exists)
-       (rmail-select-summary
-        (rmail-summary-mark-deleted del-msg)))
-    (prog1 (rmail-next-undeleted-message (if backward -1 1))
-      (rmail-maybe-display-summary))))
+  (interactive "p")
+  (if (not count) (setq count 1))
+  (let (value backward)
+    (if (< count 0)
+       (setq count (- count) backward t))
+    (dotimes (i count)
+      (rmail-set-attribute rmail-deleted-attr-index t)
+      (run-hooks 'rmail-delete-message-hook)
+      (let ((del-msg rmail-current-message))
+       (if (rmail-summary-exists)
+           (rmail-select-summary
+            (rmail-summary-mark-deleted del-msg)))
+       (setq value (rmail-next-undeleted-message (if backward -1 1)))))
+    (rmail-maybe-display-summary)
+    value))
 
-(defun rmail-delete-backward ()
+(defun rmail-delete-backward (&optional count)
   "Delete this message and move to previous nondeleted one.
-Deleted messages stay in the file until the \\[rmail-expunge] command is given."
-  (interactive)
-  (rmail-delete-forward t))
+Deleted messages stay in the file until the \\[rmail-expunge] command is given.
+Optional argument COUNT (interactively, prefix argument) is a repeat count;
+negative argument means move forwards instead of backwards.
+
+Returns t if a new message is displayed after the delete, or nil otherwise."
+
+  (interactive "p")
+  (if (not count) (setq count 1))
+  (rmail-delete-forward (- count)))
 \f
 ;; Expunging.
 
@@ -4297,31 +4315,21 @@ This has an effect only if a summary buffer exists."
 
 (defun rmail-unfontify-buffer-function ()
   ;; This function's symbol is bound to font-lock-fontify-unbuffer-function.
-  (let ((modified (buffer-modified-p))
-       (buffer-undo-list t) (inhibit-read-only t)
-       before-change-functions after-change-functions
-       buffer-file-name buffer-file-truename)
+  (with-silent-modifications
     (save-restriction
       (widen)
       (remove-hook 'rmail-show-message-hook 'rmail-fontify-message t)
       (remove-text-properties (point-min) (point-max) '(rmail-fontified nil))
-      (font-lock-default-unfontify-buffer)
-      (and (not modified) (buffer-modified-p)
-           (restore-buffer-modified-p nil)))))
+      (font-lock-default-unfontify-buffer))))
 
 (defun rmail-fontify-message ()
   ;; Fontify the current message if it is not already fontified.
   (if (text-property-any (point-min) (point-max) 'rmail-fontified nil)
-      (let ((modified (buffer-modified-p))
-           (buffer-undo-list t) (inhibit-read-only t)
-           before-change-functions after-change-functions
-           buffer-file-name buffer-file-truename)
+      (with-silent-modifications
        (save-excursion
          (save-match-data
            (add-text-properties (point-min) (point-max) '(rmail-fontified t))
-           (font-lock-fontify-region (point-min) (point-max))
-           (and (not modified) (buffer-modified-p)
-                 (restore-buffer-modified-p nil)))))))
+           (font-lock-fontify-region (point-min) (point-max)))))))
 \f
 ;;; Speedbar support for RMAIL files.
 (defcustom rmail-speedbar-match-folder-regexp "^[A-Z0-9]+\\(\\.[A-Z0-9]+\\)?$"
@@ -4773,7 +4781,7 @@ If prefix argument REVERSE is non-nil, sorts in reverse order.
 
 ;;;***
 \f
-;;;### (autoloads nil "rmailsum" "rmailsum.el" "1278ff9911aa307f30dd57c20adbcdc6")
+;;;### (autoloads nil "rmailsum" "rmailsum.el" "ee1fa556cd65d7ef457a97ab560e15da")
 ;;; Generated autoloads from rmailsum.el
 
 (autoload 'rmail-summary "rmailsum" "\
index ca884136a34480ad8a35bc7d044742f46f64ed6a..af08d0f3d3a66e935255f9f8e6e4d351bb5cef55 100644 (file)
@@ -914,7 +914,10 @@ a negative argument means to delete and move backward."
   (unless (numberp count) (setq count 1))
   (let (end del-msg
            (backward (< count 0)))
-    (while (/= count 0)
+    (while (and (/= count 0)
+               ;; Don't waste time if we are at the beginning
+               ;; and trying to go backward.
+               (not (and backward (bobp))))
       (rmail-summary-goto-msg)
       (with-current-buffer rmail-buffer
        (rmail-delete-message)
@@ -924,11 +927,13 @@ a negative argument means to delete and move backward."
                  (save-excursion (beginning-of-line)
                                  (looking-at " *[0-9]+D")))
        (forward-line (if backward -1 1)))
+      (setq count
+           (if (> count 0) (1- count) (1+ count)))
       ;; It looks ugly to move to the empty line at end of buffer.
+      ;; And don't waste time after hitting the end.
       (and (eobp) (not backward)
-          (forward-line -1))
-      (setq count
-           (if (> count 0) (1- count) (1+ count))))))
+          (progn (setq count 0)
+                 (forward-line -1))))))
 
 (defun rmail-summary-delete-backward (&optional count)
   "Delete this message and move to previous nondeleted one.
@@ -939,8 +944,9 @@ a negative argument means to delete and move forward."
   (rmail-summary-delete-forward (- count)))
 
 (defun rmail-summary-mark-deleted (&optional n undel)
-  ;; Since third arg is t, this only alters the summary, not the Rmail buf.
-  (and n (rmail-summary-goto-msg n t t))
+  (and n (not (eq n (rmail-summary-msg-number)))
+       ;; Since third arg is t, this only alters summary, not the Rmail buf.
+       (rmail-summary-goto-msg n t t))
   (or (eobp)
       (not (overlay-get rmail-summary-overlay 'face))
       (let ((buffer-read-only nil))
@@ -951,9 +957,9 @@ a negative argument means to delete and move forward."
                (progn (delete-char 1) (insert " ")))
          (delete-char 1)
          (insert "D"))
-       ;; Register a new summary line.
+       ;; Discard cached new summary line.
        (with-current-buffer rmail-buffer
-         (aset rmail-summary-vector (1- n) (rmail-create-summary-line n)))))
+         (aset rmail-summary-vector (1- n) nil))))
   (beginning-of-line))
 
 (defun rmail-summary-update-line (n)
@@ -1002,7 +1008,7 @@ Optional prefix ARG means undelete ARG previous messages."
                 (set-buffer rmail-buffer)
               (rmail-pop-to-buffer rmail-buffer))
             (and (rmail-message-deleted-p rmail-current-message)
-                 (rmail-undelete-previous-message))
+                 (rmail-undelete-previous-message 1))
             (if rmail-enable-mime
                 (rmail-pop-to-buffer rmail-buffer))
             (rmail-pop-to-buffer rmail-summary-buffer))
@@ -1011,26 +1017,35 @@ Optional prefix ARG means undelete ARG previous messages."
 (defun rmail-summary-undelete-many (&optional n)
   "Undelete all deleted msgs, optional prefix arg N means undelete N prev msgs."
   (interactive "P")
-  (with-current-buffer rmail-buffer
-    (let* ((init-msg (if n rmail-current-message rmail-total-messages))
-          (rmail-current-message init-msg)
-          (n (or n rmail-total-messages))
-          (msgs-undeled 0))
-      (while (and (> rmail-current-message 0)
-                 (< msgs-undeled n))
-       (if (rmail-message-deleted-p rmail-current-message)
-           (progn (rmail-set-attribute rmail-deleted-attr-index nil)
-                  (setq msgs-undeled (1+ msgs-undeled))))
-       (setq rmail-current-message (1- rmail-current-message)))
-      (set-buffer rmail-summary-buffer)
-      (setq rmail-current-message init-msg msgs-undeled 0)
-      (while (and (> rmail-current-message 0)
-                 (< msgs-undeled n))
-       (if (rmail-summary-deleted-p rmail-current-message)
-           (progn (rmail-summary-mark-undeleted rmail-current-message)
-                  (setq msgs-undeled (1+ msgs-undeled))))
-       (setq rmail-current-message (1- rmail-current-message))))
-    (rmail-summary-goto-msg)))
+  (if n
+      (while (and (> n 0) (not (eobp)))
+       (rmail-summary-goto-msg)
+       (let (del-msg)
+         (when (rmail-summary-deleted-p)
+           (with-current-buffer rmail-buffer
+             (rmail-undelete-previous-message 1)
+             (setq del-msg rmail-current-message))
+           (rmail-summary-mark-undeleted del-msg)))
+       (while (and (not (eobp))
+                   (save-excursion (beginning-of-line)
+                                   (looking-at " *[0-9]+ ")))
+         (forward-line 1))
+       (setq n (1- n)))
+    (rmail-summary-goto-msg 1)
+    (dotimes (i rmail-total-messages)
+      (rmail-summary-goto-msg)
+      (let (del-msg)
+       (when (rmail-summary-deleted-p)
+         (with-current-buffer rmail-buffer
+           (rmail-undelete-previous-message 1)
+           (setq del-msg rmail-current-message))
+         (rmail-summary-mark-undeleted del-msg)))
+      (if (not (eobp))
+         (forward-line 1))))
+
+  ;; It looks ugly to move to the empty line at end of buffer.
+  (and (eobp)
+       (forward-line -1)))
 \f
 ;; Rmail Summary mode is suitable only for specially formatted data.
 (put 'rmail-summary-mode 'mode-class 'special)
@@ -1188,6 +1203,13 @@ Search, the `unseen' attribute is restored.")
   (goto-char (posn-point (event-end event)))
   (rmail-summary-goto-msg))
 
+(defun rmail-summary-msg-number ()
+  (save-excursion
+    (beginning-of-line)
+    (string-to-number
+     (buffer-substring (point)
+                      (min (point-max) (+ 6 (point)))))))
+
 (defun rmail-summary-goto-msg (&optional n nowarn skip-rmail)
   "Go to message N in the summary buffer and the Rmail buffer.
 If N is nil, use the message corresponding to point in the summary
index 54f4664e6dbe2ab0d00e5206d433d206448224f3..3440741f573b15635a9e6e8a17d196b5b7bf1120 100644 (file)
@@ -733,7 +733,7 @@ Returns an error if the server cannot be contacted."
                                (plist-get (cdr result) :capabilities)
                                "\r\n")))
                  (let ((name
-                        (with-case-table ascii-case-table
+                        (with-case-table ascii-case-table ;FIXME: Why?
                           (mapcar (lambda (s) (intern (downcase s)))
                                   (split-string (substring line 4) "[ ]")))))
                    (when (= (length name) 1)
index 7a095981ebde4df94be2dd912a5a23f5de752864..4b235302f8b4549289f6224b7995781105c77165 100644 (file)
@@ -1,7 +1,6 @@
 ;;; man.el --- browse UNIX manual pages  -*- coding: utf-8 -*-
 
-;; Copyright (C) 1993-1994, 1996-1997, 2001-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1993-1994, 1996-1997, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Barry A. Warsaw <bwarsaw@cen.com>
 ;; Maintainer: emacs-devel@gnu.org
@@ -174,13 +173,12 @@ Any other value of `Man-notify-method' is equivalent to `meek'."
 
 (defcustom Man-width nil
   "Number of columns for which manual pages should be formatted.
-If nil, the width of the window selected at the moment of man
-invocation is used.  If non-nil, the width of the frame selected
-at the moment of man invocation is used.  The value also can be a
-positive integer."
+If nil, use the width of the window where the manpage is displayed.
+If non-nil, use the width of the frame where the manpage is displayed.
+The value also can be a positive integer for a fixed width."
   :type '(choice (const :tag "Window width" nil)
                  (const :tag "Frame width" t)
-                 (integer :tag "Specific width" :value 65))
+                 (integer :tag "Fixed width" :value 65))
   :group 'man)
 
 (defcustom Man-frame-parameters nil
@@ -695,9 +693,8 @@ a \"/\" as a local filename.  The function returns either `man-db'
             (with-temp-buffer
               (let ((default-directory
                       ;; Ensure that `default-directory' exists and is readable.
-                      (if (and (file-directory-p default-directory)
-                               (file-readable-p default-directory))
-                        default-directory
+                      (if (file-accessible-directory-p default-directory)
+                          default-directory
                         (expand-file-name "~/"))))
                 (ignore-errors
                   (call-process manual-program nil t nil "--help")))
@@ -932,12 +929,14 @@ test/automated/man-tests.el in the emacs bzr repository."
 ;;;###autoload
 (defun man (man-args)
   "Get a Un*x manual page and put it in a buffer.
-This command is the top-level command in the man package.  It
-runs a Un*x command to retrieve and clean a manpage in the
+This command is the top-level command in the man package.
+It runs a Un*x command to retrieve and clean a manpage in the
 background and places the results in a `Man-mode' browsing
-buffer.  See variable `Man-notify-method' for what happens when
-the buffer is ready.  If a buffer already exists for this man
-page, it will display immediately.
+buffer.  The variable `Man-width' defines the number of columns in
+formatted manual pages.  The buffer is displayed immediately.
+The variable `Man-notify-method' defines how the buffer is displayed.
+If a buffer already exists for this man page, it will be displayed
+without running the man command.
 
 For a manpage from a particular section, use either of the
 following.  \"cat(1)\" is how cross-references appear and is
@@ -1032,15 +1031,22 @@ names or descriptions.  The pattern argument is usually an
     ;;               ther is available).
     (when (or window-system
              (not (or (getenv "MANWIDTH") (getenv "COLUMNS"))))
-      ;; This isn't strictly correct, since we don't know how
-      ;; the page will actually be displayed, but it seems
-      ;; reasonable.
+      ;; Since the page buffer is displayed beforehand,
+      ;; we can select its window and get the window/frame width.
       (setenv "COLUMNS" (number-to-string
                         (cond
                          ((and (integerp Man-width) (> Man-width 0))
                           Man-width)
-                         (Man-width (frame-width))
-                         ((window-width))))))
+                         (Man-width
+                          (if (window-live-p (get-buffer-window (current-buffer) t))
+                              (with-selected-window (get-buffer-window (current-buffer) t)
+                                (frame-width))
+                            (frame-width)))
+                         (t
+                          (if (window-live-p (get-buffer-window (current-buffer) t))
+                              (with-selected-window (get-buffer-window (current-buffer) t)
+                                (window-width))
+                            (window-width)))))))
     ;; Since man-db 2.4.3-1, man writes plain text with no escape
     ;; sequences when stdout is not a tty.     In 2.5.0, the following
     ;; env-var was added to allow control of this (see Debian Bug#340673).
@@ -1059,33 +1065,45 @@ Return the buffer in which the manpage will appear."
       (message "Invoking %s %s in the background" manual-program man-args)
       (setq buffer (generate-new-buffer bufname))
       (with-current-buffer buffer
+       (Man-notify-when-ready buffer)
        (setq buffer-undo-list t)
        (setq Man-original-frame (selected-frame))
-       (setq Man-arguments man-args))
-      (Man-start-calling
-       (if (fboundp 'start-process)
-           (set-process-sentinel
-            (start-process manual-program buffer
-                           (if (memq system-type '(cygwin windows-nt))
-                               shell-file-name
-                             "sh")
-                           shell-command-switch
-                           (format (Man-build-man-command) man-args))
-            'Man-bgproc-sentinel)
-         (let ((exit-status
-                (call-process shell-file-name nil (list buffer nil) nil
-                              shell-command-switch
-                              (format (Man-build-man-command) man-args)))
-               (msg ""))
-           (or (and (numberp exit-status)
-                    (= exit-status 0))
-               (and (numberp exit-status)
-                    (setq msg
-                          (format "exited abnormally with code %d"
-                                  exit-status)))
-               (setq msg exit-status))
-           (Man-bgproc-sentinel bufname msg)))))
-      buffer))
+       (setq Man-arguments man-args)
+       (Man-mode)
+       (setq mode-line-process
+             (concat " " (propertize (if Man-fontify-manpage-flag
+                                         "[formatting...]"
+                                       "[cleaning...]")
+                                     'face 'mode-line-emphasis)))
+       (Man-start-calling
+        (if (fboundp 'start-process)
+            (let ((proc (start-process
+                         manual-program buffer
+                         (if (memq system-type '(cygwin windows-nt))
+                             shell-file-name
+                           "sh")
+                         shell-command-switch
+                         (format (Man-build-man-command) man-args))))
+              (set-process-sentinel proc 'Man-bgproc-sentinel)
+              (set-process-filter proc 'Man-bgproc-filter))
+          (let* ((inhibit-read-only t)
+                 (exit-status
+                  (call-process shell-file-name nil (list buffer nil) nil
+                                shell-command-switch
+                                (format (Man-build-man-command) man-args)))
+                 (msg ""))
+            (or (and (numberp exit-status)
+                     (= exit-status 0))
+                (and (numberp exit-status)
+                     (setq msg
+                           (format "exited abnormally with code %d"
+                                   exit-status)))
+                (setq msg exit-status))
+            (if Man-fontify-manpage-flag
+                (Man-fontify-manpage)
+              (Man-cleanup-manpage))
+            (Man-bgproc-sentinel bufname msg))))))
+    buffer))
 
 (defun Man-update-manpage ()
   "Reformat current manpage by calling the man command again synchronously."
@@ -1170,7 +1188,6 @@ See the variable `Man-notify-method' for the different notification behaviors."
   "Convert overstriking and underlining to the correct fonts.
 Same for the ANSI bold and normal escape sequences."
   (interactive)
-  (message "Please wait: formatting the %s man page..." Man-arguments)
   (goto-char (point-min))
   ;; Fontify ANSI escapes.
   (let ((ansi-color-apply-face-function
@@ -1185,7 +1202,7 @@ Same for the ANSI bold and normal escape sequences."
        ;; Multibyte characters exist.
        (progn
          (goto-char (point-min))
-         (while (search-forward "__\b\b" nil t)
+         (while (and (search-forward "__\b\b" nil t) (not (eobp)))
            (backward-delete-char 4)
            (put-text-property (point) (1+ (point)) 'face 'Man-underline))
          (goto-char (point-min))
@@ -1193,7 +1210,7 @@ Same for the ANSI bold and normal escape sequences."
            (backward-delete-char 4)
            (put-text-property (1- (point)) (point) 'face 'Man-underline))))
     (goto-char (point-min))
-    (while (search-forward "_\b" nil t)
+    (while (and (search-forward "_\b" nil t) (not (eobp)))
       (backward-delete-char 2)
       (put-text-property (point) (1+ (point)) 'face 'Man-underline))
     (goto-char (point-min))
@@ -1225,8 +1242,7 @@ Same for the ANSI bold and normal escape sequences."
     (while (re-search-forward Man-heading-regexp nil t)
       (put-text-property (match-beginning 0)
                         (match-end 0)
-                        'face 'Man-overstrike)))
-  (message "%s man page formatted" (Man-page-from-arguments Man-arguments)))
+                        'face 'Man-overstrike))))
 
 (defun Man-highlight-references (&optional xref-man-type)
   "Highlight the references on mouse-over.
@@ -1288,8 +1304,6 @@ Normally skip any jobs that should have been done by the sed script,
 but when called interactively, do those jobs even if the sed
 script would have done them."
   (interactive "p")
-  (message "Please wait: cleaning up the %s man page..."
-          Man-arguments)
   (if (or interactive (not Man-sed-script))
       (progn
        (goto-char (point-min))
@@ -1311,8 +1325,35 @@ script would have done them."
   ;; their preceding chars (but don't put Man-overstrike).  (Bug#5566)
   (goto-char (point-min))
   (while (re-search-forward ".\b" nil t) (backward-delete-char 2))
-  (Man-softhyphen-to-minus)
-  (message "%s man page cleaned up" Man-arguments))
+  (Man-softhyphen-to-minus))
+
+(defun Man-bgproc-filter (process string)
+  "Manpage background process filter.
+When manpage command is run asynchronously, PROCESS is the process
+object for the manpage command; when manpage command is run
+synchronously, PROCESS is the name of the buffer where the manpage
+command is run.  Second argument STRING is the entire string of output."
+  (save-excursion
+    (let ((Man-buffer (process-buffer process)))
+      (if (null (buffer-name Man-buffer)) ;; deleted buffer
+         (set-process-buffer process nil)
+
+       (with-current-buffer Man-buffer
+         (let ((inhibit-read-only t)
+               (beg (marker-position (process-mark process))))
+           (save-excursion
+             (goto-char beg)
+             (insert string)
+             (save-restriction
+               (narrow-to-region
+                (save-excursion
+                  (goto-char beg)
+                  (line-beginning-position))
+                (point))
+               (if Man-fontify-manpage-flag
+                   (Man-fontify-manpage)
+                 (Man-cleanup-manpage)))
+             (set-marker (process-mark process) (point-max)))))))))
 
 (defun Man-bgproc-sentinel (process msg)
   "Manpage background process sentinel.
@@ -1331,63 +1372,75 @@ manpage command."
            (set-process-buffer process nil))
 
       (with-current-buffer Man-buffer
-       (let ((case-fold-search nil))
-         (goto-char (point-min))
-         (cond ((or (looking-at "No \\(manual \\)*entry for")
-                    (looking-at "[^\n]*: nothing appropriate$"))
-                (setq err-mess (buffer-substring (point)
-                                                 (progn
-                                                   (end-of-line) (point)))
-                      delete-buff t))
-
-               ;; "-k foo", successful exit, but no output (from man-db)
-               ;; ENHANCE-ME: share the check for -k with
-               ;; `Man-highlight-references'.  The \\s- bits here are
-               ;; meant to allow for multiple options with -k among them.
-               ((and (string-match "\\(\\`\\|\\s-\\)-k\\s-" Man-arguments)
-                     (eq (process-status process) 'exit)
-                     (= (process-exit-status process) 0)
-                     (= (point-min) (point-max)))
-                (setq err-mess (format "%s: no matches" Man-arguments)
-                      delete-buff t))
-
-               ((or (stringp process)
-                    (not (and (eq (process-status process) 'exit)
-                              (= (process-exit-status process) 0))))
-                (or (zerop (length msg))
-                    (progn
-                      (setq err-mess
-                            (concat (buffer-name Man-buffer)
-                                    ": process "
-                                    (let ((eos (1- (length msg))))
-                                      (if (= (aref msg eos) ?\n)
-                                          (substring msg 0 eos) msg))))
-                      (goto-char (point-max))
-                      (insert (format "\nprocess %s" msg))))
-                ))
-        (if delete-buff
-            (kill-buffer Man-buffer)
-          (if Man-fontify-manpage-flag
-              (Man-fontify-manpage)
-            (Man-cleanup-manpage))
-
-          (run-hooks 'Man-cooked-hook)
-         (Man-mode)
-
-         (if (not Man-page-list)
-             (let ((args Man-arguments))
-               (kill-buffer (current-buffer))
-               (user-error "Can't find the %s manpage"
-                            (Man-page-from-arguments args)))
-           (set-buffer-modified-p nil))))
-       ;; Restore case-fold-search before calling
-       ;; Man-notify-when-ready because it may switch buffers.
-
-       (if (not delete-buff)
-           (Man-notify-when-ready Man-buffer))
+       (save-excursion
+         (let ((case-fold-search nil))
+           (goto-char (point-min))
+           (cond ((or (looking-at "No \\(manual \\)*entry for")
+                      (looking-at "[^\n]*: nothing appropriate$"))
+                  (setq err-mess (buffer-substring (point)
+                                                   (progn
+                                                     (end-of-line) (point)))
+                        delete-buff t))
+
+                 ;; "-k foo", successful exit, but no output (from man-db)
+                 ;; ENHANCE-ME: share the check for -k with
+                 ;; `Man-highlight-references'.  The \\s- bits here are
+                 ;; meant to allow for multiple options with -k among them.
+                 ((and (string-match "\\(\\`\\|\\s-\\)-k\\s-" Man-arguments)
+                       (eq (process-status process) 'exit)
+                       (= (process-exit-status process) 0)
+                       (= (point-min) (point-max)))
+                  (setq err-mess (format "%s: no matches" Man-arguments)
+                        delete-buff t))
+
+                 ((or (stringp process)
+                      (not (and (eq (process-status process) 'exit)
+                                (= (process-exit-status process) 0))))
+                  (or (zerop (length msg))
+                      (progn
+                        (setq err-mess
+                              (concat (buffer-name Man-buffer)
+                                      ": process "
+                                      (let ((eos (1- (length msg))))
+                                        (if (= (aref msg eos) ?\n)
+                                            (substring msg 0 eos) msg))))
+                        (goto-char (point-max))
+                        (insert (format "\nprocess %s" msg))))
+                  ))
+           (if delete-buff
+               (if (window-live-p (get-buffer-window Man-buffer t))
+                   (quit-restore-window
+                    (get-buffer-window Man-buffer t) 'kill)
+                 (kill-buffer Man-buffer))
+
+             (run-hooks 'Man-cooked-hook)
+
+             (Man-build-page-list)
+             (Man-strip-page-headers)
+             (Man-unindent)
+             (Man-goto-page 1 t)
+
+             (if (not Man-page-list)
+                 (let ((args Man-arguments))
+                   (if (window-live-p (get-buffer-window (current-buffer) t))
+                       (quit-restore-window
+                        (get-buffer-window (current-buffer) t) 'kill)
+                     (kill-buffer (current-buffer)))
+                   (message "Can't find the %s manpage"
+                            (Man-page-from-arguments args)))
+
+               (if Man-fontify-manpage-flag
+                   (message "%s man page formatted"
+                            (Man-page-from-arguments Man-arguments))
+                 (message "%s man page cleaned up"
+                          (Man-page-from-arguments Man-arguments)))
+               (unless (and (processp process)
+                            (not (eq (process-status process) 'exit)))
+                 (setq mode-line-process nil))
+               (set-buffer-modified-p nil)))))
 
        (if err-mess
-           (error "%s" err-mess))
+           (message "%s" err-mess))
        ))))
 
 (defun Man-page-from-arguments (args)
@@ -1431,7 +1484,7 @@ The following man commands are available in the buffer.  Try
 The following variables may be of some use.  Try
 \"\\[describe-variable] <variable-name> RET\" for more information:
 
-`Man-notify-method'            What happens when manpage formatting is done.
+`Man-notify-method'            What happens when manpage is ready to display.
 `Man-downcase-section-letters-flag' Force section letters to lower case.
 `Man-circular-pages-flag'      Treat multiple manpage list as circular.
 `Man-section-translations-alist' List of section numbers and their Un*x equiv.
@@ -1460,11 +1513,7 @@ The following key bindings are currently in effect in the buffer:
   (set (make-local-variable 'outline-regexp) Man-heading-regexp)
   (set (make-local-variable 'outline-level) (lambda () 1))
   (set (make-local-variable 'bookmark-make-record-function)
-       'Man-bookmark-make-record)
-  (Man-build-page-list)
-  (Man-strip-page-headers)
-  (Man-unindent)
-  (Man-goto-page 1 t))
+       'Man-bookmark-make-record))
 
 (defsubst Man-build-section-alist ()
   "Build the list of manpage sections."
@@ -1518,7 +1567,6 @@ The following key bindings are currently in effect in the buffer:
        (page-end (point-max))
        (header ""))
     (goto-char page-start)
-    ;; (switch-to-buffer (current-buffer))(debug)
     (while (not (eobp))
       (setq header
            (if (looking-at Man-page-header-regexp)
index 19c8bdd4e24d89a04d5a58b2437c2246f2eeb596..57acbbe648e85acdc436b33070719944de1cefc6 100644 (file)
@@ -887,8 +887,35 @@ by \"Save Options\" in Custom buffers.")
   (interactive)
   (customize-set-variable 'scroll-bar-mode nil))
 
+(defun menu-bar-horizontal-scroll-bar ()
+  "Display horizontal scroll bars on each window."
+  (interactive)
+  (customize-set-variable 'horizontal-scroll-bar-mode t))
+
+(defun menu-bar-no-horizontal-scroll-bar ()
+  "Turn off horizontal scroll bars."
+  (interactive)
+  (customize-set-variable 'horizontal-scroll-bar-mode nil))
+
 (defvar menu-bar-showhide-scroll-bar-menu
   (let ((menu (make-sparse-keymap "Scroll-bar")))
+    (bindings--define-key menu [horizontal]
+      '(menu-item "Horizontal"
+                  menu-bar-horizontal-scroll-bar
+                  :help "Horizontal scroll bar"
+                  :visible (display-graphic-p)
+                  :button (:radio . (eq (cdr (assq 'horizontal-scroll-bars
+                                                   (frame-parameters)))
+                                       t))))
+
+    (bindings--define-key menu [none-horizontal]
+      '(menu-item "None-horizontal"
+                  menu-bar-no-horizontal-scroll-bar
+                  :help "Turn off horizontal scroll bars"
+                  :visible (display-graphic-p)
+                  :button (:radio . (eq (cdr (assq 'horizontal-scroll-bars
+                                                   (frame-parameters)))
+                                       nil))))
 
     (bindings--define-key menu [right]
       '(menu-item "On the Right"
@@ -896,7 +923,8 @@ by \"Save Options\" in Custom buffers.")
                   :help "Scroll-bar on the right side"
                   :visible (display-graphic-p)
                   :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
-                                                   (frame-parameters))) 'right))))
+                                                   (frame-parameters)))
+                                       'right))))
 
     (bindings--define-key menu [left]
       '(menu-item "On the Left"
@@ -904,7 +932,8 @@ by \"Save Options\" in Custom buffers.")
                   :help "Scroll-bar on the left side"
                   :visible (display-graphic-p)
                   :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
-                                                   (frame-parameters))) 'left))))
+                                                   (frame-parameters)))
+                                       'left))))
 
     (bindings--define-key menu [none]
       '(menu-item "None"
@@ -912,7 +941,8 @@ by \"Save Options\" in Custom buffers.")
                   :help "Turn off scroll-bar"
                   :visible (display-graphic-p)
                   :button (:radio . (eq (cdr (assq 'vertical-scroll-bars
-                                                   (frame-parameters))) nil))))
+                                                   (frame-parameters)))
+                                       nil))))
     menu))
 
 (defun menu-bar-frame-for-menubar ()
@@ -1958,11 +1988,10 @@ It must accept a buffer as its only required argument.")
                    (dolist (pair alist)
                      (setq i (1- i))
                      (aset buffers-vec i
-                          (nconc (list (car pair)
-                                       (cons nil nil))
-                                 `(lambda ()
-                                     (interactive)
-                                     (funcall menu-bar-select-buffer-function ,(cdr pair))))))
+                          (cons (car pair)
+                                 `(lambda ()
+                                    (interactive)
+                                    (funcall menu-bar-select-buffer-function ,(cdr pair))))))
                    (list buffers-vec))))
 
         ;; Make a Frames menu if we have more than one frame.
@@ -1974,10 +2003,8 @@ It must accept a buffer as its only required argument.")
                   (i 0))
              (dolist (frame frames)
                (aset frames-vec i
-                     (nconc
-                      (list
-                       (frame-parameter frame 'name)
-                       (cons nil nil))
+                     (cons
+                      (frame-parameter frame 'name)
                       `(lambda ()
                          (interactive) (menu-bar-select-frame ,frame))))
                (setq i (1+ i)))
@@ -2140,6 +2167,13 @@ See `menu-bar-mode' for more information."
 (declare-function x-menu-bar-open "term/x-win" (&optional frame))
 (declare-function w32-menu-bar-open "term/w32-win" (&optional frame))
 
+(defun lookup-key-ignore-too-long (map key)
+  "Call `lookup-key' and convert numeric values to nil."
+  (let ((binding (lookup-key map key)))
+    (if (numberp binding)       ; `too long'
+        nil
+      binding)))
+
 (defun popup-menu (menu &optional position prefix from-menu-bar)
   "Popup the given menu and call the selected option.
 MENU can be a keymap, an easymenu-style menu or a list of keymaps as for
@@ -2192,11 +2226,9 @@ FROM-MENU-BAR, if non-nil, means we are dropping one of menu-bar's menus."
              (let ((mouse-click (apply 'vector event))
                    binding)
                (while (and map (null binding))
-                 (setq binding (lookup-key (car map) mouse-click))
-                 (if (numberp binding) ; `too long'
-                     (setq binding nil))
+                 (setq binding (lookup-key-ignore-too-long (car map) mouse-click))
                  (setq map (cdr map)))
-                 binding))
+                binding))
             (t
              ;; We were given a single keymap.
              (lookup-key map (apply 'vector event)))))
@@ -2276,8 +2308,10 @@ If FRAME is nil or not given, use the selected frame."
       (let* ((x tty-menu--initial-menu-x)
             (menu (menu-bar-menu-at-x-y x 0 frame)))
        (popup-menu (or
-                    (lookup-key global-map (vector 'menu-bar menu))
-                    (lookup-key (current-local-map) (vector 'menu-bar menu))
+                    (lookup-key-ignore-too-long
+                      global-map (vector 'menu-bar menu))
+                    (lookup-key-ignore-too-long
+                      (current-local-map) (vector 'menu-bar menu))
                     (cdar (minor-mode-key-binding (vector 'menu-bar menu))))
                    (posn-at-x-y x 0 nil t) nil t)))
      (t (with-selected-frame (or frame (selected-frame))
index b3d37ac4b1b430780cc58f373e7f2b532b6c2557..96a9b19ab78c2c13996ce1ab7cf993722c5b6410 100644 (file)
@@ -1,3 +1,7 @@
+2014-05-09  Glenn Morris  <rgm@gnu.org>
+
+       * mh-e.el (mh-variants): Use file-accessible-directory-p.
+
 2014-03-16  Bill Wohler  <wohler@newt.com>
 
        * mh-folder.el (mh-regenerate-headers): Fix scan: bad message list
index eaa05720f436f812e0809c8262135528ff1397d2..7368c0b9ffba6496d673145f1168259c5fb463ef 100644 (file)
@@ -1,7 +1,7 @@
 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
 
-;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2014 Free
-;; Software Foundation, Inc.
+;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2014
+;;   Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -739,7 +739,7 @@ is described by the variable `mh-variants'."
             (setq dir (file-chase-links (directory-file-name dir)))
             (add-to-list 'list-unique dir))
       (loop for dir in (nreverse list-unique) do
-            (when (and dir (file-directory-p dir) (file-readable-p dir))
+            (when (and dir (file-accessible-directory-p dir))
               (let ((variant (mh-variant-info dir)))
                 (if variant
                     (add-to-list 'mh-variants variant)))))
index 2c0541ac0966a8299fcce0b13e24e1044c24aec7..f998843cd854412db1adb22797c79671793a4f2a 100644 (file)
@@ -244,8 +244,7 @@ The result is a completion table which completes strings of the
 form (concat S1 S) in the same way as TABLE completes strings of
 the form (concat S2 S)."
   (lambda (string pred action)
-    (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil
-                                           completion-ignore-case))
+    (let* ((str (if (string-prefix-p s1 string completion-ignore-case)
                     (concat s2 (substring string (length s1)))))
            (res (if str (complete-with-action action table str pred))))
       (when res
@@ -257,8 +256,7 @@ the form (concat S2 S)."
                     (+ beg (- (length s1) (length s2))))
               . ,(and (eq (car-safe res) 'boundaries) (cddr res)))))
          ((stringp res)
-          (if (eq t (compare-strings res 0 (length s2) s2 nil nil
-                                     completion-ignore-case))
+          (if (string-prefix-p s2 string completion-ignore-case)
               (concat s1 (substring res (length s2)))))
          ((eq action t)
           (let ((bounds (completion-boundaries str table pred "")))
@@ -873,6 +871,7 @@ completing buffer and file names, respectively."
   ;; part of the string (e.g. substitute-in-file-name).
   (let ((requote
          (when (completion-metadata-get metadata 'completion--unquote-requote)
+           (cl-assert (functionp table))
            (let ((new (funcall table string point 'completion--unquote)))
              (setq string (pop new))
              (setq table (pop new))
@@ -1117,9 +1116,10 @@ If no characters can be completed, display a list of possible completions.
 If you repeat this command after it displayed such a list,
 scroll the window of possible completions."
   (interactive)
-  (completion-in-region (minibuffer-prompt-end) (point-max)
-                        minibuffer-completion-table
-                        minibuffer-completion-predicate))
+  (when (<= (minibuffer-prompt-end) (point))
+    (completion-in-region (minibuffer-prompt-end) (point-max)
+                          minibuffer-completion-table
+                          minibuffer-completion-predicate)))
 
 (defun completion--in-region-1 (beg end)
   ;; If the previous command was not this,
@@ -1794,8 +1794,29 @@ variables.")
              ;; window, mark it as softly-dedicated, so bury-buffer in
              ;; minibuffer-hide-completions will know whether to
              ;; delete the window or not.
-             (display-buffer-mark-dedicated 'soft))
-        (with-output-to-temp-buffer "*Completions*"
+             (display-buffer-mark-dedicated 'soft)
+             ;; Disable `pop-up-windows' temporarily to allow
+             ;; `display-buffer--maybe-pop-up-frame-or-window'
+             ;; in the display actions below to pop up a frame
+             ;; if `pop-up-frames' is non-nil, but not to pop up a window.
+             (pop-up-windows nil))
+        (with-displayed-buffer-window
+          "*Completions*"
+          ;; This is a copy of `display-buffer-fallback-action'
+          ;; where `display-buffer-use-some-window' is replaced
+          ;; with `display-buffer-at-bottom'.
+          `((display-buffer--maybe-same-window
+             display-buffer-reuse-window
+             display-buffer--maybe-pop-up-frame-or-window
+             ;; Use `display-buffer-below-selected' for inline completions,
+             ;; but not in the minibuffer (e.g. in `eval-expression')
+             ;; for which `display-buffer-at-bottom' is used.
+             ,(if (and completion-in-region-mode-predicate
+                       (not (minibuffer-selected-window)))
+                  'display-buffer-below-selected
+                'display-buffer-at-bottom))
+            (window-height . fit-window-to-buffer))
+          nil
           ;; Remove the base-size tail because `sort' requires a properly
           ;; nil-terminated list.
           (when last (setcdr last nil))
@@ -3065,16 +3086,9 @@ filter out additional entries (because TABLE might not obey PRED)."
       (nconc (completion-pcm--hilit-commonality pattern all)
              (length prefix)))))
 
-(defun completion--sreverse (str)
-  "Like `reverse' but for a string STR rather than a list."
-  (apply #'string (nreverse (mapcar 'identity str))))
-
 (defun completion--common-suffix (strs)
   "Return the common suffix of the strings STRS."
-  (completion--sreverse
-   (try-completion
-    ""
-    (mapcar #'completion--sreverse strs))))
+  (nreverse (try-completion "" (mapcar #'reverse strs))))
 
 (defun completion-pcm--merge-completions (strs pattern)
   "Extract the commonality in STRS, with the help of PATTERN.
@@ -3292,6 +3306,7 @@ the same set of elements."
                 (string-match completion-pcm--delim-wild-regex str
                               (car bounds)))
       (if (zerop (car bounds))
+          ;; FIXME: Don't hardcode "-" (bug#17559).
           (mapconcat 'string str "-")
         ;; If there's a boundary, it's trickier.  The main use-case
         ;; we consider here is file-name completion.  We'd like
index ce691748cac6dfd0da76dc2f8dbc08189b0ef3a3..2606c8b4ca44d9e7acf6dd633b00cb1734583083 100644 (file)
@@ -313,13 +313,14 @@ This command must be bound to a mouse click."
     (or (eq frame oframe)
        (set-mouse-position (selected-frame) (1- (frame-width)) 0))))
 
-(defun mouse-tear-off-window (click)
-  "Delete the window clicked on, and create a new frame displaying its buffer."
+(define-obsolete-function-alias 'mouse-tear-off-window 'tear-off-window "24.4")
+(defun tear-off-window (click)
+  "Delete the selected window, and create a new frame displaying its buffer."
   (interactive "e")
   (mouse-minibuffer-check click)
   (let* ((window (posn-window (event-start click)))
         (buf (window-buffer window))
-        (frame (make-frame)))
+        (frame (make-frame)))          ;FIXME: Use pop-to-buffer.
     (select-frame frame)
     (switch-to-buffer buf)
     (delete-window window)))
@@ -502,14 +503,18 @@ must be one of the symbols `header', `mode', or `vertical'."
   (interactive "e")
   (mouse-drag-line start-event 'vertical))
 \f
-(defun mouse-set-point (event)
+(defun mouse-set-point (event &optional promote-to-region)
   "Move point to the position clicked on with the mouse.
-This should be bound to a mouse click event type."
-  (interactive "e")
+This should be bound to a mouse click event type.
+If PROMOTE-TO-REGION is non-nil and event is a multiple-click,
+select the corresponding element around point."
+  (interactive "e\np")
   (mouse-minibuffer-check event)
-  ;; Use event-end in case called from mouse-drag-region.
-  ;; If EVENT is a click, event-end and event-start give same value.
-  (posn-set-point (event-end event)))
+  (if (and promote-to-region (> (event-click-count event) 1))
+      (mouse-set-region event)
+    ;; Use event-end in case called from mouse-drag-region.
+    ;; If EVENT is a click, event-end and event-start give same value.
+    (posn-set-point (event-end event))))
 
 (defvar mouse-last-region-beg nil)
 (defvar mouse-last-region-end nil)
@@ -522,6 +527,8 @@ This should be bound to a mouse click event type."
        (eq mouse-last-region-end (region-end))
        (eq mouse-last-region-tick (buffer-modified-tick))))
 
+(defvar mouse--drag-start-event nil)
+
 (defun mouse-set-region (click)
   "Set the region to the text dragged over, and copy to kill ring.
 This should be bound to a mouse drag event.
@@ -531,7 +538,29 @@ command alters the kill ring or not."
   (mouse-minibuffer-check click)
   (select-window (posn-window (event-start click)))
   (let ((beg (posn-point (event-start click)))
-       (end (posn-point (event-end click))))
+       (end (posn-point (event-end click)))
+        (click-count (event-click-count click)))
+    (let ((drag-start (terminal-parameter nil 'mouse-drag-start)))
+      (when drag-start
+        ;; Drag events don't come with a click count, sadly, so we hack
+        ;; our way around this problem by remembering the start-event in
+        ;; `mouse-drag-start' and fetching the click-count from there.
+        (when (and (<= click-count 1)
+                   (equal beg (posn-point (event-start drag-start))))
+          (setq click-count (event-click-count drag-start)))
+        ;; Occasionally we get spurious drag events where the user hasn't
+        ;; dragged his mouse, but instead Emacs has dragged the text under the
+        ;; user's mouse.  Try to recover those cases (bug#17562).
+        (when (and (equal (posn-x-y (event-start click))
+                          (posn-x-y (event-end click)))
+                   (not (eq (car drag-start) 'mouse-movement)))
+          (setq end beg))
+        (setf (terminal-parameter nil 'mouse-drag-start) nil)))
+    (when (and (integerp beg) (integerp end))
+      (let ((range (mouse-start-end beg end (1- click-count))))
+        (if (< end beg)
+            (setq end (nth 0 range) beg (nth 1 range))
+          (setq beg (nth 0 range) end (nth 1 range)))))
     (and mouse-drag-copy-region (integerp beg) (integerp end)
         ;; Don't set this-command to `kill-region', so a following
         ;; C-w won't double the text in the kill ring.  Ignore
@@ -551,10 +580,10 @@ command alters the kill ring or not."
 (defun mouse-set-region-1 ()
   ;; Set transient-mark-mode for a little while.
   (unless (eq (car-safe transient-mark-mode) 'only)
-    (setq transient-mark-mode
-         (cons 'only
-               (unless (eq transient-mark-mode 'lambda)
-                 transient-mark-mode))))
+    (setq-local transient-mark-mode
+                (cons 'only
+                      (unless (eq transient-mark-mode 'lambda)
+                        transient-mark-mode))))
   (setq mouse-last-region-beg (region-beginning))
   (setq mouse-last-region-end (region-end))
   (setq mouse-last-region-tick (buffer-modified-tick)))
@@ -625,13 +654,11 @@ Upon exit, point is at the far edge of the newly visible text."
 Highlight the drag area as you move the mouse.
 This must be bound to a button-down mouse event.
 In Transient Mark mode, the highlighting remains as long as the mark
-remains active.  Otherwise, it remains until the next input event.
-
-If the click is in the echo area, display the `*Messages*' buffer."
+remains active.  Otherwise, it remains until the next input event."
   (interactive "e")
   ;; Give temporary modes such as isearch a chance to turn off.
   (run-hooks 'mouse-leave-buffer-hook)
-  (mouse-drag-track start-event t))
+  (mouse-drag-track start-event))
 
 
 (defun mouse-posn-property (pos property)
@@ -648,10 +675,11 @@ its value is returned."
            (str (posn-string pos)))
        (or (and str
                 (get-text-property (cdr str) property (car str)))
-            ;; FIXME: mouse clicks on the mode-line come with a position in
-            ;; (nth 5).  Maybe we should change the C code instead so that
-            ;; mouse-clicks don't include a position there!
-           (and pt (not (memq (posn-area pos) '(mode-line header-line)))
+            ;; Mouse clicks in the fringe come with a position in
+            ;; (nth 5).  This is useful but is not exactly where we clicked, so
+            ;; don't look up that position's properties!
+           (and pt (not (memq (posn-area pos) '(left-fringe right-fringe
+                                                 left-margin right-margin)))
                 (get-char-property pt property w))))
     (get-char-property pos property)))
 
@@ -738,12 +766,9 @@ at the same position."
                    "mouse-1" (substring msg 7)))))))
   msg)
 
-(defun mouse-drag-track (start-event  &optional
-                                     do-mouse-drag-region-post-process)
+(defun mouse-drag-track (start-event)
     "Track mouse drags by highlighting area between point and cursor.
-The region will be defined with mark and point.
-DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
-`mouse-drag-region'."
+The region will be defined with mark and point."
   (mouse-minibuffer-check start-event)
   (setq mouse-selection-click-count-buffer (current-buffer))
   (deactivate-mark)
@@ -756,8 +781,6 @@ DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
         (start-posn (event-start start-event))
         (start-point (posn-point start-posn))
         (start-window (posn-window start-posn))
-        (start-window-start (window-start start-window))
-        (start-hscroll (window-hscroll start-window))
         (bounds (window-edges start-window))
         (make-cursor-line-fully-visible nil)
         (top (nth 1 bounds))
@@ -768,9 +791,7 @@ DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
         (click-count (1- (event-click-count start-event)))
         ;; Suppress automatic hscrolling, because that is a nuisance
         ;; when setting point near the right fringe (but see below).
-        (auto-hscroll-mode-saved auto-hscroll-mode)
-        (auto-hscroll-mode nil)
-        moved-off-start event end end-point)
+        (auto-hscroll-mode-saved auto-hscroll-mode))
 
     (setq mouse-selection-click-count click-count)
     ;; In case the down click is in the middle of some intangible text,
@@ -781,93 +802,51 @@ DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
 
     ;; Activate the region, using `mouse-start-end' to determine where
     ;; to put point and mark (e.g., double-click will select a word).
-    (setq transient-mark-mode
-         (if (eq transient-mark-mode 'lambda)
-             '(only)
-           (cons 'only transient-mark-mode)))
+    (setq-local transient-mark-mode
+                (if (eq transient-mark-mode 'lambda)
+                    '(only)
+                  (cons 'only transient-mark-mode)))
     (let ((range (mouse-start-end start-point start-point click-count)))
       (push-mark (nth 0 range) t t)
       (goto-char (nth 1 range)))
 
-    ;; Track the mouse until we get a non-movement event.
-    (track-mouse
-      (while (progn
-              (setq event (read-event))
-              (or (mouse-movement-p event)
-                  (memq (car-safe event) '(switch-frame select-window))))
-       (unless (memq (car-safe event) '(switch-frame select-window))
-         ;; Automatic hscrolling did not occur during the call to
-         ;; `read-event'; but if the user subsequently drags the
-         ;; mouse, go ahead and hscroll.
-         (let ((auto-hscroll-mode auto-hscroll-mode-saved))
-           (redisplay))
-         (setq end (event-end event)
-               end-point (posn-point end))
-         ;; Note whether the mouse has left the starting position.
-         (unless (eq end-point start-point)
-           (setq moved-off-start t))
-         (if (and (eq (posn-window end) start-window)
-                  (integer-or-marker-p end-point))
-             (mouse--drag-set-mark-and-point start-point
-                                             end-point click-count)
-           (let ((mouse-row (cdr (cdr (mouse-position)))))
-             (cond
-              ((null mouse-row))
-              ((< mouse-row top)
-               (mouse-scroll-subr start-window (- mouse-row top)
-                                  nil start-point))
-              ((>= mouse-row bottom)
-               (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
-                                  nil start-point))))))))
-
-    ;; Handle the terminating event if possible.
-    (when (consp event)
-      ;; Ensure that point is on the end of the last event.
-      (when (and (setq end-point (posn-point (event-end event)))
-                (eq (posn-window end) start-window)
-                (integer-or-marker-p end-point)
-                (/= start-point end-point))
-       (mouse--drag-set-mark-and-point start-point
-                                       end-point click-count))
-
-      ;; Find its binding.
-      (let* ((fun (key-binding (vector (car event))))
-            ;; FIXME This doesn't make sense, because
-            ;; event-click-count always returns something >= 1.
-            (do-multi-click (and (> (event-click-count event) 0)
-                                 (functionp fun)
-                                 (not (memq fun '(mouse-set-point
-                                                  mouse-set-region))))))
-       (if (and (/= (mark) (point))
-                (not do-multi-click))
-
-           ;; If point has moved, finish the drag.
-           (let* (last-command this-command)
-             (and mouse-drag-copy-region
-                  do-mouse-drag-region-post-process
-                  (let (deactivate-mark)
-                    (copy-region-as-kill (mark) (point)))))
-
-         ;; Otherwise, run binding of terminating up-event.
+    (setf (terminal-parameter nil 'mouse-drag-start) start-event)
+    (setq track-mouse t)
+    (setq auto-hscroll-mode nil)
+
+    (set-transient-map
+     (let ((map (make-sparse-keymap)))
+       (define-key map [switch-frame] #'ignore)
+       (define-key map [select-window] #'ignore)
+       (define-key map [mouse-movement]
+         (lambda (event) (interactive "e")
+           (let* ((end (event-end event))
+                  (end-point (posn-point end)))
+             (unless (eq end-point start-point)
+               ;; As soon as the user moves, we can re-enable auto-hscroll.
+               (setq auto-hscroll-mode auto-hscroll-mode-saved)
+               ;; And remember that we have moved, so mouse-set-region can know
+               ;; its event is really a drag event.
+               (setcar start-event 'mouse-movement))
+             (if (and (eq (posn-window end) start-window)
+                      (integer-or-marker-p end-point))
+                 (mouse--drag-set-mark-and-point start-point
+                                                 end-point click-count)
+               (let ((mouse-row (cdr (cdr (mouse-position)))))
+                 (cond
+                  ((null mouse-row))
+                  ((< mouse-row top)
+                   (mouse-scroll-subr start-window (- mouse-row top)
+                                      nil start-point))
+                  ((>= mouse-row bottom)
+                   (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
+                                      nil start-point))))))))
+       map)
+     t (lambda ()
+         (setq track-mouse nil)
+         (setq auto-hscroll-mode auto-hscroll-mode-saved)
           (deactivate-mark)
-         (if do-multi-click
-             (goto-char start-point)
-           (unless moved-off-start
-             (pop-mark)))
-
-         (when (and (functionp fun)
-                    (= start-hscroll (window-hscroll start-window))
-                    ;; Don't run the up-event handler if the window
-                    ;; start changed in a redisplay after the
-                    ;; mouse-set-point for the down-mouse event at
-                    ;; the beginning of this function.  When the
-                    ;; window start has changed, the up-mouse event
-                    ;; contains a different position due to the new
-                    ;; window contents, and point is set again.
-                    (or end-point
-                        (= (window-start start-window)
-                           start-window-start)))
-           (push event unread-command-events)))))))
+         (pop-mark)))))
 
 (defun mouse--drag-set-mark-and-point (start click click-count)
   (let* ((range (mouse-start-end start click click-count))
@@ -1895,14 +1874,10 @@ choose a font."
 \f
 ;;; Bindings for mouse commands.
 
-(define-key global-map [down-mouse-1] 'mouse-drag-region)
+(global-set-key [down-mouse-1] 'mouse-drag-region)
 (global-set-key [mouse-1]      'mouse-set-point)
 (global-set-key [drag-mouse-1] 'mouse-set-region)
 
-;; These are tested for in mouse-drag-region.
-(global-set-key [double-mouse-1] 'mouse-set-point)
-(global-set-key [triple-mouse-1] 'mouse-set-point)
-
 (defun mouse--strip-first-event (_prompt)
   (substring (this-single-command-raw-keys) 1))
 
index d569610a6152c0f868f6821b0d51233645faba7b..d03edf86bbac88098a658d429c0d9d43832f46a3 100644 (file)
@@ -1024,7 +1024,12 @@ If PLAYLIST is t or nil or missing, use the main playlist."
                          (when (and (null val) (eq tag 'Title))
                            (setq val (cdr (assq 'file info))))
                          (push `(equal ',val (cdr (assq ',tag info))) pred)
-                         val)))))
+                         (cond
+                          ((not (and (eq tag 'Date) (stringp val))) val)
+                          ;; For "date", only keep the year!
+                          ((string-match "[0-9]\\{4\\}" val)
+                           (match-string 0 val))
+                          (t val)))))))
                (space (when size
                         (setq size (string-to-number size))
                         (propertize " " 'display
@@ -1866,7 +1871,7 @@ This is used so that they can be compared with `eq', which is needed for
 `text-property-any'.")
 (defun mpc-songs-hashcons (name)
   (or (gethash name mpc-songs-hashcons) (puthash name name mpc-songs-hashcons)))
-(defcustom mpc-songs-format "%2{Disc--}%3{Track} %-5{Time} %25{Title} %20{Album} %20{Artist} %10{Date}"
+(defcustom mpc-songs-format "%2{Disc--}%3{Track} %-5{Time} %25{Title} %20{Album} %20{Artist} %5{Date}"
   "Format used to display each song in the list of songs."
   :type 'string)
 
index 9644a509b2203740ced7c17b8ba6258aa2a5a3e7..09d84795f4f9a9394cb61379bd3c8c13dd68aeab 100644 (file)
@@ -1343,16 +1343,12 @@ used instead of `browse-url-new-window-flag'."
                         "newwin\n"
                       "goto\n")
                     url "\n")
-            (let ((umask (default-file-modes)))
-              (unwind-protect
-                  (progn
-                    (set-default-file-modes ?\700)
-                    (if (file-exists-p
-                         (setq pidfile (format "/tmp/Mosaic.%d" pid)))
-                        (delete-file pidfile))
-                    ;; http://debbugs.gnu.org/17428.  Use O_EXCL.
-                    (write-region nil nil pidfile nil 'silent nil 'excl))
-                (set-default-file-modes umask))))
+            (with-file-modes ?\700
+              (if (file-exists-p
+                   (setq pidfile (format "/tmp/Mosaic.%d" pid)))
+                  (delete-file pidfile))
+              ;; http://debbugs.gnu.org/17428.  Use O_EXCL.
+              (write-region nil nil pidfile nil 'silent nil 'excl)))
          ;; Send signal SIGUSR to Mosaic
          (message "Signaling Mosaic...")
          (signal-process pid 'SIGUSR1)
index 66170dafef8a813c8f75d3b817ae610dbb0bff38..582f54faf4e91c17f0ee6e857553ff692776b2da 100644 (file)
@@ -544,6 +544,10 @@ placed in the queue.
 
 `:already-owner': Service is already the primary owner."
 
+  ;; Add Peer handler.
+  (dbus-register-method
+   bus service nil dbus-interface-peer "Ping" 'dbus-peer-handler 'dont-register)
+
   ;; Add ObjectManager handler.
   (dbus-register-method
    bus service nil dbus-interface-objectmanager "GetManagedObjects"
@@ -1151,6 +1155,22 @@ apply
          bus service dbus-path-dbus dbus-interface-peer "Ping")))
     (dbus-error nil)))
 
+(defun dbus-peer-handler ()
+  "Default handler for the \"org.freedesktop.DBus.Peer\" interface.
+It will be registered for all objects created by `dbus-register-service'."
+  (let* ((last-input-event last-input-event)
+        (method (dbus-event-member-name last-input-event)))
+    (cond
+     ;; "Ping" does not return an output parameter.
+     ((string-equal method "Ping")
+      :ignore)
+     ;; "GetMachineId" returns "s".
+     ((string-equal method "GetMachineId")
+      (signal
+       'dbus-error
+       (list
+       (format "%s.GetMachineId not implemented" dbus-interface-peer)))))))
+
 \f
 ;;; D-Bus introspection.
 
@@ -1672,7 +1692,7 @@ and \"org.freedesktop.DBus.Properties.GetAll\", which is slow."
 
 (defun dbus-managed-objects-handler ()
   "Default handler for the \"org.freedesktop.DBus.ObjectManager\" interface.
-It will be registered for all objects created by `dbus-register-method'."
+It will be registered for all objects created by `dbus-register-service'."
   (let* ((last-input-event last-input-event)
         (bus (dbus-event-bus-name last-input-event))
         (path (dbus-event-path-name last-input-event)))
index e52ead1fb7273b8e281c486387c147725b5fbb3b..ea1c805c6b9f10b2466b1eb7fba28bd00d6e470d 100644 (file)
   "List of DNS servers to query.
 If nil, /etc/resolv.conf and nslookup will be consulted.")
 
+(defvar dns-servers-valid-for-interfaces nil
+  "The return value of `network-interface-list' when `dns-servers' was set.
+If the set of network interfaces and/or their IP addresses
+change, then presumably the list of DNS servers needs to be
+updated.  Set this variable to t to disable the check.")
+
 ;;; Internal code:
 
 (defvar dns-query-types
@@ -297,6 +303,17 @@ If TCP-P, the first two bytes of the package with be the length field."
            (t string)))
       (goto-char point))))
 
+(declare-function network-interface-list "process.c")
+
+(defun dns-servers-up-to-date-p ()
+  "Return false if we need to recheck the list of DNS servers."
+  (and dns-servers
+       (or (eq dns-servers-valid-for-interfaces t)
+          ;; `network-interface-list' was introduced in Emacs 22.1.
+          (not (fboundp 'network-interface-list))
+          (equal dns-servers-valid-for-interfaces
+                 (network-interface-list)))))
+
 (defun dns-set-servers ()
   "Set `dns-servers' to a list of DNS servers or nil if none are found.
 Parses \"/etc/resolv.conf\" or calls \"nslookup\"."
@@ -314,7 +331,9 @@ Parses \"/etc/resolv.conf\" or calls \"nslookup\"."
          (goto-char (point-min))
          (re-search-forward
           "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t)
-         (setq dns-servers (list (match-string 1)))))))
+         (setq dns-servers (list (match-string 1))))))
+  (when (fboundp 'network-interface-list)
+    (setq dns-servers-valid-for-interfaces (network-interface-list))))
 
 (defun dns-read-txt (string)
   (if (> (length string) 1)
@@ -378,7 +397,7 @@ Parses \"/etc/resolv.conf\" or calls \"nslookup\"."
 If FULLP, return the entire record returned.
 If REVERSEP, look up an IP address."
   (setq type (or type 'A))
-  (unless dns-servers
+  (unless (dns-servers-up-to-date-p)
     (dns-set-servers))
 
   (when reversep
index ea4c0351be78a0a4212ee526fa7f0f9c57855632..0c650f38d9526912b0853cc874fbb101afecb8b6 100644 (file)
@@ -214,7 +214,7 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT."
                              (cl-mapcan
                               (lambda (check)
                                 (when (string-match (car check) hostname)
-                                  (cdr check)))
+                                  (copy-sequence (cdr check))))
                               gnutls-verify-error))
                             ;; else it's nil
                             (t nil))))
index 2591fc83e8458492d641c0c6099181d715f6e3fc..f06f8bd292ee75b06aec75272522f77b712746fa 100644 (file)
@@ -1,10 +1,10 @@
-;;; rcirc.el --- default, simple IRC client.
+;;; rcirc.el --- default, simple IRC client          -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2005-2014 Free Software Foundation, Inc.
 
 ;; Author: Ryan Yeske <rcyeske@gmail.com>
 ;; Maintainers: Ryan Yeske <rcyeske@gmail.com>,
-;;              Deniz Dogan <deniz@dogan.se>
+;;             Leo Liu <sdl.web@gmail.com>
 ;; Keywords: comm
 
 ;; This file is part of GNU Emacs.
@@ -43,9 +43,9 @@
 
 ;;; Code:
 
+(require 'cl-lib)
 (require 'ring)
 (require 'time-date)
-(eval-when-compile (require 'cl))
 
 (defgroup rcirc nil
   "Simple IRC client."
@@ -489,7 +489,7 @@ If ARG is non-nil, instead prompt for connection parameters."
                (when (string= server (process-name p))
                  (setq connected p)))
              (if (not connected)
-                 (condition-case e
+                 (condition-case nil
                      (rcirc-connect server port nick user-name
                                     full-name channels password encryption)
                    (quit (message "Quit connecting to %s" server)))
@@ -521,6 +521,7 @@ If ARG is non-nil, instead prompt for connection parameters."
 (defvar rcirc-user-authenticated nil)
 (defvar rcirc-user-disconnect nil)
 (defvar rcirc-connecting nil)
+(defvar rcirc-connection-info nil)
 (defvar rcirc-process nil)
 
 ;;;###autoload
@@ -549,22 +550,23 @@ If ARG is non-nil, instead prompt for connection parameters."
       (set-process-sentinel process 'rcirc-sentinel)
       (set-process-filter process 'rcirc-filter)
 
-      (set (make-local-variable 'rcirc-process) process)
-      (set (make-local-variable 'rcirc-server) server)
-      (set (make-local-variable 'rcirc-server-name) server) ; Update when we get 001 response.
-      (set (make-local-variable 'rcirc-buffer-alist) nil)
-      (set (make-local-variable 'rcirc-nick-table)
-           (make-hash-table :test 'equal))
-      (set (make-local-variable 'rcirc-nick) nick)
-      (set (make-local-variable 'rcirc-process-output) nil)
-      (set (make-local-variable 'rcirc-startup-channels) startup-channels)
-      (set (make-local-variable 'rcirc-last-server-message-time)
-           (current-time))
-
-      (set (make-local-variable 'rcirc-timeout-timer) nil)
-      (set (make-local-variable 'rcirc-user-disconnect) nil)
-      (set (make-local-variable 'rcirc-user-authenticated) nil)
-      (set (make-local-variable 'rcirc-connecting) t)
+      (setq-local rcirc-connection-info
+                 (list server port nick user-name full-name startup-channels
+                       password encryption))
+      (setq-local rcirc-process process)
+      (setq-local rcirc-server server)
+      (setq-local rcirc-server-name server) ; Update when we get 001 response.
+      (setq-local rcirc-buffer-alist nil)
+      (setq-local rcirc-nick-table (make-hash-table :test 'equal))
+      (setq-local rcirc-nick nick)
+      (setq-local rcirc-process-output nil)
+      (setq-local rcirc-startup-channels startup-channels)
+      (setq-local rcirc-last-server-message-time (current-time))
+
+      (setq-local rcirc-timeout-timer nil)
+      (setq-local rcirc-user-disconnect nil)
+      (setq-local rcirc-user-authenticated nil)
+      (setq-local rcirc-connecting t)
 
       (add-hook 'auto-save-hook 'rcirc-log-write)
 
@@ -629,7 +631,7 @@ last ping."
       (cancel-timer rcirc-keepalive-timer))
     (setq rcirc-keepalive-timer nil)))
 
-(defun rcirc-handler-ctcp-KEEPALIVE (process target sender message)
+(defun rcirc-handler-ctcp-KEEPALIVE (process _target _sender message)
   (with-rcirc-process-buffer process
     (setq header-line-format (format "%f" (- (rcirc-float-time)
                                             (string-to-number message))))))
@@ -656,6 +658,16 @@ is non-nil."
   "Hook functions called when the process sentinel is called.
 Functions are called with PROCESS and SENTINEL arguments.")
 
+(defcustom rcirc-reconnect-delay 0
+  "The minimum interval in seconds between reconnect attempts.
+When 0, do not auto-reconnect."
+  :version "24.5"
+  :type 'integer
+  :group 'rcirc)
+
+(defvar rcirc-last-connect-time nil
+  "The last time the buffer was connected.")
+
 (defun rcirc-sentinel (process sentinel)
   "Called when PROCESS receives SENTINEL."
   (let ((sentinel (replace-regexp-in-string "\n" "" sentinel)))
@@ -667,8 +679,17 @@ Functions are called with PROCESS and SENTINEL arguments.")
                       (format "%s: %s (%S)"
                               (process-name process)
                               sentinel
-                              (process-status process)) (not rcirc-target))
+                              (process-status process))
+                       (not rcirc-target))
          (rcirc-disconnect-buffer)))
+      (when (and (string= sentinel "deleted")
+                 (< 0 rcirc-reconnect-delay))
+        (let ((now (current-time)))
+          (when (or (null rcirc-last-connect-time)
+                    (< rcirc-reconnect-delay
+                       (float-time (time-subtract now rcirc-last-connect-time))))
+            (setq rcirc-last-connect-time now)
+            (rcirc-cmd-reconnect nil))))
       (run-hook-with-args 'rcirc-sentinel-functions process sentinel))))
 
 (defun rcirc-disconnect-buffer (&optional buffer)
@@ -752,7 +773,7 @@ Function is called with PROCESS, COMMAND, SENDER, ARGS and LINE.")
 (defvar rcirc-responses-no-activity '("305" "306")
   "Responses that don't trigger activity in the mode-line indicator.")
 
-(defun rcirc-handler-generic (process response sender args text)
+(defun rcirc-handler-generic (process response sender args _text)
   "Generic server response handler."
   (rcirc-print process sender response nil
                (mapconcat 'identity (cdr args) " ")
@@ -782,11 +803,11 @@ Function is called with PROCESS, COMMAND, SENDER, ARGS and LINE.")
 (defun rcirc-buffer-process (&optional buffer)
   "Return the process associated with channel BUFFER.
 With no argument or nil as argument, use the current buffer."
-  (or (get-buffer-process (if buffer
-                             (with-current-buffer buffer
-                               rcirc-server-buffer)
-                           rcirc-server-buffer))
-      rcirc-process))
+  (let ((buffer (or buffer (and (buffer-live-p rcirc-server-buffer)
+                               rcirc-server-buffer))))
+    (if buffer
+        (with-current-buffer buffer rcirc-process)
+      rcirc-process)))
 
 (defun rcirc-server-name (process)
   "Return PROCESS server name, given by the 001 response."
@@ -928,12 +949,12 @@ IRC command completion is performed only if '/' is the first input char."
 (defun set-rcirc-decode-coding-system (coding-system)
   "Set the decode coding system used in this channel."
   (interactive "zCoding system for incoming messages: ")
-  (set (make-local-variable 'rcirc-decode-coding-system) coding-system))
+  (setq-local rcirc-decode-coding-system coding-system))
 
 (defun set-rcirc-encode-coding-system (coding-system)
   "Set the encode coding system used in this channel."
   (interactive "zCoding system for outgoing messages: ")
-  (set (make-local-variable 'rcirc-encode-coding-system) coding-system))
+  (setq-local rcirc-encode-coding-system coding-system))
 
 (defvar rcirc-mode-map
   (let ((map (make-sparse-keymap)))
@@ -990,25 +1011,26 @@ This number is independent of the number of lines in the buffer.")
   (setq major-mode 'rcirc-mode)
   (setq mode-line-process nil)
 
-  (set (make-local-variable 'rcirc-input-ring)
-       ;; If rcirc-input-ring is already a ring with desired size do
-       ;; not re-initialize.
-       (if (and (ring-p rcirc-input-ring)
-               (= (ring-size rcirc-input-ring)
-                  rcirc-input-ring-size))
-          rcirc-input-ring
-        (make-ring rcirc-input-ring-size)))
-  (set (make-local-variable 'rcirc-server-buffer) (process-buffer process))
-  (set (make-local-variable 'rcirc-target) target)
-  (set (make-local-variable 'rcirc-topic) nil)
-  (set (make-local-variable 'rcirc-last-post-time) (current-time))
-  (set (make-local-variable 'fill-paragraph-function) 'rcirc-fill-paragraph)
-  (set (make-local-variable 'rcirc-recent-quit-alist) nil)
-  (set (make-local-variable 'rcirc-current-line) 0)
+  (setq-local rcirc-input-ring
+             ;; If rcirc-input-ring is already a ring with desired
+             ;; size do not re-initialize.
+             (if (and (ring-p rcirc-input-ring)
+                      (= (ring-size rcirc-input-ring)
+                         rcirc-input-ring-size))
+                 rcirc-input-ring
+               (make-ring rcirc-input-ring-size)))
+  (setq-local rcirc-server-buffer (process-buffer process))
+  (setq-local rcirc-target target)
+  (setq-local rcirc-topic nil)
+  (setq-local rcirc-last-post-time (current-time))
+  (setq-local fill-paragraph-function 'rcirc-fill-paragraph)
+  (setq-local rcirc-recent-quit-alist nil)
+  (setq-local rcirc-current-line 0)
+  (setq-local rcirc-last-connect-time (current-time))
 
   (use-hard-newlines t)
-  (set (make-local-variable 'rcirc-short-buffer-name) nil)
-  (set (make-local-variable 'rcirc-urls) nil)
+  (setq-local rcirc-short-buffer-name nil)
+  (setq-local rcirc-urls nil)
 
   ;; setup for omitting responses
   (setq buffer-invisibility-spec '())
@@ -1023,18 +1045,18 @@ This number is independent of the number of lines in the buffer.")
          (serv (if (consp (car i)) (cdar i) "")))
       (when (and (string-match chan (or target ""))
                 (string-match serv (rcirc-server-name process)))
-       (set (make-local-variable 'rcirc-decode-coding-system)
-             (if (consp (cdr i)) (cadr i) (cdr i)))
-        (set (make-local-variable 'rcirc-encode-coding-system)
-             (if (consp (cdr i)) (cddr i) (cdr i))))))
+       (setq-local rcirc-decode-coding-system
+                   (if (consp (cdr i)) (cadr i) (cdr i)))
+        (setq-local rcirc-encode-coding-system
+                   (if (consp (cdr i)) (cddr i) (cdr i))))))
 
   ;; setup the prompt and markers
-  (set (make-local-variable 'rcirc-prompt-start-marker) (point-max-marker))
-  (set (make-local-variable 'rcirc-prompt-end-marker) (point-max-marker))
+  (setq-local rcirc-prompt-start-marker (point-max-marker))
+  (setq-local rcirc-prompt-end-marker (point-max-marker))
   (rcirc-update-prompt)
   (goto-char rcirc-prompt-end-marker)
 
-  (set (make-local-variable 'overlay-arrow-position) (make-marker))
+  (setq-local overlay-arrow-position (make-marker))
 
   ;; if the user changes the major mode or kills the buffer, there is
   ;; cleanup work to do
@@ -1222,13 +1244,13 @@ Create the buffer if it doesn't exist."
          (ring-insert rcirc-input-ring input)
          (setq rcirc-input-ring-index 0))))))
 
-(defun rcirc-fill-paragraph (&optional arg)
-  (interactive "p")
+(defun rcirc-fill-paragraph (&optional justify)
+  (interactive "P")
   (when (> (point) rcirc-prompt-end-marker)
     (save-restriction
       (narrow-to-region rcirc-prompt-end-marker (point-max))
       (let ((fill-column rcirc-max-message-length))
-       (fill-region (point-min) (point-max))))))
+       (fill-region (point-min) (point-max) justify)))))
 
 (defun rcirc-process-input-line (line)
   (if (string-match "^/\\([^ ]+\\) ?\\(.*\\)$" line)
@@ -1393,9 +1415,9 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
        (rcirc-add-face start (match-beginning 0) face)
        (setq start (match-beginning 0))
        (replace-match
-        (case (aref (match-string 1) 0)
+        (cl-case (aref (match-string 1) 0)
            (?f (setq face
-                     (case (string-to-char (match-string 3))
+                     (cl-case (string-to-char (match-string 3))
                        (?w 'font-lock-warning-face)
                        (?p 'rcirc-server-prefix)
                        (?s 'rcirc-server)
@@ -1431,9 +1453,9 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
       (rcirc-add-face start (match-beginning 0) face))
       (buffer-substring (point-min) (point-max))))
 
-(defun rcirc-target-buffer (process sender response target text)
+(defun rcirc-target-buffer (process sender response target _text)
   "Return a buffer to print the server response."
-  (assert (not (bufferp target)))
+  (cl-assert (not (bufferp target)))
   (with-rcirc-process-buffer process
     (cond ((not target)
           (rcirc-any-buffer process))
@@ -1474,11 +1496,10 @@ Returns nil if the information is not recorded."
 
 (defun rcirc-last-line (process nick target)
   "Return the line from the last activity from NICK in TARGET."
-  (let* ((chanbuf (rcirc-get-buffer process target))
-        (line (or (cdr (assoc-string target
-                                     (gethash nick (with-rcirc-server-buffer
-                                                     rcirc-nick-table)) t))
-                  (rcirc-last-quit-line process nick target))))
+  (let ((line (or (cdr (assoc-string target
+                                    (gethash nick (with-rcirc-server-buffer
+                                                    rcirc-nick-table)) t))
+                 (rcirc-last-quit-line process nick target))))
     (if line
        line
       ;;(message "line is nil for %s in %s" nick target)
@@ -1883,7 +1904,9 @@ Uninteresting lines are those whose responses are listed in
        (message "Rcirc-Omit mode enabled"))
     (remove-from-invisibility-spec '(rcirc-omit . nil))
     (message "Rcirc-Omit mode disabled"))
-    (recenter (when (> (point) rcirc-prompt-start-marker) -1)))
+  (dolist (window (get-buffer-window-list (current-buffer)))
+    (with-selected-window window
+      (recenter (when (> (point) rcirc-prompt-start-marker) -1)))))
 
 (defun rcirc-switch-to-server-buffer ()
   "Switch to the server buffer associated with current channel buffer."
@@ -1956,7 +1979,7 @@ activity.  Only run if the buffer is not visible and
                      (let ((t1 (with-current-buffer b1 rcirc-last-post-time))
                            (t2 (with-current-buffer b2 rcirc-last-post-time)))
                        (time-less-p t2 t1)))))
-       (pushnew type rcirc-activity-types)
+       (cl-pushnew type rcirc-activity-types)
        (unless (and (equal rcirc-activity old-activity)
                     (member type old-types))
          (rcirc-update-activity-string)))))
@@ -1977,13 +2000,13 @@ activity.  Only run if the buffer is not visible and
 (defun rcirc-split-activity (activity)
   "Return a cons cell with ACTIVITY split into (lopri . hipri)."
   (let (lopri hipri)
-    (dolist (buf rcirc-activity)
+    (dolist (buf activity)
       (with-current-buffer buf
        (if (and rcirc-low-priority-flag
                 (not (member 'nick rcirc-activity-types)))
-           (add-to-list 'lopri buf t)
-         (add-to-list 'hipri buf t))))
-    (cons lopri hipri)))
+           (push buf lopri)
+         (push buf hipri))))
+    (cons (nreverse lopri) (nreverse hipri))))
 
 (defvar rcirc-update-activity-string-hook nil
   "Hook run whenever the activity string is updated.")
@@ -2015,7 +2038,7 @@ activity.  Only run if the buffer is not visible and
                 (with-current-buffer b
                   (dolist (type rcirc-activity-types)
                     (rcirc-add-face 0 (length s)
-                                    (case type
+                                    (cl-case type
                                       (nick 'rcirc-track-nick)
                                       (keyword 'rcirc-track-keyword))
                                     s)))
@@ -2123,7 +2146,7 @@ activity.  Only run if the buffer is not visible and
            (when (and (listp x) (listp (cadr x)))
              (setcdr x (if (> (length (cdr x)) 1)
                            (rcirc-make-trees (cdr x))
-                         (setcdr x (list (cdadr x)))))))
+                         (setcdr x (list (cl-cdadr x)))))))
          alist)))
 \f
 ;;; /commands these are called with 3 args: PROCESS, TARGET, which is
@@ -2211,6 +2234,19 @@ CHANNELS is a comma- or space-separated string of channel names."
                                         reason
                                       rcirc-id-string))))
 
+(defun-rcirc-command reconnect (_)
+  "Reconnect to current server."
+  (interactive "i")
+  (with-rcirc-server-buffer
+    (cond
+     (rcirc-connecting (message "Already connecting"))
+     ((process-live-p process) (message "Server process is alive"))
+     (t (let ((conn-info rcirc-connection-info))
+         (setf (nth 5 conn-info)
+               (cl-remove-if-not #'rcirc-channel-p
+                                 (mapcar #'car rcirc-buffer-alist)))
+         (apply #'rcirc-connect conn-info))))))
+
 (defun-rcirc-command nick (nick)
   "Change nick to NICK."
   (interactive "i")
@@ -2281,7 +2317,7 @@ With a prefix arg, prompt for new topic."
                             (mapconcat 'identity (cdr arglist) " "))))
     (rcirc-send-string process (concat "KICK " target " " argstring))))
 
-(defun rcirc-cmd-ctcp (args &optional process target)
+(defun rcirc-cmd-ctcp (args &optional process _target)
   (if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args)
       (let* ((target (match-string 1 args))
              (request (upcase (match-string 2 args)))
@@ -2292,7 +2328,7 @@ With a prefix arg, prompt for new topic."
     (rcirc-print process (rcirc-nick process) "ERROR" nil
                  "usage: /ctcp NICK REQUEST")))
 
-(defun rcirc-ctcp-sender-PING (process target request)
+(defun rcirc-ctcp-sender-PING (process target _request)
   "Send a CTCP PING message to TARGET."
   (let ((timestamp (format "%.0f" (rcirc-float-time))))
     (rcirc-send-ctcp process target "PING" timestamp)))
@@ -2412,21 +2448,20 @@ If ARG is given, opens the URL in a new browser window."
                     (lambda (x) (>= point (cdr x)))
                     rcirc-urls))
          (completions (mapcar (lambda (x) (car x)) filtered))
-         (initial-input (caar filtered))
-         (history (mapcar (lambda (x) (car x)) (cdr filtered))))
-    (browse-url (completing-read "rcirc browse-url: "
-                                 completions nil nil initial-input 'history)
+         (defaults (mapcar (lambda (x) (car x)) filtered)))
+    (browse-url (completing-read "Rcirc browse-url: "
+                                 completions nil nil (car defaults) nil defaults)
                 arg)))
 \f
-(defun rcirc-markup-timestamp (sender response)
+(defun rcirc-markup-timestamp (_sender _response)
   (goto-char (point-min))
   (insert (rcirc-facify (format-time-string rcirc-time-format)
                        'rcirc-timestamp)))
 
-(defun rcirc-markup-attributes (sender response)
+(defun rcirc-markup-attributes (_sender _response)
   (while (re-search-forward "\\([\C-b\C-_\C-v]\\).*?\\(\\1\\|\C-o\\)" nil t)
     (rcirc-add-face (match-beginning 0) (match-end 0)
-                   (case (char-after (match-beginning 1))
+                   (cl-case (char-after (match-beginning 1))
                      (?\C-b 'bold)
                      (?\C-v 'italic)
                      (?\C-_ 'underline)))
@@ -2440,7 +2475,7 @@ If ARG is given, opens the URL in a new browser window."
   (while (re-search-forward "\C-o+" nil t)
     (delete-region (match-beginning 0) (match-end 0))))
 
-(defun rcirc-markup-my-nick (sender response)
+(defun rcirc-markup-my-nick (_sender response)
   (with-syntax-table rcirc-nick-syntax-table
     (while (re-search-forward (concat "\\b"
                                      (regexp-quote (rcirc-nick
@@ -2454,7 +2489,7 @@ If ARG is given, opens the URL in a new browser window."
                        'rcirc-nick-in-message-full-line)
        (rcirc-record-activity (current-buffer) 'nick)))))
 
-(defun rcirc-markup-urls (sender response)
+(defun rcirc-markup-urls (_sender _response)
   (while (and rcirc-url-regexp ;; nil means disable URL catching
               (re-search-forward rcirc-url-regexp nil t))
     (let* ((start (match-beginning 0))
@@ -2485,7 +2520,7 @@ If ARG is given, opens the URL in a new browser window."
          (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword)
          (rcirc-record-activity (current-buffer) 'keyword))))))
 
-(defun rcirc-markup-bright-nicks (sender response)
+(defun rcirc-markup-bright-nicks (_sender response)
   (when (and rcirc-bright-nicks
             (string= response "NAMES"))
     (with-syntax-table rcirc-nick-syntax-table
@@ -2493,7 +2528,7 @@ If ARG is given, opens the URL in a new browser window."
        (rcirc-add-face (match-beginning 0) (match-end 0)
                        'rcirc-bright-nick)))))
 
-(defun rcirc-markup-fill (sender response)
+(defun rcirc-markup-fill (_sender response)
   (when (not (string= response "372"))         ; /motd
     (let ((fill-prefix
           (or rcirc-fill-prefix
@@ -2574,7 +2609,7 @@ If ARG is given, opens the URL in a new browser window."
                            sender)))
                  message t))))
 
-(defun rcirc-check-auth-status (process sender args text)
+(defun rcirc-check-auth-status (process sender args _text)
   "Check if the user just authenticated.
 If authenticated, runs `rcirc-authenticated-hook' with PROCESS as
 the only argument."
@@ -2602,10 +2637,10 @@ the only argument."
           (run-hook-with-args 'rcirc-authenticated-hook process)
           (remove-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t))))))
 
-(defun rcirc-handler-WALLOPS (process sender args text)
+(defun rcirc-handler-WALLOPS (process sender args _text)
   (rcirc-print process sender "WALLOPS" sender (car args) t))
 
-(defun rcirc-handler-JOIN (process sender args text)
+(defun rcirc-handler-JOIN (process sender args _text)
   (let ((channel (car args)))
     (with-current-buffer (rcirc-get-buffer-create process channel)
       ;; when recently rejoining, restore the linestamp
@@ -2626,7 +2661,7 @@ the only argument."
       (rcirc-print process sender "JOIN" sender channel))))
 
 ;; PART and KICK are handled the same way
-(defun rcirc-handler-PART-or-KICK (process response channel sender nick args)
+(defun rcirc-handler-PART-or-KICK (process _response channel _sender nick _args)
   (rcirc-ignore-update-automatic nick)
   (if (not (string= nick (rcirc-nick process)))
       ;; this is someone else leaving
@@ -2643,7 +2678,7 @@ the only argument."
       (when buffer
        (rcirc-disconnect-buffer buffer)))))
 
-(defun rcirc-handler-PART (process sender args text)
+(defun rcirc-handler-PART (process sender args _text)
   (let* ((channel (car args))
         (reason (cadr args))
         (message (concat channel " " reason)))
@@ -2654,10 +2689,10 @@ the only argument."
 
     (rcirc-handler-PART-or-KICK process "PART" channel sender sender reason)))
 
-(defun rcirc-handler-KICK (process sender args text)
+(defun rcirc-handler-KICK (process sender args _text)
   (let* ((channel (car args))
         (nick (cadr args))
-        (reason (caddr args))
+        (reason (cl-caddr args))
         (message (concat nick " " channel " " reason)))
     (rcirc-print process sender "KICK" channel message t)
     ;; print in private chat buffer if it exists
@@ -2682,7 +2717,7 @@ the only argument."
                      (cons (cons nick line)
                            rcirc-recent-quit-alist))))))))))
 
-(defun rcirc-handler-QUIT (process sender args text)
+(defun rcirc-handler-QUIT (process sender args _text)
   (rcirc-ignore-update-automatic sender)
   (mapc (lambda (channel)
          ;; broadcast quit message each channel
@@ -2692,7 +2727,7 @@ the only argument."
        (rcirc-nick-channels process sender))
   (rcirc-nick-remove process sender))
 
-(defun rcirc-handler-NICK (process sender args text)
+(defun rcirc-handler-NICK (process sender args _text)
   (let* ((old-nick sender)
          (new-nick (car args))
          (channels (rcirc-nick-channels process old-nick)))
@@ -2723,25 +2758,25 @@ the only argument."
         ;; reauthenticate
         (when rcirc-auto-authenticate-flag (rcirc-authenticate))))))
 
-(defun rcirc-handler-PING (process sender args text)
+(defun rcirc-handler-PING (process _sender args _text)
   (rcirc-send-string process (concat "PONG :" (car args))))
 
-(defun rcirc-handler-PONG (process sender args text)
+(defun rcirc-handler-PONG (_process _sender _args _text)
   ;; do nothing
   )
 
-(defun rcirc-handler-TOPIC (process sender args text)
+(defun rcirc-handler-TOPIC (process sender args _text)
   (let ((topic (cadr args)))
     (rcirc-print process sender "TOPIC" (car args) topic)
     (with-current-buffer (rcirc-get-buffer process (car args))
       (setq rcirc-topic topic))))
 
 (defvar rcirc-nick-away-alist nil)
-(defun rcirc-handler-301 (process sender args text)
+(defun rcirc-handler-301 (process _sender args text)
   "RPL_AWAY"
   (let* ((nick (cadr args))
         (rec (assoc-string nick rcirc-nick-away-alist))
-        (away-message (caddr args)))
+        (away-message (cl-caddr args)))
     (when (or (not rec)
              (not (string= (cdr rec) away-message)))
       ;; away message has changed
@@ -2751,7 +2786,7 @@ the only argument."
        (setq rcirc-nick-away-alist (cons (cons nick away-message)
                                          rcirc-nick-away-alist))))))
 
-(defun rcirc-handler-317 (process sender args text)
+(defun rcirc-handler-317 (process sender args _text)
   "RPL_WHOISIDLE"
   (let* ((nick (nth 1 args))
          (idle-secs (string-to-number (nth 2 args)))
@@ -2765,31 +2800,31 @@ the only argument."
                           nick idle-string signon-string)))
     (rcirc-print process sender "317" nil message t)))
 
-(defun rcirc-handler-332 (process sender args text)
+(defun rcirc-handler-332 (process _sender args _text)
   "RPL_TOPIC"
   (let ((buffer (or (rcirc-get-buffer process (cadr args))
                    (rcirc-get-temp-buffer-create process (cadr args)))))
     (with-current-buffer buffer
-      (setq rcirc-topic (caddr args)))))
+      (setq rcirc-topic (cl-caddr args)))))
 
-(defun rcirc-handler-333 (process sender args text)
+(defun rcirc-handler-333 (process sender args _text)
   "333 says who set the topic and when.
 Not in rfc1459.txt"
   (let ((buffer (or (rcirc-get-buffer process (cadr args))
                    (rcirc-get-temp-buffer-create process (cadr args)))))
     (with-current-buffer buffer
-      (let ((setter (caddr args))
+      (let ((setter (cl-caddr args))
            (time (current-time-string
                   (seconds-to-time
-                   (string-to-number (cadddr args))))))
+                   (string-to-number (cl-cadddr args))))))
        (rcirc-print process sender "TOPIC" (cadr args)
                     (format "%s (%s on %s)" rcirc-topic setter time))))))
 
-(defun rcirc-handler-477 (process sender args text)
+(defun rcirc-handler-477 (process sender args _text)
   "ERR_NOCHANMODES"
-  (rcirc-print process sender "477" (cadr args) (caddr args)))
+  (rcirc-print process sender "477" (cadr args) (cl-caddr args)))
 
-(defun rcirc-handler-MODE (process sender args text)
+(defun rcirc-handler-MODE (process sender args _text)
   (let ((target (car args))
         (msg (mapconcat 'identity (cdr args) " ")))
     (rcirc-print process sender "MODE"
@@ -2809,7 +2844,7 @@ Not in rfc1459.txt"
   (let ((tmpnam (concat " " (downcase channel) "TMP" (process-name process))))
     (get-buffer-create tmpnam)))
 
-(defun rcirc-handler-353 (process sender args text)
+(defun rcirc-handler-353 (process _sender args _text)
   "RPL_NAMREPLY"
   (let ((channel (nth 2 args))
        (names (or (nth 3 args) "")))
@@ -2822,7 +2857,7 @@ Not in rfc1459.txt"
       (goto-char (point-max))
       (insert (car (last args)) " "))))
 
-(defun rcirc-handler-366 (process sender args text)
+(defun rcirc-handler-366 (process sender args _text)
   "RPL_ENDOFNAMES"
   (let* ((channel (cadr args))
          (buffer (rcirc-get-temp-buffer-create process channel)))
@@ -2847,14 +2882,14 @@ Passwords are stored in `rcirc-authinfo' (which see)."
     (dolist (i rcirc-authinfo)
       (let ((process (rcirc-buffer-process))
            (server (car i))
-           (nick (caddr i))
+           (nick (cl-caddr i))
            (method (cadr i))
-           (args (cdddr i)))
+           (args (cl-cdddr i)))
        (when (and (string-match server rcirc-server))
           (if (and (memq method '(nickserv chanserv bitlbee))
                    (string-match nick rcirc-nick))
               ;; the following methods rely on the user's nickname.
-              (case method
+              (cl-case method
                 (nickserv
                  (rcirc-send-privmsg
                   process
@@ -2878,10 +2913,10 @@ Passwords are stored in `rcirc-authinfo' (which see)."
                "Q@CServe.quakenet.org"
                (format "AUTH %s %s" nick (car args))))))))))
 
-(defun rcirc-handler-INVITE (process sender args text)
+(defun rcirc-handler-INVITE (process sender args _text)
   (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t))
 
-(defun rcirc-handler-ERROR (process sender args text)
+(defun rcirc-handler-ERROR (process sender args _text)
   (rcirc-print process sender "ERROR" nil (mapconcat 'identity args " ")))
 
 (defun rcirc-handler-CTCP (process target sender text)
@@ -2899,7 +2934,7 @@ Passwords are stored in `rcirc-authinfo' (which see)."
               (rcirc-print process sender "CTCP" target
                           (format "%s" text) t))))))
 
-(defun rcirc-handler-ctcp-VERSION (process target sender args)
+(defun rcirc-handler-ctcp-VERSION (process _target sender _args)
   (rcirc-send-string process
                      (concat "NOTICE " sender
                              " :\C-aVERSION " rcirc-id-string
@@ -2908,12 +2943,12 @@ Passwords are stored in `rcirc-authinfo' (which see)."
 (defun rcirc-handler-ctcp-ACTION (process target sender args)
   (rcirc-print process sender "ACTION" target args t))
 
-(defun rcirc-handler-ctcp-TIME (process target sender args)
+(defun rcirc-handler-ctcp-TIME (process _target sender _args)
   (rcirc-send-string process
                      (concat "NOTICE " sender
                              " :\C-aTIME " (current-time-string) "\C-a")))
 
-(defun rcirc-handler-CTCP-response (process target sender message)
+(defun rcirc-handler-CTCP-response (process _target sender message)
   (rcirc-print process sender "CTCP" nil message t))
 \f
 (defgroup rcirc-faces nil
index c21f29077205a08476c827206417b73f4d21d3ee..16017eebba3f2c65b17fb89d8d27048b9a2e5406 100644 (file)
@@ -458,9 +458,7 @@ Emacs dired can't find files."
       (insert "  " (mapconcat 'identity sorted-lines "\n  ")))
     ;; Add final newline.
     (goto-char (point-max))
-    (unless (= (point) (line-beginning-position))
-      (insert "\n"))))
-
+    (unless (bolp) (insert "\n"))))
 
 (defun tramp-adb-ls-output-time-less-p (a b)
   "Sort \"ls\" output by time, descending."
@@ -609,10 +607,10 @@ But handle the case, if the \"test\" command is not available."
        'write-region
        (list start end tmpfile append 'no-message lockname confirm))
       (with-tramp-progress-reporter
-         v 3 (format "Moving tmp file %s to %s" tmpfile filename)
+         v 3 (format "Moving tmp file `%s' to `%s'" tmpfile filename)
        (unwind-protect
            (when (tramp-adb-execute-adb-command v "push" tmpfile localname)
-             (tramp-error v 'file-error "Cannot write: `%s' filename"))
+             (tramp-error v 'file-error "Cannot write: `%s'" filename))
          (delete-file tmpfile)))
 
       (when (or (eq visit t) (stringp visit))
@@ -998,7 +996,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
   (with-temp-buffer
     (prog1
        (unless
-           (zerop (apply 'tramp-call-process tramp-adb-program nil t nil args))
+           (zerop
+            (apply 'tramp-call-process vec tramp-adb-program nil t nil args))
          (buffer-string))
       (tramp-message vec 6 "%s" (buffer-string)))))
 
@@ -1031,7 +1030,7 @@ This happens for Android >= 4.0."
 
 (defun tramp-adb-send-command-and-check
   (vec command)
-  "Run COMMAND and and check its exit status.
+  "Run COMMAND and check its exit status.
 Sends `echo $?' along with the COMMAND for checking the exit status.  If
 COMMAND is nil, just sends `echo $?'.  Returns the exit status found."
   (tramp-adb-send-command
@@ -1107,10 +1106,7 @@ connection if a previous connection has died for some reason."
        (and p (processp p) (memq (process-status p) '(run open)))
       (save-match-data
        (when (and p (processp p)) (delete-process p))
-       (setq tramp-current-method (tramp-file-name-method vec)
-             tramp-current-user (tramp-file-name-user vec)
-             tramp-current-host (tramp-file-name-host vec)
-             devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))
+       (setq devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))
        (if (not devices)
            (tramp-error vec 'file-error "No device connected"))
        (if (and (> (length host) 0) (not (member host devices)))
index be66f18d9e44664b8cdf1f5b6757aff73a8d4d17..838d326603c14b656fa6df8953d724f3b0e29afe 100644 (file)
@@ -201,15 +201,19 @@ Remove also properties of all files in subdirectories."
 ;; Reverting or killing a buffer should also flush file properties.
 ;; They could have been changed outside Tramp.  In eshell, "ls" would
 ;; not show proper directory contents when a file has been copied or
-;; deleted before.
+;; deleted before.  We must apply `save-match-data', because it would
+;; corrupt other packages otherwise (reported from org).
 (defun tramp-flush-file-function ()
-  "Flush all Tramp cache properties from `buffer-file-name'."
-  (let ((bfn (if (stringp (buffer-file-name))
-                (buffer-file-name)
-              default-directory)))
-    (when (tramp-tramp-file-p bfn)
-      (with-parsed-tramp-file-name bfn nil
-       (tramp-flush-file-property v localname)))))
+  "Flush all Tramp cache properties from `buffer-file-name'.
+This is suppressed for temporary buffers."
+  (save-match-data
+    (unless (string-match "^ \\*temp\\*" (or (buffer-name) ""))
+      (let ((bfn (if (stringp (buffer-file-name))
+                    (buffer-file-name)
+                  default-directory)))
+       (when (tramp-tramp-file-p bfn)
+         (with-parsed-tramp-file-name bfn nil
+           (tramp-flush-file-property v localname)))))))
 
 (add-hook 'before-revert-hook 'tramp-flush-file-function)
 (add-hook 'eshell-pre-command-hook 'tramp-flush-file-function)
index dc84a524ba0816602fec32c5f20e299e936784dd..d98f6d74a6ad95985e4e05182745754b7b074057 100644 (file)
@@ -120,17 +120,6 @@ present for backward compatibility."
      tramp-ftp-method
      '((tramp-parse-netrc "~/.netrc"))))
 
-;; If there is URL syntax, `substitute-in-file-name' needs special
-;; handling.
-(put 'substitute-in-file-name 'ange-ftp 'tramp-handle-substitute-in-file-name)
-(add-hook 'tramp-ftp-unload-hook
-         (lambda ()
-            (setplist 'substitute-in-file-name
-                      (delete 'ange-ftp
-                              (delete 'tramp-handle-substitute-in-file-name
-                                      (symbol-plist
-                                       'substitute-in-file-name))))))
-
 ;;;###tramp-autoload
 (defun tramp-ftp-file-name-handler (operation &rest args)
   "Invoke the Ange-FTP handler for OPERATION.
index 52189e091fb40c0654ad531306ef58d62b6c023f..5d6447609fadd0a48af31f8a829f09531cd4cbdc 100644 (file)
 
 ;; The customer option `tramp-gvfs-methods' contains the list of
 ;; supported connection methods.  Per default, these are "dav",
-;; "davs", "obex" and "synce".  Note that with "obex" it might be
-;; necessary to pair with the other bluetooth device, if it hasn't
+;; "davs", "obex", "sftp" and "synce".  Note that with "obex" it might
+;; be necessary to pair with the other bluetooth device, if it hasn't
 ;; been done already.  There might be also some few seconds delay in
 ;; discovering available bluetooth devices.
 
-;; Other possible connection methods are "ftp", "sftp" and "smb".
-;; When one of these methods is added to the list, the remote access
-;; for that method is performed via GVFS instead of the native Tramp
+;; Other possible connection methods are "ftp" and "smb".  When one of
+;; these methods is added to the list, the remote access for that
+;; method is performed via GVFS instead of the native Tramp
 ;; implementation.
 
 ;; GVFS offers even more connection methods.  The complete list of
   (require 'custom))
 
 ;;;###tramp-autoload
-(defcustom tramp-gvfs-methods '("dav" "davs" "obex" "synce")
+(defcustom tramp-gvfs-methods '("dav" "davs" "obex" "sftp" "synce")
   "List of methods for remote files, accessed with GVFS."
   :group 'tramp
   :version "23.2"
@@ -661,7 +661,7 @@ is no information where to trace the message.")
   "Like `delete-file' for Tramp files."
   (with-parsed-tramp-file-name filename nil
     (tramp-flush-file-property v (file-name-directory localname))
-    (tramp-flush-directory-property v localname)
+    (tramp-flush-file-property v localname)
     (unless
        (tramp-gvfs-send-command
         v (if (and trash delete-by-moving-to-trash) "gvfs-trash" "gvfs-rm")
@@ -794,7 +794,8 @@ is no information where to trace the message.")
            (goto-char (point-min))
            (setq res-filemodes
                  (if (re-search-forward "unix::mode:\\s-+\\([0-9]+\\)" nil t)
-                     (tramp-file-mode-from-int (match-string 1))
+                     (tramp-file-mode-from-int
+                      (string-to-number (match-string 1)))
                    (if dirp "drwx------" "-rwx------")))
            ;; ... inode and device
            (goto-char (point-min))
@@ -899,7 +900,7 @@ is no information where to trace the message.")
               entry)
            ;; Get a list of directories and files.
           (tramp-gvfs-send-command
-           v "gvfs-ls" (tramp-gvfs-url-file-name directory))
+           v "gvfs-ls" "-h" (tramp-gvfs-url-file-name directory))
 
           ;; Now grab the output.
            (with-temp-buffer
@@ -1118,9 +1119,9 @@ is no information where to trace the message.")
              (setq user
                    (concat (match-string 2 user) ";" (match-string 1 user))))
            (url-parse-make-urlobj
-            method (url-hexify-string user) nil
+            method (and user (url-hexify-string user)) nil
             (tramp-file-name-real-host v) (tramp-file-name-port v)
-            (url-hexify-string localname) nil nil t))
+            (and localname (url-hexify-string localname)) nil nil t))
        (url-parse-make-urlobj
         "file" nil nil nil nil
         (url-hexify-string (file-truename filename)) nil nil t))))
@@ -1555,14 +1556,10 @@ connection if a previous connection has died for some reason."
   "Send the COMMAND with its ARGS to connection VEC.
 COMMAND is usually a command from the gvfs-* utilities.
 `call-process' is applied, and it returns `t' if the return code is zero."
-  (let (result)
-    (with-current-buffer (tramp-get-connection-buffer vec)
-      (tramp-gvfs-maybe-open-connection vec)
-      (erase-buffer)
-      (tramp-message vec 6 "%s %s" command (mapconcat 'identity args " "))
-      (setq result (apply 'tramp-call-process command nil t nil args))
-      (tramp-message vec 6 "\n%s" (buffer-string))
-      (zerop result))))
+  (with-current-buffer (tramp-get-connection-buffer vec)
+    (tramp-gvfs-maybe-open-connection vec)
+    (erase-buffer)
+    (zerop (apply 'tramp-call-process vec command nil t nil args))))
 
 \f
 ;; D-Bus BLUEZ functions.
@@ -1671,7 +1668,7 @@ be used."
        (list user host)))
    (zeroconf-list-services "_webdav._tcp")))
 
-;; Add completion function for DAV and DAVS methods.
+;; Add completion function for SFTP, DAV and DAVS methods.
 (when (and tramp-gvfs-enabled
           (member zeroconf-service-avahi (dbus-list-known-names :system)))
   (zeroconf-init tramp-gvfs-zeroconf-domain)
index 6f55b86e9e5f5a73d3a0edd45933a9254c18e23e..e234162bd4afc74b8947bb8abdd5fa5bd42ed26d 100644 (file)
 (defvar directory-sep-char)
 (defvar tramp-gw-tunnel-method)
 (defvar tramp-gw-socks-method)
+(defvar vc-handled-backends)
+(defvar vc-bzr-program)
+(defvar vc-git-program)
+(defvar vc-hg-program)
 
 (defcustom tramp-inline-compress-start-size 4096
   "The minimum size of compressing where inline transfer.
@@ -141,17 +145,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
                                 ("-o" "StrictHostKeyChecking=no")))
     (tramp-default-port         22)))
 ;;;###tramp-autoload
-(add-to-list 'tramp-methods
-  '("sftp"
-    (tramp-login-program        "ssh")
-    (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
-                                ("-e" "none") ("%h")))
-    (tramp-async-args           (("-q")))
-    (tramp-remote-shell         "/bin/sh")
-    (tramp-remote-shell-args    ("-c"))
-    (tramp-copy-program         "sftp")
-    (tramp-copy-args            ("%c"))))
- ;;;###tramp-autoload
 (add-to-list 'tramp-methods
   '("rsync"
     (tramp-login-program        "ssh")
@@ -210,11 +203,25 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   '("telnet"
     (tramp-login-program        "telnet")
-    (tramp-login-args           (("%h") ("%p")))
+    (tramp-login-args           (("%h") ("%p") ("2>/dev/null")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-default-port         23)))
 ;;;###tramp-autoload
+(add-to-list 'tramp-methods
+  '("nc"
+    (tramp-login-program        "telnet")
+    (tramp-login-args           (("%h") ("%p") ("2>/dev/null")))
+    (tramp-remote-shell         "/bin/sh")
+    (tramp-remote-shell-args    ("-c"))
+    (tramp-copy-program         "nc")
+    ;; We use "-v" for better error tracking.
+    (tramp-copy-args            (("-w" "1") ("-v") ("%h") ("%r")))
+    (tramp-remote-copy-program  "nc")
+    ;; We use "-p" as required for busyboxes.
+    (tramp-remote-copy-args     (("-l") ("-p" "%r")))
+    (tramp-default-port         23)))
+;;;###tramp-autoload
 (add-to-list 'tramp-methods
   '("su"
     (tramp-login-program        "su")
@@ -249,9 +256,16 @@ detected as prompt when being sent on echoing hosts, therefore.")
     (tramp-remote-shell-args    ("-c"))))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("plink"
+  `("plink"
     (tramp-login-program        "plink")
-    (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
+    ;; ("%h") must be a single element, see `tramp-compute-multi-hops'.
+    (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("-t")
+                                ("%h") ("\"")
+                                (,(format
+                                   "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
+                                   tramp-terminal-type
+                                   tramp-initial-end-of-output))
+                                ("/bin/sh") ("\"")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-default-port         22)))
@@ -259,21 +273,25 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-methods
   `("plinkx"
     (tramp-login-program        "plink")
-    ;; ("%h") must be a single element, see
-    ;; `tramp-compute-multi-hops'.
-    (tramp-login-args           (("-load") ("%h") ("-t")
+    (tramp-login-args           (("-load") ("%h") ("-t") ("\"")
                                 (,(format
                                    "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
                                    tramp-terminal-type
                                    tramp-initial-end-of-output))
-                                ("/bin/sh")))
+                                ("/bin/sh") ("\"")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("pscp"
+  `("pscp"
     (tramp-login-program        "plink")
-    (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
+    (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("-t")
+                                ("%h") ("\"")
+                                (,(format
+                                   "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
+                                   tramp-terminal-type
+                                   tramp-initial-end-of-output))
+                                ("/bin/sh") ("\"")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "pscp")
@@ -284,9 +302,15 @@ detected as prompt when being sent on echoing hosts, therefore.")
     (tramp-default-port         22)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("psftp"
+  `("psftp"
     (tramp-login-program        "plink")
-    (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
+    (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-ssh") ("-t")
+                                ("%h") ("\"")
+                                (,(format
+                                   "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
+                                   tramp-terminal-type
+                                   tramp-initial-end-of-output))
+                                ("/bin/sh") ("\"")))
     (tramp-remote-shell         "/bin/sh")
     (tramp-remote-shell-args    ("-c"))
     (tramp-copy-program         "pscp")
@@ -319,7 +343,8 @@ detected as prompt when being sent on echoing hosts, therefore.")
 (add-to-list 'tramp-default-user-alist
             `(,(concat
                 "\\`"
-                (regexp-opt '("rcp" "remcp" "rsh" "telnet" "krlogin" "fcp"))
+                (regexp-opt
+                 '("rcp" "remcp" "rsh" "telnet" "nc" "krlogin" "fcp"))
                 "\\'")
               nil ,(user-login-name)))
 
@@ -370,7 +395,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
      (tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh)
@@ -378,6 +402,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
      (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function
       "telnet" tramp-completion-function-alist-telnet)
+     (tramp-set-completion-function "nc" tramp-completion-function-alist-telnet)
      (tramp-set-completion-function "su" tramp-completion-function-alist-su)
      (tramp-set-completion-function "sudo" tramp-completion-function-alist-su)
      (tramp-set-completion-function "ksu" tramp-completion-function-alist-su)
@@ -387,6 +412,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
      (tramp-set-completion-function
       "plinkx" tramp-completion-function-alist-putty)
      (tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh)
+     (tramp-set-completion-function "psftp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh)))
 
 ;; "getconf PATH" yields:
@@ -1239,8 +1265,7 @@ target of the symlink differ."
               (format "%s -ild %s"
                       (tramp-get-ls-command v)
                       (tramp-shell-quote-argument localname)))
-             (setq attr (buffer-substring (point)
-                                          (progn (end-of-line) (point)))))
+             (setq attr (buffer-substring (point) (point-at-eol))))
            (tramp-set-file-property
             v localname "visited-file-modtime-ild" attr))
          (when (boundp 'last-coding-system-used)
@@ -1291,8 +1316,7 @@ of."
                       (tramp-get-ls-command v)
                       (tramp-shell-quote-argument localname)))
              (with-current-buffer (tramp-get-buffer v)
-               (setq attr (buffer-substring
-                           (point) (progn (end-of-line) (point)))))
+               (setq attr (buffer-substring (point) (point-at-eol))))
              (equal
               attr
               (tramp-get-file-property
@@ -1346,7 +1370,7 @@ of."
     ;; We are local, so we don't need the UTC settings.
     (zerop
      (tramp-call-process
-      "touch" nil nil nil "-t"
+      nil "touch" nil nil nil "-t"
       (format-time-string "%Y%m%d%H%M.%S" time)
       (tramp-shell-quote-argument filename)))))
 
@@ -1380,7 +1404,7 @@ be non-negative integers."
       (let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
            (gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
        (tramp-call-process
-        "chown" nil nil nil
+        nil "chown" nil nil nil
          (format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
 
 (defun tramp-remote-selinux-p (vec)
@@ -1542,7 +1566,7 @@ be non-negative integers."
 (defun tramp-sh-handle-file-directory-p (filename)
   "Like `file-directory-p' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    ;; `file-directory-p' is used as predicate for filename completion.
+    ;; `file-directory-p' is used as predicate for file name completion.
     ;; Sometimes, when a connection is not established yet, it is
     ;; desirable to return t immediately for "/method:foo:".  It can
     ;; be expected that this is always a directory.
@@ -1644,10 +1668,10 @@ be non-negative integers."
    vec
    (format
     (concat
-     ;; We must care about filenames with spaces, or starting with
+     ;; We must care about file names with spaces, or starting with
      ;; "-"; this would confuse xargs.  "ls -aQ" might be a solution,
      ;; but it does not work on all remote systems.  Therefore, we
-     ;; quote the filenames via sed.
+     ;; quote the file names via sed.
      "cd %s; echo \"(\"; (%s -a | sed -e s/\\$/\\\"/g -e s/^/\\\"/g | "
      "xargs %s -c "
      "'(\"%%n\" (\"%%N\") %%h %s %s %%Xe0 %%Ye0 %%Ze0 %%se0 \"%%A\" t %%ie0 -1)'"
@@ -1670,15 +1694,15 @@ be non-negative integers."
        (mapcar
        'list
         (or
-        ;; Try cache entries for filename, filename with last
-        ;; character removed, filename with last two characters
+        ;; Try cache entries for `filename', `filename' with last
+        ;; character removed, `filename' with last two characters
         ;; removed, ..., and finally the empty string - all
         ;; concatenated to the local directory name.
          (let ((remote-file-name-inhibit-cache
                (or remote-file-name-inhibit-cache
                    tramp-completion-reread-directory-timeout)))
 
-          ;; This is inefficient for very long filenames, pity
+          ;; This is inefficient for very long file names, pity
           ;; `reduce' is not available...
           (car
            (apply
@@ -1742,7 +1766,7 @@ be non-negative integers."
                       (tramp-shell-quote-argument localname)
                       (tramp-get-ls-command v)
                       ;; When `filename' is empty, just `ls' without
-                      ;; filename argument is more efficient than `ls *'
+                      ;; `filename' argument is more efficient than `ls *'
                       ;; for very large directories and might avoid the
                       ;; `Argument list too long' error.
                       ;;
@@ -1981,7 +2005,7 @@ file names."
               ;; create a new buffer, insert the contents of the
               ;; source file into it, then write out the buffer to
               ;; the target file.  The advantage is that it doesn't
-              ;; matter which filename handlers are used for the
+              ;; matter which file name handlers are used for the
               ;; source and target file.
               (t
                (tramp-do-copy-or-rename-file-via-buffer
@@ -2212,19 +2236,19 @@ the uid and gid from FILENAME."
            (set-file-modes newname file-modes))))))
 
 (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date)
-  "Invoke rcp program to copy.
+  "Invoke `scp' program to copy.
 The method used must be an out-of-band method."
   (let* ((t1 (tramp-tramp-file-p filename))
         (t2 (tramp-tramp-file-p newname))
         (orig-vec (tramp-dissect-file-name (if t1 filename newname)))
-        copy-program copy-args copy-env copy-keep-date port spec
-        options source target)
+        copy-program copy-args copy-env copy-keep-date port listener spec
+        options source target remote-copy-program remote-copy-args)
 
     (with-parsed-tramp-file-name (if t1 filename newname) nil
       (if (and t1 t2)
 
          ;; Both are Tramp files.  We shall optimize it when the
-         ;; methods for filename and newname are the same.
+         ;; methods for FILENAME and NEWNAME are the same.
          (let* ((dir-flag (file-directory-p filename))
                 (tmpfile (tramp-compat-make-temp-file localname dir-flag)))
            (if dir-flag
@@ -2285,6 +2309,13 @@ The method used must be an out-of-band method."
        (setq user (or (tramp-file-name-user v)
                       (tramp-get-connection-property v "login-as" nil)))
 
+       ;; Check for listener port.
+       (when (tramp-get-method-parameter method 'tramp-remote-copy-args)
+         (setq listener (number-to-string (+ 50000 (random 10000))))
+         (while
+             (zerop (tramp-call-process v "nc" nil nil nil "-z" host listener))
+           (setq listener (number-to-string (+ 50000 (random 10000))))))
+
        ;; Compose copy command.
        (setq host (or host "")
              user (or user "")
@@ -2297,7 +2328,7 @@ The method used must be an out-of-band method."
                           tramp-ssh-controlmaster-options "")
                       spec)
              spec (format-spec-make
-                   ?h host ?u user ?p port ?c options
+                   ?h host ?u user ?p port ?r listener ?c options
                    ?k (if keep-date " " ""))
              copy-program (tramp-get-method-parameter
                            method 'tramp-copy-program)
@@ -2325,12 +2356,57 @@ The method used must be an out-of-band method."
                (lambda (x)
                  (setq x (mapcar (lambda (y) (format-spec y spec)) x))
                  (unless (member "" x) (mapconcat 'identity x " ")))
-               (tramp-get-method-parameter method 'tramp-copy-env))))
+               (tramp-get-method-parameter method 'tramp-copy-env)))
+             remote-copy-program (tramp-get-method-parameter
+                                  method 'tramp-remote-copy-program)
+             remote-copy-args
+             (delete
+              ;; " " has either been a replacement of "%k" (when
+              ;; keep-date argument is non-nil), or a replacement
+              ;; for the whole keep-date sublist.
+              " "
+              (dolist
+                  (x
+                   (tramp-get-method-parameter method 'tramp-remote-copy-args)
+                   remote-copy-args)
+                (setq remote-copy-args
+                      (append
+                       remote-copy-args
+                       (let ((y (mapcar (lambda (z) (format-spec z spec)) x)))
+                         (if (member "" y) '(" ") y)))))))
 
-       ;; Check for program.
+       ;; Check for local copy program.
        (unless (executable-find copy-program)
          (tramp-error
-          v 'file-error "Cannot find copy program: %s" copy-program))
+          v 'file-error "Cannot find local copy program: %s" copy-program))
+
+       ;; Install listener on the remote side.  The prompt must be
+       ;; consumed later on, when the process does not listen anymore.
+       (when remote-copy-program
+         (unless (with-tramp-connection-property
+                     v (concat "remote-copy-program-" remote-copy-program)
+                   (tramp-find-executable
+                    v remote-copy-program (tramp-get-remote-path v)))
+           (tramp-error
+            v 'file-error
+            "Cannot find remote listener: %s" remote-copy-program))
+         (setq remote-copy-program
+               (mapconcat
+                'identity
+                (append
+                 (list remote-copy-program) remote-copy-args
+                 (list (if t1 (concat "<" source) (concat ">" target)) "&"))
+                " "))
+         (tramp-send-command v remote-copy-program)
+         (with-timeout
+             (1 (tramp-error
+                 v 'file-error
+                 "Listener process not running on remote host: `%s'"
+                 remote-copy-program))
+           (tramp-send-command v (format "netstat -l | grep -q :%s" listener))
+           (while (not (tramp-send-command-and-check v nil))
+             (tramp-send-command
+              v (format "netstat -l | grep -q :%s" listener)))))
 
        (with-temp-buffer
          (unwind-protect
@@ -2347,24 +2423,26 @@ The method used must be an out-of-band method."
                  (tramp-message
                   orig-vec 6 "%s=\"%s\"" (car copy-env) (cadr copy-env))
                  (setenv (pop copy-env) (pop copy-env)))
+               (setq
+                copy-args
+                (append
+                 copy-args
+                 (if remote-copy-program
+                     (list (if t1 (concat ">" target) (concat "<" source)))
+                   (list source target))))
 
                ;; Use an asynchronous process.  By this, password can
-               ;; be handled.  The default directory must be local, in
-               ;; order to apply the correct `copy-program'.  We don't
-               ;; set a timeout, because the copying of large files can
-               ;; last longer than 60 secs.
-               (let ((p (let ((default-directory
-                                (tramp-compat-temporary-file-directory)))
-                          (apply 'start-process-shell-command
-                                 (tramp-get-connection-name v)
-                                 (tramp-get-connection-buffer v)
-                                 copy-program
-                                 (append
-                                  copy-args
-                                  (list
-                                   source target
-                                   "&&" "echo" "tramp_exit_status" "0"
-                                   "||" "echo" "tramp_exit_status" "1"))))))
+               ;; be handled.  We don't set a timeout, because the
+               ;; copying of large files can last longer than 60
+               ;; secs.
+               (let ((p (apply 'start-process-shell-command
+                               (tramp-get-connection-name v)
+                               (tramp-get-connection-buffer v)
+                               copy-program
+                               (append
+                                copy-args
+                                (list "&&" "echo" "tramp_exit_status" "0"
+                                      "||" "echo" "tramp_exit_status" "1")))))
                  (tramp-message
                   orig-vec 6 "%s"
                   (mapconcat 'identity (process-command p) " "))
@@ -2391,7 +2469,14 @@ The method used must be an out-of-band method."
 
            ;; Reset the transfer process properties.
            (tramp-set-connection-property v "process-name" nil)
-           (tramp-set-connection-property v "process-buffer" nil)))
+           (tramp-set-connection-property v "process-buffer" nil)
+           ;; Clear the remote prompt.
+           (when (and remote-copy-program
+                      (not (tramp-send-command-and-check v nil)))
+             ;; Houston, we have a problem!  Likely, the listener is
+             ;; still running, so let's clear everything (but the
+             ;; cached password).
+             (tramp-cleanup-connection v 'keep-debug 'keep-password))))
 
        ;; Handle KEEP-DATE argument.
        (when (and keep-date (not copy-keep-date))
@@ -2621,7 +2706,8 @@ This is like `dired-recursive-delete-directory' for Tramp files."
            (delete-region (match-beginning 0) (point)))
 
          ;; Some busyboxes are reluctant to discard colors.
-         (unless (string-match "color" (tramp-get-connection-property v "ls" ""))
+         (unless
+             (string-match "color" (tramp-get-connection-property v "ls" ""))
            (goto-char beg)
            (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
              (replace-match "")))
@@ -2651,9 +2737,9 @@ This is like `dired-recursive-delete-directory' for Tramp files."
 
 (defun tramp-sh-handle-expand-file-name (name &optional dir)
   "Like `expand-file-name' for Tramp files.
-If the localname part of the given filename starts with \"/../\" then
-the result will be a local, non-Tramp, filename."
-  ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
+If the localname part of the given file name starts with \"/../\" then
+the result will be a local, non-Tramp, file name."
+  ;; If DIR is not given, use `default-directory' or "/".
   (setq dir (or dir default-directory "/"))
   ;; Unless NAME is absolute, concat DIR and NAME.
   (unless (file-name-absolute-p name)
@@ -3133,7 +3219,7 @@ the result will be a local, non-Tramp, filename."
                    (symbol-value 'last-coding-system-used))))
 
          ;; The permissions of the temporary file should be set.  If
-         ;; filename does not exist (eq modes nil) it has been
+         ;; FILENAME does not exist (eq modes nil) it has been
          ;; renamed to the backup file.  This case `save-buffer'
          ;; handles permissions.
          ;; Ensure that it is still readable.
@@ -3144,7 +3230,7 @@ the result will be a local, non-Tramp, filename."
 
          ;; This is a bit lengthy due to the different methods
          ;; possible for file transfer.  First, we check whether the
-         ;; method uses an rcp program.  If so, we call it.
+         ;; method uses an scp program.  If so, we call it.
          ;; Otherwise, both encoding and decoding command must be
          ;; specified.  However, if the method _also_ specifies an
          ;; encoding function, then that is used for encoding the
@@ -3238,7 +3324,7 @@ the result will be a local, non-Tramp, filename."
                        (erase-buffer)
                        (and
                         ;; cksum runs locally, if possible.
-                        (zerop (tramp-call-process "cksum" tmpfile t))
+                        (zerop (tramp-call-process "cksum" tmpfile t))
                         ;; cksum runs remotely.
                         (tramp-send-command-and-check
                          v
@@ -3264,7 +3350,7 @@ the result will be a local, non-Tramp, filename."
              (tramp-error
               v 'file-error
               (concat "Method `%s' should specify both encoding and "
-                      "decoding command or an rcp program")
+                      "decoding command or an scp program")
               method))))
 
          ;; Make `last-coding-system-used' have the right value.
@@ -3281,7 +3367,7 @@ the result will be a local, non-Tramp, filename."
        (when (or (eq visit t) (stringp visit))
           (let ((file-attr (tramp-compat-file-attributes filename 'integer)))
             (set-visited-file-modtime
-             ;; We must pass modtime explicitly, because filename can
+             ;; We must pass modtime explicitly, because FILENAME can
              ;; be different from (buffer-file-name), f.e. if
              ;; `file-precious-flag' is set.
              (nth 5 file-attr))
@@ -3369,7 +3455,28 @@ the result will be a local, non-Tramp, filename."
        ;; calls shall be answered from the file cache.  We unset
        ;; `process-file-side-effects' and `remote-file-name-inhibit-cache'
        ;; in order to keep the cache.
-       (let (remote-file-name-inhibit-cache process-file-side-effects)
+       (let ((vc-handled-backends vc-handled-backends)
+             remote-file-name-inhibit-cache process-file-side-effects)
+         ;; Reduce `vc-handled-backends' in order to minimize process calls.
+         (when (and (memq 'Bzr vc-handled-backends)
+                    (boundp 'vc-bzr-program)
+                    (not (with-tramp-connection-property v vc-bzr-program
+                           (tramp-find-executable
+                            v vc-bzr-program (tramp-get-remote-path v)))))
+           (setq vc-handled-backends (delq 'Bzr vc-handled-backends)))
+         (when (and (memq 'Git vc-handled-backends)
+                    (boundp 'vc-git-program)
+                    (not (with-tramp-connection-property v vc-git-program
+                           (tramp-find-executable
+                            v vc-git-program (tramp-get-remote-path v)))))
+           (setq vc-handled-backends (delq 'Git vc-handled-backends)))
+         (when (and (memq 'Hg vc-handled-backends)
+                    (boundp 'vc-hg-program)
+                    (not (with-tramp-connection-property v vc-hg-program
+                           (tramp-find-executable
+                            v vc-hg-program (tramp-get-remote-path v)))))
+           (setq vc-handled-backends (delq 'Hg vc-handled-backends)))
+         ;; Run.
          (ignore-errors
            (tramp-run-real-handler 'vc-registered (list file))))))))
 
@@ -3855,15 +3962,16 @@ process to set up.  VEC specifies the connection."
   ;; Try to set up the coding system correctly.
   ;; CCC this can't be the right way to do it.  Hm.
   (tramp-message vec 5 "Determining coding system")
-  (tramp-send-command vec "echo foo ; echo bar" t)
   (with-current-buffer (process-buffer proc)
-    (goto-char (point-min))
     (if (featurep 'mule)
        ;; Use MULE to select the right EOL convention for communicating
        ;; with the process.
-       (let* ((cs (or (tramp-compat-funcall 'process-coding-system proc)
-                      (cons 'undecided 'undecided)))
-              cs-decode cs-encode)
+       (let ((cs (or (when (string-match
+                            "utf8" (or (tramp-get-remote-locale vec) ""))
+                       (cons 'utf-8 'utf-8))
+                     (tramp-compat-funcall 'process-coding-system proc)
+                     (cons 'undecided 'undecided)))
+             cs-decode cs-encode)
          (when (symbolp cs) (setq cs (cons cs cs)))
          (setq cs-decode (car cs))
          (setq cs-encode (cdr cs))
@@ -3871,6 +3979,8 @@ process to set up.  VEC specifies the connection."
          (unless cs-encode (setq cs-encode 'undecided))
          (setq cs-encode (tramp-compat-coding-system-change-eol-conversion
                           cs-encode 'unix))
+         (tramp-send-command vec "echo foo ; echo bar" t)
+         (goto-char (point-min))
          (when (search-forward "\r" nil t)
            (setq cs-decode (tramp-compat-coding-system-change-eol-conversion
                             cs-decode 'dos)))
@@ -4010,7 +4120,7 @@ FORMAT is  symbol describing the encoding/decoding format.  It can be
 ENCODING and DECODING can be strings, giving commands, or symbols,
 giving functions.  If they are strings, then they can contain
 the \"%s\" format specifier.  If that specifier is present, the input
-filename will be put into the command line at that spot.  If the
+file name will be put into the command line at that spot.  If the
 specifier is not present, the input should be read from standard
 input.
 
@@ -4045,7 +4155,7 @@ FORMAT is a symbol describing the encoding/decoding format.  It can be
 ENCODING and DECODING can be strings, giving commands, or symbols,
 giving variables.  If they are strings, then they can contain
 the \"%s\" format specifier.  If that specifier is present, the input
-filename will be put into the command line at that spot.  If the
+file name will be put into the command line at that spot.  If the
 specifier is not present, the input should be read from standard
 input.
 
@@ -4171,32 +4281,28 @@ Goes through the list `tramp-local-coding-commands' and
                  (setq rem-dec (nth 2 ritem))
                  (setq found t)))))))
 
-      ;; Did we find something?
-      (unless found
-       (tramp-error
-        vec 'file-error "Couldn't find an inline transfer encoding"))
-
-      ;; Set connection properties.  Since the commands are risky (due
-      ;; to output direction), we cache them in the process cache.
-      (tramp-message vec 5 "Using local encoding `%s'" loc-enc)
-      (tramp-set-connection-property p "local-encoding" loc-enc)
-      (tramp-message vec 5 "Using local decoding `%s'" loc-dec)
-      (tramp-set-connection-property p "local-decoding" loc-dec)
-      (tramp-message vec 5 "Using remote encoding `%s'" rem-enc)
-      (tramp-set-connection-property p "remote-encoding" rem-enc)
-      (tramp-message vec 5 "Using remote decoding `%s'" rem-dec)
-      (tramp-set-connection-property p "remote-decoding" rem-dec))))
+      (when found
+       ;; Set connection properties.  Since the commands are risky
+       ;; (due to output direction), we cache them in the process cache.
+       (tramp-message vec 5 "Using local encoding `%s'" loc-enc)
+       (tramp-set-connection-property p "local-encoding" loc-enc)
+       (tramp-message vec 5 "Using local decoding `%s'" loc-dec)
+       (tramp-set-connection-property p "local-decoding" loc-dec)
+       (tramp-message vec 5 "Using remote encoding `%s'" rem-enc)
+       (tramp-set-connection-property p "remote-encoding" rem-enc)
+       (tramp-message vec 5 "Using remote decoding `%s'" rem-dec)
+       (tramp-set-connection-property p "remote-decoding" rem-dec)))))
 
 (defun tramp-call-local-coding-command (cmd input output)
   "Call the local encoding or decoding command.
 If CMD contains \"%s\", provide input file INPUT there in command.
 Otherwise, INPUT is passed via standard input.
 INPUT can also be nil which means `/dev/null'.
-OUTPUT can be a string (which specifies a filename), or t (which
+OUTPUT can be a string (which specifies a file name), or t (which
 means standard output and thus the current buffer), or nil (which
 means discard it)."
   (tramp-call-process
-   tramp-encoding-shell
+   nil tramp-encoding-shell
    (when (and input (not (string-match "%s" cmd))) input)
    (if (eq output t) t nil)
    nil
@@ -4844,15 +4950,18 @@ Return ATTR."
    ""))
 
 (defun tramp-make-copy-program-file-name (vec)
-  "Create a file name suitable to be passed to `rcp' and workalikes."
-  (let ((user (tramp-file-name-user vec))
+  "Create a file name suitable to be passed to `scp' or `nc' and workalikes."
+  (let ((method (tramp-file-name-method vec))
+       (user (tramp-file-name-user vec))
        (host (tramp-file-name-real-host vec))
        (localname (tramp-shell-quote-argument
                    (tramp-file-name-localname vec))))
-    (shell-quote-argument
-     (if (not (zerop (length user)))
-        (format "%s@%s:%s" user host localname)
-       (format "%s:%s" host localname)))))
+    (cond
+     ((tramp-get-method-parameter method 'tramp-remote-copy-program)
+      localname)
+     ((not (zerop (length user)))
+      (shell-quote-argument (format "%s@%s:%s" user host localname)))
+     (t (shell-quote-argument (format "%s:%s" host localname))))))
 
 (defun tramp-method-out-of-band-p (vec size)
   "Return t if this is an out-of-band method, nil otherwise."
@@ -5147,7 +5256,9 @@ Return ATTR."
 (defun tramp-get-remote-python (vec)
   (with-tramp-connection-property vec "python"
     (tramp-message vec 5 "Finding a suitable `python' command")
-    (tramp-find-executable vec "python" (tramp-get-remote-path vec))))
+    (or (tramp-find-executable vec "python" (tramp-get-remote-path vec))
+        (tramp-find-executable vec "python2" (tramp-get-remote-path vec))
+        (tramp-find-executable vec "python3" (tramp-get-remote-path vec)))))
 
 (defun tramp-get-remote-uid-with-python (vec id-format)
   (tramp-send-command-and-read
@@ -5155,8 +5266,8 @@ Return ATTR."
    (format "%s -c \"%s\""
           (tramp-get-remote-python vec)
           (if (equal id-format 'integer)
-              "import os; print os.getuid()"
-            "import os, pwd; print '\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"'"))))
+              "import os; print (os.getuid())"
+            "import os, pwd; print ('\\\"' + pwd.getpwuid(os.getuid())[0] + '\\\"')"))))
 
 (defun tramp-get-remote-uid (vec id-format)
   (with-tramp-connection-property vec (format "uid-%s" id-format)
@@ -5196,8 +5307,8 @@ Return ATTR."
    (format "%s -c \"%s\""
           (tramp-get-remote-python vec)
           (if (equal id-format 'integer)
-              "import os; print os.getgid()"
-            "import os, grp; print '\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"'"))))
+              "import os; print (os.getgid())"
+            "import os, grp; print ('\\\"' + grp.getgrgid(os.getgid())[0] + '\\\"')"))))
 
 (defun tramp-get-remote-gid (vec id-format)
   (with-tramp-connection-property vec (format "gid-%s" id-format)
@@ -5371,9 +5482,5 @@ function cell is returned to be applied on a buffer."
 ;;   rsync).
 ;; * Keep a second connection open for out-of-band methods like scp or
 ;;   rsync.
-;; * Try telnet+curl as new method.  It might be useful for busybox,
-;;   without built-in uuencode/uudecode.
-;; * Try telnet+nc as new method.  It might be useful for busybox,
-;;   without built-in uuencode/uudecode.
 
 ;;; tramp-sh.el ends here
index fa5e72dfb3e0112d60f5b2e2f2256bb78d7dfa46..15ae9ed6fa806d73abf90e1c596639c7a40c20ed 100644 (file)
@@ -447,8 +447,7 @@ pass to the OPERATION."
                               (expand-file-name
                                tramp-temp-name-prefix
                                (tramp-compat-temporary-file-directory))))
-                  (args      (list tramp-smb-program
-                                   (concat "//" real-host "/" share) "-E")))
+                  (args      (list (concat "//" real-host "/" share) "-E")))
 
              (if (not (zerop (length real-user)))
                  (setq args (append args (list "-U" real-user)))
@@ -495,10 +494,11 @@ pass to the OPERATION."
                    ;; Use an asynchronous processes.  By this,
                    ;; password can be handled.
                    (let* ((default-directory tmpdir)
-                          (p (start-process-shell-command
+                          (p (apply
+                              'start-process
                               (tramp-get-connection-name v)
                               (tramp-get-connection-buffer v)
-                              (mapconcat 'identity args " "))))
+                              tramp-smb-program args)))
 
                      (tramp-message
                       v 6 "%s" (mapconcat 'identity (process-command p) " "))
@@ -938,99 +938,100 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
       (setq filename (file-name-as-directory filename))
     (setq filename (directory-file-name filename)))
   (with-parsed-tramp-file-name filename nil
-    (save-match-data
-      (let ((base (file-name-nondirectory filename))
-           ;; We should not destroy the cache entry.
-           (entries (copy-sequence
-                     (tramp-smb-get-file-entries
-                      (file-name-directory filename)))))
-
-       (when wildcard
-         (string-match "\\." base)
-         (setq base (replace-match "\\\\." nil nil base))
-         (string-match "\\*" base)
-         (setq base (replace-match ".*" nil nil base))
-         (string-match "\\?" base)
-         (setq base (replace-match ".?" nil nil base)))
-
-       ;; Filter entries.
-       (setq entries
-             (delq
-              nil
-              (if (or wildcard (zerop (length base)))
-                  ;; Check for matching entries.
-                  (mapcar
-                   (lambda (x)
-                     (when (string-match
-                            (format "^%s" base) (nth 0 x))
-                       x))
-                   entries)
-                ;; We just need the only and only entry FILENAME.
-                (list (assoc base entries)))))
-
-       ;; Sort entries.
-       (setq entries
-             (sort
-              entries
-              (lambda (x y)
-                (if (string-match "t" switches)
-                    ;; Sort by date.
-                    (tramp-time-less-p (nth 3 y) (nth 3 x))
-                  ;; Sort by name.
-                  (string-lessp (nth 0 x) (nth 0 y))))))
-
-       ;; Handle "-F" switch.
-       (when (string-match "F" switches)
+    (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename)
+      (save-match-data
+       (let ((base (file-name-nondirectory filename))
+             ;; We should not destroy the cache entry.
+             (entries (copy-sequence
+                       (tramp-smb-get-file-entries
+                        (file-name-directory filename)))))
+
+         (when wildcard
+           (string-match "\\." base)
+           (setq base (replace-match "\\\\." nil nil base))
+           (string-match "\\*" base)
+           (setq base (replace-match ".*" nil nil base))
+           (string-match "\\?" base)
+           (setq base (replace-match ".?" nil nil base)))
+
+         ;; Filter entries.
+         (setq entries
+               (delq
+                nil
+                (if (or wildcard (zerop (length base)))
+                    ;; Check for matching entries.
+                    (mapcar
+                     (lambda (x)
+                       (when (string-match
+                              (format "^%s" base) (nth 0 x))
+                         x))
+                     entries)
+                  ;; We just need the only and only entry FILENAME.
+                  (list (assoc base entries)))))
+
+         ;; Sort entries.
+         (setq entries
+               (sort
+                entries
+                (lambda (x y)
+                  (if (string-match "t" switches)
+                      ;; Sort by date.
+                      (tramp-time-less-p (nth 3 y) (nth 3 x))
+                    ;; Sort by name.
+                    (string-lessp (nth 0 x) (nth 0 y))))))
+
+         ;; Handle "-F" switch.
+         (when (string-match "F" switches)
+           (mapc
+            (lambda (x)
+              (when (not (zerop (length (car x))))
+                (cond
+                 ((char-equal ?d (string-to-char (nth 1 x)))
+                  (setcar x (concat (car x) "/")))
+                 ((char-equal ?x (string-to-char (nth 1 x)))
+                  (setcar x (concat (car x) "*"))))))
+            entries))
+
+         ;; Print entries.
          (mapc
           (lambda (x)
-            (when (not (zerop (length (car x))))
-              (cond
-               ((char-equal ?d (string-to-char (nth 1 x)))
-                (setcar x (concat (car x) "/")))
-               ((char-equal ?x (string-to-char (nth 1 x)))
-                (setcar x (concat (car x) "*"))))))
-          entries))
-
-       ;; Print entries.
-       (mapc
-        (lambda (x)
-          (when (not (zerop (length (nth 0 x))))
-            (when (string-match "l" switches)
-              (let ((attr
-                     (when (tramp-smb-get-stat-capability v)
-                       (ignore-errors
-                         (file-attributes filename 'string)))))
+            (when (not (zerop (length (nth 0 x))))
+              (when (string-match "l" switches)
+                (let ((attr
+                       (when (tramp-smb-get-stat-capability v)
+                         (ignore-errors
+                           (file-attributes filename 'string)))))
+                  (insert
+                   (format
+                    "%10s %3d %-8s %-8s %8s %s "
+                    (or (nth 8 attr) (nth 1 x)) ; mode
+                    (or (nth 1 attr) 1) ; inode
+                    (or (nth 2 attr) "nobody") ; uid
+                    (or (nth 3 attr) "nogroup") ; gid
+                    (or (nth 7 attr) (nth 2 x)) ; size
+                    (format-time-string
+                     (if (tramp-time-less-p
+                          (tramp-time-subtract (current-time) (nth 3 x))
+                          tramp-half-a-year)
+                         "%b %e %R"
+                       "%b %e  %Y")
+                     (nth 3 x)))))) ; date
+
+              ;; We mark the file name.  The inserted name could be
+              ;; from somewhere else, so we use the relative file name
+              ;; of `default-directory'.
+              (let ((start (point)))
                 (insert
                  (format
-                  "%10s %3d %-8s %-8s %8s %s "
-                  (or (nth 8 attr) (nth 1 x)) ; mode
-                  (or (nth 1 attr) 1) ; inode
-                  (or (nth 2 attr) "nobody") ; uid
-                  (or (nth 3 attr) "nogroup") ; gid
-                  (or (nth 7 attr) (nth 2 x)) ; size
-                  (format-time-string
-                   (if (tramp-time-less-p
-                        (tramp-time-subtract (current-time) (nth 3 x))
-                        tramp-half-a-year)
-                       "%b %e %R"
-                     "%b %e  %Y")
-                   (nth 3 x)))))) ; date
-
-            ;; We mark the file name.  The inserted name could be
-            ;; from somewhere else, so we use the relative file name
-            ;; of `default-directory'.
-            (let ((start (point)))
-              (insert
-               (format
-                "%s\n"
-                (file-relative-name
-                 (expand-file-name
-                  (nth 0 x) (file-name-directory filename))
-                 (when full-directory-p (file-name-directory filename)))))
-              (put-text-property start (1- (point)) 'dired-filename t))
-            (forward-line)
-            (beginning-of-line)))
-        entries)))))
+                  "%s\n"
+                  (file-relative-name
+                   (expand-file-name
+                    (nth 0 x) (file-name-directory filename))
+                   (when full-directory-p (file-name-directory filename)))))
+                (put-text-property start (1- (point)) 'dired-filename t))
+              (forward-line)
+              (beginning-of-line)))
+          entries))))))
 
 (defun tramp-smb-handle-make-directory (dir &optional parents)
   "Like `make-directory' for Tramp files."
@@ -1277,6 +1278,8 @@ target of the symlink differ."
 
            ;; We must also flush the cache of the directory, because
            ;; `file-attributes' reads the values from there.
+           (tramp-flush-file-property v1 (file-name-directory v1-localname))
+           (tramp-flush-file-property v1 v1-localname)
            (tramp-flush-file-property v2 (file-name-directory v2-localname))
            (tramp-flush-file-property v2 v2-localname)
            (unless (tramp-smb-get-share v2)
@@ -1349,7 +1352,7 @@ target of the symlink differ."
                ;; Use an asynchronous processes.  By this, password can
                ;; be handled.
                (let ((p (apply
-                         'start-process-shell-command
+                         'start-process
                          (tramp-get-connection-name v)
                          (tramp-get-connection-buffer v)
                          tramp-smb-acl-program args)))
index 9a97d82452879fdb0a62770afd9d6cc2c9f7b35e..921c70135df1a65ad1d767e1f11bdff3f8ab39e7 100644 (file)
@@ -240,7 +240,7 @@ pair of the form (KEY VALUE).  The following KEYs are defined:
     tamper the process output.
   * `tramp-copy-program'
     This specifies the name of the program to use for remotely copying
-    the file; this might be the absolute filename of rcp or the name of
+    the file; this might be the absolute filename of scp or the name of
     a workalike program.  It is always applied on the local host.
   * `tramp-copy-args'
     This specifies the list of parameters to pass to the above mentioned
@@ -248,6 +248,13 @@ pair of the form (KEY VALUE).  The following KEYs are defined:
   * `tramp-copy-env'
      A list of environment variables and their values, which will
      be set when calling `tramp-copy-program'.
+  * `tramp-remote-copy-program'
+    The listener program to be applied on remote side, if needed.
+  * `tramp-remote-copy-args'
+    The list of parameters to pass to the listener program, the hints
+    for `tramp-login-args' also apply here.  Additionally, \"%r\" could
+    be used here and in `tramp-copy-args'.  It denotes a randomly
+    chosen port for the remote listener.
   * `tramp-copy-keep-date'
     This specifies whether the copying program when the preserves the
     timestamp of the original file.
@@ -275,7 +282,7 @@ pair of the form (KEY VALUE).  The following KEYs are defined:
 What does all this mean?  Well, you should specify `tramp-login-program'
 for all methods; this program is used to log in to the remote site.  Then,
 there are two ways to actually transfer the files between the local and the
-remote side.  One way is using an additional rcp-like program.  If you want
+remote side.  One way is using an additional scp-like program.  If you want
 to do this, set `tramp-copy-program' in the method.
 
 Another possibility for file transfer is inline transfer, i.e. the
@@ -1762,7 +1769,7 @@ Example:
                       (and (memq system-type '(cygwin windows-nt))
                            (zerop
                             (tramp-call-process
-                             "reg" nil nil nil "query" (nth 1 (car v)))))
+                             "reg" nil nil nil "query" (nth 1 (car v)))))
                     ;; Configuration file.
                     (file-exists-p (nth 1 (car v)))))
        (setq r (delete (car v) r)))
@@ -2816,7 +2823,7 @@ User is always nil."
   (if (memq system-type '(windows-nt))
       (with-temp-buffer
        (when (zerop (tramp-call-process
-                     "reg" nil t nil "query" registry-or-dirname))
+                     nil "reg" nil t nil "query" registry-or-dirname))
          (goto-char (point-min))
          (loop while (not (eobp)) collect
                (tramp-parse-putty-group registry-or-dirname))))
@@ -2895,7 +2902,7 @@ User is always nil."
 (defun tramp-handle-file-accessible-directory-p (filename)
   "Like `file-accessible-directory-p' for Tramp files."
   (and (file-directory-p filename)
-       (file-executable-p filename)))
+       (file-readable-p filename)))
 
 (defun tramp-handle-file-exists-p (filename)
   "Like `file-exists-p' for Tramp files."
@@ -3333,8 +3340,9 @@ User is always nil."
 (defun tramp-handle-unhandled-file-name-directory (_filename)
   "Like `unhandled-file-name-directory' for Tramp files."
   ;; With Emacs 23, we could simply return `nil'.  But we must keep it
-  ;; for backward compatibility.
-  (expand-file-name "~/"))
+  ;; for backward compatibility.  "~/" cannot be returned, because
+  ;; there might be machines without a HOME directory (like hydra).
+  "/")
 
 (defun tramp-handle-set-visited-file-modtime (&optional time-list)
   "Like `set-visited-file-modtime' for Tramp files."
@@ -3905,7 +3913,7 @@ be granted."
                (tramp-get-file-property
                 vec (tramp-file-name-localname vec)
                 (concat "file-attributes-" suffix) nil)
-               (file-attributes
+               (tramp-compat-file-attributes
                 (tramp-make-tramp-file-name
                  (tramp-file-name-method vec)
                  (tramp-file-name-user vec)
@@ -4117,18 +4125,34 @@ ALIST is of the form ((FROM . TO) ...)."
 ;;; Compatibility functions section:
 
 (defun tramp-call-process
-  (program &optional infile destination display &rest args)
+  (vec program &optional infile destination display &rest args)
   "Calls `call-process' on the local host.
-This is needed because for some Emacs flavors Tramp has
-defadvised `call-process' to behave like `process-file'.  The
-Lisp error raised when PROGRAM is nil is trapped also, returning 1.
-Furthermore, traces are written with verbosity of 6."
-  (tramp-message
-   (vector tramp-current-method tramp-current-user tramp-current-host nil nil)
-   6 "`%s %s' %s %s" program (mapconcat 'identity args " ") infile destination)
-  (if (executable-find program)
-      (apply 'call-process program infile destination display args)
-    1))
+It always returns a return code.  The Lisp error raised when
+PROGRAM is nil is trapped also, returning 1.  Furthermore, traces
+are written with verbosity of 6."
+  (let ((v (or vec
+              (vector tramp-current-method tramp-current-user
+                      tramp-current-host nil nil)))
+       (destination (if (eq destination t) (current-buffer) destination))
+       result)
+    (tramp-message
+     v 6 "`%s %s' %s %s"
+     program (mapconcat 'identity args " ") infile destination)
+    (condition-case err
+       (with-temp-buffer
+         (setq result
+               (apply
+                'call-process program infile (or destination t) display args))
+         ;; `result' could also be an error string.
+         (when (stringp result)
+           (signal 'file-error (list result)))
+         (with-current-buffer
+             (if (bufferp destination) destination (current-buffer))
+           (tramp-message v 6 "%d\n%s" result (buffer-string))))
+      (error
+       (setq result 1)
+       (tramp-message v 6 "%d\n%s" result (error-message-string err))))
+    result))
 
 ;;;###tramp-autoload
 (defun tramp-read-passwd (proc &optional prompt)
index 1ee6e6ad025ca85dc58a5a1fdf6acf5f4d48ddec..065c3f33ebec92d93c7fd43d50a564c1b8698bca 100644 (file)
 
 ;;; Code:
 
-;; In the Tramp CVS repository, the version number and the bug report
+;; In the Tramp GIT repository, the version number and the bug report
 ;; address are auto-frobbed from configure.ac, so you should edit that
 ;; file and run "autoconf && ./configure" to change them.  (X)Emacs
 ;; version check is defined in macro AC_EMACS_INFO of aclocal.m4;
 ;; should be changed only there.
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.2.9-24.4"
+(defconst tramp-version "2.2.11-pre"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -44,7 +44,7 @@
                      (= emacs-major-version 21)
                      (>= emacs-minor-version 4)))
             "ok"
-          (format "Tramp 2.2.9-24.4 is not fit for %s"
+          (format "Tramp 2.2.11-pre is not fit for %s"
                   (when (string-match "^.*$" (emacs-version))
                     (match-string 0 (emacs-version)))))))
   (unless (string-match "\\`ok\\'" x) (error "%s" x)))
index 2d798494b8b5b6e3539dd06597d2f8db4446d9fa..b607eb95df2267e27f0b49766be578b98e995a8b 100644 (file)
@@ -1390,22 +1390,12 @@ unless optional argument SOFT is non-nil."
         ;; If we're not inside a comment, just try to indent.
         ((not compos) (indent-according-to-mode))
         (t
-         (let* ((comment-column
-                 ;; The continuation indentation should be somewhere between
-                 ;; the current line's indentation (plus 2 for good measure)
-                 ;; and the current comment's indentation, with a preference
-                 ;; for comment-column.
-                 (save-excursion
-                   ;; FIXME: use prev line's info rather than first line's.
-                   (goto-char compos)
-                   (min (current-column) (max comment-column
-                                              (+ 2 (current-indentation))))))
-                (comstart (buffer-substring compos comin))
+         (let* ((comstart (buffer-substring compos comin))
                 (normalp
                  (string-match (regexp-quote (comment-string-strip
                                               comment-start t t))
                                comstart))
-                (comment-end
+                (comend
                  (if normalp comment-end
                    ;; The comment starter is not the normal comment-start
                    ;; so we can't just use comment-end.
@@ -1416,19 +1406,42 @@ unless optional argument SOFT is non-nil."
                         (buffer-substring
                          (save-excursion (comment-enter-backward) (point))
                          (point))
-                        nil t)))))
-                (comment-start comstart)
-                (continuep (or comment-multi-line
-                               (cadr (assoc comment-style comment-styles))))
-                ;; Force comment-continue to be recreated from comment-start.
-                ;; FIXME: wrong if comment-continue was set explicitly!
-                ;; FIXME: use prev line's continuation if available.
-                (comment-continue nil))
-           (if (and comment-multi-line (> (length comment-end) 0))
+                        nil t))))))
+           (if (and comment-multi-line (> (length comend) 0))
                (indent-according-to-mode)
              (insert-and-inherit ?\n)
              (forward-char -1)
-             (comment-indent continuep)
+              (let* ((comment-column
+                      ;; The continuation indentation should be somewhere
+                      ;; between the current line's indentation (plus 2 for
+                      ;; good measure) and the current comment's indentation,
+                      ;; with a preference for comment-column.
+                      (save-excursion
+                        ;; FIXME: use prev line's info rather than first
+                        ;; line's.
+                        (goto-char compos)
+                        (min (current-column)
+                             (max comment-column
+                                  (+ 2 (current-indentation))))))
+                     (comment-indent-function
+                      ;; If the previous comment is on its own line, then
+                      ;; reuse its indentation unconditionally.
+                      ;; Important for modes like Python/Haskell where
+                      ;; auto-indentation is unreliable.
+                      (if (save-excursion (goto-char compos)
+                                          (skip-chars-backward " \t")
+                                          (bolp))
+                          (lambda () comment-column) comment-indent-function))
+                     (comment-start comstart)
+                     (comment-end comend)
+                     (continuep (or comment-multi-line
+                                    (cadr (assoc comment-style
+                                                 comment-styles))))
+                     ;; Recreate comment-continue from comment-start.
+                     ;; FIXME: wrong if comment-continue was set explicitly!
+                     ;; FIXME: use prev line's continuation if available.
+                     (comment-continue nil))
+                (comment-indent continuep))
              (save-excursion
                (let ((pt (point)))
                  (end-of-line)
index b3ce7aaac258d4c59397c781cb6f81e3687a1686..4859bbc7a77b2f41fe3e0a641c1d46ca7e1de076 100644 (file)
@@ -2567,7 +2567,7 @@ With a prefix argument, inserts the character directly."
               (> (prefix-numeric-value arg) 0))))
     (when (not (eq new nxml-char-ref-extra-display))
       (setq nxml-char-ref-extra-display new)
-      (font-lock-fontify-buffer))))
+      (font-lock-flush))))
 
 (put 'nxml-char-ref 'evaporate t)
 
similarity index 99%
rename from lisp/emulation/crisp.el
rename to lisp/obsolete/crisp.el
index ad46341273583d4ad62b762cfd57531a843f28e7..47cf898190bf25a9a7ae081f365f3a6a0f4540de 100644 (file)
@@ -4,6 +4,7 @@
 
 ;; Author: Gary D. Foster <Gary.Foster@Corp.Sun.COM>
 ;; Keywords: emulations brief crisp
+;; Obsolete-since: 24.5
 
 ;; This file is part of GNU Emacs.
 
similarity index 99%
rename from lisp/emacs-lisp/gulp.el
rename to lisp/obsolete/gulp.el
index d0a89b3075ab9065659f0a95ed5ecddd01f1eef7..d959b73ba696a027e7fbd07f66ed96257a4ae4d9 100644 (file)
@@ -5,6 +5,7 @@
 ;; Author: Sam Shteingold <shteingd@math.ucla.edu>
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: maint
+;; Obsolete-since: 24.5
 
 ;; This file is part of GNU Emacs.
 
index c1313b8a00fde8da562591cb899291d9d9a8a040..dfe1222d550d69fdd626e7594cf07fcac711f1f3 100644 (file)
@@ -1416,10 +1416,7 @@ See the variable `iswitchb-case' for details."
          (isearch-no-upper-case-p iswitchb-text)
        (isearch-no-upper-case-p iswitchb-text t))))
 
-;; NB obsolete/ is not scanned for autoloads.
-;; If you change any of the following doc, copy the changes to simple.el.
-
-;;;###autoload
+;;;###obsolete-autoload
 (define-minor-mode iswitchb-mode
   "Toggle Iswitchb mode.
 With a prefix argument ARG, enable Iswitchb mode if ARG is
@@ -1433,7 +1430,7 @@ between buffers using substrings.  See `iswitchb' for details."
       (add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)
     (remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)))
 
-;;;###autoload
+;;;###obsolete-autoload
 (make-obsolete 'iswitchb-mode
                "use `icomplete-mode' or `ido-mode' instead." "24.4")
 
index 880780c577cbefa23a7596062c4d763684dd82b4..bcd468c2b06389f96db8d22db904d0c8e490fa2a 100644 (file)
@@ -75,12 +75,7 @@ site-init."
            (if mail-interactive
                (with-current-buffer errbuf
                  (erase-buffer))))
-         (let ((m (default-file-modes)))
-           (unwind-protect
-               (progn
-                 (set-default-file-modes 384)
-                 (setq temfile  (make-temp-file ",rpost")))
-             (set-default-file-modes m)))
+         (with-file-modes 384 (setq temfile (make-temp-file ",rpost")))
          (apply 'call-process
                 (append (list (if (boundp 'post-mail-program)
                                   post-mail-program
index e5ac1e1427d979253863af7d42de78af8ce3e91b..5ee0818a1e5879932fd6edbe1e37cc602d41994d 100644 (file)
@@ -388,7 +388,7 @@ but before calling PC Selection mode):
                   (fboundp 'normal-erase-is-backspace-mode))
          (normal-erase-is-backspace-mode 1))
        (setq highlight-nonselected-windows nil)
-       (setq transient-mark-mode t)
+       (transient-mark-mode 1)
        (setq mark-even-if-inactive t)
        (delete-selection-mode 1))
     ;;else
index 5a54cb0caffbf11e87dcbc2987544d273d0eb638..5d6ae9cc2e96993c87d49e69f62c7526d859ee35 100644 (file)
@@ -202,15 +202,11 @@ passphrase cache or user."
 (defun pgg-pgp-verify-region (start end &optional signature)
   "Verify region between START and END as the detached signature SIGNATURE."
   (let* ((orig-file (pgg-make-temp-file "pgg"))
-        (args "+verbose=1 +batchmode +language=us")
-        (orig-mode (default-file-modes)))
-    (unwind-protect
-       (progn
-         (set-default-file-modes 448)
-         (let ((coding-system-for-write 'binary)
-               jka-compr-compression-info-list jam-zcat-filename-list)
-           (write-region start end orig-file)))
-      (set-default-file-modes orig-mode))
+        (args "+verbose=1 +batchmode +language=us"))
+    (with-file-modes 448
+      (let ((coding-system-for-write 'binary)
+            jka-compr-compression-info-list jam-zcat-filename-list)
+        (write-region start end orig-file)))
     (if (stringp signature)
        (progn
          (copy-file signature (setq signature (concat orig-file ".asc")))
index beece7ea2ea5f36bea731d054f553c898c8ea0b3..944800cf0f6a49c6c457d0a026fbdcb8a1156673 100644 (file)
@@ -208,15 +208,11 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
 (defun pgg-pgp5-verify-region (start end &optional signature)
   "Verify region between START and END as the detached signature SIGNATURE."
   (let ((orig-file (pgg-make-temp-file "pgg"))
-       (args '("+verbose=1" "+batchmode=1" "+language=us"))
-       (orig-mode (default-file-modes)))
-    (unwind-protect
-       (progn
-         (set-default-file-modes 448)
-         (let ((coding-system-for-write 'binary)
-               jka-compr-compression-info-list jam-zcat-filename-list)
-           (write-region start end orig-file)))
-      (set-default-file-modes orig-mode))
+       (args '("+verbose=1" "+batchmode=1" "+language=us")))
+    (with-file-modes 448
+      (let ((coding-system-for-write 'binary)
+           jka-compr-compression-info-list jam-zcat-filename-list)
+       (write-region start end orig-file)))
     (when (stringp signature)
       (copy-file signature (setq signature (concat orig-file ".asc")))
       (setq args (append args (list signature))))
similarity index 99%
rename from lisp/emulation/tpu-edt.el
rename to lisp/obsolete/tpu-edt.el
index d9ed1908c763a46542103f35ca0c9c9054fb9155..43189319a6a21748ec780b827c8c7db6737396a6 100644 (file)
@@ -6,6 +6,7 @@
 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
 ;; Version: 4.5
 ;; Keywords: emulations
+;; Obsolete-since: 24.5
 
 ;; This file is part of GNU Emacs.
 
similarity index 99%
rename from lisp/emulation/tpu-extras.el
rename to lisp/obsolete/tpu-extras.el
index 9ebaaf6ffcef7f18d471cb45c11b69f3a2ba03fd..32257e840ac046cf42b71133eb4c1d3f0b522714 100644 (file)
@@ -6,6 +6,7 @@
 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
 ;; Keywords: emulations
 ;; Package: tpu-edt
+;; Obsolete-since: 24.5
 
 ;; This file is part of GNU Emacs.
 
similarity index 99%
rename from lisp/emulation/tpu-mapper.el
rename to lisp/obsolete/tpu-mapper.el
index 2479389ac3c732343e396a2b7b44ba54a59591d1..d653685218bccb1fa4b07fd741de092a7b27ea2d 100644 (file)
@@ -6,6 +6,7 @@
 ;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
 ;; Keywords: emulations
 ;; Package: tpu-edt
+;; Obsolete-since: 24.5
 
 ;; This file is part of GNU Emacs.
 
similarity index 99%
rename from lisp/emulation/vi.el
rename to lisp/obsolete/vi.el
index 9aae40c0d00ed4ced974df47a8df9ca8456a0b2d..fbdf7a1e920a2db8dc7d730c412217a3f7f8347f 100644 (file)
@@ -8,9 +8,12 @@
 ;; Author: Neal Ziring <nz@rsch.wisc.edu>
 ;;     Felix S. T. Wu <wu@crys.wisc.edu>
 ;; Keywords: emulations
+;; Obsolete-since: 24.5
 
 ;;; Commentary:
 
+;; This file is obsolete.  Consider using viper instead.
+
 ;; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring)
 ;; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu)
 ;; Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
@@ -1197,7 +1200,7 @@ SPECIAL FEATURE: char argument can be used to specify shift amount(1-9)."
     (let ((aelt (assq char vi-mark-alist)))
       (if aelt
          (move-marker (cdr aelt) (point)) ; fixed 6/12/86
-       (setq aelt (cons char (copy-marker (point))))
+       (setq aelt (cons char (point-marker)))
        (setq vi-mark-alist (cons aelt vi-mark-alist))))))
 
 (defun vi-find-matching-paren ()
similarity index 99%
rename from lisp/emulation/vip.el
rename to lisp/obsolete/vip.el
index 09456e6320bc03e2fcc6f452ba54167db9b08ec6..ea102cb0ac5ae05763502e602b22836a7d8efe54 100644 (file)
@@ -1,10 +1,11 @@
 ;;; vip.el --- a VI Package for GNU Emacs
 
-;; Copyright (C) 1986-1988, 1992-1993, 1998, 2001-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1986-1988, 1992-1993, 1998, 2001-2014
+;;   Free Software Foundation, Inc.
 
 ;; Author: Masahiko Sato <ms@sail.stanford.edu>
 ;; Keywords: emulations
+;; Obsolete-since: 24.5
 
 ;; This file is part of GNU Emacs.
 
@@ -23,6 +24,8 @@
 
 ;;; Commentary:
 
+;; This file is obsolete.  Consider using viper instead.
+
 ;; A full-featured vi(1) emulator.
 ;;
 ;; In Japan, the author's address is: masahiko@sato.riec.tohoku.junet
similarity index 99%
rename from lisp/emulation/ws-mode.el
rename to lisp/obsolete/ws-mode.el
index fb140e6ebd7a530472971be298aae748481cbef5..d87cc73252b1375701396f492e45d161a36857f8 100644 (file)
@@ -5,6 +5,7 @@
 ;; Author: Juergen Nickelsen <nickel@cs.tu-berlin.de>
 ;; Version: 0.7
 ;; Keywords: emulations
+;; Obsolete-since: 24.5
 
 ;; This file is part of GNU Emacs.
 
index a74388b7d710a27203a5eff6898e207c7581bb2f..7ad601b1719d3ec41b322b9e8f2ec2fe9c61f113 100644 (file)
@@ -1,3 +1,31 @@
+2014-06-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * org-compat.el (activate-mark): Set transient-mark-mode buffer-locally.
+
+2014-06-22  Mario Lang  <mlang@delysid.org>
+
+       * org-list.el (org-list-insert-item): The the -> the.
+
+       * org-bibtex.el (org-bibtex-fields): The the -> the.
+
+2013-06-22  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * ob-core.el (org-babel-insert-result): Prefer point-min-marker
+       and point-max-marker.
+       * org-mouse.el (org-mouse-do-remotely): Prefer point-marker
+       to copy-marker of point.
+
+2014-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * org-compat.el (org-font-lock-ensure): New function.
+       * ox-odt.el (org-odt-do-format-code):
+       * ox-html.el (org-html-fontify-code):
+       * org.el (org-fontify-like-in-org-mode):
+       * org-src.el (org-src-font-lock-fontify-block):
+       * org-clock.el (org-clock-get-clocktable): Use it.
+       * ox-org.el (org-org-publish-to-org): Use it.  Avoid using find-file
+       from Elisp.
+
 2014-05-12  Eric Schulte  <eric.schulte@gmx.com>
 
        * ob-screen.el (org-babel-screen-session-write-temp-file)
        `org-babel-gnuplot-table-to-data´ expects a table, so we need to
        construct one when Babel hands us a vector.
 
-       * ob-ref.el (org-babel-ref-parse): If
-       `org-babel-current-src-block-location' is a marker, it can be from
+       * ob-ref.el (org-babel-ref-parse):
+       If `org-babel-current-src-block-location' is a marker, it can be from
        another buffer, use marker-position instead in this case.
 
 2014-04-22  Arun Persaud  <apersaud@lbl.gov>  (tiny change)
 
-       * org-src.el (org-edit-src-exit): Don't add indentation on empty
-       lines.
+       * org-src.el (org-edit-src-exit): Don't add indentation on empty lines.
 
 2014-04-22  Bastien Guerry  <bzg@gnu.org>
 
 
        * org-table.el (org-table-copy-down)
        (org-table-find-dataline, org-table-move-row)
-       (org-table-insert-hline, org-table-kill-row): Use
-       `org-move-to-column' with the IGNORE-INVISIBLE arg set to `t', so
+       (org-table-insert-hline, org-table-kill-row):
+       Use `org-move-to-column' with the IGNORE-INVISIBLE arg set to `t', so
        that abbreviated rows don't interfer with setting the cursor back
        at the correct position.
 
        * org-table.el (org-table-field-info): Throw a user error when not
        at a table.
 
-       * org-agenda.el (org-agenda-drag-line-forward): Call
-       `org-agenda-mark-clocking-task' when done.
+       * org-agenda.el (org-agenda-drag-line-forward):
+       Call `org-agenda-mark-clocking-task' when done.
        (org-agenda-mark-clocking-task): Small refactoring.
 
        * org-compat.el (org-set-transient-map): Alias pointing at
 
 2014-04-22  Markus Hauck  <markus1189@gmail.com>  (tiny change)
 
-       * org-agenda.el (org-agenda-get-scheduled): If
-       `org-agenda-skip-scheduled-if-deadline-is-shown' is set to
+       * org-agenda.el (org-agenda-get-scheduled):
+       If `org-agenda-skip-scheduled-if-deadline-is-shown' is set to
        'repeated-after-deadline, still show tasks without any deadline
 
 2014-04-22  Michael Brand  <michael.ch.brand@gmail.com>
        followed by multiple blank lines.
 
        * ox.el (org-export-insert-default-template): Only insert
-       keywords and options relatives to the selected back-end.  Ignore
-       those relatives to its parent in the case of a derived back-end.
+       keywords and options relatives to the selected back-end.
+       Ignore those relatives to its parent in the case of a derived back-end.
 
        * ox-beamer.el: Remove unnecessary package definitions in default
        class.
        docstring.
        (org-entry-get): Minor docstring enhancement.
        (org-set-startup-visibility): Bugfix.
-       (org-shiftcontrolup, org-shiftcontroldown): When
-       `org-support-shift-select' is not `nil', let-bind it to nil if
+       (org-shiftcontrolup, org-shiftcontroldown):
+       When `org-support-shift-select' is not `nil', let-bind it to nil if
        point is on a clock log.  Otherwise throw an error.
 
        * ob-lob.el (org-babel-lob-files): Fix custom type.
 
        * ox-html.el: Clean up "FIXME" comments.
 
-       * ox-publish.el (org-publish-resolve-external-fuzzy-link): Fix
-       docstring.
+       * ox-publish.el (org-publish-resolve-external-fuzzy-link):
+       Fix docstring.
 
        * ox.el (org-export-smart-quotes-regexps): Fix smart quote
        detection when it is followed by an open parenthesis syntax class.
 
-       * org-element.el (org-element-inline-babel-call-successor): Use
-       original regexp to stay up-to-date with Babel changes.
+       * org-element.el (org-element-inline-babel-call-successor):
+       Use original regexp to stay up-to-date with Babel changes.
        (org-element--affiliated-re): Fix affiliated keyword regexp.
 
        * ox-org.el (org-org-identity): Since back-end specific keywords
        are stripped from output, also remove attr_backend keywords.
        (org-babel-exp-process-buffer): Fix duplicate evaluation with
        :wrap src.
-       (org-babel-exp-non-block-elements): Removed function.
+       (org-babel-exp-non-block-elements): Remove function.
 
 2013-01-07  Ted Wiles  <thewiles@wharton.upenn.edu>  (tiny change)
 
        (org-texinfo-drawer): Always use
        `org-texinfo-format-drawer-function' as it is now a function
        by default.
-       (org-texinfo-headline): Compare
-       `org-texinfo-format-headline-function' against 'ignore.
-       (org-texinfo-inlinetask): Compare
-       `org-texinfo-format-inlinetask-function' against 'ignore.
+       (org-texinfo-headline):
+       Compare `org-texinfo-format-headline-function' against 'ignore.
+       (org-texinfo-inlinetask):
+       Compare `org-texinfo-format-inlinetask-function' against 'ignore.
 
        * ox-odt.el (org-odt-format-drawer-function): Use a function as
        the default value.  Update docstring.
        (org-odt-format-inlinetask-function): Fix default value.
        (org-odt-drawer): Always use `org-odt-format-drawer-function'
        as it is now a function by default.
-       (org-odt-format-headline--wrap): Compare
-       `org-odt-format-headline-function' against 'ignore.
+       (org-odt-format-headline--wrap):
+       Compare `org-odt-format-headline-function' against 'ignore.
 
        * ox-latex.el (org-latex-format-drawer-function): Use a function
        as the default value.  Update docstring.
        (org-latex-drawer): Always use
        `org-latex-format-drawer-function' as it is now a function by
        default.
-       (org-latex-inlinetask): Compare
-       `org-latex-format-inlinetask-function' against 'ignore.
+       (org-latex-inlinetask):
+       Compare `org-latex-format-inlinetask-function' against 'ignore.
 
        * ox-html.el (org-html-format-drawer-function): Use a function as
        the default value.  Update docstring.
        (org-html-format-headline-function)
        (org-html-format-inlinetask-function): Fix default value.
        (org-html--format-toc-headline)
-       (org-html-format-headline--wrap): Compare
-       `org-html-format-headline-function' against 'ignore.
-       (org-html-inlinetask): Compare
-       `org-html-format-inlinetask-function' against 'ignore.
+       (org-html-format-headline--wrap):
+       Compare `org-html-format-headline-function' against 'ignore.
+       (org-html-inlinetask):
+       Compare `org-html-format-inlinetask-function' against 'ignore.
 
        * ox-ascii.el (org-ascii-format-drawer-function): Use a
        function as the default value.  Update docstring.
        `org-ascii-format-drawer-function' as it is now a function by
        default.
        (org-ascii-format-inlinetask-default): New function.
-       (org-ascii-format-inlinetask-function): Use
-       `org-ascii-format-inlinetask-default' as the default.
+       (org-ascii-format-inlinetask-function):
+       Use `org-ascii-format-inlinetask-default' as the default.
 
        * org.el (org-mouse-1-follows-link): Use :set to set the default
        value.  Update custom type.
        type.
        (orgstruct-heading-prefix-regexp): Use an empty string as the
        default value.  Use 'regexp as the custom type.
-       (orgstruct-make-binding): Tiny docstring enhancement.  Assume
-       `orgstruct-heading-prefix-regexp' is a string.
+       (orgstruct-make-binding): Tiny docstring enhancement.
+       Assume `orgstruct-heading-prefix-regexp' is a string.
 
-       * org-agenda.el (org-agenda-search-view-max-outline-level): Set
-       default value to 0.  Update docstring.
+       * org-agenda.el (org-agenda-search-view-max-outline-level):
+       Set default value to 0.  Update docstring.
        (org-agenda-deadline-leaders): Fix custom type.
-       (org-search-view): Assume
-       `org-agenda-search-view-max-outline-level' is a number.
+       (org-search-view):
+       Assume `org-agenda-search-view-max-outline-level' is a number.
 
        * ob-ruby.el (org-babel-ruby-nil-to): Fix custom type.
 
        * ox-html.el (org-html-format-latex): Add an argument.  Ensure
        latex header is the same as specified in the original buffer when
        exporting a LaTeX fragment or environment.
-       (org-html-latex-environment, org-html-latex-fragment): Apply
-       signature change.
+       (org-html-latex-environment, org-html-latex-fragment):
+       Apply signature change.
 
        * ox-publish.el (org-publish-cache-ctime-of-src): Return an error
        when publishing a non-existent file.
        * org.el (org-format-latex): Do not re-generate a LaTeX preview if
        the image already exists.
 
-       * org-agenda.el (org-agenda-search-view-max-outline-level): New
-       option to define the max level for the entries shown by the search
+       * org-agenda.el (org-agenda-search-view-max-outline-level):
+       New option to define the max level for the entries shown by the search
        view.  A value of 1 means to show the top parent of the entries.
 
        * org.el (org-create-formula-image-with-dvipng): Fix bug that made
        (org-babel-get-rownames, org-table.el)
        (org-table-transpose-table-at-point): Replace the inadvertent use
        of mapcar* (from cl) by plain mapcar and direct cons manipulation.
-       (org-babel-params-from-properties): Use
-       `org-babel-current-src-block-location' for evaluating new-style
+       (org-babel-params-from-properties):
+       Use `org-babel-current-src-block-location' for evaluating new-style
        header-argument properties.  Remove superfluous save-match-data
        clauses.  Comment which properties get evaluated where.
        (org-babel-insert-header-arg, org-babel-parse-src-block-match):
        `org-re-property'.
        (org-re-property-keyword): Remove, functionality is subsumed by
        `org-re-property'.
-       (org-property-re): Define using `org-re-property'.  Improve
-       definition so that this regex can be
+       (org-property-re): Define using `org-re-property'.
+       Improve definition so that this regex can be
        (org-entry-get, org-property-values): Adjust match number for
        PROPVAL.  (org-entry-put): Use `org-re-property' instead of
        `org-re-property-keyword'.
        (define-obsolete-function-alias): Actually remove the third (and
        any following) argument from the argument list before calling the
        advised function.  Extend eval-and-compile clause and add advices
-       for functions that have different parameter lists in XEmacs.  Add
-       variable definitions that XEmacs lacks .
+       for functions that have different parameter lists in XEmacs.
+       Add variable definitions that XEmacs lacks .
 
        * ob-fortran.el (org-every): Declare.
 
-       * org-element.el (org-element-node-property-parser): Use
-       `org-property-re' and adjust match group numbers accordingly.
+       * org-element.el (org-element-node-property-parser):
+       Use `org-property-re' and adjust match group numbers accordingly.
        Move `looking-at' out of the let clause to not rely on the
        unspecified evaluation order inside the let.
 
        argument list that XEmacs complains about by adding parenthesis.
 
        * ob-octave.el (org-babel-octave-initiate-session): If octave-inf
-       can't be loaded, try octave instead before giving up.  Emacs
-       24.3.50 and upwards replaces octave-inf with just plain octave.
+       can't be loaded, try octave instead before giving up.
+       Emacs 24.3.50 and upwards replaces octave-inf with just plain octave.
 
        * org-id.el (org-id-update-id-locations): Autoload interactive
        function.
        * org-table.el (org-table-colgroup-info): Remove unused defvar for
        `org-table-colgroup-info'.
        (org-table-clean-before-export): Let-bind regular expression
-       strings and remove unused matching group.  Use
-       `org-table-clean-did-remove-column' in cond statement rather than
+       strings and remove unused matching group.
+       Use `org-table-clean-did-remove-column' in cond statement rather than
        branching via if to avoid code duplication.  Remove the code
        associated with the removed `org-table-colgroup-info'.
        (orgtbl-export): Remove unused internal function.
        * ob-perl.el (org-babel-execute:perl): Pass `result-params´
        through to `org-babel-perl-evaluate´.
        (org-babel-variable-assignments:perl): Add "my" to variable
-       declaration so that it becomes compatible with "use strict;".  Use
-       new internal formatting function `org-babel-perl--var-to-perl´.
+       declaration so that it becomes compatible with "use strict;".
+       Use new internal formatting function `org-babel-perl--var-to-perl´.
        (org-babel-perl--var-to-perl): New internal function, uses Perl
        non-interpolating quoting on the string that defines the variable
        to suppress spurious interpretation of it as Perl syntax.
        * ob-eval.el (org-babel-eval): Use simplified version of
        `org-babel--shell-command-on-region´, we are the only caller of
        this function.
-       (org-babel--shell-command-on-region): Replace
-       `org-babel-shell-command-on-region´ with a much more simplified
+       (org-babel--shell-command-on-region):
+       Replace `org-babel-shell-command-on-region´ with a much more simplified
        internal version, remove superfluous DOCSTRING and interactive
        clause, strip out all conditionals which were never used.  Prevent
        deletion of temporary input file to aid debugging when the symbol
        * org-macs.el: New macro to allow the 5-argument form of load to
        be used where possible without breaking compatibility with XEmacs.
 
-       * org.el (org-version, org-reload): Use
-       `org-load-noerror-mustsuffix´ instead of adding a fifth argument
+       * org.el (org-version, org-reload):
+       Use `org-load-noerror-mustsuffix´ instead of adding a fifth argument
        to load directly.  Guard against undefined variable load-suffixes,
        which doesn't exist in XEmacs.
 
 
 2013-11-12  Alan Schmitt  <alan.schmitt@polytechnique.org>
 
-       * ob-ocaml.el (org-babel-prep-session:ocaml): Use
-       `save-window-excursion' around the code starting the tuareg
+       * ob-ocaml.el (org-babel-prep-session:ocaml):
+       Use `save-window-excursion' around the code starting the tuareg
        process.
        (org-babel-ocaml-command): New option to specify the name of the
        toplevel to run.
        when inserting the new time as a text property.
        (org-agenda-filter-make-matcher): When filtering tags and hitting
        space, filter out entries with tags, only keep those without tags.
-       (org-agenda-drag-line-forward, org-agenda-drag-line-backward): Fix
-       bugs: don't drag lines without text and don't drag lines
+       (org-agenda-drag-line-forward, org-agenda-drag-line-backward):
+       Fix bugs: don't drag lines without text and don't drag lines
        before/after hidden lines.
 
        * ox-odt.el (org-odt-table-style-format): Use %s for inserting the
        * org-capture.el (org-capture-set-target-location): Don't throw an
        error when `org-time-was-given' is not bound.
 
-       * org-clock.el (org-clock-modify-effort-estimate): Clarify
-       docstring.
+       * org-clock.el (org-clock-modify-effort-estimate):
+       Clarify docstring.
 
        * org.el (org-set-regexps-and-options-for-tags): Return a list
        with tag-related variables.
        (org-get-outline-path): Remove statistical and checkboxes cookies.
 
        * org-agenda.el (org-agenda, org-search-view, org-tags-view)
-       (org-agenda-get-day-entries, org-agenda-set-restriction-lock): Use
-       (current-buffer) as the value of `org-agenda-restrict'.  Fix a bug
+       (org-agenda-get-day-entries, org-agenda-set-restriction-lock):
+       Use (current-buffer) as the value of `org-agenda-restrict'.  Fix a bug
        about narrowing to wrong region boundaries when
        `org-agenda-restrict' is non-nil.
 
        (org-insert-heading): Fix case when there the first heading starts
        at the beginning of the buffer.
 
-       * ob-core.el (org-babel-expand-src-block): Use
-       `org-called-interactively-p'.
+       * ob-core.el (org-babel-expand-src-block):
+       Use `org-called-interactively-p'.
 
        * org.el (org-agenda-prepare-buffers): Avoid duplicates in
        `org-tag-alist-for-agenda' correctly.
        (org-read-date-minibuffer-local-map): Check if we are at the
-       beginning of the prompt, not if we are after a whitespace.  Bind
-       C-. to `calendar-goto-today'.
+       beginning of the prompt, not if we are after a whitespace.
+       Bind C-. to `calendar-goto-today'.
 
        * org-clock.el (org-clock-in): Don't forward by one character when
        setting the marker in the clock history.
 
-       * org.el (org-read-date-minibuffer-local-map): Call
-       `calendar-goto-today' only if there is a space before point in the
+       * org.el (org-read-date-minibuffer-local-map):
+       Call `calendar-goto-today' only if there is a space before point in the
        minibuffer prompt.
        (org-insert-heading): Reveal context when called interactively.
        Fix bug about wrong conversion of lines with :END: or #+end_ into
        (org-mark-subtree, org-kill-line, org-first-sibling-p)
        (org-up-element, org-down-element)
        (org-drag-element-backward, org-drag-element-forward)
-       (org-unindent-buffer, org-speedbar-set-agenda-restriction): Use
-       `user-error' instead of `error'.
+       (org-unindent-buffer, org-speedbar-set-agenda-restriction):
+       Use `user-error' instead of `error'.
 
        * ox-latex.el (latex): Don't force exporting with smart quotes.
 
        values.
 
        * org.el (org-shifttab): Show the correct number of empty
-       headlines when called with a numeric prefix argument.  Enhance
-       docstring.
+       headlines when called with a numeric prefix argument.
+       Enhance docstring.
        (org-uniquify): Use `copy-sequence'.
        (org-adaptive-fill-function, org-fill-paragraph): Throw a useful
        error message when parse an element fails in the current buffer.
        (org-cycle-emulate-tab, org-file-apps)
        (org-set-font-lock-defaults)
        (org-translate-link-from-planner, org-link-search)
-       (org-refile-get-targets, org-read-date-get-relative): Minor
-       code clean-up: fix dangling parentheses.
+       (org-refile-get-targets, org-read-date-get-relative):
+       Minor code clean-up: fix dangling parentheses.
 
        * org-agenda.el (org-agenda-entry-text-mode): Also check against
        regexp filters.
        * org-mouse.el (org-mouse-agenda-context-menu): Fix a function's
        name.
 
-       * ox.el (org-export-options-alist, org-export--skip-p): Use
-       `:with-planning' instead of `:with-plannings', to keep in sync
+       * ox.el (org-export-options-alist, org-export--skip-p):
+       Use `:with-planning' instead of `:with-plannings', to keep in sync
        with the corresponding option's name.
 
        * ob-core.el (org-babel-confirm-evaluate): Fix typo in docstring.
        (org-re-timestamp): Handle closed time-stamps.
        (org-closed-in-range): Delete.
 
-       * org-capture.el (org-capture-import-remember-templates): Take
-       care of adding :jump-to-captured option if needed.
+       * org-capture.el (org-capture-import-remember-templates):
+       Take care of adding :jump-to-captured option if needed.
 
        * org.el (org-toggle-pretty-entities): Enhance messages.
        (org-raise-scripts): Handle scripts like "a_b^c".
        information for filtering in the agenda buffer.
        (org-uniquify-alist): New function.
 
-       * org-pcomplete.el (pcomplete/org-mode/file-option/tags): Handle
-       :grouptags.
+       * org-pcomplete.el (pcomplete/org-mode/file-option/tags):
+       Handle :grouptags.
 
        * org-faces.el (mode-line): New face for group tags.
 
        * ox-ascii.el (ascii): Use `org-export-define-backend' and
        `org-export-define-derived-backend' as defuns, not macros.
 
-       * org.el (org-set-regexps-and-options): Use
-       `org-table-set-constants'.
+       * org.el (org-set-regexps-and-options):
+       Use `org-table-set-constants'.
 
        * org-table.el (org-table-set-constants): New function.
        (orgtbl-ctrl-c-ctrl-c): Use it.
        * ox-publish.el (org-publish-org-to)
        (org-publish-org-sitemap, org-publish-find-title)
        (org-publish-find-date)
-       (org-publish-cache-file-needs-publishing): Set
-       `org-inhibit-startup' to t when visiting files for
+       (org-publish-cache-file-needs-publishing):
+       Set `org-inhibit-startup' to t when visiting files for
        publication.
 
        * ox-org.el (org-org-publish-to-org): Kill buffers not visited at
        (org-agenda-filter-remove-all): New command.
        (org-agenda-filter-show-all-re): Rename from
        `org-agenda-filter-show-all-regexp'.
-       (org-agenda-filter-by-regexp): Call
-       `org-agenda-filter-show-all-re'.
+       (org-agenda-filter-by-regexp):
+       Call `org-agenda-filter-show-all-re'.
 
        * org-list.el (org-insert-item): Don't ask for a definition term
        when insert an item in a description list.
        * ox.el (org-export--copy-to-kill-ring-p): New function.
        (org-export-copy-to-kill-ring): Use 'if-interactive as the
        default.
-       (org-export-to-buffer, org-export-to-file): Use
-       `org-export--copy-to-kill-ring-p' and fix docstrings.
+       (org-export-to-buffer, org-export-to-file):
+       Use `org-export--copy-to-kill-ring-p' and fix docstrings.
 
-       * ox-odt.el (org-odt-export-as-odf): Use
-       `org-export--copy-to-kill-ring-p'.
+       * ox-odt.el (org-odt-export-as-odf):
+       Use `org-export--copy-to-kill-ring-p'.
 
        * org.el (org-set-font-lock-defaults): Fontify macros.
 
        (org-scheduled-time-hour-regexp): New buffer local variables.
        (org-set-regexps-and-options): Set the new variables.
 
-       * org-agenda.el (org-agenda-custom-commands-local-options): Add
-       :deadline* and :scheduled* to the list of possible agenda entry
+       * org-agenda.el (org-agenda-custom-commands-local-options):
+       Add :deadline* and :scheduled* to the list of possible agenda entry
        types.
        (org-agenda): Implement a new agenda type agenda* with :scheduled*
        and :deadline* replacing :scheduled and :deadline respectively in
        (org-agenda-list): New parameter `with-hour'.  Use :scheduled* and
        :deadline*.
        (org-agenda-get-day-entries): Handle :scheduled* and :deadline*.
-       (org-agenda-get-deadlines, org-agenda-get-scheduled): New
-       parameter `with-hour'.  Use `org-deadline-time-hour-regexp' or
+       (org-agenda-get-deadlines, org-agenda-get-scheduled):
+       New parameter `with-hour'.  Use `org-deadline-time-hour-regexp' or
        `org-scheduled-time-hour-regexp' as the search string if needed.
        (org-agenda-to-appt): Use :scheduled* and :deadline* by default,
        as other scheduled and deadline items don't have a time spec and
        cannot be turned into appointments.  Trim bracket links and use
        only the description as the appointment text.
-       (org-agenda-get-restriction-and-command): Add
-       default description for the agenda* view.
+       (org-agenda-get-restriction-and-command):
+       Add default description for the agenda* view.
        (org-agenda-run-series): Handle agenda* views.
 
        * org-faces.el (org-agenda-filter-tags)
        (org-agenda-filter-category): Docstring fix.
        (org-agenda-filter-category): New face.
 
-       * org-agenda.el (org-agenda-local-vars): Add
-       `org-agenda-re-filter-overlays' and `org-agenda-regexp-filter'.
+       * org-agenda.el (org-agenda-local-vars):
+       Add `org-agenda-re-filter-overlays' and `org-agenda-regexp-filter'.
        (org-agenda-mode-map): Use "|" for
        `org-agenda-filtered-by-regexp'.
        (org-agenda-re-filter-overlays): New variable.
-       (org-agenda-mark-filtered-text): Use
-       `org-agenda-re-filter-overlays'.
+       (org-agenda-mark-filtered-text):
+       Use `org-agenda-re-filter-overlays'.
        (org-agenda-finalize, org-agenda-redo): Allow regexp filtering.
        (org-agenda-filter-by-category): Set `org-agenda-category-filter'
        here instead of within `org-agenda-apply-filter'.
        (org-agenda-filter-make-matcher): Make matcher for regexp filters.
        (org-agenda-filter-apply): Don't set `org-agenda-tag-filter' and
        `org-agenda-category-filter'.  Maybe apply regexp filter.
-       (org-agenda-filter-hide-line): Add docstring.  Hide
-       regexp-filtered lines.
+       (org-agenda-filter-hide-line): Add docstring.
+       Hide regexp-filtered lines.
        (org-agenda-filter-show-all-tag, org-agenda-filter-show-all-cat):
        Add docstring.
        (org-agenda-filter-show-all-regexp): New function.
        (org-agenda-regexp-filter-preset): New variable.
        (org-agenda-prepare): Use the new variable.
 
-       * ox-odt.el (org-odt-code, org-odt-verbatim): Use
-       `org-odt--encode-plain-text'.
+       * ox-odt.el (org-odt-code, org-odt-verbatim):
+       Use `org-odt--encode-plain-text'.
 
        * ox-html.el (org-html-link): Minor code clean-up.
 
        a universal prefix arg will only convert the first line.  This is
        more consistent with `org-toggle-item'.
        (orgstruct-setup): Add `org-ctrl-c-minus' and `org-ctrl-c-star'.
-       (customize-package-emacs-version-alist): Update
-       `customize-package-emacs-version-alist'.
+       (customize-package-emacs-version-alist):
+       Update `customize-package-emacs-version-alist'.
 
        * ox-texinfo.el (org-export-texinfo)
        (org-texinfo-filename, org-texinfo-classes)
        docstring.
 
        * ox-latex.el:
-       (org-latex-table-scientific-notation, org-latex-verse-block): Fix
-       typos in docstrings.
+       (org-latex-table-scientific-notation, org-latex-verse-block):
+       Fix typos in docstrings.
 
        * ox-html.el (org-html-text-markup-alist)
        (org-html-pretty-output, org-html-link-org-files-as-html)
        (org-html-format-list-item, org-html-format-latex)
        (org-html-encode-plain-text)
        (org-html-table-first-row-data-cells)
-       (org-html-table--table.el-table, org-html-final-function): Fix
-       or add docstring.
+       (org-html-table--table.el-table, org-html-final-function):
+       Fix or add docstring.
 
        * org.el (org-insert-heading): If the current item has a checkbox,
        insert the new item with a checkbox.
        known as HTML_STYLE_EXTRA.
        (org-html-head): Enhance docstring.
        (org-html-head-extra): Reintroduce.  Was `org-html-style-extra'.
-       (org-html--build-head): Rename from `org-html--build-head'.  Add
-       information from `org-html-head-extra'.
+       (org-html--build-head): Rename from `org-html--build-head'.
+       Add information from `org-html-head-extra'.
        (org-html-template): Use `org-html--build-head'.
 
        * ox-html.el (org-html-display-buffer-mode): Delete.
        (org-insert-heading-respect-content): New optional argument
        arg, passed to `org-insert-heading'.
 
-       * org.el (org-mode): Remove syntax entries.  Use
-       `org-backward-element' and `org-forward-element' for
+       * org.el (org-mode): Remove syntax entries.
+       Use `org-backward-element' and `org-forward-element' for
        `beginning-of-defun-function' and `end-of-defun-function': this
        allows using C-M-a and C-M-e before the first headline.
 
        publishing projects.
 
        * ox-html.el (org-html-style-default): Update docstring.
-       (org-html-infojs-install-script, org-html--build-style): Update
-       property names.
+       (org-html-infojs-install-script, org-html--build-style):
+       Update property names.
        (org-html-head-include-scripts)
        (org-html-head-include-default-style, org-html-head):
        Respectively rename from `org-html-style-include-scripts',
        * ob-tangle.el (org-babel-tangle): Remove unused attempt of
        prompting the user of the tangle file name since :tangle is always
        set.  Don't prompt for a tangle file name when called with two
-       universal prefix arg outside of a src block.  Use
-       `org-babel-tangle-single-block'.
+       universal prefix arg outside of a src block.
+       Use `org-babel-tangle-single-block'.
        (org-babel-tangle-single-block): New function.
        (org-babel-tangle-collect-blocks): Use the new function.
 
        universal prefix arguments, set the warning time or the delay
        relatively to the current timestamp, not to today's date.
 
-       * org-agenda.el (org-agenda-filter-apply): Deactive
-       `org-agenda-entry-text-mode' when filtering.
+       * org-agenda.el (org-agenda-filter-apply):
+       Deactive `org-agenda-entry-text-mode' when filtering.
        (org-agenda-entry-text-mode): Don't allow in filtered views.
        Don't show the maximum number of lines when turning off.
 
        * org-macs.el (org-unmodified): Update comment.  Don't define
        `with-silent-modifications' for emacsen that don't have it.
 
-       * org-compat.el (org-with-silent-modifications): New
-       compatibility macro.
+       * org-compat.el (org-with-silent-modifications):
+       New compatibility macro.
 
        * org.el (org-refresh-category-properties)
        (org-refresh-properties, org-entry-blocked-p)
        * ox-publish.el (org-publish-sitemap-date-format): Small docstring
        enhancement.
 
-       * ox-latex.el (org-latex-format-headline-default-function): New
-       option.
+       * ox-latex.el (org-latex-format-headline-default-function):
+       New option.
        (org-latex-format-headline-function): Use the new option as
        the default value.
        (org-latex-toc-command): Don't add vertical space after the table
        (org-html-htmlized-org-css-url)
        (org-html-htmlize-region-for-paste): Rename from
        org-export-htmlize-*.
-       (org-html-htmlize-generate-css, org-html-fontify-code): Use
-       the correct names.
+       (org-html-htmlize-generate-css, org-html-fontify-code):
+       Use the correct names.
 
        * org-compat.el (org-file-equal-p): New compatibility function.
 
        (org-clock-in, org-clock-out): Set and delete
        `org-clock-current-task'.  Minor code clean-up.
 
-       * org-clock.el (org-clock-in, org-clock-in-last): Tell
-       `org-current-time' to always return a past time.
+       * org-clock.el (org-clock-in, org-clock-in-last):
+       Tell `org-current-time' to always return a past time.
 
        * org.el (org-current-time): New argument `past' to force
        returning a past time when rounding.
        `org-emphasis-alist' word constituents.
        (org-mode-transpose-word-syntax-table): Rename from
        `org-syntax-table'.
-       (org-transpose-words): Use
-       `org-mode-transpose-word-syntax-table'.
+       (org-transpose-words):
+       Use `org-mode-transpose-word-syntax-table'.
 
        * ox.el (org-export--dispatch-ui)
        (org-export--dispatch-action): Use integers for control chars.
        (org-edit-src-exit): Inconditionally kill the src/example
        editing buffer.
 
-       * org-pcomplete.el (pcomplete/org-mode/file-option): Require
-       'org-element.  This fixes a bug about unbound variable
+       * org-pcomplete.el (pcomplete/org-mode/file-option):
+       Require 'org-element.  This fixes a bug about unbound variable
        `org-element-affiliated-keywords' when trying to complete a
        keyword before 'org-element was required.
 
 
        * org.el (org-syntax-table, org-transpose-words): Delete.
        (org-mode): Syntactically Define {} and <> as parentheses.
-       (org-drag-line-forward, org-drag-line-backward): New
-       functions.
+       (org-drag-line-forward, org-drag-line-backward):
+       New functions.
        (org-shiftmetaup, org-shiftmetadown): Fall back on the new
        functions instead of throwing an error.
        (org-make-org-heading-search-string): Don't use statistic or [x/y]
        * org.el (org-emphasis-alist, org-protecting-blocks):
        * org-src.el (org-edit-src-find-region-and-lang):
        * org-list.el (org-list-forbidden-blocks):
-       * org-footnote.el (org-footnote-forbidden-blocks): Remove
-       references to the deleted DocBook exporter.
+       * org-footnote.el (org-footnote-forbidden-blocks):
+       Remove references to the deleted DocBook exporter.
 
        * org.el (org-end-of-line): Don't throw an error outside elements.
 
        (org-transpose-words): New command, simply wrapping the new
        syntax table around `transpose-words'.
        (org-mode-map): Bind `org-transpose-words' to `M-t'.
-       (org-store-link): Use keyword at point as the search string.  Use
-       `delq nil' instead of `delete nil'.
+       (org-store-link): Use keyword at point as the search string.
+       Use `delq nil' instead of `delete nil'.
        (org-make-org-heading-search-string): Rewrite using
        org-element.el.  Not an interactive function anymore.
 
        these list HTML tags: <ul> <dl> and <ol>.
 
        * org-clock.el (org-clock-timestamps-up)
-       (org-clock-timestamps-down, org-clock-timestamps-change): Add
-       an optional argument N to change timestamps by several units.
+       (org-clock-timestamps-down, org-clock-timestamps-change):
+       Add an optional argument N to change timestamps by several units.
 
        * org.el (org-shiftcontrolup, org-shiftcontroldown): Ditto.
 
        * org.el (org-block-entry-blocking): New variable.
        (org-todo): Use it.  Also use `user-error' when a TODO state
        change is blocked.
-       (org-block-todo-from-children-or-siblings-or-parent): Display
-       `org-block-entry-blocking' in the user-error message.
+       (org-block-todo-from-children-or-siblings-or-parent):
+       Display `org-block-entry-blocking' in the user-error message.
 
        * org.el (org-get-cursor-date): New optional argument WITH-TIME to
        add the time of the day.
        (org-use-last-clock-out-time-as-effective-time): New option.
        (org-current-effective-time): Use the new option.
 
-       * org-clock.el (org-clock-get-last-clock-out-time): New
-       function.
+       * org-clock.el (org-clock-get-last-clock-out-time):
+       New function.
 
        * org.el (org-toggle-inline-images): Only send a message when
        called interactively.
        (org-agenda-get-blocks, org-agenda-change-all-lines): Add a
        new text property 'level, a string with as many whitespaces as
        the level of the item.
-       (org-agenda-format-item, org-compile-prefix-format): Handle
-       the new `%l' specifier.
+       (org-agenda-format-item, org-compile-prefix-format):
+       Handle the new `%l' specifier.
 
        * org-colview.el (org-columns-next-allowed-value): Add the
        CLOCKSUM property to the list of properties that can be
        * org-agenda.el (org-agenda-custom-commands-local-options):
        (org-agenda-span, org-agenda-ndays-to-span)
        (org-agenda-span-to-ndays, org-agenda-list, org-agenda-later)
-       (org-agenda-change-time-span, org-agenda-compute-starting-span): Add
-       support for fortnight view.
+       (org-agenda-change-time-span, org-agenda-compute-starting-span):
+       Add support for fortnight view.
        (org-agenda-menu): Add fortnight view command.
        (org-agenda-fortnight-view): New command.
 
        * org-timer.el (org-clock-sound): Silence compiler.
 
-       * org.el (org-beginning-of-line, org-end-of-line): Bind
-       deactivate-mark to avoid that this command deactivates it.
+       * org.el (org-beginning-of-line, org-end-of-line):
+       Bind deactivate-mark to avoid that this command deactivates it.
        (org-make-tags-matcher): Do not interpret / in property value as
        starter of TODO match.
        (org-overview): Preserve point.
 
        * org.el (org-unlogged-message): New function.
        (org-cycle, org-cycle-internal-global, org-cycle-internal-local)
-       (org-global-cycle, org-display-outline-path): Use
-       `org-unlogged-message'.
+       (org-global-cycle, org-display-outline-path):
+       Use `org-unlogged-message'.
 
-       * org-pcomplete.el (org-make-org-heading-search-string): Fix
-       function declaration.
+       * org-pcomplete.el (org-make-org-heading-search-string):
+       Fix function declaration.
        (pcomplete/org-mode/searchhead): Remove incorrect second arguments
        to `org-make-org-heading-search-string'.
 
        (org-display-outline-path): Do not log outline path in Message
        buffer.
        (org-agenda-ignore-drawer-properties): New option.
-       (org-agenda-prepare-buffers): Honour
-       `org-agenda-ignore-drawer-properties'.
+       (org-agenda-prepare-buffers):
+       Honour `org-agenda-ignore-drawer-properties'.
 
        * org-clock.el (org-clock-goto): Recenter to thrd line
 
        (org-set-regexps-and-options-for-tags): Use `org-bookmark-names-plist'.
        (org-refile): Use `org-bookmark-names-plist'.
 
-       * org-capture.el (org-capture-bookmark-last-stored-position): Use
-       `org-bookmark-names-plist'.
+       * org-capture.el (org-capture-bookmark-last-stored-position):
+       Use `org-bookmark-names-plist'.
 
        * org.el (org-insert-heading): Rewritten from scratch.
        (org-N-empty-lines-before-current): New function
 
        * org-ctags.el (org-ctags-path-to-ctags): Avoid usine `case'.
 
-       * org.el (org-beginning-of-line, org-end-of-line): Set
-       disable-point-adjustment when the command ends next to invisible
+       * org.el (org-beginning-of-line, org-end-of-line):
+       Set disable-point-adjustment when the command ends next to invisible
        text.
 
        * ob-lob.el (org-babel-lob-files): Fix custom type.
 
 2013-11-12  Christian Moe  <mail@christianmoe.com>
 
-       * ox-odt.el (org-odt-line-break, org-odt-plain-text): Remove
-       newline after line-break tag.
+       * ox-odt.el (org-odt-line-break, org-odt-plain-text):
+       Remove newline after line-break tag.
 
 2013-11-12  Christophe Junke  <christophe.junke@inria.fr>  (tiny change)
 
        property.
        (org-heading-components): Use `org-heading-regexp' in
        orgstruct-mode.
-       (orgstruct-heading-prefix-regexp, orgstruct-setup-hook): New
-       options.
+       (orgstruct-heading-prefix-regexp, orgstruct-setup-hook):
+       New options.
        (orgstruct-initialized): New variable.
        (org-get-local-variables): Honour state property.
        (org-run-like-in-org-mode): Use `let' instead of `progv'.  Do not
        override variables with non-default values.
        (org-forward-heading-same-level): Do not skip to headlines on
        another level.  Handle negative prefix argument correctly.
-       (org-backward-heading-same-level): Use
-       `org-forward-heading-same-level'.
+       (org-backward-heading-same-level):
+       Use `org-forward-heading-same-level'.
 
 2013-11-12  Craig Tanis  <craig-tanis@utc.edu>  (tiny change)
 
 
        * ox-html.el (org-html-doctype-alist): New variable holding an
        alist of (X)HTML doctypes
-       (org-html-xhtml-p, org-html-html5-p, org-html-close-tag): New
-       function.
+       (org-html-xhtml-p, org-html-html5-p, org-html-close-tag):
+       New function.
        (org-html-html5-fancy): New export option, determining whether or
        not to use HTML5-specific elements.
        (org-html-html5-elements): New variable, new HTML5 elements.
        (org-html-format-list-item, org-html-line-break, org-html-table)
        (org-html-verse-block): Changes to allow flavored export.
 
-       * ox-latex.el (org-latex--org-table, org-latex-table-row): Allow
-       use of the "tabu" and "longtabu" table environments.  New table
+       * ox-latex.el (org-latex--org-table, org-latex-table-row):
+       Allow use of the "tabu" and "longtabu" table environments.  New table
        attribute :spread handles the width specification syntax of "tabu"
        and "longtabu" table environments.
 
        * ob-sh.el (org-babel-sh-evaluate):
        * ob-shen.el (org-babel-execute:shen):
        * ob-sql.el (org-babel-execute:sql):
-       * ob-sqlite.el (org-babel-execute:sqlite): Use
-       `org-babel-result-cond'.
+       * ob-sqlite.el (org-babel-execute:sqlite):
+       Use `org-babel-result-cond'.
 
        * ob.el (org-babel-common-header-args-w-values): Add a new "none"
        header argument.
        :padnewlines to "yes".  Either way lets just remove this which
        shouldn't have any functional effect.
 
-       * ob-haskell.el (org-babel-default-header-args:haskell): Set
-       :padlines to "no" by default.
+       * ob-haskell.el (org-babel-default-header-args:haskell):
+       Set :padlines to "no" by default.
 
        * ob-exp.el (org-babel-exp-non-block-elements): Ignore inline
        source block on #+ prefixed lines.
        * ob-sh.el (org-babel-sh-var-to-string): Fix bug in ob-sh when
        dealing with list variables.
 
-       * ob-core.el (org-babel-demarcate-block): Include
-       `org-src-lang-modes' in block demarcation options.
+       * ob-core.el (org-babel-demarcate-block):
+       Include `org-src-lang-modes' in block demarcation options.
 
        * ob-C.el: Don't modify `org-babel-load-languages' from ob-*
        files.
        * ob-gnuplot.el (org-babel-header-args:gnuplot): Term is a gnuplot
        header argument.
 
-       * ob-tangle.el (org-babel-tangle): Fixed bug in tangle-file.
+       * ob-tangle.el (org-babel-tangle): Fix bug in tangle-file.
        Collect tangle modes, and only apply them to the file after all
        tangling has completed, including the post-tangle-hook.
 
        * ob-core.el (org-babel-current-src-block-location):
        (org-babel-execute-src-block):
        * ob-exp.el (org-babel-exp-results):
-       * ob-lob.el (org-babel-lob-execute): Rename
-       `org-babel-current-exec-src-block-head' to
+       * ob-lob.el (org-babel-lob-execute):
+       Rename `org-babel-current-exec-src-block-head' to
        `org-babel-current-src-block-location'.
 
        * ob-core.el (org-babel-common-header-args-w-values): Adding the
        `org-babel-current-exec-src-block-head' variable when executing
        inline or lob style code.
 
-       * ob-core.el (org-babel-execute-src-block): The
-       `org-babel-current-exec-src-block-head' variable should point to
+       * ob-core.el (org-babel-execute-src-block):
+       The `org-babel-current-exec-src-block-head' variable should point to
        the outermost code block.
 
        * org.el (org-some): An org-mode version of the cl some function.
        * org.el (org-every): An Org-mode version of the cl every
        function.
 
-       * ob-tangle.el (org-babel-tangle-jump-to-org): Use
-       `org-src-switch-to-buffer' to jump from src to org.  Use the
+       * ob-tangle.el (org-babel-tangle-jump-to-org):
+       Use `org-src-switch-to-buffer' to jump from src to org.  Use the
        existing `org-edit-src' functionality to jump back to the correct
        point in the code block in the original Org-mode buffer.
 
        * ob-js.el (org-babel-execute:js): Use `org-babel-result-cond' in
        JavaScript code blocks.
 
-       * ob-scheme.el (org-babel-execute:scheme): Use
-       `org-babel-result-cond' in scheme code blocks.
+       * ob-scheme.el (org-babel-execute:scheme):
+       Use `org-babel-result-cond' in scheme code blocks.
 
-       * ob-ocaml.el (org-babel-execute:ocaml): Use
-       `org-babel-result-cond' in OCaml code blocks.
+       * ob-ocaml.el (org-babel-execute:ocaml):
+       Use `org-babel-result-cond' in OCaml code blocks.
 
-       * ob-haskell.el (org-babel-execute:haskell): Use
-       `org-babel-result-cond' in Haskell code blocks.
+       * ob-haskell.el (org-babel-execute:haskell):
+       Use `org-babel-result-cond' in Haskell code blocks.
 
        * ob-core.el (org-babel-result-cond): The "raw", "org" and
        "drawer" :results header argument values preclude table processing
        (org-babel-insert-result): Cycle tables for :results org and
        :results wrap.
 
-       * ob-python.el (org-babel-python-initiate-session-by-key): Fixed a
+       * ob-python.el (org-babel-python-initiate-session-by-key): Fix a
        bug pointed out by Gary Oberbrunner.
        (org-babel-python-initiate-session-by-key): Add "-i" to the python
        command on windows sessions.  Actually setting new session names.
        (org-babel-confirm-evaluate): Fix whitespaces.
        (org-babel-execute-src-block): A cond makes it more clear that we
        definitely do not execute without user confirmation.
-       (org-babel-call-process-region-original): Fixed line over 80 chars
+       (org-babel-call-process-region-original): Fix line over 80 chars
        long.
 
        * ob-tangle.el (org-babel-tangle-collect-blocks): Update comment
        * ox-html.el (org-html-latex-environment)
        (org-html-latex-fragment): Fix imagemagick support.
 
-       * org.el (org-create-formula-image-with-imagemagick): Generate
-       correct size formula image.
+       * org.el (org-create-formula-image-with-imagemagick):
+       Generate correct size formula image.
        (org-format-latex-header): Change pagestyle command position.
 
        * ox-latex.el (org-latex--caption/label-string): Allow to build a
 
        * org.el (org-reftex-citation): Fix contrib package name in the
        docstring.
-       (org-preview-latex-fragment, org-display-inline-images): Detect
-       whether a graphic display is available before inlining images to
+       (org-preview-latex-fragment, org-display-inline-images):
+       Detect whether a graphic display is available before inlining images to
        prevent an error.
        (org-startup-with-latex-preview): New option.
        (org-startup-options): New startup keywords for the new option.
        (org-reverse-string): Add `org-reverse-string' to reverse a
        string.
 
-       * org-id.el (org-id-new, org-id-decode): Replace
-       `org-id-reverse-string' by `org-reverse-string'.
+       * org-id.el (org-id-new, org-id-decode):
+       Replace `org-id-reverse-string' by `org-reverse-string'.
 
        * ob-core.el (org-babel-trim): Replace `org-babel-reverse-string'
        by `org-reverse-string' and declare it.
        * ox-md.el: Remove comments at the beginning of the file since
        the library is documented in Org manual.
 
-       * org-element.el (org-element--list-struct): Use
-       `org-match-string-no-properties'.  Fix block parsing in lists.
+       * org-element.el (org-element--list-struct):
+       Use `org-match-string-no-properties'.  Fix block parsing in lists.
 
        * ox-publish.el (org-publish-all): Fix compilation problem.
 
-       * org-element.el (org-element-timestamp-interpreter): Correctly
-       interpret timestamps with delays.
+       * org-element.el (org-element-timestamp-interpreter):
+       Correctly interpret timestamps with delays.
        (org-element-timestamp-parser)
        (org-element-timestamp-interpreter): Parse warning delays.
 
        Fix infloop when called on a blank line at the end of the buffer
        after a headline.
 
-       * org.el (org-forward-paragraph, org-backward-paragraph): New
-       functions.
+       * org.el (org-forward-paragraph, org-backward-paragraph):
+       New functions.
 
        * org.el (org-meta-return): Allow M-RET to insert items within
        drawers.  Rewrite function.
 
-       * org-element.el (org-element-footnote-definition-parser): Fix
-       value for :contents-begin when first line of footnote definition
+       * org-element.el (org-element-footnote-definition-parser):
+       Fix value for :contents-begin when first line of footnote definition
        is empty besides the label.
        (org-element-at-point): Return correct element when point is on a
        blank line just below a headline.
-       (org-element-paragraph-parser): Use
-       `org-match-string-no-properties'.  Small fixes to paragraph
+       (org-element-paragraph-parser):
+       Use `org-match-string-no-properties'.  Small fixes to paragraph
        parsing.
 
        * org.el (org-adaptive-fill-function): Do not handle
 
        * ox-publish.el (project-plist): Remove variable.
 
-       * ox.el (org-export-to-buffer, org-export-to-file): Fix
-       docstrings.
+       * ox.el (org-export-to-buffer, org-export-to-file):
+       Fix docstrings.
 
        * ox-org.el (org-export-as-org): Add missing BODY-ONLY argument,
        which is always nil in this back-end.
        (org-export--dispatch-action): Maintain compatibility with Emacs
        23.
 
-       * org.el (org-adaptive-fill-function, org-fill-paragraph): Add
-       support for `adaptive-fill-regexp' in paragraphs and comments.
+       * org.el (org-adaptive-fill-function, org-fill-paragraph):
+       Add support for `adaptive-fill-regexp' in paragraphs and comments.
        (org-indent-line): Fix indentation after a list.
 
        * ox.el (org-export--get-inbuffer-options): Multiple options can
        * ox-latex.el (org-latex-template): Fix missing newlines in
        header.
 
-       * ox.el (org-export-insert-default-template): Fix
-       "wrong-type-argument" error in template insertion.
+       * ox.el (org-export-insert-default-template):
+       Fix "wrong-type-argument" error in template insertion.
 
        * org.el (org-fill-paragraph): Use empty commented lines as
        separators when filling comments.  This mimics default behavior
 
        * ox-latex.el (org-latex-listings): Update docstring.
 
-       * org-pcomplete.el (pcomplete/org-mode/file-option/options): Apply
-       changes to export back-end definiton.
+       * org-pcomplete.el (pcomplete/org-mode/file-option/options):
+       Apply changes to export back-end definiton.
 
        * org.el (org-get-export-keywords): Apply changes to export
        back-end definiton.
        (org-odt-format-headline--wrap): Use `org-export-with-backend'
        instead of `org-export-with-translations'.
 
-       * ox.el (org-export--registered-backends): Renamed from
+       * ox.el (org-export--registered-backends): Rename from
        `org-export-registered-backends'.
-       (org-export-invisible-backends): Removed variable.
+       (org-export-invisible-backends): Remove variable.
        (org-export-get-backend, org-export-get-all-transcoders
-       org-export-get-all-options, org-export-get-all-filters): New
-       functions.  It replaces `org-export-backend-translate-table'.
+       org-export-get-all-options, org-export-get-all-filters):
+       New functions.  It replaces `org-export-backend-translate-table'.
        (org-export-barf-if-invalid-backend, org-export-derived-backend-p,
        org-export-define-backend, org-export-define-derived-backend):
        Rewrite functions using new representation.
        org-export--get-inbuffer-options, org-export--get-global-options,
        org-export-to-buffer org-export-to-file, org-export-string-as
        org-export-replace-region-by): Update docstring.
-       (org-export-data-with-translations): Remove function.  Use
-       `org-export-data-with-backend' with a temporary back-end instead.
+       (org-export-data-with-translations): Remove function.
+       Use `org-export-data-with-backend' with a temporary back-end instead.
        (org-export-data-with-backend, org-export-as): Reflect new definition
        for back-ends.
        (org-export--dispatch-action, org-export--dispatch-ui): Reflect new
 
        * ox-html.el (org-html-link): Small refactoring.
 
-       * org-element.el (org-element--current-element): Fix
-       org-meta-return error at the end of buffer.
+       * org-element.el (org-element--current-element):
+       Fix org-meta-return error at the end of buffer.
 
        * ox-odt.el (org-odt-category-map-alist): Fix internationalization
        of "Table" and "Listing".
        (org-latex-long-listings): Remove variable.
 
        * org-element.el (org-element--list-struct): New function.
-       (org-element-plain-list-parser, org-element--current-element): Use
-       new function.
+       (org-element-plain-list-parser, org-element--current-element):
+       Use new function.
 
        * ox-man.el (org-man-compile):
        * ox-texinfo.el (org-texinfo-compile): Use appropriate argument.
 
        * ox-md.el (md): Delegate underscore transcoding to HTML back-end.
 
-       * org-element.el (org-element--remove-indentation): Small
-       optimization.
+       * org-element.el (org-element--remove-indentation):
+       Small optimization.
        (org-element--remove-indentation): New function.
        (org-element-example-block-parser, org-element-src-block-parser):
        Use new function.
        `org-list-allow-alphabetical' when changed after org.el has been
        loaded.
 
-       * org-element.el (org-element-fixed-width-interpreter): Fix
-       interpretation of fixed-width elements with a nil or empty string
+       * org-element.el (org-element-fixed-width-interpreter):
+       Fix interpretation of fixed-width elements with a nil or empty string
        value.
 
        * ox-html.el (org-html-link): Don't skip the link description when
        * ox-icalendar.el (icalendar): Ignore footnotes.
        (org-icalendar--combine-files): Small refactoring.
 
-       * ox.el (org-export--skip-p, org-export--interpret-p): When
-       `org-export-with-footnotes' is nil, ignore completely footnotes
+       * ox.el (org-export--skip-p, org-export--interpret-p):
+       When `org-export-with-footnotes' is nil, ignore completely footnotes
        references and definitions instead of exporting them verbatim.
 
        * ox-beamer.el (org-beamer--frame-level): Small refactoring.
        * ox-html.el (html): Rename :html-table-tag property into
        :org-table-attributes.
        (org-html-table-default-attributes): New variable.
-       (org-html-table-tag): Removed variable.
+       (org-html-table-tag): Remove variable.
        (org-html--make-attribute-string): New function.
        (org-html-link--inline-image, org-html-table): Use new function.
-       (org-html-splice-attributes, org-export-splice-style): Remove
-       functions.
+       (org-html-splice-attributes, org-export-splice-style):
+       Remove functions.
        (org-html-inline-image-rules): Remove out of context part of the
        docstring.
 
        (org-export-with-sub-superscripts, org-export-with-toc)
        (org-export-with-tables, org-export-with-tags)
        (org-export-with-tasks, org-export-time-stamp-file)
-       (org-export-with-timestamps, org-export-with-todo-keywords): Fix
-       docstrings.
+       (org-export-with-timestamps, org-export-with-todo-keywords):
+       Fix docstrings.
 
        * ox-html.el (org-html-postamble-format): Slightly change default
        value so "Generated by" string doesn't get duplicated.
        (org-export--dispatch-ui, org-export--dispatch-action): Access to
        the function through the dispatcher.
 
-       * ox-icalendar.el (org-icalendar-convert-timestamp): Update
-       docstring.
+       * ox-icalendar.el (org-icalendar-convert-timestamp):
+       Update docstring.
        (org-icalendar-dtstamp): New function.
        (org-icalendar--vevent, org-icalendar--vtodo): Use new function.
 
        (org-macro-initialize-templates): Apply signature change from function
        above.
 
-       * ox.el (org-export--list-bound-variables): Renamed from
+       * ox.el (org-export--list-bound-variables): Rename from
        `org-export--install-letbind-maybe'.  Though, only return list of
        bound variables instead of installing them as buffer-local
        variables.
        * ox-man.el (org-man-table--org-table): Use new attribute syntax.
        Small refactoring.
 
-       * ox-odt.el (org-odt-link--inline-image, org-odt-table-cell): Use
-       new attribute syntax.
+       * ox-odt.el (org-odt-link--inline-image, org-odt-table-cell):
+       Use new attribute syntax.
 
        * ox.el (org-export-async-start): Remove code evaluation queries
        from asynchronous export.
        * ox-latex.el (org-latex-inline-image-rules)
        (org-latex-default-table-environment)
        (org-latex-default-table-mode, org-latex-tables-booktabs)
-       (org-latex-table-scientific-notation, org-latex-known-errors): Add
-       :version and :package-version.
+       (org-latex-table-scientific-notation, org-latex-known-errors):
+       Add :version and :package-version.
 
        * ox-md.el (org-md-headline-style): Add :version and
        :package-version.
        * ox.el (org-export-with-drawers, org-export-with-latex)
        (org-export-with-inlinetasks, org-export-with-planning)
        (org-export-with-smart-quotes, org-export-with-statistics-cookies)
-       (org-export-allow-bind-keywords, org-export-async-init-file): Add
-       :version and :package-version.
+       (org-export-allow-bind-keywords, org-export-async-init-file):
+       Add :version and :package-version.
 
        * ox-icalendar.el (org-icalendar-export-to-ics): Change back-end
        name from `e-ascii' to `ascii'.
        * org.el (org-fill-paragraph): Small refactoring to
        `org-fill-paragraph'.  Do not look for table cells in a paragraph.
 
-       * org-element.el (org-element-object-restrictions): Simplify
-       restrictions within secondary strings and objects.
+       * org-element.el (org-element-object-restrictions):
+       Simplify restrictions within secondary strings and objects.
 
        * org-list.el (org-list-send-list): Do not rely on
        `org-list-parse-list'.
-       (org-list-to-latex, org-list-to-html, org-list-to-texinfo): Use
-       appropriate export back-end instead of using
+       (org-list-to-latex, org-list-to-html, org-list-to-texinfo):
+       Use appropriate export back-end instead of using
        `org-list-to-generic'.
 
        * ox-html.el (org-html-inner-template): Remove contents div and
        (org-icalendar-export-current-agenda): Integrate previous
        functions.
 
-       * ox-latex.el (org-latex-format-headline-default-function): Use
-       declarative shape to nest makup for TODO keywords.  Previous
-       syntax generated errors during export.
+       * ox-latex.el (org-latex-format-headline-default-function):
+       Use declarative shape to nest makup for TODO keywords.
+       Previous syntax generated errors during export.
 
        * ox.el (org-export-async-start): Ignore `org-mode-hook' and
        `kill-emacs-hook'.  The first one has been run in the original
        computing minimal headline level.
 
        * org.el (org-do-latex-and-related): Fix infloop when user
-       provides a wrong value for `org-highlight-latex-and-related'.  In
-       this case, `org-latex-and-related-regexp' is the empty string and
+       provides a wrong value for `org-highlight-latex-and-related'.
+       In this case, `org-latex-and-related-regexp' is the empty string and
        generates an infloop since matching it doesn't move point.
 
-       * org-element.el (org-element-headline-parser): Rename
-       :optional-title into :alt-title.
+       * org-element.el (org-element-headline-parser):
+       Rename :optional-title into :alt-title.
 
-       * ox.el (org-export-get-alt-title): Renamed from
+       * ox.el (org-export-get-alt-title): Rename from
        `org-export-get-optional-title'.
 
        * ox-ascii.el (org-ascii--build-title):
        * ox-latex.el (org-latex-compile): Add an optional argument for
        latex snippet previewing.
 
-       * org.el (org-create-formula-image-with-imagemagick): Use
-       `org-latex-compile' instead of rewriting it.
+       * org.el (org-create-formula-image-with-imagemagick):
+       Use `org-latex-compile' instead of rewriting it.
 
        * ox-html.el (org-html-fontify-code): Do not use [^\000] in
        regexps that may match large strings.
        (org-element-plain-link-successor): New function.
 
        * org.el (org-match-substring-regexp)
-       (org-match-substring-with-braces-regexp): Update regexp.  A
-       sub/superscript cannot start anymore at the beginning of the line
+       (org-match-substring-with-braces-regexp): Update regexp.
+       sub/superscript cannot start anymore at the beginning of the line
        or after a space.
 
        * org-element.el (org-element--get-next-object-candidates):
 
        * ox-html.el (org-html--format-toc-headline): Fix function name.
        (org-html-toc, org-html--toc-text): Change to docstring.
-       (org-html-list-of-listings, org-html-list-of-tables): New
-       functions.
+       (org-html-list-of-listings, org-html-list-of-tables):
+       New functions.
        (org-html-keyword): Use new functions.
        (org-html-src-block): Add an ID attribute when a name is given.
 
-       * org-element.el (org-element-footnote-definition-parser): Require
-       2 blank lines to separate footnote definition.
+       * org-element.el (org-element-footnote-definition-parser):
+       Require 2 blank lines to separate footnote definition.
 
        * org-footnote.el (org-footnote-at-definition-p): Require 2 blank
        lines to separate footnote definition.
        (org-export-stack-refresh): Refactor.
        (org-export-stack-remove, org-export-stack-view): Apply renaming.
        (org-export-stack-mode-map): Use tabulated list map as a basis.
-       (org-export-stack--generate, org-export-stack--num-predicate): New
-       function.
+       (org-export-stack--generate, org-export-stack--num-predicate):
+       New function.
        (org-export-get-optional-title): Return regular title when no
        optional title is found.
 
        * ox-latex.el (org-latex-headline): Apply change to
        `org-export-get-optional-title'.
 
-       * ox-ascii.el (org-ascii--build-title): Add an argument.  Use
-       optional title when building a toc line.
+       * ox-ascii.el (org-ascii--build-title): Add an argument.
+       Use optional title when building a toc line.
        (org-ascii--build-toc): Call `org-ascii--build-title' with
        appropriate arguments.
 
        * ox-latex.el (org-latex-headline): Use optional title for table
        of contents.
 
-       * ox-html.el (org-html--toc-text): Renamed from
+       * ox-html.el (org-html--toc-text): Rename from
        `org-html-toc-text'.  Add docstring.
-       (org-html--format-toc-headline): Renamed from
+       (org-html--format-toc-headline): Rename from
        `org-html-format-toc-headline'.  Add docstring.  Use optional
        title if possible.
        (org-html-toc): Add docstring.
 
        * ox.el (org-export-get-optional-title): New function.
 
-       * ox-latex.el (org-latex-format-headline-default-function): Make
-       the variable a function.
+       * ox-latex.el (org-latex-format-headline-default-function):
+       Make the variable a function.
 
-       * ox-publish.el (org-publish-resolve-external-fuzzy-link): No
-       error when resolving external fuzzy links outside publishing.
+       * ox-publish.el (org-publish-resolve-external-fuzzy-link):
+       No error when resolving external fuzzy links outside publishing.
        Though search option for these links will not be resolved.
 
        * ox-latex.el (org-latex-guess-inputenc): Set inputenc option
        according to `org-export-coding-system'.
 
-       * ox.el (org-export--generate-copy-script): Clone
-       `buffer-file-coding-system' when creating a buffer copy.
+       * ox.el (org-export--generate-copy-script):
+       Clone `buffer-file-coding-system' when creating a buffer copy.
 
        * ox-html.el (org-html-link): Resolve external links with search
        options like [[file.org::#custom-id]] or
 
        * ox-latex.el (org-latex-property-drawer): Remove function.
 
-       * ox-ascii.el (org-ascii-filter-paragraph-spacing): Remove
-       reference to now renamed `e-ascii' back-end.
+       * ox-ascii.el (org-ascii-filter-paragraph-spacing):
+       Remove reference to now renamed `e-ascii' back-end.
 
        * ox-beamer.el (org-beamer-template): Allow to span documentclass
        options accross multiple lines in template.
        * org-element.el (org-element-map): Allow to map over any list.
        Do not restrict mapping to object types.
 
-       * org-faces.el (org-latex-and-related): Renamed from
+       * org-faces.el (org-latex-and-related): Rename from
        `org-latex-and-export-specials', which wasn't appropriate anymore.
 
        * org.el (org-highlight-latex-and-related)
        (org-latex-and-related-regexp): New variables.
-       (org-compute-latex-and-related-regexp, org-do-latex-and-related): New
-       function, revived from a previous commit.
+       (org-compute-latex-and-related-regexp, org-do-latex-and-related):
+       New function, revived from a previous commit.
        (org-set-regexps-and-options, org-set-font-lock-defaults): Use new
        functions.
        (org-set-regexps-and-options): Remove reference to LATEX_CLASS and
        * org-element.el (org-element-link-parser): Do not remove newlines
        characters in paths anymore, since this is not required.
 
-       * ox.el (org-export--dispatch-ui): Renamed from
+       * ox.el (org-export--dispatch-ui): Rename from
        `org-export-dispatch-ui'.  Handle scrolling.
-       (org-export--dispatch-action): Renamed from
+       (org-export--dispatch-action): Rename from
        `org-export-dispatch-action'.  Implement scrolling.
        (org-export-dispatch): Apply renaming.
 
 
        * ox.el (org-export-stack-mode): Fix docstring.
 
-       * org-pcomplete.el (pcomplete/org-mode/file-option): Allow
-       completion for ATTR_ prefixed keywords.
+       * org-pcomplete.el (pcomplete/org-mode/file-option):
+       Allow completion for ATTR_ prefixed keywords.
 
        * org.el (org-options-keywords): Add missing colons.
 
-       * org-macs.el (org-default-options): Removed function.
+       * org-macs.el (org-default-options): Remove function.
 
        * org-pcomplete.el (org-command-at-point): Fix bug with some file
        options.
-       (pcomplete/org-mode/file-option/x): Removed macro.
+       (pcomplete/org-mode/file-option/x): Remove macro.
        (pcomplete/org-mode/file-option): Refactor code.
        (pcomplete/org-mode/file-option/author)
        (pcomplete/org-mode/file-option/date)
 
        * ox-ascii.el (org-ascii-inner-template): New function.
        (org-ascii-template): Use new function.
-       (org-ascii-export-as-ascii, org-ascii-export-to-ascii): Update
-       docstring.
+       (org-ascii-export-as-ascii, org-ascii-export-to-ascii):
+       Update docstring.
 
        * org-element.el (org-element-link-parser): Take into
        consideration links filled and indented.
        * org-element.el (org-element-nested-p): Do not inline function.
 
        * ox.el (org-export-copy-buffer, org-export-with-buffer-copy)
-       (org-export--generate-copy-script): Moved earlier in the file.
+       (org-export--generate-copy-script): Move earlier in the file.
 
        * ox-texinfo.el (org-texinfo-link): Do not transform path part of
        internal links.
        required in the external process.
 
        * org.el (org-format-latex-header-extra, org-export-have-math):
-       Removed variables.
-       (org-latex-default-packages-alist): Renamed from
+       Remove variables.
+       (org-latex-default-packages-alist): Rename from
        `org-export-latex-default-packages-alist'.
-       (org-latex-packages-alist): Renamed from
+       (org-latex-packages-alist): Rename from
        `org-export-latex-packages-alist'.
        (org-try-cdlatex-tab, org-cdlatex-underscore-caret,
        org-cdlatex-math-modify): Reorder in file.
 
        * org-entities.el (org-entities-user): Update docstring.
 
-       * ox-latex.el (org-latex-classes, org-latex-listings): Update
-       docstring.
-       (org-latex-guess-inputenc): Renamed from `org-latex--guess-inputenc'.
-       (org-latex-guess-babel-language): Renamed from
+       * ox-latex.el (org-latex-classes, org-latex-listings):
+       Update docstring.
+       (org-latex-guess-inputenc): Rename from `org-latex--guess-inputenc'.
+       (org-latex-guess-babel-language): Rename from
        `org-latex--guess-babel-language'.
        (org-latex-template): Apply renaming.
 
        copying it.
 
        * org-macs.el (org-if-unprotected, org-if-unprotected-1)
-       (org-if-unprotected-at): Removed macros.
-       (org-re-search-forward-unprotected): Removed function.
+       (org-if-unprotected-at): Remove macros.
+       (org-re-search-forward-unprotected): Remove function.
 
        * org.el (org-format-latex):
        * org-list.el (org-list-struct):
        * org-capture.el (org-capture-fill-template): Remove reference to
        `org-protected'.
 
-       * ob-exp.el (org-babel-exp-process-buffer): Renamed from
+       * ob-exp.el (org-babel-exp-process-buffer): Rename from
        `org-export-blocks-preprocess'.
 
        * ox.el (org-export-execute-babel-code): Apply previous renaming.
        framework.
        (pcomplete/org-mode/file-option/options): Rewrite using new export
        framework.  Only complete up to the colon.
-       (pcomplete/org-mode/file-option/x): Removed macro.
+       (pcomplete/org-mode/file-option/x): Remove macro.
        (pcomplete/org-mode/file-option/title)
        (pcomplete/org-mode/file-option/author)
        (pcomplete/org-mode/file-option/email)
-       (pcomplete/org-mode/file-option/date): Removed functions.
+       (pcomplete/org-mode/file-option/date): Remove functions.
        (pcomplete/org-mode/file-option/infojs_opt): New function.
 
        * org-clock.el (org-clocktable-defaults)
        function.
 
        * org-inlinetask.el (org-inlinetask-export)
-       (org-inlinetask-export-templates): Removed variables.
-       (org-inlinetask-export-handler): Removed function.
+       (org-inlinetask-export-templates): Remove variables.
+       (org-inlinetask-export-handler): Remove function.
 
        * org-plot.el: Remove dependency on `org-exp' library.
 
        * org-agenda.el (org-agenda-menu, org-agenda-write): Use new
        iCalendar export back-end.
 
-       * org-table.el (org-table-export, orgtbl-export): Remove
-       dependency on `org-exp' library.
+       * org-table.el (org-table-export, orgtbl-export):
+       Remove dependency on `org-exp' library.
        (org-table-clean-before-export): New function.
        (org-table-colgroup-info): New variable.
        (orgtbl-to-html): Use to new HTML export back-end.
        Elements.
 
        * org-element.el (org-element-at-point): When point is before any
-       element, in the first blank lines of the buffer, return nil.  When
-       point is within blank lines just after a headline, return that
+       element, in the first blank lines of the buffer, return nil.
+       When point is within blank lines just after a headline, return that
        headline.
        (org-element-context): Return nil when point is within the blank at
        the beginning of the buffer.
 
        * org.el (org-edit-special): Fix regression.
        (org-timestamp-has-time-p, org-timestamp-format)
-       (org-timestamp-split-range, org-timestamp-translate): New
-       functions.
+       (org-timestamp-split-range, org-timestamp-translate):
+       New functions.
 
-       * org-element.el (org-element-timestamp-interpreter): Interpret
-       timestamps ranges with repeaters.
+       * org-element.el (org-element-timestamp-interpreter):
+       Interpret timestamps ranges with repeaters.
 
        * org.el (org-edit-special): Rewrite `org-edit-special' using Org
        Elements tools.  Behavior should be unchanged.
        * org.el (org-all-targets): Fix radio targets detection when
        object is directly followed by a non-whitespace character.
 
-       * ob.el (org-babel-use-quick-and-dirty-noweb-expansion): Renamed
-       from `org-babel-use-quick-and-dirty-noweb-expansion'.
+       * ob.el (org-babel-use-quick-and-dirty-noweb-expansion):
+       Rename from `org-babel-use-quick-and-dirty-noweb-expansion'.
        (org-babel-expand-noweb-references): Use new variable name.
 
-       * org-element.el (org-element-timestamp-interpreter): Fix
-       timestamp interpreter when raw value isn't available.
+       * org-element.el (org-element-timestamp-interpreter):
+       Fix timestamp interpreter when raw value isn't available.
 
        * ob-exp.el (org-babel-exp-non-block-elements): Make sure to parse
        inline babel call or inline src block instead of the following
        (org-element-horizontal-rule-parser, org-element-keyword-parser)
        (org-element-latex-environment-parser)
        (org-element-paragraph-parser, org-element-src-block-parser)
-       (org-element-table-parser, org-element-verse-block-parser): Add
-       `:post-affiliated' property to elements.
+       (org-element-table-parser, org-element-verse-block-parser):
+       Add `:post-affiliated' property to elements.
        (org-element-inlinetask-parser): Remove affilated keywords.
 
        * org.el (org-adaptive-fill-function): Use new property.
        (org-element--current-element): Tiny refactoring.
 
        * ob.el (org-babel-where-is-src-block-result): Insert new results
-       keyword in current narrowed part of buffer, if necessary.  Small
-       refactoring.
+       keyword in current narrowed part of buffer, if necessary.
+       Small refactoring.
        (org-babel-insert-result): Do not widen buffer when new results have
        to be inserted.  Therefore, results inserted after the last block of
        a narrowed buffer still belong to the narrowed part of the buffer.
        (org-element-diary-sexp-parser)
        (org-element-diary-sexp-interpreter): New functions.
        (org-element-horizontal-rule-parser)
-       (org-element-keyword-parser, org-element--current-element): Small
-       refactoring.
+       (org-element-keyword-parser, org-element--current-element):
+       Small refactoring.
        (org-element-property): Access to text properties when argument is
        a string.
        (org-element-put-property): Correctly set property when target is
 
        * org.el (org-all-targets): Make sure the regexp really matched a
        radio target.
-       (org-macro-expand, org-macro-replace-all): Change signature.  The
-       function now accepts an alist of templates so it doesn't have to
+       (org-macro-expand, org-macro-replace-all): Change signature.
+       The function now accepts an alist of templates so it doesn't have to
        rely only on `org-macro-templates'.
        (org-macro-initialize-templates): {{{date}}} is not anymore an
        alias for {{{time}}}.  During export, it will provide the value
        * org-exp-blocks.el: Delete.
 
        * ob-exp.el (org-export-blocks-preprocess):
-       * ob-ditaa.el (org-ditaa-jar-path): Moved from
+       * ob-ditaa.el (org-ditaa-jar-path): Move from
        "org-export-blocks.el".
 
        * ob-exp.el (org-babel-exp-src-block): Remove unused argument.
        (org-babel-exp-non-block-elements): Rewrite function using Org
        Element.
 
-       * org-exp-blocks.el (org-export-blocks-preprocess): Rewrite
-       function using Org Element.
+       * org-exp-blocks.el (org-export-blocks-preprocess):
+       Rewrite function using Org Element.
 
        * org-element.el (org-element-recursive-objects)
        (org-element-object-restrictions): Remove `macro' from recursive
        same style.  Make all anchors font-size %100.  Remove margin from
        the content section.
        (org-html-container-element): Fix docstring.
-       (org-html-postamble-format, org-html-preamble-format): Update
-       docstrings.
+       (org-html-postamble-format, org-html-preamble-format):
+       Update docstrings.
        (org-html-template): Use `org-html--build-pre/postamble'.
        (org-html--build-pre/postamble): New function, combining the
        pre/postamble generator.  Merge lists of formatters from the
        (org-html-divs): Change to alist of three entries each containing
        a key ('preamble, 'content, 'postamble), an HTML element type and
        an id to allow setting container elements.
-       (org-html--build-preamble, org-html--build-postamble): Modified to
+       (org-html--build-preamble, org-html--build-postamble): Modify to
        use `org-html-divs'.
-       (org-html-template): Modified to use doctype and container-element
+       (org-html-template): Modify to use doctype and container-element
        settings.
        (org-export-define-backend): Add css url option.
        (org-export-htmlized-org-css-url): Modify docstring and options.
        * ob-tangle.el (org-babel-tangle-collect-blocks): Change argument
        name collid `org-babel-map-src-blocks' variable 'lang'.
 
-       * org-protocol.el (org-protocol-convert-query-to-plist): New
-       function.
+       * org-protocol.el (org-protocol-convert-query-to-plist):
+       New function.
        (org-protocol-do-capture): Use new function.
        (org-protocol-data-separator): Change default separator.
 
 
 2013-11-12  Vitalie Spinu  <spinuvit@gmail.com>
 
-       * ob-tangle.el (org-babel-find-file-noselect-refresh): Call
-       `find-file-noselect' with 'nowarn argument to surpress
+       * ob-tangle.el (org-babel-find-file-noselect-refresh):
+       Call `find-file-noselect' with 'nowarn argument to surpress
        `yes-or-no-p' reversion message.
 
-       * ob-core.el (org-babel-where-is-src-block-head): Return
-       `point-marker' instead of `point'.
+       * ob-core.el (org-babel-where-is-src-block-head):
+       Return `point-marker' instead of `point'.
 
 2013-11-12  Yann Hodique  <yann.hodique@gmail.com>
 
        if result is not a string and not nil.  If the result is nil,
        treat it as if it was the empty string.
 
-       * org-clock.el (org-clock-notify-once-if-expired): Honor
-       `org-clock-sound'.
+       * org-clock.el (org-clock-notify-once-if-expired):
+       Honor `org-clock-sound'.
 
 2013-11-12  Rasmus Pank  <rasmus.pank@gmail.com>
 
        * ob-C.el: Added C++ to `org-babel-load-languages' automatically
        after loading C.
 
-       * org-src.el (org-src-lang-modes): Added association between
+       * org-src.el (org-src-lang-modes): Add association between
        language C++ and `c++-mode'.
 
-       * ox.el (org-export-smart-quotes-alist): Added ("da" "no" "nb"
+       * ox.el (org-export-smart-quotes-alist): Add ("da" "no" "nb"
        "nn" "sv").
-       (org-export-dictionary): Added some entries ("da" "no" "nb" "nn"
+       (org-export-dictionary): Add some entries ("da" "no" "nb" "nn"
        "sv").
        (org-export-default-language): Mention other variables affected by
        language.
 
-       * ox-latex.el (org-latex-babel-language-alist): Added 'nb', 'nn',
+       * ox-latex.el (org-latex-babel-language-alist): Add 'nb', 'nn',
        and 'no' for Norwegian.  Removed 'no-no'.
        (org-latex-pdf-process): let `latexmk' be a preconfigured choice
        and change the wording of the docstring.
        (org-latex-guess-babel-language): Replace AUTO with language if
        AUTO is the option of the LaTeX package Babel.
-       (org-latex-classes): Updated documentation with respect
+       (org-latex-classes): Update documentation with respect
        to `org-latex-guess-babel-language'.
 
 2013-11-12  Дядов Васил Стоянов  <vdyadov@elvees.com>  (tiny change)
        * org-clock.el (org-clock-idle-time): Org-mode assumed that
        x11idle was an available command, and returned an idle time of 0
        if it was not
-       (never idle): Added checks so that org-idle-time will come from
+       (never idle): Add checks so that org-idle-time will come from
        emacs' own current-idle-time if x11idle cannot be found or if it
        cannot retrieve the idle time from X11
 
 
 2011-07-28  Bastien Guerry  <bzg@gnu.org>
 
-       * org-agenda.el (org-agenda-repeating-timestamp-show-all): Allow
-       to use a list of TODO keywords as the value of this variable.
+       * org-agenda.el (org-agenda-repeating-timestamp-show-all):
+       Allow to use a list of TODO keywords as the value of this variable.
        The agenda will show repeating stamps for entries matching these TODO
        keywords.
        (org-agenda-get-timestamps, org-agenda-get-deadlines)
index e8943c6656114113d33b3583f79f8321fcf03dc9..61d9ee3f8701a5d1c31e8621ed0dd6ec2881b910 100644 (file)
@@ -2039,8 +2039,8 @@ code ---- the results are extracted in the syntax of the source
                                 t info hash indent)))
             (results-switches
              (cdr (assoc :results_switches (nth 2 info))))
-            (visible-beg (copy-marker (point-min)))
-            (visible-end (copy-marker (point-max)))
+            (visible-beg (point-min-marker))
+            (visible-end (point-max-marker))
             ;; When results exist outside of the current visible
             ;; region of the buffer, be sure to widen buffer to
             ;; update them.
index b6557108845e318e2eea1f3e85eea720aa6592f0..75ac69ba70416f8c826a39cde83a5a628c63c8f6 100644 (file)
     (:pages        . "One or more page numbers or range of numbers, such as 42-111 or 7,41,73-97 or 43+ (the ‘+’ in this last example indicates pages following that don’t form simple range). BibTEX requires double dashes for page ranges (--).")
     (:publisher    . "The publisher’s name.")
     (:school       . "The name of the school where a thesis was written.")
-    (:series       . "The name of a series or set of books.  When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.")
+    (:series       . "The name of a series or set of books.  When citing an entire book, the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.")
     (:title        . "The work’s title, typed as explained in the LaTeX book.")
     (:type         . "The type of a technical report for example, 'Research Note'.")
     (:volume       . "The volume of a journal or multi-volume book.")
index f2a37484cc09c0af9223ba021e4326cf897a308c..e345bf37b6d48bae9ff1d238cf0f102dd3f3fd53 100644 (file)
@@ -1927,7 +1927,7 @@ fontified, and then returned."
     (org-mode)
     (org-create-dblock props)
     (org-update-dblock)
-    (font-lock-fontify-buffer)
+    (org-font-lock-ensure)
     (forward-line 2)
     (buffer-substring (point) (progn
                                (re-search-forward "^[ \t]*#\\+END" nil t)
index 70c41d53cd953033379646860f9bdb9e4a4c7548..c3ccf062db90d025eaa39539f3efa0bef6fe64b5 100644 (file)
@@ -295,7 +295,7 @@ Works on both Emacs and XEmacs."
       (setq mark-active t)
       (when (and (boundp 'transient-mark-mode)
                 (not transient-mark-mode))
-       (setq transient-mark-mode 'lambda))
+       (set (make-local-variable 'transient-mark-mode) 'lambda))
       (when (boundp 'zmacs-regions)
        (setq zmacs-regions t)))))
 
@@ -489,6 +489,11 @@ LIMIT."
              (looking-at (concat "\\(?:"  regexp "\\)\\'")))))
       (not (null pos)))))
 
+(defalias 'org-font-lock-ensure
+  (if (fboundp 'org-font-lock-ensure)
+      #'font-lock-ensure
+    (lambda (_beg _end) (font-lock-fontify-buffer))))
+
 (defun org-floor* (x &optional y)
   "Return a list of the floor of X and the fractional part of X.
 With two arguments, return floor and remainder of their quotient."
index d24dad28363de28ceadac9b06c426b7eefb94d05..92a92491e3056cdf73c01e576ac08105d013bde7 100644 (file)
@@ -1254,7 +1254,7 @@ some heuristics to guess the result."
 If POS is before first character after bullet of the item, the
 new item will be created before the current one.
 
-STRUCT is the list structure.  PREVS is the the alist of previous
+STRUCT is the list structure.  PREVS is the alist of previous
 items, as returned by `org-list-prevs-alist'.
 
 Insert a checkbox if CHECKBOX is non-nil, and string AFTER-BULLET
index 27dc0e070fc1de5da59165fa11db4d2e134f76dc..9f9538df78908c0d132b02ba89b76fb6ca873fe1 100644 (file)
@@ -1005,7 +1005,7 @@ This means, between the beginning of line and the point."
        (let ((endmarker (with-current-buffer buffer
                           (outline-end-of-subtree)
                           (forward-char 1)
-                          (copy-marker (point)))))
+                          (point-marker))))
          (org-with-remote-undo buffer
            (with-current-buffer buffer
              (widen)
@@ -1015,7 +1015,7 @@ This means, between the beginning of line and the point."
                (and (outline-next-heading)
                     (org-flag-heading nil)))   ; show the next heading
              (org-back-to-heading)
-             (setq marker (copy-marker (point)))
+             (setq marker (point-marker))
              (goto-char (max (point-at-bol) (- (point-at-eol) anticol)))
              (funcall command)
              (message "_cmd: %S" org-mouse-cmd)
index f870b2c714d1217ba043bd777192b2ba4a81fd97..d5e70076df0ad22d48af7a487270ced4f0e07725 100644 (file)
@@ -923,7 +923,7 @@ fontification of code blocks see `org-src-fontify-block' and
            (delete-region (point-min) (point-max))
            (insert string " ") ;; so there's a final property change
            (unless (eq major-mode lang-mode) (funcall lang-mode))
-           (font-lock-fontify-buffer)
+            (org-font-lock-ensure)
            (setq pos (point-min))
            (while (setq next (next-single-property-change pos 'face))
              (put-text-property
index c9522341106540ff29bb066469b0eabe8673e96d..ed926a387b5aa116a0870fc43ff5cdcc03365d7f 100644 (file)
@@ -3182,9 +3182,9 @@ with the prefix ARG."
     (save-excursion
       ;; Insert a temporary formula at right after the table
       (goto-char (org-table-TBLFM-begin))
-      (setq s (set-marker (make-marker) (point)))
+      (setq s (point-marker))
       (insert (concat formula "\n"))
-      (setq e (set-marker (make-marker) (point)))
+      (setq e (point-marker))
       ;; Recalculate the table
       (beginning-of-line 0)            ; move to the inserted line
       (skip-chars-backward " \r\n\t")
index 2a451ed5456975959c714718d51bea96cb0086c5..fed3854007f1f66bbe15b729b3c7811abb5937a4 100644 (file)
@@ -6355,7 +6355,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
     (insert s)
     (let ((org-odd-levels-only odd-levels))
       (org-mode)
-      (font-lock-fontify-buffer)
+      (org-font-lock-ensure)
       (buffer-string))))
 
 (defvar org-m nil)
index 88e572084c8841d2993558b390122bc7938e6a51..1fd1da7bbbb3c3ba0620011bd1ebab73dbc4b259 100644 (file)
@@ -1856,7 +1856,7 @@ is the language used for CODE, as a string, or nil."
                       (funcall lang-mode)
                       (insert code)
                       ;; Fontify buffer.
-                      (font-lock-fontify-buffer)
+                      (org-font-lock-ensure)
                       ;; Remove formatting on newline characters.
                       (save-excursion
                         (let ((beg (point-min))
index 772017cdd0c2073d79fe339cc249b1d05ed44d00..49be3bcb01529fabeaf3b13ebe5100d310f97a76 100644 (file)
@@ -3127,7 +3127,7 @@ and prefix with \"OrgSrc\".  For example,
                 (with-temp-buffer
                   (insert code)
                   (funcall lang-mode)
-                  (font-lock-fontify-buffer)
+                  (org-font-lock-ensure)
                   (buffer-string))))
         (fontifier (if use-htmlfontify-p 'org-odt-htmlfontify-string
                      'org-odt--encode-plain-text))
index 3b2e55e2d459a62f469a2d3d5882786b96f600c8..d9a8001dcfc2201834fea4fc09df3c149466bb56 100644 (file)
@@ -223,12 +223,13 @@ Return output file name."
           (html-ext (concat "." (or (plist-get plist :html-extension)
                                     org-html-extension "html")))
           (visitingp (find-buffer-visiting filename))
-          (work-buffer (or visitingp (find-file filename)))
+          (work-buffer (or visitingp (find-file-noselect filename)))
           newbuf)
-      (font-lock-fontify-buffer)
-      (show-all)
-      (org-show-block-all)
-      (setq newbuf (htmlize-buffer))
+      (with-current-buffer work-buffer
+        (org-font-lock-ensure)
+        (show-all)
+        (org-show-block-all)
+        (setq newbuf (htmlize-buffer)))
       (with-current-buffer newbuf
        (when org-org-htmlized-css-url
          (goto-char (point-min))
@@ -237,10 +238,12 @@ Return output file name."
               (replace-match
                (format
                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">"
-                org-org-htmlized-css-url) t t)))
+                org-org-htmlized-css-url)
+                t t)))
        (write-file (concat pub-dir (file-name-nondirectory filename) html-ext)))
       (kill-buffer newbuf)
       (unless visitingp (kill-buffer work-buffer)))
+    ;; FIXME: Why?  Which buffer is this supposed to apply to?
     (set-buffer-modified-p nil)))
 
 
index e7f5725a0f0f68418066fa29fd7891d66ec72ed8..cae151f0b332bb17188964281b6770dcb8e856db 100644 (file)
@@ -1005,20 +1005,17 @@ Set `bubbles--col-offset' and `bubbles--row-offset'."
     (set-buffer-modified-p nil)
     (erase-buffer)
     (insert " ")
-    (add-text-properties
-     (point-min) (point) (list 'intangible t 'display
-                               (cons 'space
-                                     (list :height bubbles--row-offset))))
+    (put-text-property (point-min) (point)
+                       'display
+                       (cons 'space (list :height bubbles--row-offset)))
     (insert "\n")
     (let ((max-char (length (bubbles--colors))))
       (dotimes (i (bubbles--grid-height))
         (let ((p (point)))
           (insert " ")
-          (add-text-properties
-           p (point) (list 'intangible t
-                           'display (cons 'space
-                                          (list :width
-                                                bubbles--col-offset)))))
+          (put-text-property p (point)
+                             'display
+                             (cons 'space (list :width bubbles--col-offset))))
         (dotimes (j (bubbles--grid-width))
           (let* ((index (random max-char))
                  (char (nth index bubbles-chars)))
@@ -1026,10 +1023,9 @@ Set `bubbles--col-offset' and `bubbles--row-offset'."
             (add-text-properties (1- (point)) (point) (list 'index index))))
         (insert "\n"))
       (insert "\n ")
-      (add-text-properties
-       (1- (point)) (point) (list 'intangible t 'display
-                                  (cons 'space
-                                        (list :width bubbles--col-offset)))))
+      (put-text-property (1- (point)) (point)
+                         'display
+                         (cons 'space (list :width bubbles--col-offset))))
     (put-text-property (point-min) (point-max) 'pointer 'arrow))
   (bubbles-mode)
   (bubbles--reset-score)
@@ -1179,10 +1175,9 @@ Use optional parameter POS instead of point if given."
       (delete-region (point) (point-max))
       (insert (format "Selected: %4d\n" bubbles--neighborhood-score))
       (insert " ")
-      (add-text-properties (1- (point)) (point)
-                           (list 'intangible t 'display
-                                 (cons 'space
-                                       (list :width bubbles--col-offset))))
+      (put-text-property (1- (point)) (point)
+                         'display
+                         (cons 'space (list :width bubbles--col-offset)))
       (insert (format "Score:    %4d" bubbles--score))
       (put-text-property pos (point) 'status t))))
 
@@ -1200,10 +1195,9 @@ Use optional parameter POS instead of point if given."
   (goto-char (point-max))
   (let* ((inhibit-read-only t))
     (insert "\n ")
-    (add-text-properties (1- (point)) (point)
-                         (list 'intangible t 'display
-                               (cons 'space
-                                     (list :width bubbles--col-offset))))
+    (put-text-property (1- (point)) (point)
+                       'display
+                       (cons 'space (list :width bubbles--col-offset)))
     (insert "Game Over!"))
   ;; save score
   (gamegrid-add-score (format "bubbles-%s-%d-%d-%d-scores"
index 0028b7258aec5d79753a458daa256a8ccc9e76e8..3f4b8e8c5b8671a57f7af51da527d5896cd84fc2 100644 (file)
 
 (defun dun-describe-room (room)
   (if (and (not (member (abs room) dun-light-rooms))
-          (not (member obj-lamp dun-inventory)))
+          (not (member obj-lamp dun-inventory))
+          (not (member obj-lamp (nth dun-current-room dun-room-objects))))
       (dun-mprincl "It is pitch dark.  You are likely to be eaten by a grue.")
     (dun-mprincl (cadr (nth (abs room) dun-rooms)))
     (if (and (and (or (member room dun-visited)
@@ -615,7 +616,8 @@ just try dropping it.")
 
 (defun dun-move (dir)
   (if (and (not (member dun-current-room dun-light-rooms))
-          (not (member obj-lamp dun-inventory)))
+          (not (member obj-lamp dun-inventory))
+          (not (member obj-lamp (nth dun-current-room dun-room-objects))))
       (progn
        (dun-mprinc
 "You trip over a grue and fall into a pit and break every bone in your
@@ -896,7 +898,7 @@ to swim.")
 
 (defun dun-help (args)
   (dun-mprincl
-"Welcome to dunnet (2.01), by Ron Schnell (ronnie@driver-aces.com).
+"Welcome to dunnet (2.02), by Ron Schnell (ronnie@driver-aces.com - @RonnieSchnell).
 Here is some useful information (read carefully because there are one
 or more clues in here):
 - If you have a key that can open a door, you do not need to explicitly
@@ -1385,8 +1387,8 @@ for a moment, then straighten yourself up.
 (setq dungeon-mode 'dungeon)
 (setq dun-unix-verbs '((ls . dun-ls) (ftp . dun-ftp) (echo . dun-echo)
                       (exit . dun-uexit) (cd . dun-cd) (pwd . dun-pwd)
-                      (rlogin . dun-rlogin) (uncompress . dun-uncompress)
-                      (cat . dun-cat)))
+                      (rlogin . dun-rlogin) (ssh . dun-rlogin)
+                      (uncompress . dun-uncompress) (cat . dun-cat)))
 
 (setq dun-dos-verbs '((dir . dun-dos-dir) (type . dun-dos-type)
                      (exit . dun-dos-exit) (command . dun-dos-spawn)
@@ -2537,25 +2539,31 @@ treasures for points?" "4" "four")
          (dun-mprincl "Incorrect.")))
 
     (let (varname epoint afterq i value)
-      (setq varname (substring line 0 esign))
-      (if (not (setq epoint (string-match ")" line)))
-         (if (string= (substring line (1+ esign) (+ esign 2))
-                      "\"")
-             (progn
-               (setq afterq (substring line (+ esign 2)))
-               (setq epoint (+
-                             (string-match "\"" afterq)
-                             (+ esign 3))))
-
-           (if (not (setq epoint (string-match " " line)))
-               (setq epoint (length line))))
-       (setq epoint (1+ epoint))
-       (while (and
-               (not (= epoint (length line)))
-               (setq i (string-match ")" (substring line epoint))))
-         (setq epoint (+ epoint i 1))))
-      (setq value (substring line (1+ esign) epoint))
-      (dun-eval varname value))))
+      (setq varname (replace-regexp-in-string " " "" (substring line 0 esign)))
+
+      (if (or (= (length varname) 0) (< (- (length line) esign) 2))
+         (progn
+           (dun-mprinc line)
+           (dun-mprincl " : not found."))
+
+       (if (not (setq epoint (string-match ")" line)))
+           (if (string= (substring line (1+ esign) (+ esign 2))
+                        "\"")
+               (progn
+                 (setq afterq (substring line (+ esign 2)))
+                 (setq epoint (+
+                               (string-match "\"" afterq)
+                               (+ esign 3))))
+
+             (if (not (setq epoint (string-match " " line)))
+                 (setq epoint (length line))))
+         (setq epoint (1+ epoint))
+         (while (and
+                 (not (= epoint (length line)))
+                 (setq i (string-match ")" (substring line epoint))))
+           (setq epoint (+ epoint i 1))))
+       (setq value (substring line (1+ esign) epoint))
+       (dun-eval varname value)))))
 
 (defun dun-eval (varname value)
   (let (eval-error)
@@ -2739,16 +2747,20 @@ drwxr-xr-x  3 root     staff          2048 Jan 1 1970 ..")
                  (if dun-batch-mode
                      (dun-mprincl "Login failed.")
                    (dun-mprincl "\nLogin failed."))
-               (if dun-batch-mode
-                  (dun-mprincl
-                   "Guest login okay, user access restrictions apply.")
-                 (dun-mprincl
-                  "\nGuest login okay, user access restrictions apply."))
-               (dun-ftp-commands)
-               (setq newlist
+               (if (= (length ident) 0)
+                   (if dun-batch-mode
+                       (dun-mprincl "Password is required.")
+                     (dun-mprincl "\nPassword is required."))
+                 (if dun-batch-mode
+                     (dun-mprincl
+                      "Guest login okay, user access restrictions apply.")
+                   (dun-mprincl
+                    "\nGuest login okay, user access restrictions apply."))
+                 (dun-ftp-commands)
+                 (setq newlist
 '("What password did you use during anonymous ftp to gamma?"))
-               (setq newlist (append newlist (list ident)))
-               (rplaca (nthcdr 1 dun-endgame-questions) newlist)))))))))
+                 (setq newlist (append newlist (list ident)))
+                 (rplaca (nthcdr 1 dun-endgame-questions) newlist))))))))))
 
 (defun dun-ftp-commands ()
     (setq dun-exitf nil)
index a2a93730cf0906b69d31544b3a4f3fd2d7888a9b..b71eb562f084eb2f5ac96b5aa8b8380b342e6e0f 100644 (file)
@@ -590,31 +590,30 @@ shogi, etc.) players, it is a slightly modified version of Outline mode.
   (add-hook 'write-contents-hooks 'gametree-save-and-hack-layout))
 
 ;;;; Goodies for mousing users
-(and (fboundp 'track-mouse)
-     (defun gametree-mouse-break-line-here (event)
-       (interactive "e")
-       (mouse-set-point event)
-       (gametree-break-line-here))
-     (defun gametree-mouse-show-children-and-entry (event)
-       (interactive "e")
-       (mouse-set-point event)
-       (gametree-show-children-and-entry))
-     (defun gametree-mouse-show-subtree (event)
-       (interactive "e")
-       (mouse-set-point event)
-       (show-subtree))
-     (defun gametree-mouse-hide-subtree (event)
-       (interactive "e")
-       (mouse-set-point event)
-       (hide-subtree))
-     (define-key gametree-mode-map [M-down-mouse-2 M-mouse-2]
-       'gametree-mouse-break-line-here)
-     (define-key gametree-mode-map [S-down-mouse-1 S-mouse-1]
-       'gametree-mouse-show-children-and-entry)
-     (define-key gametree-mode-map [S-down-mouse-2 S-mouse-2]
-       'gametree-mouse-show-subtree)
-     (define-key gametree-mode-map [S-down-mouse-3 S-mouse-3]
-       'gametree-mouse-hide-subtree))
+(defun gametree-mouse-break-line-here (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (gametree-break-line-here))
+(defun gametree-mouse-show-children-and-entry (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (gametree-show-children-and-entry))
+(defun gametree-mouse-show-subtree (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (show-subtree))
+(defun gametree-mouse-hide-subtree (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (hide-subtree))
+(define-key gametree-mode-map [M-down-mouse-2 M-mouse-2]
+  'gametree-mouse-break-line-here)
+(define-key gametree-mode-map [S-down-mouse-1 S-mouse-1]
+  'gametree-mouse-show-children-and-entry)
+(define-key gametree-mode-map [S-down-mouse-2 S-mouse-2]
+  'gametree-mouse-show-subtree)
+(define-key gametree-mode-map [S-down-mouse-3 S-mouse-3]
+  'gametree-mouse-hide-subtree)
 
 (provide 'gametree)
 
index f1bd87ce847c46d1e38c7710287763c34e2f06d6..c11759449175922ce8fb4290f4220f57477a82ec 100644 (file)
@@ -1,10 +1,11 @@
-;;; landmark.el --- neural-network robot that learns landmarks
+;;; landmark.el --- Neural-network robot that learns landmarks  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1996-1997, 2000-2014 Free Software Foundation, Inc.
 
 ;; Author: Terrence Brannon (was: <brannon@rana.usc.edu>)
 ;; Created: December 16, 1996 - first release to usenet
 ;; Keywords: games, neural network, adaptive search, chemotaxis
+;; Version: 1.0
 
 ;; This file is part of GNU Emacs.
 
                   'landmark-font-lock-face-X)))
   "Font lock rules for Landmark.")
 
-(put 'landmark-mode 'front-sticky
-     (put 'landmark-mode 'rear-nonsticky '(intangible)))
-(put 'landmark-mode 'intangible 1)
 ;; This one is for when they set view-read-only to t: Landmark cannot
 ;; allow View Mode to be activated in its buffer.
 (define-derived-mode landmark-mode special-mode "Lm"
@@ -244,7 +242,8 @@ Entry to this mode calls the value of `landmark-mode-hook' if that value
 is non-nil.  One interesting value is `turn-on-font-lock'."
   (landmark-display-statistics)
   (setq-local font-lock-defaults '(landmark-font-lock-keywords t))
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (add-hook 'post-command-hook #'landmark--intangible nil t))
 
 
 ;;;_ +  THE SCORE TABLE.
@@ -679,8 +678,8 @@ along the DX, DY direction, considering that DVAL has been added on SQUARE."
     (landmark-prompt-for-other-game))
    (t
     (message "Let me think...")
-    (let (square score)
-      (setq square (landmark-strongest-square))
+    (let ((square (landmark-strongest-square))
+          score)
       (cond ((null square)
             (landmark-terminate-game 'nobody-won))
            (t
@@ -722,8 +721,7 @@ along the DX, DY direction, considering that DVAL has been added on SQUARE."
        (min (max (/ (+ (- (cdr click)
                           landmark-y-offset
                           1)
-                       (let ((inhibit-point-motion-hooks t))
-                         (count-lines 1 (window-start)))
+                        (count-lines (point-min) (window-start))
                        landmark-square-height
                        (% landmark-square-height 2)
                        (/ landmark-square-height 2))
@@ -749,8 +747,8 @@ If the game is finished, this command requests for another game."
    ((not landmark-game-in-progress)
     (landmark-prompt-for-other-game))
    (t
-    (let (square score)
-      (setq square (landmark-point-square))
+    (let ((square (landmark-point-square))
+          score)
       (cond ((null square)
             (error "Your point is not on a square. Retry!"))
            ((not (zerop (aref landmark-board square)))
@@ -844,16 +842,15 @@ If the game is finished, this command requests for another game."
 
 (defun landmark-point-y ()
   "Return the board row where point is."
-  (let ((inhibit-point-motion-hooks t))
-    (1+ (/ (- (count-lines 1 (point)) landmark-y-offset (if (bolp) 0 1))
-          landmark-square-height))))
+  (1+ (/ (- (count-lines (point-min) (point))
+            landmark-y-offset (if (bolp) 0 1))
+         landmark-square-height)))
 
 (defun landmark-point-square ()
   "Return the index of the square point is on."
-  (let ((inhibit-point-motion-hooks t))
     (landmark-xy-to-index (1+ (/ (- (current-column) landmark-x-offset)
                               landmark-square-width))
-                       (landmark-point-y))))
+                      (landmark-point-y)))
 
 (defun landmark-goto-square (index)
   "Move point to square number INDEX."
@@ -861,23 +858,21 @@ If the game is finished, this command requests for another game."
 
 (defun landmark-goto-xy (x y)
   "Move point to square at X, Y coords."
-  (let ((inhibit-point-motion-hooks t))
     (goto-char (point-min))
-    (forward-line (+ landmark-y-offset (* landmark-square-height (1- y)))))
+  (forward-line (+ landmark-y-offset (* landmark-square-height (1- y))))
   (move-to-column (+ landmark-x-offset (* landmark-square-width (1- x)))))
 
 (defun landmark-plot-square (square value)
   "Draw 'X', 'O' or '.' on SQUARE depending on VALUE, leave point there."
   (or (= value 1)
       (landmark-goto-square square))
-  (let ((inhibit-read-only t)
-       (inhibit-point-motion-hooks t))
-    (insert-and-inherit (cond ((= value 1) ?.)
-                             ((= value 2) ?N)
-                             ((= value 3) ?S)
-                             ((= value 4) ?E)
-                             ((= value 5) ?W)
-                             ((= value 6) ?^)))
+  (let ((inhibit-read-only t))
+    (insert (cond ((= value 1) ?.)
+                  ((= value 2) ?N)
+                  ((= value 3) ?S)
+                  ((= value 4) ?E)
+                  ((= value 5) ?W)
+                  ((= value 6) ?^)))
 
     (and (zerop value)
         (add-text-properties (1- (point)) (point)
@@ -892,8 +887,7 @@ mouse-1: get robot moving, mouse-2: play on this square")))
   "Display an N by M Landmark board."
   (buffer-disable-undo (current-buffer))
   (let ((inhibit-read-only t)
-       (point 1) opoint
-       (intangible t)
+       (point (point-min)) opoint
        (i m) j x)
     ;; Try to minimize number of chars (because of text properties)
     (setq tab-width
@@ -902,7 +896,7 @@ mouse-1: get robot moving, mouse-2: play on this square")))
            (max (/ (+ (% landmark-x-offset landmark-square-width)
                       landmark-square-width 1) 2) 2)))
     (erase-buffer)
-    (newline landmark-y-offset)
+    (insert-char ?\n landmark-y-offset)
     (while (progn
             (setq j n
                   x (- landmark-x-offset landmark-square-width))
@@ -910,9 +904,7 @@ mouse-1: get robot moving, mouse-2: play on this square")))
               (insert-char ?\t (/ (- (setq x (+ x landmark-square-width))
                                      (current-column))
                                   tab-width))
-              (insert-char ?  (- x (current-column)))
-              (if (setq intangible (not intangible))
-                  (put-text-property point (point) 'intangible 2))
+               (insert-char ?\s (- x (current-column)))
               (and (zerop j)
                    (= i (- m 2))
                    (progn
@@ -929,14 +921,7 @@ mouse-1: get robot moving, mouse-2: play on this square")))
       (if (= i (1- m))
          (setq opoint point))
       (insert-char ?\n landmark-square-height))
-    (or (eq (char-after 1) ?.)
-       (put-text-property 1 2 'point-entered
-                          (lambda (_x _y) (if (bobp) (forward-char)))))
-    (or intangible
-       (put-text-property point (point) 'intangible 2))
-    (put-text-property point (point) 'point-entered
-                      (lambda (_x _y) (if (eobp) (backward-char))))
-    (put-text-property (point-min) (point) 'category 'landmark-mode))
+    (insert-char ?\n))
   (landmark-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board
   (sit-for 0))                         ; Display NOW
 
@@ -998,8 +983,7 @@ mouse-1: get robot moving, mouse-2: play on this square")))
   "Cross every square between SQUARE1 and SQUARE2 in the DX, DY direction."
   (save-excursion                      ; Not moving point from last square
     (let ((depl (landmark-xy-to-index dx dy))
-         (inhibit-read-only t)
-         (inhibit-point-motion-hooks t))
+         (inhibit-read-only t))
       ;; WARNING: this function assumes DEPL > 0 and SQUARE2 > SQUARE1
       (while (/= square1 square2)
        (landmark-goto-square square1)
@@ -1018,20 +1002,40 @@ mouse-1: get robot moving, mouse-2: play on this square")))
               (setq landmark-n (1+ landmark-n))
               (forward-line 1)
               (indent-to column)
-              (insert-and-inherit ?|))))
+              (insert ?|))))
          ((= dx -1)                    ; 1st Diagonal
           (indent-to (prog1 (- (current-column) (/ landmark-square-width 2))
                        (forward-line (/ landmark-square-height 2))))
-          (insert-and-inherit ?/))
+          (insert ?/))
          (t                            ; 2nd Diagonal
           (indent-to (prog1 (+ (current-column) (/ landmark-square-width 2))
                        (forward-line (/ landmark-square-height 2))))
-          (insert-and-inherit ?\\))))))
+          (insert ?\\))))))
   (sit-for 0))                         ; Display NOW
 
 
 ;;;_ + CURSOR MOTION.
 
+(defvar-local landmark--last-pos 0)
+
+(defconst landmark--intangible-chars "- \t\n|/\\\\")
+
+(defun landmark--intangible ()
+  (when (or (eobp)
+            (save-excursion
+              (not (zerop (skip-chars-forward landmark--intangible-chars)))))
+    (if (<= landmark--last-pos (point))   ;Moving forward.
+        (progn
+          (skip-chars-forward landmark--intangible-chars)
+          (when (eobp)
+            (skip-chars-backward landmark--intangible-chars)
+            (forward-char -1)))
+      (skip-chars-backward landmark--intangible-chars)
+      (if (bobp)
+          (skip-chars-forward landmark--intangible-chars)
+        (forward-char -1))))
+  (setq landmark--last-pos (point)))
+
 ;; previous-line and next-line don't work right with intangible newlines
 (defun landmark-move-down ()
   "Move point down one row on the Landmark board."
@@ -1138,7 +1142,7 @@ because it is overwritten by \"One moment please\"."
 
 
 (defun landmark-print-distance ()
-  (insert (format "tree: %S \n" (calc-distance-of-robot-from 'landmark-tree)))
+  (insert (format "tree: %S \n" (landmark-calc-distance-of-robot-from 'landmark-tree)))
   (mapc 'landmark-print-distance-int landmark-directions))
 
 
@@ -1303,9 +1307,9 @@ After this limit is reached, landmark-random-move is called to push him out of i
 ;;;_  - landmark-plot-internal (sym)
 (defun landmark-plot-internal (sym)
   (landmark-plot-square (landmark-xy-to-index
-                  (get sym 'x)
-                  (get sym 'y))
-                  (get sym 'sym)))
+                         (get sym 'x)
+                         (get sym 'y))
+                        (get sym 'sym)))
 ;;;_  - landmark-plot-landmarks ()
 (defun landmark-plot-landmarks ()
   (setq landmark-cx (/ landmark-board-width  2))
@@ -1336,26 +1340,24 @@ After this limit is reached, landmark-random-move is called to push him out of i
 
 
 ;;;_ + Distance-calculation functions
-;;;_  - square (a)
-(defun square (a)
-  (* a a))
 
 ;;;_  - distance (x x0 y y0)
-(defun distance (x x0 y y0)
-  (sqrt (+ (square (- x x0)) (square (- y y0)))))
+(defun landmark--distance (x x0 y y0)
+  (let ((dx (- x x0)) (dy (- y y0)))
+    (sqrt (+ (* dx dx) (* dy dy)))))
 
-;;;_  - calc-distance-of-robot-from (direction)
-(defun calc-distance-of-robot-from (direction)
+;;;_  - landmark-calc-distance-of-robot-from (direction)
+(defun landmark-calc-distance-of-robot-from (direction)
   (put direction 'distance
-       (distance (get direction 'x)
-                (landmark-index-to-x (landmark-point-square))
-                (get direction 'y)
-                (landmark-index-to-y (landmark-point-square)))))
+       (landmark--distance (get direction 'x)
+                           (landmark-index-to-x (landmark-point-square))
+                           (get direction 'y)
+                           (landmark-index-to-y (landmark-point-square)))))
 
-;;;_  - calc-smell-internal (sym)
-(defun calc-smell-internal (sym)
+;;;_  - landmark-calc-smell-internal (sym)
+(defun landmark-calc-smell-internal (sym)
   (let ((r (get sym 'r))
-       (d (calc-distance-of-robot-from sym)))
+       (d (landmark-calc-distance-of-robot-from sym)))
     (if (> (* 0.5 (- 1 (/ d r))) 0)
        (* 0.5 (- 1 (/ d r)))
       0)))
@@ -1402,12 +1404,12 @@ After this limit is reached, landmark-random-move is called to push him out of i
 
 (defun landmark-calc-current-smells ()
   (mapc (lambda (direction)
-            (put direction 'smell (calc-smell-internal direction)))
+            (put direction 'smell (landmark-calc-smell-internal direction)))
          landmark-directions))
 
 (defun landmark-calc-payoff ()
   (put 'z 't-1 (get 'z 't))
-  (put 'z 't (calc-smell-internal 'landmark-tree))
+  (put 'z 't (landmark-calc-smell-internal 'landmark-tree))
   (if (= (- (get 'z 't) (get 'z 't-1)) 0.0)
       (cl-incf landmark-no-payoff)
     (setf landmark-no-payoff 0)))
@@ -1448,8 +1450,9 @@ After this limit is reached, landmark-random-move is called to push him out of i
            (message "e-w normalization"))))
 
   (mapc (lambda (pair)
-            (if (> (get (car pair) 'y_t) 0)
-                (funcall (car (cdr pair)))))
+            (when (> (get (car pair) 'y_t) 0)
+               (funcall (car (cdr pair)))
+               (landmark--intangible)))
          '(
            (landmark-n landmark-move-up)
            (landmark-s landmark-move-down)
@@ -1471,7 +1474,7 @@ After this limit is reached, landmark-random-move is called to push him out of i
 
 (defun landmark-amble-robot ()
   (interactive)
-  (while (> (calc-distance-of-robot-from 'landmark-tree) 0)
+  (while (> (landmark-calc-distance-of-robot-from 'landmark-tree) 0)
 
     (landmark-store-old-y_t)
     (landmark-calc-current-smells)
@@ -1505,8 +1508,7 @@ If the game is finished, this command requests for another game."
    ((not landmark-game-in-progress)
     (landmark-prompt-for-other-game))
    (t
-    (let (square)
-      (setq square (landmark-point-square))
+    (let ((square (landmark-point-square)))
       (cond ((null square)
             (error "Your point is not on a square. Retry!"))
            ((not (zerop (aref landmark-board square)))
@@ -1517,7 +1519,7 @@ If the game is finished, this command requests for another game."
 
               (landmark-store-old-y_t)
               (landmark-calc-current-smells)
-              (put 'z 't (calc-smell-internal 'landmark-tree))
+              (put 'z 't (landmark-calc-smell-internal 'landmark-tree))
 
               (landmark-random-move)
 
@@ -1590,7 +1592,9 @@ If the game is finished, this command requests for another game."
 ;; distance on scent.
 
 (defun landmark-set-landmark-signal-strengths ()
-  (setq landmark-tree-r (* (sqrt (+ (square landmark-cx) (square landmark-cy))) 1.5))
+  (setq landmark-tree-r (* (sqrt (+ (* landmark-cx landmark-cx)
+                                    (* landmark-cy landmark-cy)))
+                           1.5))
   (mapc (lambda (direction)
             (put direction 'r (* landmark-cx 1.1)))
        landmark-ew)
@@ -1609,7 +1613,7 @@ If the game is finished, this command requests for another game."
   "Run 100 Landmark games, each time saving the weights from the previous game."
   (interactive)
   (landmark 1)
-  (dotimes (scratch-var 100)
+  (dotimes (_ 100)
     (landmark 2)))
 
 ;;;###autoload
index 5b6173ceb350959665cd7f88c6fe90540c6606f8..39da132d64e777d7e587f859c99fc44d6c0a23b9 100644 (file)
@@ -1038,20 +1038,27 @@ Please send all bug fixes and enhancements to
 ;; To avoid compilation gripes
 
 
-(or (fboundp 'subst-char-in-string)    ; hacked from subr.el
-    (defun subst-char-in-string (fromchar tochar string &optional inplace)
-      "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
+;; Emacs has this since at least 21.1.
+(when (featurep 'xemacs)
+  (or (fboundp 'subst-char-in-string)  ; hacked from subr.el
+      (defun subst-char-in-string (fromchar tochar string &optional inplace)
+       "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
 Unless optional argument INPLACE is non-nil, return a new string."
-      (let ((i (length string))
-           (newstr (if inplace string (copy-sequence string))))
-       (while (> (setq i (1- i)) 0)
-         (if (eq (aref newstr i) fromchar)
-             (aset newstr i tochar)))
-       newstr)))
-
-
-(or (fboundp 'make-temp-file)          ; hacked from subr.el
-    (defun make-temp-file (prefix &optional dir-flag suffix)
+       (let ((i (length string))
+             (newstr (if inplace string (copy-sequence string))))
+         (while (> (setq i (1- i)) 0)
+           (if (eq (aref newstr i) fromchar)
+               (aset newstr i tochar)))
+         newstr))))
+
+
+;; Emacs has this since at least 21.1, but the SUFFIX argument
+;; (which this file uses) only since 22.1.  So the fboundp test
+;; wasn't even correct/adequate.  Whatever, no-one is using
+;; this file on older Emacs version, so it's irrelevant.
+(when (featurep 'xemacs)
+  (or (fboundp 'make-temp-file)                ; hacked from subr.el
+      (defun make-temp-file (prefix &optional dir-flag suffix)
       "Create a temporary file.
 The returned file name (created by appending some random characters at the end
 of PREFIX, and expanding against `temporary-file-directory' if necessary),
@@ -1086,7 +1093,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
                nil)
              file)
          ;; Reset the umask.
-         (set-default-file-modes umask)))))
+         (set-default-file-modes umask))))))
 
 
 (eval-when-compile
@@ -3164,12 +3171,9 @@ See `pr-ps-printer-alist'.")
 
 
 (defmacro pr-save-file-modes (&rest body)
-  "Set temporally file modes to `pr-file-modes'."
-  `(let ((pr--default-file-modes (default-file-modes)))        ; save default
-     (set-default-file-modes pr-file-modes)
-     ,@body
-     (set-default-file-modes pr--default-file-modes))) ; restore default
-
+  "Execute BODY with file permissions temporarily set to `pr-file-modes'."
+  (declare (obsolete with-file-modes "24.5"))
+  `(with-file-modes pr-file-modes ,@body))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Keys & Menus
@@ -3192,9 +3196,10 @@ See `pr-ps-printer-alist'.")
 
 
 (defalias 'pr-get-symbol
-  (if (fboundp 'easy-menu-intern)      ; hacked from easymenu.el
-      'easy-menu-intern
-    (lambda (s) (if (stringp s) (intern s) s))))
+  (if (featurep 'emacs) 'easy-menu-intern ; since 22.1
+    (if (fboundp 'easy-menu-intern)    ; hacked from easymenu.el
+       'easy-menu-intern
+      (lambda (s) (if (stringp s) (intern s) s)))))
 
 
 (defconst pr-menu-spec
@@ -4364,12 +4369,12 @@ Noninteractively, the argument FILENAME is treated as follows: if it is nil,
 send the image to the printer.  If FILENAME is a string, save the PostScript
 image in a file with that name."
   (interactive (list (ps-print-preprint current-prefix-arg)))
-  (pr-save-file-modes
-   (let ((ps-lpr-command         (pr-command pr-ps-command))
-        (ps-lpr-switches        pr-ps-switches)
-        (ps-printer-name-option pr-ps-printer-switch)
-        (ps-printer-name        pr-ps-printer))
-     (ps-despool filename))))
+  (with-file-modes pr-file-modes
+    (let ((ps-lpr-command         (pr-command pr-ps-command))
+         (ps-lpr-switches        pr-ps-switches)
+         (ps-printer-name-option pr-ps-printer-switch)
+         (ps-printer-name        pr-ps-printer))
+      (ps-despool filename))))
 
 
 ;;;###autoload
@@ -5632,12 +5637,12 @@ If menu binding was not done, calls `pr-menu-bind'."
       (goto-char (point-max))
       (insert (format "%s %S\n" cmd args)))
     ;; *Printing Command Output* == show any return message from command
-    (pr-save-file-modes
-     (setq status
-          (condition-case data
-              (apply 'call-process cmd nil buffer nil args)
-            ((quit error)
-             (error-message-string data)))))
+    (with-file-modes pr-file-modes
+      (setq status
+           (condition-case data
+               (apply 'call-process cmd nil buffer nil args)
+             ((quit error)
+              (error-message-string data)))))
     ;; *Printing Command Output* == show exit status
     (with-current-buffer buffer
       (goto-char (point-max))
@@ -5882,42 +5887,42 @@ If menu binding was not done, calls `pr-menu-bind'."
 
 
 (defun pr-text2ps (kind n-up filename &optional from to)
-  (pr-save-file-modes
-   (let ((ps-n-up-printing n-up)
-        (ps-spool-config (and (eq ps-spool-config 'setpagedevice)
-                              'setpagedevice)))
-     (pr-delete-file-if-exists filename)
-     (cond (pr-faces-p
-           (cond (pr-spool-p
-                  ;; pr-faces-p and pr-spool-p
-                  ;; here FILENAME arg is ignored
-                  (cond ((eq kind 'buffer)
-                         (ps-spool-buffer-with-faces))
-                        ((eq kind 'region)
-                         (ps-spool-region-with-faces (or from (point))
-                                                     (or to (mark))))
-                        ))
-                 ;; pr-faces-p and not pr-spool-p
-                 ((eq kind 'buffer)
-                  (ps-print-buffer-with-faces filename))
-                 ((eq kind 'region)
-                  (ps-print-region-with-faces (or from (point))
-                                              (or to (mark)) filename))
-                 ))
-          (pr-spool-p
-           ;; not pr-faces-p and pr-spool-p
-           ;; here FILENAME arg is ignored
-           (cond ((eq kind 'buffer)
-                  (ps-spool-buffer))
-                 ((eq kind 'region)
-                  (ps-spool-region (or from (point)) (or to (mark))))
-                 ))
-          ;; not pr-faces-p and not pr-spool-p
-          ((eq kind 'buffer)
-           (ps-print-buffer filename))
-          ((eq kind 'region)
-           (ps-print-region (or from (point)) (or to (mark)) filename))
-          ))))
+  (with-file-modes pr-file-modes
+    (let ((ps-n-up-printing n-up)
+         (ps-spool-config (and (eq ps-spool-config 'setpagedevice)
+                               'setpagedevice)))
+      (pr-delete-file-if-exists filename)
+      (cond (pr-faces-p
+            (cond (pr-spool-p
+                   ;; pr-faces-p and pr-spool-p
+                   ;; here FILENAME arg is ignored
+                   (cond ((eq kind 'buffer)
+                          (ps-spool-buffer-with-faces))
+                         ((eq kind 'region)
+                          (ps-spool-region-with-faces (or from (point))
+                                                      (or to (mark))))
+                         ))
+                  ;; pr-faces-p and not pr-spool-p
+                  ((eq kind 'buffer)
+                   (ps-print-buffer-with-faces filename))
+                  ((eq kind 'region)
+                   (ps-print-region-with-faces (or from (point))
+                                               (or to (mark)) filename))
+                  ))
+           (pr-spool-p
+            ;; not pr-faces-p and pr-spool-p
+            ;; here FILENAME arg is ignored
+            (cond ((eq kind 'buffer)
+                   (ps-spool-buffer))
+                  ((eq kind 'region)
+                   (ps-spool-region (or from (point)) (or to (mark))))
+                  ))
+           ;; not pr-faces-p and not pr-spool-p
+           ((eq kind 'buffer)
+            (ps-print-buffer filename))
+           ((eq kind 'region)
+            (ps-print-region (or from (point)) (or to (mark)) filename))
+           ))))
 
 
 (defun pr-command (command)
@@ -6543,8 +6548,7 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
 
 
 (defun pr-i-directory ()
-  (or (and (file-directory-p pr-i-directory)
-          (file-readable-p pr-i-directory))
+  (or (file-accessible-directory-p pr-i-directory)
       (error "Please specify be a readable directory")))
 
 
@@ -6552,8 +6556,7 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
   (and pr-buffer-verbose
        (message "You can use M-TAB or ESC TAB for file completion"))
   (let ((dir (widget-value widget)))
-    (and (file-directory-p dir)
-        (file-readable-p dir)
+    (and (file-accessible-directory-p dir)
         (setq pr-i-directory dir))))
 
 
diff --git a/lisp/progmodes/cap-words.el b/lisp/progmodes/cap-words.el
deleted file mode 100644 (file)
index b03daf4..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-;;; cap-words.el --- minor mode for motion in CapitalizedWordIdentifiers
-
-;; Copyright (C) 2002-2014 Free Software Foundation, Inc.
-
-;; Author: Dave Love <fx@gnu.org>
-;; Keywords: languages
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Provides Capitalized Words minor mode for word movement in
-;; identifiers CapitalizedLikeThis.
-
-;; Note that the same effect could be obtained by frobbing the
-;; category of upper case characters to produce word boundaries, but
-;; the necessary processing isn't done for ASCII characters.
-
-;; Fixme: This doesn't work properly for mouse double clicks.
-
-;;; Code:
-
-(defun capitalized-find-word-boundary (pos limit)
-  "Function for use in `find-word-boundary-function-table'.
-Looks for word boundaries before capitals."
-  (save-excursion
-    (goto-char pos)
-    (let (case-fold-search)
-      (if (<= pos limit)
-         ;; Fixme: Are these regexps the best?
-         (or (and (re-search-forward "\\=.\\w*[[:upper:]]"
-                                     limit t)
-                  (progn (backward-char)
-                         t))
-             (re-search-forward "\\>" limit t))
-       (or (re-search-backward "[[:upper:]]\\w*\\=" limit t)
-           (re-search-backward "\\<" limit t))))
-    (point)))
-
-
-(defconst capitalized-find-word-boundary-function-table
-  (let ((tab (make-char-table nil)))
-    (set-char-table-range tab t #'capitalized-find-word-boundary)
-    tab)
-  "Assigned to `find-word-boundary-function-table' in Capitalized Words mode.")
-
-;;;###autoload
-(define-minor-mode capitalized-words-mode
-  "Toggle Capitalized Words mode.
-With a prefix argument ARG, enable Capitalized Words mode if ARG
-is positive, and disable it otherwise.  If called from Lisp,
-enable the mode if ARG is omitted or nil.
-
-Capitalized Words mode is a buffer-local minor mode.  When
-enabled, a word boundary occurs immediately before an uppercase
-letter in a symbol.  This is in addition to all the normal
-boundaries given by the syntax and category tables.  There is no
-restriction to ASCII.
-
-E.g. the beginning of words in the following identifier are as marked:
-
-  capitalizedWorDD
-  ^          ^  ^^
-
-Note that these word boundaries only apply for word motion and
-marking commands such as \\[forward-word].  This mode does not affect word
-boundaries found by regexp matching (`\\>', `\\w' &c).
-
-This style of identifiers is common in environments like Java ones,
-where underscores aren't trendy enough.  Capitalization rules are
-sometimes part of the language, e.g. Haskell, which may thus encourage
-such a style.  It is appropriate to add `capitalized-words-mode' to
-the mode hook for programming language modes in which you encounter
-variables like this, e.g. `java-mode-hook'.  It's unlikely to cause
-trouble if such identifiers aren't used.
-
-See also `glasses-mode' and `studlify-word'.
-Obsoletes `c-forward-into-nomenclature'."
-  nil " Caps" nil :group 'programming
-  (set (make-local-variable 'find-word-boundary-function-table)
-       capitalized-find-word-boundary-function-table))
-
-(provide 'cap-words)
-
-;;; cap-words.el ends here
index 1606cfb33575df70fb66ab9f13a7d8fe011f4880..d6134a510b2573ec7fa6a0fb84610323e5f96b62 100644 (file)
@@ -823,6 +823,8 @@ be after it."
 (defmacro c-with-syntax-table (table &rest code)
   ;; Temporarily switches to the specified syntax table in a failsafe
   ;; way to execute code.
+  ;; Maintainers' note: If TABLE is `c++-template-syntax-table', DON'T call
+  ;; any forms inside this that call `c-parse-state'.  !!!!
   `(let ((c-with-syntax-table-orig-table (syntax-table)))
      (unwind-protect
         (progn
@@ -1834,12 +1836,9 @@ system."
 immediately, i.e. at the same time as the `c-lang-defconst' form
 itself is evaluated."
   ;; Evaluate at macro expansion time, i.e. in the
-  ;; `cl-macroexpand-all' inside `c-lang-defconst'.
+  ;; `macroexpand-all' inside `c-lang-defconst'.
   (eval form))
 
-;; Only used at compile time - suppress "might not be defined at runtime".
-(declare-function cl-macroexpand-all "cl" (form &optional env))
-
 (defmacro c-lang-defconst (name &rest args)
   "Set the language specific values of the language constant NAME.
 The second argument can optionally be a docstring.  The rest of the
@@ -1881,7 +1880,7 @@ constant.  A file is identified by its base name."
 
   (let* ((sym (intern (symbol-name name) c-lang-constants))
         ;; Make `c-lang-const' expand to a straightforward call to
-        ;; `c-get-lang-constant' in `cl-macroexpand-all' below.
+        ;; `c-get-lang-constant' in `macroexpand-all' below.
         ;;
         ;; (The default behavior, i.e. to expand to a call inside
         ;; `eval-when-compile' should be equivalent, since that macro
@@ -1944,7 +1943,7 @@ constant.  A file is identified by its base name."
        ;; reason, but we also use this expansion handle
        ;; `c-lang-defconst-eval-immediately' and to register
        ;; dependencies on the `c-lang-const's in VAL.)
-       (setq val (cl-macroexpand-all val))
+       (setq val (macroexpand-all val))
 
        (setq bindings (cons (cons assigned-mode val) bindings)
              args (cdr args))))
index f86e4b2c48a4e3fc985b9dfe0ffe8d19829d5b7f..7404241af9b91dba5585448b95aae49348eb72c2 100644 (file)
@@ -2219,7 +2219,8 @@ comment at the start of cc-engine.el for more info."
        ((and (not not-in-delimiter)    ; inside a comment starter
             (not (bobp))
             (progn (backward-char)
-                   (and (not (looking-at "\\s!"))
+                   (and (not (and (memq 'category-properties c-emacs-features)
+                                  (looking-at "\\s!")))
                         (looking-at c-comment-start-regexp))))
        (setq ty (if (looking-at c-block-comment-start-regexp) 'c 'c++)
              co-st (point))
@@ -9354,16 +9355,16 @@ comment at the start of cc-engine.el for more info."
                    (not (looking-at c-<-op-cont-regexp))))))
       (c-with-syntax-table c++-template-syntax-table
        (goto-char placeholder)
-       (c-beginning-of-statement-1 containing-sexp t)
-       (if (save-excursion
-             (c-backward-syntactic-ws containing-sexp)
-             (eq (char-before) ?<))
-           ;; In a nested template arglist.
-           (progn
-             (goto-char placeholder)
-             (c-syntactic-skip-backward "^,;" containing-sexp t)
-             (c-forward-syntactic-ws))
-         (back-to-indentation)))
+       (c-beginning-of-statement-1 containing-sexp t))
+      (if (save-excursion
+           (c-backward-syntactic-ws containing-sexp)
+           (eq (char-before) ?<))
+         ;; In a nested template arglist.
+         (progn
+           (goto-char placeholder)
+           (c-syntactic-skip-backward "^,;" containing-sexp t)
+           (c-forward-syntactic-ws))
+       (back-to-indentation))
       ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
       ;; template aware.
       (c-add-syntax 'template-args-cont (point) placeholder))
@@ -10021,16 +10022,16 @@ comment at the start of cc-engine.el for more info."
                            (eq (char-after placeholder) ?<))))))
            (c-with-syntax-table c++-template-syntax-table
              (goto-char placeholder)
-             (c-beginning-of-statement-1 lim t)
-             (if (save-excursion
-                   (c-backward-syntactic-ws lim)
-                   (eq (char-before) ?<))
-                 ;; In a nested template arglist.
-                 (progn
-                   (goto-char placeholder)
-                   (c-syntactic-skip-backward "^,;" lim t)
-                   (c-forward-syntactic-ws))
-               (back-to-indentation)))
+             (c-beginning-of-statement-1 lim t))
+           (if (save-excursion
+                 (c-backward-syntactic-ws lim)
+                 (eq (char-before) ?<))
+               ;; In a nested template arglist.
+               (progn
+                 (goto-char placeholder)
+                 (c-syntactic-skip-backward "^,;" lim t)
+                 (c-forward-syntactic-ws))
+             (back-to-indentation))
            ;; FIXME: Should use c-add-stmt-syntax, but it's not yet
            ;; template aware.
            (c-add-syntax 'template-args-cont (point) placeholder))
index abde007cd044225a0219b88e0f21de25ec0892e3..5424e8d4a61e7bcd1491538c654a01d2b66c70e9 100644 (file)
@@ -504,8 +504,7 @@ is called with one argument, the guessed style."
                      (cond
                       ((or (and a-guessed? b-guessed?)
                            (not (or a-guessed? b-guessed?)))
-                       (string-lessp (symbol-name (car a))
-                                     (symbol-name (car b))))
+                       (string-lessp (car a) (car b)))
                       (a-guessed? t)
                       (b-guessed? nil)))))))
   style)
index d2d2de8801a7f2e6aeda150144cefffdcd1a1969..42b6f5964c2ff5437c02601e04532b62654f24b9 100644 (file)
@@ -213,7 +213,6 @@ the evaluated constant value at compile time."
 ;; These are defined in cl as aliases to the cl- versions.
 ;(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys) t)
 ;(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest) t)
-;(declare-function cl-macroexpand-all "cl" (form &optional env))
 
 (eval-and-compile
   ;; Some helper functions used when building the language constants.
@@ -394,7 +393,9 @@ The syntax tables aren't stored directly since they're quite large."
   ;; lists are parsed.  Note that this encourages incorrect parsing of
   ;; templates since they might contain normal operators that uses the
   ;; '<' and '>' characters.  Therefore this syntax table might go
-  ;; away when CC Mode handles templates correctly everywhere.
+  ;; away when CC Mode handles templates correctly everywhere.  WHILE
+  ;; THIS SYNTAX TABLE IS CURRENT, `c-parse-state' MUST _NOT_ BE
+  ;; CALLED!!!
   t   nil
   (java c++) `(lambda ()
         (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))
@@ -3183,7 +3184,7 @@ accomplish that conveniently."
       `(lambda ()
 
         ;; This let sets up the context for `c-mode-var' and similar
-        ;; that could be in the result from `cl-macroexpand-all'.
+        ;; that could be in the result from `macroexpand-all'.
         (let ((c-buffer-is-cc-mode ',mode)
               current-var source-eval)
           (c-make-emacs-variables-local)
@@ -3193,7 +3194,7 @@ accomplish that conveniently."
                   (setq ,@(let ((c-buffer-is-cc-mode mode)
                                 (c-lang-const-expansion 'immediate))
                             ;; `c-lang-const' will expand to the evaluated
-                            ;; constant immediately in `cl-macroexpand-all'
+                            ;; constant immediately in `macroexpand-all'
                             ;; below.
                              (cl-mapcan
                               (lambda (init)
index 30f30dfe83fa1787ac3552c08e50e0207d54d581..000d7191ee77552a882a11dab557ea18d632b299 100644 (file)
@@ -134,7 +134,7 @@ and a string describing how the process finished.")
 ;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit
 
 (defvar compilation-error-regexp-alist-alist
-  '((absoft
+  `((absoft
      "^\\(?:[Ee]rror on \\|[Ww]arning on\\( \\)\\)?[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\
 of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
 
@@ -255,16 +255,46 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
      ;; can be composed of any non-newline char, but it also rules out some
      ;; valid but unlikely cases, such as a trailing space or a space
      ;; followed by a -, or a colon followed by a space.
-
+     ;; 
      ;; The "in \\|from " exception was added to handle messages from Ruby.
-     "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\
-\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\
-\\([0-9]+\\)\\(?:-\\(?4:[0-9]+\\)\\(?:\\.\\(?5:[0-9]+\\)\\)?\
-\\|[.:]\\(?3:[0-9]+\\)\\(?:-\\(?:\\(?4:[0-9]+\\)\\.\\)?\\(?5:[0-9]+\\)\\)?\\)?:\
-\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
- *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|\\[ skipping .+ \\]\\|\
-\\(?:instantiated\\|required\\) from\\|[Nn]ote\\)\\|\
- *[Ee]rror\\|[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
+     ,(rx
+       bol
+       (? (| (regexp "[[:alpha:]][-[:alnum:].]+: ?")
+             (regexp "[ \t]+\\(?:in \\|from\\)")))
+       (group-n 1 (: (regexp "[0-9]*[^0-9\n]")
+                     (*? (| (regexp "[^\n :]")
+                            (regexp " [^-/\n]")
+                            (regexp ":[^ \n]")))))
+       (regexp ": ?")
+       (group-n 2 (regexp "[0-9]+"))
+       (? (| (: "-"
+                (group-n 4 (regexp "[0-9]+"))
+                (? "." (group-n 5 (regexp "[0-9]+"))))
+             (: (in ".:")
+                (group-n 3 (regexp "[0-9]+"))
+                (? "-"
+                   (? (group-n 4 (regexp "[0-9]+")) ".")
+                   (group-n 5 (regexp "[0-9]+"))))))
+       ":"
+       (| (: (* " ")
+             (group-n 6 (| "FutureWarning"
+                           "RuntimeWarning"
+                           "Warning"
+                           "warning"
+                           "W:")))
+          (: (* " ")
+             (group-n 7 (| (regexp "[Ii]nfo\\(?:\\>\\|rmationa?l?\\)")
+                           "I:"
+                           (: "[ skipping " (+ ".") " ]")
+                           "instantiated from"
+                           "required from"
+                           (regexp "[Nn]ote"))))
+          (: (* " ")
+             (regexp "[Ee]rror"))
+          (: (regexp "[0-9]?")
+             (| (regexp "[^0-9\n]")
+                eol))
+          (regexp "[0-9][0-9][0-9]")))
      1 (2 . 4) (3 . 5) (6 . 7))
 
     (lcc
@@ -2039,8 +2069,7 @@ Optional argument MINOR indicates this is called from
   (if minor
       (progn
        (font-lock-add-keywords nil (compilation-mode-font-lock-keywords))
-       (if font-lock-mode
-            (font-lock-fontify-buffer)))
+        (font-lock-flush))
     (setq font-lock-defaults '(compilation-mode-font-lock-keywords t))))
 
 (defun compilation--unsetup ()
@@ -2049,8 +2078,7 @@ Optional argument MINOR indicates this is called from
   (remove-hook 'before-change-functions 'compilation--flush-parse t)
   (kill-local-variable 'compilation--parsed)
   (compilation--remove-properties)
-  (if font-lock-mode
-      (font-lock-fontify-buffer)))
+  (font-lock-flush))
 
 ;;;###autoload
 (define-minor-mode compilation-shell-minor-mode
index c4f2b9ffe517a30845fe10d96f1dc51452b4b76c..cd60475974c59769ea923a4a13ac604cc9f91769 100644 (file)
@@ -4828,9 +4828,9 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
       (and (memq (char-syntax (preceding-char)) '(?w ?_))
           (progn
             (backward-sexp)
-            ;; sub {BLK}, print {BLK} $data, but NOT `bless', `return', `tr'
+            ;; sub {BLK}, print {BLK} $data, but NOT `bless', `return', `tr', `constant'
             (or (and (looking-at "[a-zA-Z0-9_:]+[ \t\n\f]*[{#]") ; Method call syntax
-                     (not (looking-at "\\(bless\\|return\\|q[wqrx]?\\|tr\\|[smy]\\)\\>")))
+                     (not (looking-at "\\(bless\\|return\\|q[wqrx]?\\|tr\\|[smy]\\|constant\\)\\>")))
                 ;; sub bless::foo {}
                 (progn
                   (cperl-backward-to-noncomment (point-min))
index 4e4fc1388773f629cc9f420d11108afd64a05399..1aa5170591a57a2d64d0bcb675e34c886f33f152 100644 (file)
@@ -188,7 +188,7 @@ and disable it otherwise.  If called from Lisp, enable the mode
 if ARG is omitted or nil."
   :group 'cwarn :lighter cwarn-mode-text
   (cwarn-font-lock-keywords cwarn-mode)
-  (if font-lock-mode (font-lock-fontify-buffer)))
+  (font-lock-flush))
 
 ;;;###autoload
 (define-obsolete-function-alias 'turn-on-cwarn-mode 'cwarn-mode "24.1")
index 215b8d8358e3564cf74e36e195077bb302ef3bd6..c7f018f5f155037661d0b69fad737939687dc82b 100644 (file)
@@ -830,7 +830,7 @@ Can be overridden by the value of `font-lock-maximum-decoration'.")
   (font-lock-mode 1)
   (setq font-lock-keywords
         (symbol-value (intern-soft (format "f90-font-lock-keywords-%d" n))))
-  (font-lock-fontify-buffer))
+  (font-lock-flush))
 
 (defun f90-font-lock-1 ()
   "Set `font-lock-keywords' to `f90-font-lock-keywords-1'."
index 99629450c1b88d7b02fc9d67569bdbaa4f55a24b..d60534074b9ebed2d5743a89e99cffa4aa9d733e 100644 (file)
@@ -1,7 +1,6 @@
-;;; grep.el --- run `grep' and display the results
+;;; grep.el --- run `grep' and display the results  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>
 ;; Maintainer: emacs-devel@gnu.org
@@ -805,16 +804,20 @@ substitution string.  Note dynamic scoping of variables.")
 
 (defun grep-expand-template (template &optional regexp files dir excl)
   "Patch grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>."
-  (let ((command template)
-       (cf case-fold-search)
-       (case-fold-search nil))
+  (let* ((command template)
+         (env `((cf . ,case-fold-search)
+                (excl . ,excl)
+                (dir . ,dir)
+                (files . ,files)
+                (regexp . ,regexp)))
+         (case-fold-search nil))
     (dolist (kw grep-expand-keywords command)
       (if (string-match (car kw) command)
          (setq command
                (replace-match
                 (or (if (symbolp (cdr kw))
-                        (symbol-value (cdr kw))
-                      (save-match-data (eval (cdr kw))))
+                        (eval (cdr kw) env)
+                      (save-match-data (eval (cdr kw) env)))
                     "")
                 t t command))))))
 
@@ -901,7 +904,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
                (confirm (equal current-prefix-arg '(4))))
           (list regexp files dir confirm))))))
   (when (and (stringp regexp) (> (length regexp) 0))
-    (unless (and dir (file-directory-p dir) (file-readable-p dir))
+    (unless (and dir (file-accessible-directory-p dir))
       (setq dir default-directory))
     (let ((command regexp))
       (if (null files)
@@ -982,7 +985,7 @@ to specify a command to run."
                (confirm (equal current-prefix-arg '(4))))
           (list regexp files dir confirm))))))
   (when (and (stringp regexp) (> (length regexp) 0))
-    (unless (and dir (file-directory-p dir) (file-readable-p dir))
+    (unless (and dir (file-accessible-directory-p dir))
       (setq dir default-directory))
     (if (null files)
        (if (not (string= regexp (if (consp grep-find-command)
@@ -1055,7 +1058,7 @@ to specify a command to run."
              (setq default-directory dir)))))))
 
 ;;;###autoload
-(defun zrgrep (regexp &optional files dir confirm grep-find-template)
+(defun zrgrep (regexp &optional files dir confirm template)
   "Recursively grep for REGEXP in gzipped FILES in tree rooted at DIR.
 Like `rgrep' but uses `zgrep' for `grep-program', sets the default
 file name to `*.gz', and sets `grep-highlight-matches' to `always'."
@@ -1090,10 +1093,8 @@ file name to `*.gz', and sets `grep-highlight-matches' to `always'."
             (list regexp files dir confirm grep-find-template)))))))
   ;; Set `grep-highlight-matches' to `always'
   ;; since `zgrep' puts filters in the grep output.
-  (let ((grep-highlight-matches 'always))
-    ;; `rgrep' uses the dynamically bound value `grep-find-template'
-    ;; from the argument `grep-find-template' whose value is computed
-    ;; in the `interactive' spec.
+  (let ((grep-find-template template)
+        (grep-highlight-matches 'always))
     (rgrep regexp files dir confirm)))
 
 ;;;###autoload
index 506f2c2364eafb362600a995e47e1f9e1bea1c4f..b1eaa6ad66c1d914d287e4c2c45b6116855ba1af 100644 (file)
@@ -1,10 +1,10 @@
-;;; hideif.el --- hides selected code within ifdef
+;;; hideif.el --- hides selected code within ifdef  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1988, 1994, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Brian Marick
 ;;     Daniel LaLiberte <liberte@holonexus.org>
-;; Maintainer: emacs-devel@gnu.org
+;; Maintainer: Luke Lee <luke.yx.lee@gmail.com>
 ;; Keywords: c, outlines
 
 ;; This file is part of GNU Emacs.
@@ -36,6 +36,8 @@
 ;;
 ;; Hide-ifdef suppresses the display of code that the preprocessor wouldn't
 ;; pass through.  Support complete C/C++ expression and precedence.
+;; It will automatically scan for new #define symbols and macros on the way
+;; parsing.
 ;;
 ;; The hidden code is marked by ellipses (...).  Be
 ;; cautious when editing near ellipses, since the hidden text is
 ;; Extensively modified by Daniel LaLiberte (while at Gould).
 ;;
 ;; Extensively modified by Luke Lee in 2013 to support complete C expression
-;; evaluation.
+;; evaluation and argumented macro expansion.
 
 ;;; Code:
 
 (require 'cc-mode)
+(require 'cl-lib)
 
 (defgroup hide-ifdef nil
   "Hide selected code within `ifdef'."
   :group 'hide-ifdef
   :version "23.1")
 
+(defcustom hide-ifdef-exclude-define-regexp nil
+  "Ignore #define names if those names match this exclusion pattern."
+  :type 'string
+  :version "24.5")
+
+(defcustom hide-ifdef-expand-reinclusion-protection t
+  "Non-nil means don't hide an entire header file enclosed by #ifndef...#endif.
+Most C/C++ headers are usually wrapped with ifdefs to prevent re-inclusion:
+
+  ----- beginning of file -----
+  #ifndef _XXX_HEADER_FILE_INCLUDED_
+  #define _XXX_HEADER_FILE_INCLUDED_
+     xxx
+     xxx
+     xxx...
+  #endif
+  ----- end of file -----
+
+The first time we visit such a file, _XXX_HEADER_FILE_INCLUDED_ is
+undefined, and so nothing is hidden.  The next time we visit it, everything will
+be hidden.
+
+This behavior is generally undesirable.  If this option is non-nil, the outermost
+#if is always visible."
+  :type 'boolean
+  :version "24.5")
+
+(defcustom hide-ifdef-header-regexp
+  "\\.h\\(h\\|xx\\|pp\\)?\\'"
+  "C/C++ header file name patterns to determine if current buffer is a header.
+Effective only if `hide-ifdef-expand-reinclusion-protection' is t."
+  :type 'string
+  :group 'hide-ifdef
+  :version "24.5")
 
 (defvar hide-ifdef-mode-submap
   ;; Set up the submap that goes after the prefix key.
     (define-key map "s" 'show-ifdefs)
     (define-key map "\C-d" 'hide-ifdef-block)
     (define-key map "\C-s" 'show-ifdef-block)
+    (define-key map "e" 'hif-evaluate-macro)
+    (define-key map "C" 'hif-clear-all-ifdef-defined)
 
     (define-key map "\C-q" 'hide-ifdef-toggle-read-only)
     (define-key map "\C-w" 'hide-ifdef-toggle-shadowing)
           (cons '(hide-ifdef-hiding " Hiding")
                 minor-mode-alist)))
 
-;; fix c-mode syntax table so we can recognize whole symbols.
+;; Fix c-mode syntax table so we can recognize whole symbols.
 (defvar hide-ifdef-syntax-table
   (let ((st (copy-syntax-table c-mode-syntax-table)))
     (modify-syntax-entry ?_ "w" st)
 (defvar hide-ifdef-env nil
   "An alist of defined symbols and their values.")
 
+(defvar hide-ifdef-env-backup nil
+  "This variable is a backup of the previously cleared `hide-ifdef-env'.
+This backup prevents any accidental clearance of `hide-fidef-env' by
+`hif-clear-all-ifdef-defined'.")
+
 (defvar hif-outside-read-only nil
   "Internal variable.  Saves the value of `buffer-read-only' while hiding.")
 
@@ -229,53 +273,75 @@ that the C preprocessor would eliminate may be hidden from view.
 Several variables affect how the hiding is done:
 
 `hide-ifdef-env'
-       An association list of defined and undefined symbols for the
-       current buffer.  Initially, the global value of `hide-ifdef-env'
-       is used.
+        An association list of defined and undefined symbols for the
+        current project.  Initially, the global value of `hide-ifdef-env'
+        is used.  This variable was a buffer-local variable, which limits
+        hideif to parse only one C/C++ file at a time.  We've extended
+        hideif to support parsing a C/C++ project containing multiple C/C++
+        source files opened simultaneously in different buffers.  Therefore
+        `hide-ifdef-env' can no longer be buffer local but must be global.
 
 `hide-ifdef-define-alist'
-       An association list of defined symbol lists.
+        An association list of defined symbol lists.
         Use `hide-ifdef-set-define-alist' to save the current `hide-ifdef-env'
         and `hide-ifdef-use-define-alist' to set the current `hide-ifdef-env'
         from one of the lists in `hide-ifdef-define-alist'.
 
 `hide-ifdef-lines'
-       Set to non-nil to not show #if, #ifdef, #ifndef, #else, and
-       #endif lines when hiding.
+        Set to non-nil to not show #if, #ifdef, #ifndef, #else, and
+        #endif lines when hiding.
 
 `hide-ifdef-initially'
-       Indicates whether `hide-ifdefs' should be called when Hide-Ifdef mode
-       is activated.
+        Indicates whether `hide-ifdefs' should be called when Hide-Ifdef mode
+        is activated.
 
 `hide-ifdef-read-only'
-       Set to non-nil if you want to make buffers read only while hiding.
-       After `show-ifdefs', read-only status is restored to previous value.
+        Set to non-nil if you want to make buffers read only while hiding.
+        After `show-ifdefs', read-only status is restored to previous value.
 
 \\{hide-ifdef-mode-map}"
   :group 'hide-ifdef :lighter " Ifdef"
   (if hide-ifdef-mode
       (progn
-       ;; inherit global values
-       (set (make-local-variable 'hide-ifdef-env)
-            (default-value 'hide-ifdef-env))
-       (set (make-local-variable 'hide-ifdef-hiding)
-            (default-value 'hide-ifdef-hiding))
-       (set (make-local-variable 'hif-outside-read-only) buffer-read-only)
-       (set (make-local-variable 'line-move-ignore-invisible) t)
-       (add-hook 'change-major-mode-hook
-                 (lambda () (hide-ifdef-mode -1)) nil t)
-
-       (add-to-invisibility-spec '(hide-ifdef . t))
-
-       (if hide-ifdef-initially
-           (hide-ifdefs)
-         (show-ifdefs)))
+        ;; inherit global values
+
+        ;; `hide-ifdef-env' is now a global variable.
+        ;; We can still simulate the behavior of older hideif versions (i.e.
+        ;; `hide-ifdef-env' being buffer local) by clearing this variable
+        ;; (C-c @ C) everytime before hiding current buffer.
+;;      (set (make-local-variable 'hide-ifdef-env)
+;;           (default-value 'hide-ifdef-env))
+        (set 'hide-ifdef-env (default-value 'hide-ifdef-env))
+        ;; Some C/C++ headers might have other ways to prevent reinclusion and
+        ;; thus would like `hide-ifdef-expand-reinclusion-protection' to be nil.
+        (set (make-local-variable 'hide-ifdef-expand-reinclusion-protection)
+             (default-value 'hide-ifdef-expand-reinclusion-protection))
+        (set (make-local-variable 'hide-ifdef-hiding)
+             (default-value 'hide-ifdef-hiding))
+        (set (make-local-variable 'hif-outside-read-only) buffer-read-only)
+        (set (make-local-variable 'line-move-ignore-invisible) t)
+        (add-hook 'change-major-mode-hook
+                  (lambda () (hide-ifdef-mode -1)) nil t)
+
+        (add-to-invisibility-spec '(hide-ifdef . t))
+
+        (if hide-ifdef-initially
+            (hide-ifdefs)
+          (show-ifdefs)))
     ;; else end hide-ifdef-mode
     (kill-local-variable 'line-move-ignore-invisible)
     (remove-from-invisibility-spec '(hide-ifdef . t))
     (when hide-ifdef-hiding
       (show-ifdefs))))
 
+(defun hif-clear-all-ifdef-defined ()
+  "Clears all symbols defined in `hide-ifdef-env'.
+It will backup this variable to `hide-ifdef-env-backup' before clearing to
+prevent accidental clearance."
+  (interactive)
+  (when (y-or-n-p "Clear all #defined symbols? ")
+    (setq hide-ifdef-env-backup hide-ifdef-env)
+    (setq hide-ifdef-env nil)))
 
 (defun hif-show-all ()
   "Show all of the text in the current buffer."
@@ -295,16 +361,64 @@ Several variables affect how the hiding is done:
   (while (= (logand 1 (skip-chars-backward "\\\\")) 1)
     (end-of-line 2)))
 
+(defun hif-merge-ifdef-region (start end)
+  "This function merges nearby ifdef regions to form a bigger overlay.
+The region is defined by START and END.  This will decrease the number of
+overlays created."
+  ;; Generally there is no need to call itself recursively since there should
+  ;; originally exists no un-merged regions; however, if a part of the file is
+  ;; hidden with `hide-ifdef-lines' equals to nil while another part with 't,
+  ;; this case happens.
+  ;; TODO: Should we merge? or just create a container overlay? -- this can
+  ;; prevent `hideif-show-ifdef' expanding too many hidden contents since there
+  ;; is only a big overlay exists there without any smaller overlays.
+  (save-restriction
+    (widen) ; Otherwise `point-min' and `point-max' will be restricted and thus
+                                        ; fail to find neighbor overlays
+    (let ((begovrs (overlays-in
+                    (max (- start 2) (point-min))
+                    (max (- start 1) (point-min))))
+          (endovrs (overlays-in
+                    (min (+ end 1) (point-max))
+                    (min (+ end 2) (point-max))))
+          (ob nil)
+          (oe nil)
+          b e)
+      ;; Merge overlays before START
+      (dolist (o begovrs)
+        (when (overlay-get o 'hide-ifdef)
+          (setq b (min start (overlay-start o))
+                e (max end (overlay-end o)))
+          (move-overlay o b e)
+          (hif-merge-ifdef-region b e)
+          (setq ob o)))
+      ;; Merge overlays after END
+      (dolist (o endovrs)
+        (when (overlay-get o 'hide-ifdef)
+          (setq b (min start (overlay-start o))
+                e (max end (overlay-end o)))
+          (move-overlay o b e)
+          (hif-merge-ifdef-region b e)
+          (setf oe o)))
+      ;; If both START and END merging happens, merge into bigger one
+      (when (and ob oe)
+        (let ((b (min (overlay-start ob) (overlay-start oe)))
+              (e (max (overlay-end ob) (overlay-end oe))))
+          (delete-overlay oe)
+          (move-overlay ob b e)
+          (hif-merge-ifdef-region b e)))
+      (or ob oe))))
+
 (defun hide-ifdef-region-internal (start end)
-  (remove-overlays start end 'hide-ifdef t)
+  (unless (hif-merge-ifdef-region start end)
   (let ((o (make-overlay start end)))
     (overlay-put o 'hide-ifdef t)
     (if hide-ifdef-shadow
-       (overlay-put o 'face 'hide-ifdef-shadow)
-      (overlay-put o 'invisible 'hide-ifdef))))
+        (overlay-put o 'face 'hide-ifdef-shadow)
+        (overlay-put o 'invisible 'hide-ifdef)))))
 
 (defun hide-ifdef-region (start end)
-  "START is the start of a #if or #else form.  END is the ending part.
+  "START is the start of a #if, #elif, or #else form.  END is the ending part.
 Everything including these lines is made invisible."
   (save-excursion
     (goto-char start) (hif-end-of-line) (setq start (point))
@@ -313,7 +427,9 @@ Everything including these lines is made invisible."
 
 (defun hif-show-ifdef-region (start end)
   "Everything between START and END is made visible."
-  (remove-overlays start end 'hide-ifdef t))
+  (let ((onum (length (overlays-in start end))))
+    (remove-overlays start end 'hide-ifdef t)
+    (/= onum (length (overlays-in start end)))))
 
 
 ;;===%%SF%% evaluation (Start)  ===
@@ -330,7 +446,7 @@ that form should be displayed.")
 
 
 (defun hif-set-var (var value)
-  "Prepend (var value) pair to `hide-ifdef-env'."
+  "Prepend (VAR VALUE) pair to `hide-ifdef-env'."
   (setq hide-ifdef-env (cons (cons var value) hide-ifdef-env)))
 
 (declare-function semantic-c-hideif-lookup  "semantic/bovine/c" (var))
@@ -338,11 +454,11 @@ that form should be displayed.")
 
 (defun hif-lookup (var)
   (or (when (bound-and-true-p semantic-c-takeover-hideif)
-       (semantic-c-hideif-lookup var))
+        (semantic-c-hideif-lookup var))
       (let ((val (assoc var hide-ifdef-env)))
-       (if val
-           (cdr val)
-         hif-undefined-symbol))))
+        (if val
+            (cdr val)
+          hif-undefined-symbol))))
 
 (defun hif-defined (var)
   (cond
@@ -358,25 +474,43 @@ that form should be displayed.")
 ;;===%%SF%% parsing (Start)  ===
 ;;;  The code that understands what ifs and ifdef in files look like.
 
-(defconst hif-cpp-prefix "\\(^\\|\r\\)[ \t]*#[ \t]*")
-(defconst hif-ifndef-regexp (concat hif-cpp-prefix "ifndef"))
-(defconst hif-ifx-regexp (concat hif-cpp-prefix "if\\(n?def\\)?[ \t]+"))
-(defconst hif-else-regexp (concat hif-cpp-prefix "else"))
-(defconst hif-endif-regexp (concat hif-cpp-prefix "endif"))
+(defconst hif-cpp-prefix      "\\(^\\|\r\\)[ \t]*#[ \t]*")
+(defconst hif-ifxdef-regexp   (concat hif-cpp-prefix "if\\(n\\)?def"))
+(defconst hif-ifndef-regexp   (concat hif-cpp-prefix "ifndef"))
+(defconst hif-ifx-regexp      (concat hif-cpp-prefix "if\\(n?def\\)?[ \t]+"))
+(defconst hif-elif-regexp     (concat hif-cpp-prefix "elif"))
+(defconst hif-else-regexp     (concat hif-cpp-prefix "else"))
+(defconst hif-endif-regexp    (concat hif-cpp-prefix "endif"))
 (defconst hif-ifx-else-endif-regexp
-  (concat hif-ifx-regexp "\\|" hif-else-regexp "\\|" hif-endif-regexp))
-
-;; Used to store the current token and the whole token list during parsing.
-;; Only bound dynamically.
+  (concat hif-ifx-regexp "\\|" hif-elif-regexp "\\|" hif-else-regexp "\\|"
+          hif-endif-regexp))
+(defconst hif-macro-expr-prefix-regexp
+  (concat hif-cpp-prefix "\\(if\\(n?def\\)?\\|elif\\|define\\)[ \t]+"))
+
+(defconst hif-white-regexp    "[ \t]*")
+(defconst hif-define-regexp   (concat hif-cpp-prefix "\\(define\\|undef\\)"))
+(defconst hif-id-regexp       (concat "[[:alpha:]_][[:alnum:]_]*"))
+(defconst hif-macroref-regexp
+  (concat hif-white-regexp "\\(" hif-id-regexp "\\)" hif-white-regexp
+          "\\("
+          "(" hif-white-regexp
+          "\\(" hif-id-regexp "\\)?" hif-white-regexp
+          "\\(" "," hif-white-regexp hif-id-regexp hif-white-regexp "\\)*"
+          "\\(\\.\\.\\.\\)?" hif-white-regexp
+          ")"
+          "\\)?" ))
+
+;; Store the current token and the whole token list during parsing.
+;; Bound dynamically.
 (defvar hif-token)
 (defvar hif-token-list)
 
 (defconst hif-token-alist
   '(("||"  . hif-or)
     ("&&"  . hif-and)
-    ("|"  . hif-logior)
+    ("|"   . hif-logior)
     ("^"   . hif-logxor)
-    ("&"  . hif-logand)
+    ("&"   . hif-logand)
     ("<<"  . hif-shiftleft)
     (">>"  . hif-shiftright)
     ("=="  . hif-equal)
@@ -384,23 +518,28 @@ that form should be displayed.")
     ;; expression syntax, because they are still relevant for the tokenizer,
     ;; especially in conjunction with ##.
     ("="   . hif-assign)
-    ("!=" . hif-notequal)
+    ("!="  . hif-notequal)
     ("##"  . hif-token-concat)
     ("!"   . hif-not)
     ("~"   . hif-lognot)
     ("("   . hif-lparen)
     (")"   . hif-rparen)
-    (">"  . hif-greater)
-    ("<"  . hif-less)
-    (">=" . hif-greater-equal)
-    ("<=" . hif-less-equal)
-    ("+"  . hif-plus)
-    ("-"  . hif-minus)
+    (">"   . hif-greater)
+    ("<"   . hif-less)
+    (">="  . hif-greater-equal)
+    ("<="  . hif-less-equal)
+    ("+"   . hif-plus)
+    ("-"   . hif-minus)
     ("*"   . hif-multiply)
     ("/"   . hif-divide)
     ("%"   . hif-modulo)
-    ("?"  . hif-conditional)
-    (":"  . hif-colon)))
+    ("?"   . hif-conditional)
+    (":"   . hif-colon)
+    (","   . hif-comma)
+    ("#"   . hif-stringify)
+    ("..." . hif-etc)))
+
+(defconst hif-valid-token-list (mapcar 'cdr hif-token-alist))
 
 (defconst hif-token-regexp
   (concat (regexp-opt (mapcar 'car hif-token-alist))
@@ -410,47 +549,71 @@ that form should be displayed.")
 
 (defconst hif-string-literal-regexp  "\\(\"\\(?:[^\"\\]\\|\\\\.\\)*\"\\)")
 
+(defun hif-string-to-number (string &optional base)
+  "Like `string-to-number', but it understands non-decimal floats."
+  (if (or (not base) (= base 10))
+      (string-to-number string base)
+    (let* ((parts (split-string string "\\." t "[ \t]+"))
+           (frac (cadr parts))
+           (fraclen (length frac))
+           (quot (expt (if (zerop fraclen)
+                           base
+                           (* base 1.0)) fraclen)))
+      (/ (string-to-number (concat (car parts) frac) base) quot))))
+
+;; The dynamic binding variable `hif-simple-token-only' is shared only by
+;; `hif-tokenize' and `hif-find-define'. The purpose is to prevent `hif-tokenize'
+;; from returning one more value to indicate a simple token is scanned. This help
+;; speeding up macro evaluation on those very simple cases like integers or
+;; literals.
+;; Check the long comments before `hif-find-define' for more details. [lukelee]
+(defvar hif-simple-token-only)
 
 (defun hif-tokenize (start end)
   "Separate string between START and END into a list of tokens."
   (let ((token-list nil))
+    (setq hif-simple-token-only t)
     (with-syntax-table hide-ifdef-syntax-table
       (save-excursion
-       (goto-char start)
-       (while (progn (forward-comment (point-max)) (< (point) end))
-         ;; (message "expr-start = %d" expr-start) (sit-for 1)
-         (cond
-          ((looking-at "\\\\\n")
-           (forward-char 2))
+        (goto-char start)
+        (while (progn (forward-comment (point-max)) (< (point) end))
+          ;; (message "expr-start = %d" expr-start) (sit-for 1)
+          (cond
+           ((looking-at "\\\\\n")
+            (forward-char 2))
 
            ((looking-at hif-string-literal-regexp)
             (push (substring-no-properties (match-string 1)) token-list)
             (goto-char (match-end 0)))
-          ((looking-at hif-token-regexp)
-           (let ((token (buffer-substring (point) (match-end 0))))
-             (goto-char (match-end 0))
-             ;; (message "token: %s" token) (sit-for 1)
-             (push
+
+           ((looking-at hif-token-regexp)
+            (let ((token (buffer-substring-no-properties
+                          (point) (match-end 0))))
+              (goto-char (match-end 0))
+              ;; (message "token: %s" token) (sit-for 1)
+              (push
                (or (cdr (assoc token hif-token-alist))
                    (if (string-equal token "defined") 'hif-defined)
                    ;; TODO:
                    ;; 1. postfix 'l', 'll', 'ul' and 'ull'
-                   ;; 2. floating number formats
-                   ;; 3. hexadecimal/octal floats
-                   ;; 4. 098 is interpreted as octal conversion error
-                   ;; FIXME: string-to-number does not convert hex floats
+                   ;; 2. floating number formats (like 1.23e4)
+                   ;; 3. 098 is interpreted as octal conversion error
                    (if (string-match "0x\\([0-9a-fA-F]+\\.?[0-9a-fA-F]*\\)"
                                      token)
-                       (string-to-number (match-string 1 token) 16)) ;; hex
-                   ;; FIXME: string-to-number does not convert octal floats
+                       (hif-string-to-number (match-string 1 token) 16)) ;; hex
                    (if (string-match "\\`0[0-9]+\\(\\.[0-9]+\\)?\\'" token)
-                       (string-to-number token 8)) ;; octal
+                       (hif-string-to-number token 8)) ;; octal
                    (if (string-match "\\`[1-9][0-9]*\\(\\.[0-9]+\\)?\\'"
                                      token)
                        (string-to-number token)) ;; decimal
-                   (intern token))
+                   (prog1 (intern token)
+                     (setq hif-simple-token-only nil)))
                token-list)))
-          (t (error "Bad #if expression: %s" (buffer-string)))))))
+
+           ((looking-at "\r") ; Sometimes MS-Windows user will leave CR in
+            (forward-char 1)) ;  the source code. Let's not get stuck here.
+           (t (error "Bad #if expression: %s" (buffer-string)))))))
+
     (nreverse token-list)))
 
 ;;------------------------------------------------------------------------
@@ -485,9 +648,116 @@ that form should be displayed.")
   "Pop the next token from token-list into the let variable `hif-token'."
   (setq hif-token (pop hif-token-list)))
 
-(defun hif-parse-if-exp (token-list)
-  "Parse the TOKEN-LIST.  Return translated list in prefix form."
-  (let ((hif-token-list token-list))
+(defsubst hif-if-valid-identifier-p (id)
+  (not (or (numberp id)
+           (stringp id))))
+
+(defun hif-define-operator (tokens)
+  "`Upgrade' hif-define xxx to '(hif-define xxx)' so it won't be subsitituted."
+  (let ((result nil)
+        (tok nil))
+    (while (setq tok (pop tokens))
+      (push
+       (if (eq tok 'hif-defined)
+           (progn
+             (setq tok (cadr tokens))
+             (if (eq (car tokens) 'hif-lparen)
+                 (if (and (hif-if-valid-identifier-p tok)
+                          (eq (cl-caddr tokens) 'hif-rparen))
+                     (setq tokens (cl-cdddr tokens))
+                   (error "#define followed by non-identifier: %S" tok))
+               (setq tok (car tokens)
+                     tokens (cdr tokens))
+               (unless (hif-if-valid-identifier-p tok)
+                 (error "#define followed by non-identifier: %S" tok)))
+             (list 'hif-defined 'hif-lparen tok 'hif-rparen))
+         tok)
+       result))
+    (nreverse result)))
+
+(defun hif-flatten (l)
+  "Flatten a tree."
+  (apply #'nconc
+         (mapcar (lambda (x) (if (listp x)
+                                 (hif-flatten x)
+                               (list x))) l)))
+
+(defun hif-expand-token-list (tokens &optional macroname expand_list)
+  "Perform expansion on TOKENS till everything expanded.
+Self-reference (directly or indirectly) tokens are not expanded.
+EXPAND_LIST is the list of macro names currently being expanded, used for
+detecting self-reference."
+  (catch 'self-referencing
+    (let ((expanded nil)
+          (remains (hif-define-operator
+                    (hif-token-concatenation
+                     (hif-token-stringification tokens))))
+          tok rep)
+      (if macroname
+          (setq expand_list (cons macroname expand_list)))
+      ;; Expanding all tokens till list exhausted
+      (while (setq tok (pop remains))
+        (if (memq tok expand_list)
+            ;; For self-referencing tokens, don't expand it
+            (throw 'self-referencing tokens))
+        (push
+         (cond
+          ((or (memq tok hif-valid-token-list)
+               (numberp tok)
+               (stringp tok))
+           tok)
+
+          ((setq rep (hif-lookup tok))
+           (if (and (listp rep)
+                    (eq (car rep) 'hif-define-macro)) ; A defined macro
+               ;; Recursively expand it
+               (if (cadr rep) ; Argument list is not nil
+                   (if (not (eq (car remains) 'hif-lparen))
+                       ;; No argument, no invocation
+                       tok
+                     ;; Argumented macro, get arguments and invoke it.
+                     ;; Dynamically bind hif-token-list and hif-token
+                     ;; for hif-macro-supply-arguments
+                     (let* ((hif-token-list (cdr remains))
+                            (hif-token nil)
+                            (parmlist (mapcar #'hif-expand-token-list
+                                              (hif-get-argument-list)))
+                            (result
+                             (hif-expand-token-list
+                              (hif-macro-supply-arguments tok parmlist)
+                              tok expand_list)))
+                       (setq remains (cons hif-token hif-token-list))
+                       result))
+                 ;; Argument list is nil, direct expansion
+                 (setq rep (hif-expand-token-list
+                            (cl-caddr rep) ; Macro's token list
+                            tok expand_list))
+                 ;; Replace all remaining references immediately
+                 (setq remains (cl-substitute tok rep remains))
+                 rep)
+             ;; Lookup tok returns an atom
+             rep))
+
+          ;;[2013-10-22 16:06:12 +0800] Must keep the token, removing
+          ;; this token might results in an incomplete expression that
+          ;; cannot be parsed further.
+          ;;((= 1 (hif-defined tok)) ; defined (hif-defined tok)=1,
+          ;;  ;;but empty (hif-lookup tok)=nil, thus remove this token
+          ;; (setq remains (delete tok remains))
+          ;; nil)
+
+          (t ; Usual IDs
+           tok))
+
+         expanded))
+
+      (hif-flatten (nreverse expanded)))))
+
+(defun hif-parse-exp (token-list &optional macroname)
+  "Parse the TOKEN-LIST.
+Return translated list in prefix form.  MACRONAME is applied when invoking
+macros to prevent self-reference."
+  (let ((hif-token-list (hif-expand-token-list token-list macroname)))
     (hif-nexttoken)
     (prog1
         (and hif-token
@@ -496,31 +766,31 @@ that form should be displayed.")
           (error "Error: unexpected token: %s" hif-token)))))
 
 (defun hif-exprlist ()
-  "Parse an exprlist: expr { ',' expr}"
+  "Parse an exprlist: expr { ',' expr}."
   (let ((result (hif-expr)))
     (if (eq hif-token 'hif-comma)
-       (let ((temp (list result)))
-         (while
-           (progn
-             (hif-nexttoken)
-             (push (hif-expr) temp)
-             (eq hif-token 'hif-comma)))
-         (cons 'hif-comma (nreverse temp)))
+        (let ((temp (list result)))
+          (while
+            (progn
+              (hif-nexttoken)
+              (push (hif-expr) temp)
+              (eq hif-token 'hif-comma)))
+          (cons 'hif-comma (nreverse temp)))
       result)))
 
 (defun hif-expr ()
   "Parse an expression as found in #if.
-       expr : or-expr | or-expr '?' expr ':' expr."
+expr : or-expr | or-expr '?' expr ':' expr."
   (let ((result (hif-or-expr))
-       middle)
+        middle)
     (while (eq hif-token 'hif-conditional)
       (hif-nexttoken)
       (setq middle (hif-expr))
       (if (eq hif-token 'hif-colon)
-         (progn
-           (hif-nexttoken)
-           (setq result (list 'hif-conditional result middle (hif-expr))))
-       (error "Error: unexpected token: %s" hif-token)))
+          (progn
+            (hif-nexttoken)
+            (setq result (list 'hif-conditional result middle (hif-expr))))
+        (error "Error: unexpected token: %s" hif-token)))
     result))
 
 (defun hif-or-expr ()
@@ -577,7 +847,8 @@ that form should be displayed.")
   "Parse a comp-expr : logshift | comp-expr `<'|`>'|`>='|`<=' logshift."
   (let ((result (hif-logshift-expr))
         (comp-token nil))
-    (while (memq hif-token '(hif-greater hif-less hif-greater-equal hif-less-equal))
+    (while (memq hif-token '(hif-greater hif-less hif-greater-equal
+                                         hif-less-equal))
       (setq comp-token hif-token)
       (hif-nexttoken)
       (setq result (list comp-token result (hif-logshift-expr))))
@@ -608,7 +879,7 @@ that form should be displayed.")
   "Parse an expression with *,/,%.
        muldiv : factor | muldiv '*|/|%' factor."
   (let ((result (hif-factor))
-       (math-op nil))
+        (math-op nil))
     (while (memq hif-token '(hif-multiply hif-divide hif-modulo))
       (setq math-op hif-token)
       (hif-nexttoken)
@@ -616,7 +887,9 @@ that form should be displayed.")
   result))
 
 (defun hif-factor ()
-  "Parse a factor: '!' factor | '~' factor | '(' expr ')' | 'defined(' id ')' | 'id(parmlist)' | strings | id."
+  "Parse a factor.
+factor : '!' factor | '~' factor | '(' expr ')' | 'defined(' id ')' |
+         'id(parmlist)' | strings | id."
   (cond
    ((eq hif-token 'hif-not)
     (hif-nexttoken)
@@ -630,36 +903,119 @@ that form should be displayed.")
     (hif-nexttoken)
     (let ((result (hif-exprlist)))
       (if (not (eq hif-token 'hif-rparen))
-         (error "Bad token in parenthesized expression: %s" hif-token)
-       (hif-nexttoken)
-       result)))
+          (error "Bad token in parenthesized expression: %s" hif-token)
+        (hif-nexttoken)
+        result)))
 
    ((eq hif-token 'hif-defined)
     (hif-nexttoken)
     (let ((paren (when (eq hif-token 'hif-lparen) (hif-nexttoken) t))
-         (ident hif-token))
+          (ident hif-token))
       (if (memq hif-token '(or and not hif-defined hif-lparen hif-rparen))
-         (error "Error: unexpected token: %s" hif-token))
+          (error "Error: unexpected token: %s" hif-token))
       (when paren
-       (hif-nexttoken)
+        (hif-nexttoken)
         (unless (eq hif-token 'hif-rparen)
-         (error "Error: expected \")\" after identifier")))
+          (error "Error: expected \")\" after identifier")))
       (hif-nexttoken)
       `(hif-defined (quote ,ident))))
 
    ((numberp hif-token)
     (prog1 hif-token (hif-nexttoken)))
+   ((stringp hif-token)
+    (hif-string-concatenation))
 
    ;; Unary plus/minus.
    ((memq hif-token '(hif-minus hif-plus))
     (list (prog1 hif-token (hif-nexttoken)) 0 (hif-factor)))
 
-   (t                                  ; identifier
+   (t                                   ; identifier
     (let ((ident hif-token))
-      (if (memq ident '(or and))
-         (error "Error: missing identifier"))
       (hif-nexttoken)
-      `(hif-lookup (quote ,ident))))))
+      (if (eq hif-token 'hif-lparen)
+          (hif-place-macro-invocation ident)
+        `(hif-lookup (quote ,ident)))))))
+
+(defun hif-get-argument-list ()
+  (let ((nest 0)
+        (parmlist nil) ; A "token" list of parameters, will later be parsed
+        (parm nil))
+
+    (while (or (not (eq (hif-nexttoken) 'hif-rparen))
+               (/= nest 0))
+      (if (eq (car (last parm)) 'hif-comma)
+          (setq parm nil))
+      (cond
+       ((eq hif-token 'hif-lparen)
+        (setq nest (1+ nest)))
+       ((eq hif-token 'hif-rparen)
+        (setq nest (1- nest)))
+       ((and (eq hif-token 'hif-comma)
+             (= nest 0))
+        (push (nreverse parm) parmlist)
+        (setq parm nil)))
+      (push hif-token parm))
+
+    (push (nreverse parm) parmlist) ; Okay even if PARM is nil
+    (hif-nexttoken) ; Drop the `hif-rparen', get next token
+    (nreverse parmlist)))
+
+(defun hif-place-macro-invocation (ident)
+  (let ((parmlist (hif-get-argument-list)))
+    `(hif-invoke (quote ,ident) (quote ,parmlist))))
+
+(defun hif-string-concatenation ()
+  "Parse concatenated strings: string | strings string."
+  (let ((result (substring-no-properties hif-token)))
+    (while (stringp (hif-nexttoken))
+      (setq result (concat
+                    (substring result 0 -1)    ; remove trailing '"'
+                    (substring hif-token 1)))) ; remove leading  '"'
+    result))
+
+(defun hif-define-macro (_parmlist _token-body)
+  "A marker for defined macro with arguments.
+This macro cannot be evaluated alone without parameters inputed."
+  ;;TODO: input arguments at run time, use minibuffer to query all arguments
+  (error
+   "Argumented macro cannot be evaluated without passing any parameter"))
+
+(defun hif-stringify (a)
+  "Stringify a number, string or symbol."
+  (cond
+   ((numberp a)
+    (number-to-string a))
+   ((atom a)
+    (symbol-name a))
+   ((stringp a)
+    (concat "\"" a "\""))
+   (t
+    (error "Invalid token to stringify"))))
+
+(defun intern-safe (str)
+  (if (stringp str)
+      (intern str)))
+
+(defun hif-token-concat (a b)
+  "Concatenate two tokens into a longer token.
+Currently support only simple token concatenation.  Also support weird (but
+valid) token concatenation like '>' ## '>' becomes '>>'.  Here we take care only
+those that can be evaluated during preprocessing time and ignore all those that
+can only be evaluated at C(++) runtime (like '++', '--' and '+='...)."
+  (if (or (memq a hif-valid-token-list)
+          (memq b hif-valid-token-list))
+      (let* ((ra (car (rassq a hif-token-alist)))
+             (rb (car (rassq b hif-token-alist)))
+             (result (and ra rb
+                          (cdr (assoc (concat ra rb) hif-token-alist)))))
+        (or result
+            ;;(error "Invalid token to concatenate")
+            (error "Concatenating \"%s\" and \"%s\" does not give a valid \
+preprocessing token"
+                   (or ra (symbol-name a))
+                   (or rb (symbol-name b)))))
+    (intern-safe (concat (hif-stringify a)
+                         (hif-stringify b)))))
 
 (defun hif-mathify (val)
   "Treat VAL as a number: if it's t or nil, use 1 or 0."
@@ -715,30 +1071,159 @@ that form should be displayed.")
 
 
 (defun hif-comma (&rest expr)
-  "Evaluate a list of expr, return the result of the last item."
+  "Evaluate a list of EXPR, return the result of the last item."
   (let ((result nil))
     (dolist (e expr)
       (ignore-errors
         (setq result (funcall hide-ifdef-evaluator e))))
     result))
 
+(defun hif-token-stringification (l)
+  "Scan token list for `hif-stringify' ('#') token and stringify the next token."
+  (let (result)
+    (while l
+      (push (if (eq (car l) 'hif-stringify)
+                (prog1
+                    (if (cadr l)
+                        (hif-stringify (cadr l))
+                      (error "No token to stringify"))
+                  (setq l (cdr l)))
+              (car l))
+            result)
+      (setq l (cdr l)))
+    (nreverse result)))
+
+(defun hif-token-concatenation (l)
+  "Scan token list for `hif-token-concat' ('##') token and concatenate two tokens."
+  (let ((prev nil)
+        result)
+    (while l
+      (while (eq (car l) 'hif-token-concat)
+        (unless prev
+          (error "No token before ## to concatenate"))
+        (unless (cdr l)
+          (error "No token after ## to concatenate"))
+        (setq prev (hif-token-concat prev (cadr l)))
+        (setq l (cddr l)))
+      (if prev
+          (setq result (append result (list prev))))
+      (setq prev (car l)
+            l (cdr l)))
+    (if prev
+        (append result (list prev))
+      result)))
+
+(defun hif-delimit (lis atom)
+  (nconc (cl-mapcan (lambda (l) (list l atom))
+                    (butlast lis))
+         (last lis)))
+
+;; Perform token replacement:
+(defun hif-macro-supply-arguments (macro-name actual-parms)
+  "Expand a macro call, replace ACTUAL-PARMS in the macro body."
+  (let* ((SA                   (assoc macro-name hide-ifdef-env))
+         (macro                (and SA
+                                    (cdr SA)
+                                    (eq (cadr SA) 'hif-define-macro)
+                                    (cddr SA)))
+         (formal-parms         (and macro (car macro)))
+         (macro-body           (and macro (cadr macro)))
+         actual-count
+         formal-count
+         formal
+         etc)
+
+    (when (and actual-parms formal-parms macro-body)
+      ;; For each actual parameter, evaluate each one and associate it
+      ;; with an actual parameter, put it into local table and finally
+      ;; evaluate the macro body.
+      (if (setq etc (eq (car formal-parms) 'hif-etc))
+          ;; Take care of `hif-etc' first. Prefix `hif-comma' back if needed.
+          (setq formal-parms (cdr formal-parms)))
+      (setq formal-count (length formal-parms)
+            actual-count (length actual-parms))
+
+      (if (> formal-count actual-count)
+          (error "Too few parmameter for macro %S" macro-name)
+        (if (< formal-count actual-count)
+            (or etc
+                (error "Too many parameters for macro %S" macro-name))))
+
+      ;; Perform token replacement on the MACRO-BODY with the parameters
+      (while (setq formal (pop formal-parms))
+        ;; Prevent repetitive substitutation, thus cannot use `subst'
+        ;; for example:
+        ;; #define mac(a,b) (a+b)
+        ;; #define testmac mac(b,y)
+        ;; testmac should expand to (b+y): replace of argument a and b
+        ;; occurs simultaneously, not sequentially. If sequentially,
+        ;; according to the argument order, it will become:
+        ;; 1. formal parm #1 'a' replaced by actual parm 'b', thus (a+b)
+        ;;    becomes (b+b)
+        ;; 2. formal parm #2 'b' replaced by actual parm 'y', thus (b+b)
+        ;;    becomes (y+y).
+        (setq macro-body
+              ;; Unlike `subst', `substitute' replace only the top level
+              ;; instead of the whole tree; more importantly, it's not
+              ;; destructive.
+              (cl-substitute (if (and etc (null formal-parms))
+                                 (hif-delimit actual-parms 'hif-comma)
+                               (car actual-parms))
+                             formal macro-body))
+        (setq actual-parms (cdr actual-parms)))
+
+      ;; Replacement completed, flatten the whole token list
+      (setq macro-body (hif-flatten macro-body))
+
+      ;; Stringification and token concatenation happens here
+      (hif-token-concatenation (hif-token-stringification macro-body)))))
+
+(defun hif-invoke (macro-name actual-parms)
+  "Invoke a macro by expanding it, reparse macro-body and finally invoke it."
+  ;; Reparse the macro body and evaluate it
+  (funcall hide-ifdef-evaluator
+           (hif-parse-exp
+            (hif-macro-supply-arguments macro-name actual-parms)
+            macro-name)))
 
 ;;;----------- end of parser -----------------------
 
 
-(defun hif-canonicalize ()
-  "When at beginning of #ifX, return a Lisp expression for its condition."
+(defun hif-canonicalize-tokens (regexp) ; For debugging
+  "Return the expanded result of the scanned tokens."
   (save-excursion
-    (let ((negate (looking-at hif-ifndef-regexp)))
-      (re-search-forward hif-ifx-regexp)
-      (let* ((tokens (hif-tokenize (point)
-                                  (progn (hif-end-of-line) (point))))
-            (expr (hif-parse-if-exp tokens)))
-       ;; (message "hif-canonicalized: %s" expr)
-       (if negate
-           (list 'hif-not expr)
-         expr)))))
-
+    (re-search-forward regexp)
+    (let* ((curr-regexp (match-string 0))
+           (defined (string-match hif-ifxdef-regexp curr-regexp))
+           (negate (and defined
+                        (string= (match-string 2 curr-regexp) "n")))
+           (hif-simple-token-only nil) ;; Dynamic binding var for `hif-tokenize'
+           (tokens (hif-tokenize (point)
+                                 (progn (hif-end-of-line) (point)))))
+      (if defined
+          (setq tokens (list 'hif-defined tokens)))
+      (if negate
+          (setq tokens (list 'hif-not tokens)))
+      tokens)))
+
+(defun hif-canonicalize (regexp)
+  "Return a Lisp expression for its condition by scanning current buffer.
+Do this when cursor is at the beginning of `regexp' (i.e. #ifX)."
+  (let ((case-fold-search nil))
+    (save-excursion
+      (re-search-forward regexp)
+      (let* ((curr-regexp (match-string 0))
+             (defined (string-match hif-ifxdef-regexp curr-regexp))
+             (negate (and defined
+                          (string= (match-string 2 curr-regexp) "n")))
+             (hif-simple-token-only nil) ; Dynamic binding for `hif-tokenize'
+             (tokens (hif-tokenize (point)
+                                   (progn (hif-end-of-line) (point)))))
+        (if defined
+            (setq tokens (list 'hif-defined tokens)))
+        (if negate
+            (setq tokens (list 'hif-not tokens)))
+        (hif-parse-exp tokens)))))
 
 (defun hif-find-any-ifX ()
   "Move to next #if..., or #ifndef, at point or after."
@@ -749,10 +1234,10 @@ that form should be displayed.")
 
 
 (defun hif-find-next-relevant ()
-  "Move to next #if..., #else, or #endif, after the current line."
+  "Move to next #if..., #elif..., #else, or #endif, after the current line."
   ;; (message "hif-find-next-relevant at %d" (point))
   (end-of-line)
-  ;; avoid infinite recursion by only going to beginning of line if match found
+  ;; Avoid infinite recursion by only going to line-beginning if match found
   (if (re-search-forward hif-ifx-else-endif-regexp (point-max) t)
       (beginning-of-line)))
 
@@ -760,33 +1245,37 @@ that form should be displayed.")
   "Move to previous #if..., #else, or #endif, before the current line."
   ;; (message "hif-find-previous-relevant at %d" (point))
   (beginning-of-line)
-  ;; avoid infinite recursion by only going to beginning of line if match found
+  ;; Avoid infinite recursion by only going to line-beginning if match found
   (if (re-search-backward hif-ifx-else-endif-regexp (point-min) t)
      (beginning-of-line)))
 
 
-(defun hif-looking-at-ifX ()           ;; Should eventually see #if
-  (looking-at hif-ifx-regexp))
+(defun hif-looking-at-ifX ()
+  (looking-at hif-ifx-regexp))   ; Should eventually see #if
 (defun hif-looking-at-endif ()
   (looking-at hif-endif-regexp))
 (defun hif-looking-at-else ()
   (looking-at hif-else-regexp))
 
+(defun hif-looking-at-elif ()
+  (looking-at hif-elif-regexp))
 
 
 (defun hif-ifdef-to-endif ()
-  "If positioned at #ifX or #else form, skip to corresponding #endif."
+  "If positioned at #ifX, #elif, or #else form, skip to corresponding #endif."
   ;; (message "hif-ifdef-to-endif at %d" (point)) (sit-for 1)
   (hif-find-next-relevant)
   (cond ((hif-looking-at-ifX)
-        (hif-ifdef-to-endif) ; find endif of nested if
-        (hif-ifdef-to-endif)) ; find outer endif or else
-       ((hif-looking-at-else)
-        (hif-ifdef-to-endif)) ; find endif following else
-       ((hif-looking-at-endif)
-        'done)
-       (t
-        (error "Mismatched #ifdef #endif pair"))))
+         (hif-ifdef-to-endif) ; Find endif of nested if
+         (hif-ifdef-to-endif)) ; Find outer endif or else
+        ((hif-looking-at-elif)
+         (hif-ifdef-to-endif))
+        ((hif-looking-at-else)
+         (hif-ifdef-to-endif)) ; Find endif following else
+        ((hif-looking-at-endif)
+         'done)
+        (t
+         (error "Mismatched #ifdef #endif pair"))))
 
 
 (defun hif-endif-to-ifdef ()
@@ -795,15 +1284,18 @@ that form should be displayed.")
   (let ((start (point)))
     (hif-find-previous-relevant)
     (if (= start (point))
-       (error "Mismatched #ifdef #endif pair")))
+        (error "Mismatched #ifdef #endif pair")))
   (cond ((hif-looking-at-endif)
-        (hif-endif-to-ifdef) ; find beginning of nested if
-        (hif-endif-to-ifdef)) ; find beginning of outer if or else
-       ((hif-looking-at-else)
-        (hif-endif-to-ifdef))
-       ((hif-looking-at-ifX)
-        'done)
-       (t)))                   ; never gets here
+         (hif-endif-to-ifdef) ; Find beginning of nested if
+         (hif-endif-to-ifdef)) ; Find beginning of outer if or else
+        ((hif-looking-at-elif)
+         (hif-endif-to-ifdef))
+        ((hif-looking-at-else)
+         (hif-endif-to-ifdef))
+        ((hif-looking-at-ifX)
+         'done)
+        (t
+         (error "Mismatched #endif"))))                 ; never gets here
 
 
 (defun forward-ifdef (&optional arg)
@@ -897,26 +1389,25 @@ With argument, do this that many times."
 ;;===%%SF%% hide-ifdef-hiding (Start)  ===
 
 
-;;; A range is a structure with four components:
-;;; ELSE-P     True if there was an else clause for the ifdef.
-;;; START      The start of the range. (beginning of line)
-;;; ELSE       The else marker (beginning of line)
-;;;                    Only valid if ELSE-P is true.
-;;; END                The end of the range.  (beginning of line)
+;; A range is a structure with four components:
+;; START       The start of the range. (beginning of line)
+;; ELSE        The else marker (beginning of line)
+;; END         The end of the range.  (beginning of line)
+;; ELIF        A sequence of #elif markers (beginning of line)
 
-(defsubst hif-make-range (start end &optional else)
-  (list start else end))
+(defsubst hif-make-range (start end &optional else elif)
+  (list start else end elif))
 
 (defsubst hif-range-start (range) (elt range 0))
 (defsubst hif-range-else (range) (elt range 1))
 (defsubst hif-range-end (range) (elt range 2))
+(defsubst hif-range-elif (range) (elt range 3))
 
 
-
-;;; Find-Range
-;;; The workhorse, it delimits the #if region.  Reasonably simple:
-;;; Skip until an #else or #endif is found, remembering positions.  If
-;;; an #else was found, skip some more, looking for the true #endif.
+;; Find-Range
+;; The workhorse, it delimits the #if region.  Reasonably simple:
+;; Skip until an #else or #endif is found, remembering positions.  If
+;; an #else was found, skip some more, looking for the true #endif.
 
 (defun hif-find-range ()
   "Return a Range structure describing the current #if region.
@@ -925,35 +1416,40 @@ Point is left unchanged."
   (save-excursion
     (beginning-of-line)
     (let ((start (point))
-         (else nil)
-         (end nil))
-      ;; Part one.  Look for either #endif or #else.
+          (elif nil)
+          (else nil)
+          (end nil))
+      ;; Part one.  Look for either #elif, #else or #endif.
       ;; This loop-and-a-half dedicated to E. Dijkstra.
-      (while (progn
-              (hif-find-next-relevant)
-              (hif-looking-at-ifX))            ; Skip nested ifdef
-       (hif-ifdef-to-endif))
-      ;; Found either a #else or an #endif.
-      (cond ((hif-looking-at-else)
-            (setq else (point)))
-           (t
-            (setq end (point)))) ; (line-end-position)
+      (while (and (not else) (not end))
+        (while (progn
+                 (hif-find-next-relevant)
+                 (hif-looking-at-ifX))            ; Skip nested ifdef
+          (hif-ifdef-to-endif))
+        ;; Found either a #else, #elif, or an #endif.
+        (cond ((hif-looking-at-elif)
+               (setq elif (nconc elif (list (point)))))
+              ((hif-looking-at-else)
+               (setq else (point)))
+              (t
+               (setq end (point)))))
       ;; If found #else, look for #endif.
       (when else
-       (while (progn
-                (hif-find-next-relevant)
-                (hif-looking-at-ifX))  ; Skip nested ifdef
-         (hif-ifdef-to-endif))
-       (if (hif-looking-at-else)
-           (error "Found two elses in a row?  Broken!"))
-       (setq end (point)))            ; (line-end-position)
-      (hif-make-range start end else))))
+        (while (progn
+                 (hif-find-next-relevant)
+                 (hif-looking-at-ifX))  ; Skip nested ifdef
+          (hif-ifdef-to-endif))
+        (if (hif-looking-at-else)
+            (error "Found two elses in a row?  Broken!"))
+        (setq end (point)))            ; (line-end-position)
+      (hif-make-range start end else elif))))
 
 
-;;; A bit slimy.
+;; A bit slimy.
 
 (defun hif-hide-line (point)
-  "Hide the line containing point.  Does nothing if `hide-ifdef-lines' is nil."
+  "Hide the line containing point.
+Does nothing if `hide-ifdef-lines' is nil."
   (when hide-ifdef-lines
     (save-excursion
       (goto-char point)
@@ -961,80 +1457,323 @@ Point is left unchanged."
        (line-beginning-position) (progn (hif-end-of-line) (point))))))
 
 
-;;;  Hif-Possibly-Hide
-;;;  There are four cases.  The #ifX expression is "taken" if it
-;;;  the hide-ifdef-evaluator returns T.  Presumably, this means the code
-;;;  inside the #ifdef would be included when the program was
-;;;  compiled.
-;;;
-;;;  Case 1:  #ifX taken, and there's an #else.
-;;;    The #else part must be hidden.  The #if (then) part must be
-;;;    processed for nested #ifX's.
-;;;  Case 2:  #ifX taken, and there's no #else.
-;;;    The #if part must be processed for nested #ifX's.
-;;;  Case 3:  #ifX not taken, and there's an #else.
-;;;    The #if part must be hidden.  The #else part must be processed
-;;;    for nested #ifs.
-;;;  Case 4:  #ifX not taken, and there's no #else.
-;;;    The #ifX part must be hidden.
-;;;
-;;;  Further processing is done by narrowing to the relevant region
-;;;  and just recursively calling hide-ifdef-guts.
-;;;
-;;;  When hif-possibly-hide returns, point is at the end of the
-;;;  possibly-hidden range.
-
-(defun hif-recurse-on (start end)
+;;  Hif-Possibly-Hide
+;;  There are four cases.  The #ifX expression is "taken" if it
+;;  the hide-ifdef-evaluator returns T.  Presumably, this means the code
+;;  inside the #ifdef would be included when the program was
+;;  compiled.
+;;
+;;  Case 1:  #ifX taken, and there's an #else.
+;;     The #else part must be hidden.  The #if (then) part must be
+;;     processed for nested #ifX's.
+;;  Case 2:  #ifX taken, and there's no #else.
+;;     The #if part must be processed for nested #ifX's.
+;;  Case 3:  #ifX not taken, and there's an #elif
+;;     The #if part must be hidden, and then evaluate
+;;     the #elif condition like a new #ifX.
+;;  Case 4:  #ifX not taken, and there's just an #else.
+;;     The #if part must be hidden.  The #else part must be processed
+;;     for nested #ifs.
+;;  Case 5:  #ifX not taken, and there's no #else.
+;;     The #ifX part must be hidden.
+;;
+;;  Further processing is done by narrowing to the relevant region
+;;  and just recursively calling hide-ifdef-guts.
+;;
+;;  When hif-possibly-hide returns, point is at the end of the
+;;  possibly-hidden range.
+
+(defvar hif-recurse-level 0)
+
+(defun hif-recurse-on (start end &optional dont-go-eol)
   "Call `hide-ifdef-guts' after narrowing to end of START line and END line."
   (save-excursion
     (save-restriction
       (goto-char start)
-      (end-of-line)
+      (unless dont-go-eol
+        (end-of-line))
       (narrow-to-region (point) end)
-      (hide-ifdef-guts))))
+      (let ((hif-recurse-level (1+ hif-recurse-level)))
+        (hide-ifdef-guts)))))
 
-(defun hif-possibly-hide ()
+(defun hif-possibly-hide (expand-reinclusion)
   "Called at #ifX expression, this hides those parts that should be hidden.
-It uses the judgment of `hide-ifdef-evaluator'."
+It uses the judgment of `hide-ifdef-evaluator'.  EXPAND-REINCLUSION is a flag
+indicating that we should expand the #ifdef even if it should be hidden.
+Refer to `hide-ifdef-expand-reinclusion-protection' for more details."
   ;; (message "hif-possibly-hide") (sit-for 1)
-  (let ((test (hif-canonicalize))
-       (range (hif-find-range)))
+  (let* ((case-fold-search nil)
+         (test (hif-canonicalize hif-ifx-regexp))
+         (range (hif-find-range))
+         (elifs (hif-range-elif range))
+         (if-part t) ; Everytime we start from if-part
+         (complete nil))
     ;; (message "test = %s" test) (sit-for 1)
 
     (hif-hide-line (hif-range-end range))
-    (if (not (hif-not (funcall hide-ifdef-evaluator test)))
-       (cond ((hif-range-else range)   ; case 1
-              (hif-hide-line (hif-range-else range))
-              (hide-ifdef-region (hif-range-else range)
-                                 (1- (hif-range-end range)))
-              (hif-recurse-on (hif-range-start range)
-                              (hif-range-else range)))
-             (t                        ; case 2
-              (hif-recurse-on (hif-range-start range)
-                              (hif-range-end range))))
-      (cond ((hif-range-else range)    ; case 3
-            (hif-hide-line (hif-range-else range))
-            (hide-ifdef-region (hif-range-start range)
-                               (1- (hif-range-else range)))
-            (hif-recurse-on (hif-range-else range)
-                            (hif-range-end range)))
-           (t                          ; case 4
-            (hide-ifdef-region (point)
-                               (1- (hif-range-end range))))))
+    (while (not complete)
+      (if (and (not (and expand-reinclusion if-part))
+               (hif-not (funcall hide-ifdef-evaluator test)))
+          ;; ifX/elif is FALSE
+          (if elifs
+              ;; Case 3 - Hide the #ifX and eval #elif
+              (let ((newstart (car elifs)))
+                (hif-hide-line (hif-range-start range))
+                (hide-ifdef-region (hif-range-start range)
+                                   (1- newstart))
+                (setcar range newstart)
+                (goto-char newstart)
+                (setq elifs (cdr elifs))
+                (setq test (hif-canonicalize hif-elif-regexp)))
+
+            ;; Check for #else
+            (cond ((hif-range-else range)
+                   ;; Case 4 - #else block visible
+                   (hif-hide-line (hif-range-else range))
+                   (hide-ifdef-region (hif-range-start range)
+                                      (1- (hif-range-else range)))
+                   (hif-recurse-on (hif-range-else range)
+                                   (hif-range-end range)))
+                  (t
+                   ;; Case 5 - No #else block, hide #ifX
+                   (hide-ifdef-region (point)
+                                      (1- (hif-range-end range)))))
+            (setq complete t))
+
+        ;; ifX/elif is TRUE
+        (cond (elifs
+               ;; Luke fix: distinguish from #elif..#elif to #elif..#else
+               (let ((elif (car elifs)))
+                 ;; hide all elifs
+                 (hif-hide-line elif)
+                 (hide-ifdef-region elif (1- (hif-range-end range)))
+                 (hif-recurse-on (hif-range-start range)
+                                 elif)))
+              ((hif-range-else range)
+               ;; Case 1 - Hide #elif and #else blocks, recurse #ifX
+               (hif-hide-line (hif-range-else range))
+               (hide-ifdef-region (hif-range-else range)
+                                  (1- (hif-range-end range)))
+               (hif-recurse-on (hif-range-start range)
+                               (hif-range-else range)))
+              (t
+               ;; Case 2 - No #else, just recurse #ifX
+               (hif-recurse-on (hif-range-start range)
+                               (hif-range-end range))))
+        (setq complete t))
+      (setq if-part nil))
+
+    ;; complete = t
     (hif-hide-line (hif-range-start range)) ; Always hide start.
     (goto-char (hif-range-end range))
     (end-of-line)))
 
+(defun hif-evaluate-region (start end)
+  (let* ((tokens (ignore-errors ; Prevent C statement things like
+                                ; 'do { ... } while (0)'
+                   (hif-tokenize start end)))
+         (expr (and tokens
+                    (condition-case nil
+                        (hif-parse-exp tokens)
+                      (error
+                       tokens))))
+         (result (funcall hide-ifdef-evaluator expr)))
+    result))
 
+(defun hif-evaluate-macro (rstart rend)
+  "Evaluate the macro expansion result for a region.
+If no region active, find the current #ifdefs and evaluate the result.
+Currently it supports only math calculations, strings or argumented macros can
+not be expanded."
+  (interactive "r")
+  (let ((case-fold-search nil))
+    (save-excursion
+      (unless mark-active
+        (setq rstart nil rend nil)
+        (beginning-of-line)
+        (when (and (re-search-forward hif-macro-expr-prefix-regexp nil t)
+                   (string= "define" (match-string 2)))
+          (re-search-forward hif-macroref-regexp nil t)))
+      (let* ((start (or rstart (point)))
+             (end   (or rend (progn (hif-end-of-line) (point))))
+             (defined nil)
+             (simple 't)
+             (tokens (ignore-errors ; Prevent C statement things like
+                                        ; 'do { ... } while (0)'
+                       (hif-tokenize start end)))
+             (expr (or (and (<= (length tokens) 1) ; Simple token
+                            (setq defined (assoc (car tokens) hide-ifdef-env))
+                            (setq simple (atom (hif-lookup (car tokens))))
+                            (hif-lookup (car tokens)))
+                       (and tokens
+                            (condition-case nil
+                                (hif-parse-exp tokens)
+                              (error
+                               nil)))))
+             (result (funcall hide-ifdef-evaluator expr))
+             (exprstring (replace-regexp-in-string
+                          ;; Trim off leading/trailing whites
+                          "^[ \t]*\\([^ \t]+\\)[ \t]*" "\\1"
+                          (replace-regexp-in-string
+                           "\\(//.*\\)" "" ; Trim off end-of-line comments
+                           (buffer-substring-no-properties start end)))))
+        (cond
+         ((and (<= (length tokens) 1) simple) ; Simple token
+          (if defined
+              (message "%S <= `%s'" result exprstring)
+            (message "`%s' is not defined" exprstring)))
+         ((integerp result)
+          (if (or (= 0 result) (= 1 result))
+              (message "%S <= `%s'" result exprstring)
+            (message "%S (0x%x) <= `%s'" result result exprstring)))
+         ((null result) (message "%S <= `%s'" 'false exprstring))
+         ((eq t result) (message "%S <= `%s'" 'true exprstring))
+         (t (message "%S <= `%s'" result exprstring)))
+        result))))
+
+(defun hif-parse-macro-arglist (str)
+  "Parse argument list formatted as '( arg1 [ , argn] [...] )'.
+The '...' is also included.  Return a list of the arguments, if '...' exists the
+first arg will be `hif-etc'."
+  (let* ((hif-simple-token-only nil) ; Dynamic binding var for `hif-tokenize'
+         (tokenlist
+          (cdr (hif-tokenize
+                (- (point) (length str)) (point)))) ; Remove `hif-lparen'
+         etc result token)
+    (while (not (eq (setq token (pop tokenlist)) 'hif-rparen))
+      (cond
+       ((eq token 'hif-etc)
+        (setq etc t))
+       ((eq token 'hif-comma)
+        t)
+       (t
+        (push token result))))
+    (if etc
+        (cons 'hif-etc (nreverse result))
+      (nreverse result))))
+
+;; The original version of hideif evaluates the macro early and store the
+;; final values for the defined macro into the symbol database (aka
+;; `hide-ifdef-env'). The evaluation process is "strings -> tokens -> parsed
+;; tree -> [value]". (The square bracket refers to what's stored in in our
+;; `hide-ifdef-env'.)
+;;
+;; This forbids the evaluation of an argumented macro since the parameters
+;; are applied at run time. In order to support argumented macro I then
+;; postponed the evaluation process one stage and store the "parsed tree"
+;; into symbol database. The evaluation process was then "strings -> tokens
+;; -> [parsed tree] -> value". Hideif therefore run slower since it need to
+;; evaluate the parsed tree everytime when trying to expand the symbol. These
+;; temporarily code changes are obsolete and not in Emacs source repository.
+;;
+;; Furthermore, CPP did allow partial expression to be defined in several
+;; macros and later got concatenated into a complete expression and then
+;; evaluate it. In order to match this behavior I had to postpone one stage
+;; further, otherwise those partial expression will be fail on parsing and
+;; we'll miss all macros that reference it. The evaluation process thus
+;; became "strings -> [tokens] -> parsed tree -> value." This degraded the
+;; performance since we need to parse tokens and evaluate them everytime
+;; when that symbol is referenced.
+;;
+;; In real cases I found a lot portion of macros are "simple macros" that
+;; expand to literals like integers or other symbols. In order to enhance
+;; the performance I use this `hif-simple-token-only' to notify my code and
+;; save the final [value] into symbol database. [lukelee]
+
+(defun hif-find-define (&optional min max)
+  "Parse texts and retrieve all defines within the region MIN and MAX."
+  (interactive)
+  (and min (goto-char min))
+  (and (re-search-forward hif-define-regexp max t)
+       (or
+        (let* ((defining (string= "define" (match-string 2)))
+               (name (and (re-search-forward hif-macroref-regexp max t)
+                          (match-string 1)))
+               (parmlist (and (match-string 3) ; First arg id found
+                              (hif-parse-macro-arglist (match-string 2)))))
+          (if defining
+              ;; Ignore name (still need to return 't), or define the name
+              (or (and hide-ifdef-exclude-define-regexp
+                       (string-match hide-ifdef-exclude-define-regexp
+                                     name))
+
+                  (let* ((start (point))
+                         (end   (progn (hif-end-of-line) (point)))
+                         (hif-simple-token-only nil) ; Dynamic binding
+                         (tokens
+                          (and name
+                               ;; `hif-simple-token-only' is set/clear
+                               ;; only in this block
+                               (condition-case nil
+                                   ;; Prevent C statements like
+                                   ;; 'do { ... } while (0)'
+                                   (hif-tokenize start end)
+                                 (error
+                                  ;; We can't just return nil here since
+                                  ;; this will stop hideif from searching
+                                  ;; for more #defines.
+                                  (setq hif-simple-token-only t)
+                                  (buffer-substring-no-properties
+                                   start end)))))
+                         ;; For simple tokens we save only the parsed result;
+                         ;; otherwise we save the tokens and parse it after
+                         ;; parameter replacement
+                         (expr (and tokens
+                                    ;; `hif-simple-token-only' is checked only
+                                    ;; here.
+                                    (or (and hif-simple-token-only
+                                             (listp tokens)
+                                             (= (length tokens) 1)
+                                             (hif-parse-exp tokens))
+                                        `(hif-define-macro ,parmlist
+                                                           ,tokens))))
+                         (SA (and name
+                                  (assoc (intern name) hide-ifdef-env))))
+                    (and name
+                         (if SA
+                             (or (setcdr SA expr) t)
+                           ;; Lazy evaluation, eval only if hif-lookup find it.
+                           ;; Define it anyway, even if nil it's still in list
+                           ;; and therefore considerred defined
+                           (push (cons (intern name) expr) hide-ifdef-env)))))
+            ;; #undef
+            (and name
+                 (hif-undefine-symbol (intern name))))))
+       t))
+
+
+(defun hif-add-new-defines (&optional min max)
+  "Scan and add all #define macros between MIN and MAX."
+  (interactive)
+  (save-excursion
+    (save-restriction
+      ;; (mark-region min max) ;; for debugging
+      (while (hif-find-define min max)
+        (setf min (point)))
+      (if max (goto-char max)
+        (goto-char (point-max))))))
 
 (defun hide-ifdef-guts ()
   "Does most of the work of `hide-ifdefs'.
 It does not do the work that's pointless to redo on a recursive entry."
   ;; (message "hide-ifdef-guts")
   (save-excursion
-    (goto-char (point-min))
-    (while (hif-find-any-ifX)
-      (hif-possibly-hide))))
+    (let* ((case-fold-search t) ; Ignore case for `hide-ifdef-header-regexp'
+           (expand-header (and hide-ifdef-expand-reinclusion-protection
+                               (string-match hide-ifdef-header-regexp
+                                             (buffer-file-name))
+                               (zerop hif-recurse-level)))
+           (case-fold-search nil)
+           min max)
+      (goto-char (point-min))
+      (setf min (point))
+      (cl-loop do
+               (setf max (hif-find-any-ifX))
+               (hif-add-new-defines min max)
+               (if max
+                   (hif-possibly-hide expand-header))
+               (setf min (point))
+               while max))))
 
 ;;===%%SF%% hide-ifdef-hiding (End)  ===
 
@@ -1048,7 +1787,8 @@ It does not do the work that's pointless to redo on a recursive entry."
   (message "Hide-Read-Only %s"
           (if hide-ifdef-read-only "ON" "OFF"))
   (if hide-ifdef-hiding
-      (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only)))
+      (setq buffer-read-only (or hide-ifdef-read-only
+                                 hif-outside-read-only)))
   (force-mode-line-update))
 
 (defun hide-ifdef-toggle-outside-read-only ()
@@ -1078,38 +1818,67 @@ It does not do the work that's pointless to redo on a recursive entry."
          (overlay-put overlay 'face nil)
          (overlay-put overlay 'invisible 'hide-ifdef))))))
 
-(defun hide-ifdef-define (var)
-  "Define a VAR so that #ifdef VAR would be included."
-  (interactive "SDefine what? ")
-  (hif-set-var var 1)
+(defun hide-ifdef-define (var &optional val)
+  "Define a VAR to VAL (default 1) in `hide-ifdef-env'.
+This allows #ifdef VAR to be hidden."
+  (interactive
+   (let* ((default (save-excursion
+                     (beginning-of-line)
+                     (cond ((looking-at hif-ifx-else-endif-regexp)
+                            (forward-word 2)
+                            (current-word 'strict))
+                           (t
+                            nil))))
+          (var (read-minibuffer "Define what? " default))
+          (val (read-from-minibuffer (format "Set %s to? (default 1): " var)
+                                     nil nil t nil "1")))
+     (list var val)))
+  (hif-set-var var (or val 1))
+  (message "%s set to %s" var (or val 1))
+  (sleep-for 1)
   (if hide-ifdef-hiding (hide-ifdefs)))
 
-(defun hide-ifdef-undef (var)
-  "Undefine a VAR so that #ifdef VAR would not be included."
-  (interactive "SUndefine what? ")
-  (hif-set-var var nil)
-  (if hide-ifdef-hiding (hide-ifdefs)))
+(defun hif-undefine-symbol (var)
+  (setq hide-ifdef-env
+        (delete (assoc var hide-ifdef-env) hide-ifdef-env)))
 
+(defun hide-ifdef-undef (start end)
+  "Undefine a VAR so that #ifdef VAR would not be included."
+  (interactive "r")
+  (let* ((symstr
+          (or (and mark-active
+                   (buffer-substring-no-properties start end))
+              (read-string "Undefine what? " (current-word))))
+         (sym (and symstr
+                   (intern symstr))))
+    (if (zerop (hif-defined sym))
+        (message "`%s' not defined, no need to undefine it" symstr)
+      (hif-undefine-symbol sym)
+      (if hide-ifdef-hiding (hide-ifdefs))
+      (message "`%S' undefined" sym))))
 
 (defun hide-ifdefs (&optional nomsg)
   "Hide the contents of some #ifdefs.
 Assume that defined symbols have been added to `hide-ifdef-env'.
 The text hidden is the text that would not be included by the C
 preprocessor if it were given the file with those symbols defined.
+With prefix command presents it will also hide the #ifdefs themselves.
 
 Turn off hiding by calling `show-ifdefs'."
 
   (interactive)
-  (message "Hiding...")
-  (setq hif-outside-read-only buffer-read-only)
-  (unless hide-ifdef-mode (hide-ifdef-mode 1)) ; turn on hide-ifdef-mode
-  (if hide-ifdef-hiding
-      (show-ifdefs))                   ; Otherwise, deep confusion.
-  (setq hide-ifdef-hiding t)
-  (hide-ifdef-guts)
-  (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only))
-  (or nomsg
-      (message "Hiding done")))
+  (let ((hide-ifdef-lines current-prefix-arg))
+    (or nomsg
+        (message "Hiding..."))
+    (setq hif-outside-read-only buffer-read-only)
+    (unless hide-ifdef-mode (hide-ifdef-mode 1)) ; Turn on hide-ifdef-mode
+    (if hide-ifdef-hiding
+        (show-ifdefs))                    ; Otherwise, deep confusion.
+    (setq hide-ifdef-hiding t)
+    (hide-ifdef-guts)
+    (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only))
+    (or nomsg
+        (message "Hiding done"))))
 
 
 (defun show-ifdefs ()
@@ -1125,46 +1894,74 @@ Turn off hiding by calling `show-ifdefs'."
 Return as (TOP . BOTTOM) the extent of ifdef block."
   (let (max-bottom)
     (cons (save-excursion
-           (beginning-of-line)
-           (unless (or (hif-looking-at-else) (hif-looking-at-ifX))
-             (up-ifdef))
-           (prog1 (point)
-             (hif-ifdef-to-endif)
-             (setq max-bottom (1- (point)))))
-         (save-excursion
-           (beginning-of-line)
-           (unless (hif-looking-at-endif)
-             (hif-find-next-relevant))
-           (while (hif-looking-at-ifX)
-             (hif-ifdef-to-endif)
-             (hif-find-next-relevant))
-           (min max-bottom (1- (point)))))))
-
-
-(defun hide-ifdef-block ()
-  "Hide the ifdef block (true or false part) enclosing or before the cursor."
-  (interactive)
-  (unless hide-ifdef-mode (hide-ifdef-mode 1))
-  (let ((top-bottom (hif-find-ifdef-block)))
-    (hide-ifdef-region (car top-bottom) (cdr top-bottom))
-    (when hide-ifdef-lines
-      (hif-hide-line (car top-bottom))
-      (hif-hide-line (1+ (cdr top-bottom))))
-    (setq hide-ifdef-hiding t))
-  (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only)))
-
-(defun show-ifdef-block ()
+            (beginning-of-line)
+            (unless (or (hif-looking-at-else) (hif-looking-at-ifX))
+              (up-ifdef))
+            (prog1 (point)
+              (hif-ifdef-to-endif)
+              (setq max-bottom (1- (point)))))
+          (save-excursion
+            (beginning-of-line)
+            (unless (hif-looking-at-endif)
+              (hif-find-next-relevant))
+            (while (hif-looking-at-ifX)
+              (hif-ifdef-to-endif)
+              (hif-find-next-relevant))
+              (min max-bottom (1- (point)))))))
+
+
+(defun hide-ifdef-block (&optional arg start end)
+  "Hide the ifdef block (true or false part) enclosing or before the cursor.
+With optional prefix agument ARG, also hide the #ifdefs themselves."
+  (interactive "P\nr")
+  (let ((hide-ifdef-lines arg))
+    (if mark-active
+        (let ((hif-recurse-level (1+ hif-recurse-level)))
+          (hif-recurse-on start end t)
+          (setq mark-active nil))
+      (unless hide-ifdef-mode (hide-ifdef-mode 1))
+      (let ((top-bottom (hif-find-ifdef-block)))
+        (hide-ifdef-region (car top-bottom) (cdr top-bottom))
+        (when hide-ifdef-lines
+          (hif-hide-line (car top-bottom))
+          (hif-hide-line (1+ (cdr top-bottom))))
+        (setq hide-ifdef-hiding t))
+      (setq buffer-read-only
+            (or hide-ifdef-read-only hif-outside-read-only)))))
+
+(defun show-ifdef-block (&optional start end)
   "Show the ifdef block (true or false part) enclosing or before the cursor."
-  (interactive)
-  (let ((top-bottom (hif-find-ifdef-block)))
+  (interactive "r")
+  (if mark-active
+      (progn
+        (dolist (o (overlays-in start end))
+          (if (overlay-get o 'hide-ifdef)
+              (delete-overlay o)))
+        (setq mark-active nil))
+    (let ((top-bottom (condition-case nil
+                          (hif-find-ifdef-block)
+                        (error
+                         nil)))
+          (ovrs (overlays-in (max (point-min) (1- (point)))
+                             (min (point-max) (1+ (point)))))
+          (del nil))
+      (if top-bottom
     (if hide-ifdef-lines
-       (hif-show-ifdef-region
-        (save-excursion
-          (goto-char (car top-bottom)) (line-beginning-position))
-        (save-excursion
-          (goto-char (1+ (cdr top-bottom)))
-          (hif-end-of-line) (point)))
-      (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom)))))
+        (hif-show-ifdef-region
+         (save-excursion
+           (goto-char (car top-bottom)) (line-beginning-position))
+         (save-excursion
+           (goto-char (1+ (cdr top-bottom)))
+           (hif-end-of-line) (point)))
+      (setf del (hif-show-ifdef-region
+                 (1- (car top-bottom)) (cdr top-bottom)))))
+      (if (not (and top-bottom
+                    del))
+          (dolist (o ovrs)
+            ;;(dolist (o (overlays-in (1- (point)) (1+ (point))))
+            ;;   (if (overlay-get o 'hide-ifdef) (message "%S" o)))
+            (if (overlay-get o 'hide-ifdef)
+                (delete-overlay o)))))))
 
 
 ;;;  definition alist support
index e9349b655b0bd5fdeb0fb1e86cbed0d8f344a371..a016c3283ebe9a0d1a61876569da741dd9353bd0 100644 (file)
@@ -390,37 +390,31 @@ Use the command `hs-minor-mode' to toggle or set this variable.")
       :help "Do not hidden code or comment blocks when isearch matches inside them"
       :active t :style radio :selected (eq hs-isearch-open nil)])))
 
-(defvar hs-c-start-regexp nil
+(defvar-local hs-c-start-regexp nil
   "Regexp for beginning of comments.
 Differs from mode-specific comment regexps in that
 surrounding whitespace is stripped.")
-(make-variable-buffer-local 'hs-c-start-regexp)
 
-(defvar hs-block-start-regexp nil
+(defvar-local hs-block-start-regexp nil
   "Regexp for beginning of block.")
-(make-variable-buffer-local 'hs-block-start-regexp)
 
-(defvar hs-block-start-mdata-select nil
+(defvar-local hs-block-start-mdata-select nil
   "Element in `hs-block-start-regexp' match data to consider as block start.
 The internal function `hs-forward-sexp' moves point to the beginning of this
 element (using `match-beginning') before calling `hs-forward-sexp-func'.")
-(make-variable-buffer-local 'hs-block-start-mdata-select)
 
-(defvar hs-block-end-regexp nil
+(defvar-local hs-block-end-regexp nil
   "Regexp for end of block.")
-(make-variable-buffer-local 'hs-block-end-regexp)
 
-
-(defvar hs-forward-sexp-func 'forward-sexp
+(defvar-local hs-forward-sexp-func 'forward-sexp
   "Function used to do a `forward-sexp'.
 Should change for Algol-ish modes.  For single-character block
 delimiters -- ie, the syntax table regexp for the character is
 either `(' or `)' -- `hs-forward-sexp-func' would just be
 `forward-sexp'.  For other modes such as simula, a more specialized
 function is necessary.")
-(make-variable-buffer-local 'hs-forward-sexp-func)
 
-(defvar hs-adjust-block-beginning nil
+(defvar-local hs-adjust-block-beginning nil
   "Function used to tweak the block beginning.
 The block is hidden from the position returned by this function,
 as opposed to hiding it from the position returned when searching
@@ -439,7 +433,6 @@ It should return the position from where we should start hiding.
 It should not move the point.
 
 See `hs-c-like-adjust-block-beginning' for an example of using this.")
-(make-variable-buffer-local 'hs-adjust-block-beginning)
 
 (defvar hs-headline nil
   "Text of the line where a hidden block begins, set during isearch.
@@ -789,6 +782,7 @@ If `hs-hide-comments-when-hiding-all' is non-nil, also hide the comments."
      (unless hs-allow-nesting
        (hs-discard-overlays (point-min) (point-max)))
      (goto-char (point-min))
+     (syntax-propertize (point-max))
      (let ((spew (make-progress-reporter "Hiding all blocks..."
                                          (point-min) (point-max)))
            (re (concat "\\("
index cd17600182fce4065f66187e3553fd8caad5570d..3d42fe231bdd8b0bd574a102ce286025ee8ec54c 100644 (file)
@@ -1177,15 +1177,13 @@ Useful when source code is displayed as help.  See the option
   (if (featurep 'font-lock)
       (let ((major-mode 'idlwave-mode)
            (font-lock-verbose
-            (if (called-interactively-p 'interactive) font-lock-verbose nil))
-           (syntax-table (syntax-table)))
-       (unwind-protect
-           (progn
-             (set-syntax-table idlwave-mode-syntax-table)
-             (set (make-local-variable 'font-lock-defaults)
-                  idlwave-font-lock-defaults)
-             (font-lock-fontify-buffer))
-         (set-syntax-table syntax-table)))))
+            (if (called-interactively-p 'interactive) font-lock-verbose nil)))
+       (with-syntax-table idlwave-mode-syntax-table
+          (set (make-local-variable 'font-lock-defaults)
+               idlwave-font-lock-defaults)
+          (if (fboundp 'font-lock-ensure)
+              (font-lock-ensure)
+            (font-lock-fontify-buffer))))))
 
 
 (defun idlwave-help-error (name type class keyword)
index 5d43edc2fc885f16d942a93a3ee4e944936f19de..876695b0809bbd461a6f226d59fe1535ddcc52e1 100644 (file)
@@ -590,27 +590,28 @@ TYPE is either 'pro' or 'rinfo', and `idlwave-shell-temp-pro-file' or
 
 (defun idlwave-shell-make-temp-file (prefix)
   "Create a temporary file."
-  ; Hard coded make-temp-file for Emacs<21
-  (if (fboundp 'make-temp-file)
+  (if (featurep 'emacs)
       (make-temp-file prefix)
-    (let (file
-         (temp-file-dir (if (boundp 'temporary-file-directory)
-                            temporary-file-directory
-                          "/tmp")))
-      (while (condition-case ()
-                (progn
-                  (setq file
-                        (make-temp-name
-                         (expand-file-name prefix temp-file-dir)))
-                   (if (featurep 'xemacs)
-                      (write-region "" nil file nil 'silent nil)
-                    (write-region "" nil file nil 'silent nil 'excl))
-                  nil)
-              (file-already-exists t))
-       ;; the file was somehow created by someone else between
-       ;; `make-temp-name' and `write-region', let's try again.
-       nil)
-      file)))
+    (if (fboundp 'make-temp-file)
+       (make-temp-file prefix)
+      (let (file
+           (temp-file-dir (if (boundp 'temporary-file-directory)
+                              temporary-file-directory
+                            "/tmp")))
+       (while (condition-case ()
+                  (progn
+                    (setq file
+                          (make-temp-name
+                           (expand-file-name prefix temp-file-dir)))
+                    (if (featurep 'xemacs)
+                        (write-region "" nil file nil 'silent nil)
+                      (write-region "" nil file nil 'silent nil 'excl))
+                    nil)
+                (file-already-exists t))
+         ;; the file was somehow created by someone else between
+         ;; `make-temp-name' and `write-region', let's try again.
+         nil)
+       file))))
 
 
 (defvar idlwave-shell-dirstack-query "cd,current=___cur & print,___cur"
index 5419a6dbdb82254138d5058b35b7531ba413a7a8..ba64ae318444307e168cee451623555bb67aa73e 100644 (file)
@@ -112,6 +112,8 @@ mode.  Default is whitespace followed by 0 or 1 single-letter colon-keyword
 (define-key lisp-mode-map "\C-x\C-e" 'lisp-eval-last-sexp) ; Gnu convention
 (define-key lisp-mode-map "\C-c\C-e" 'lisp-eval-defun)
 (define-key lisp-mode-map "\C-c\C-r" 'lisp-eval-region)
+(define-key lisp-mode-map "\C-c\C-n" 'lisp-eval-form-and-next)
+(define-key lisp-mode-map "\C-c\C-p" 'lisp-eval-paragraph)
 (define-key lisp-mode-map "\C-c\C-c" 'lisp-compile-defun)
 (define-key lisp-mode-map "\C-c\C-z" 'switch-to-lisp)
 (define-key lisp-mode-map "\C-c\C-l" 'lisp-load-file)
@@ -311,6 +313,14 @@ of `inferior-lisp-program').  Runs the hooks from
 ;;;###autoload
 (defalias 'run-lisp 'inferior-lisp)
 
+(defun lisp-eval-paragraph (&optional and-go)
+  "Send the current paragraph to the inferior Lisp process.
+Prefix argument means switch to the Lisp buffer afterwards."
+  (interactive "P")
+  (save-excursion
+    (mark-paragraph)
+    (lisp-eval-region (point) (mark) and-go)))
+
 (defun lisp-eval-region (start end &optional and-go)
   "Send the current region to the inferior Lisp process.
 Prefix argument means switch to the Lisp buffer afterwards."
@@ -361,6 +371,14 @@ Prefix argument means switch to the Lisp buffer afterwards."
   (interactive "P")
   (lisp-eval-region (save-excursion (backward-sexp) (point)) (point) and-go))
 
+(defun lisp-eval-form-and-next ()
+  "Send the previous sexp to the inferior Lisp process and move to the next one."
+  (interactive "")
+  (while (not (zerop (car (syntax-ppss))))
+    (up-list))
+  (lisp-eval-last-sexp)
+  (forward-sexp))
+
 (defun lisp-compile-region (start end &optional and-go)
   "Compile the current region in the inferior Lisp process.
 Prefix argument means switch to the Lisp buffer afterwards."
index ef372a34fdb11a6dd153b71e0f2664d3a778c820..476a98926e2584728b4e18c9542722953bb94163 100644 (file)
 ;; a rich language; writing a more suitable parser would be a big job):
 ;; 2)  The globbing syntax <pattern> is not recognized, so special
 ;;       characters in the pattern string must be backslashed.
-;; 3)  The << quoting operators are not recognized; see below.
-;; 5)  To make '$' work correctly, $' is not recognized as a variable.
-;;     Use "$'" or $POSTMATCH instead.
 ;;
-;; If you don't use font-lock, additional problems will appear:
-;; 1)  Regular expression delimiters do not act as quotes, so special
-;;       characters such as `'"#:;[](){} may need to be backslashed
-;;       in regular expressions and in both parts of s/// and tr///.
-;; 4)  The q and qq quoting operators are not recognized; see below.
-;; 5)  To make variables such a $' and $#array work, perl-mode treats
-;;       $ just like backslash, so '$' is not treated correctly.
-;; 6)  Unfortunately, treating $ like \ makes ${var} be treated as an
-;;       unmatched }.  See below.
-;; 7)  When ' (quote) is used as a package name separator, perl-mode
-;;       doesn't understand, and thinks it is seeing a quoted string.
-
 ;; Here are some ugly tricks to bypass some of these problems:  the perl
 ;; expression /`/ (that's a back-tick) usually evaluates harmlessly,
 ;; but will trick perl-mode into starting a quoted string, which
 (defvar perl-quote-like-pairs
   '((?\( . ?\)) (?\[ . ?\]) (?\{ . ?\}) (?\< . ?\>)))
 
+(eval-and-compile
+  (defconst perl--syntax-exp-intro-regexp
+    (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
+            (regexp-opt '("split" "if" "unless" "until" "while" "print"
+                          "grep" "map" "not" "or" "and" "for" "foreach"))
+            "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*")))
+
 ;; FIXME: handle here-docs and regexps.
 ;; <<EOF <<"EOF" <<'EOF' (no space)
 ;; see `man perlop'
       ;; *opening* slash.  We can afford to mis-match the closing ones
       ;; here, because they will be re-treated separately later in
       ;; perl-font-lock-special-syntactic-constructs.
-      ((concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
-               (regexp-opt '("split" "if" "unless" "until" "while" "split"
-                             "grep" "map" "not" "or" "and" "for" "foreach"))
-               "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)")
+      ((concat perl--syntax-exp-intro-regexp "\\(/\\)")
        (2 (ignore
            (if (and (match-end 1)       ; / at BOL.
                     (save-excursion
                                   (string-to-syntax "\"")))
              (perl-syntax-propertize-special-constructs end)))))
       ;; Here documents.
-      ;; TODO: Handle <<WORD.  These are trickier because you need to
-      ;; disambiguate with the shift operator.
-      ("<<[ \t]*\\('[^'\n]*'\\|\"[^\"\n]*\"\\|\\\\[[:alpha:]][[:alnum:]]*\\).*\\(\n\\)"
-       (2 (let* ((st (get-text-property (match-beginning 2) 'syntax-table))
+      ((concat
+        "\\(?:"
+        ;; << "EOF", << 'EOF', or << \EOF
+        "<<[ \t]*\\('[^'\n]*'\\|\"[^\"\n]*\"\\|\\\\[[:alpha:]][[:alnum:]]*\\)"
+        ;; The <<EOF case which needs perl--syntax-exp-intro-regexp, to
+        ;; disambiguate with the left-bitshift operator.
+        "\\|" perl--syntax-exp-intro-regexp "<<\\(?1:\\sw+\\)\\)"
+        ".*\\(\n\\)")
+       (3 (let* ((st (get-text-property (match-beginning 3) 'syntax-table))
                  (name (match-string 1)))
             (goto-char (match-end 1))
             (if (save-excursion (nth 8 (syntax-ppss (match-beginning 0))))
                     ;; Remember the names of heredocs found on this line.
                     (cons (pcase (aref name 0)
                             (`?\\ (substring name 1))
-                            (_ (substring name 1 -1)))
+                            ((or `?\" `?\' `?\`) (substring name 1 -1))
+                            (_ name))
                           (cdr st)))))))
       ;; We don't call perl-syntax-propertize-special-constructs directly
       ;; from the << rule, because there might be other elements (between
@@ -753,7 +748,7 @@ following list:
                (bof (perl-beginning-of-function))
                (delta (progn
                         (goto-char oldpnt)
-                        (perl-indent-line "\f\\|;?#" bof))))
+                        (perl-indent-line "\f\\|;?#"))))
           (and perl-tab-to-comment
                (= oldpnt (point))   ; done if point moved
                (if (listp delta)    ; if line starts in a quoted string
@@ -791,28 +786,23 @@ following list:
                         (ding t)))))))))
 (make-obsolete 'perl-indent-command 'indent-according-to-mode "24.4")
 
-(defun perl-indent-line (&optional nochange parse-start)
+(defun perl-indent-line (&optional nochange)
   "Indent current line as Perl code.
 Return the amount the indentation
 changed by, or (parse-state) if line starts in a quoted string."
   (let ((case-fold-search nil)
        (pos (- (point-max) (point)))
-       (bof (or parse-start (save-excursion
-                               ;; Don't consider text on this line as a
-                               ;; valid BOF from which to indent.
-                              (goto-char (line-end-position 0))
-                              (perl-beginning-of-function))))
        beg indent shift-amt)
     (beginning-of-line)
     (setq beg (point))
     (setq shift-amt
-         (cond ((eq (char-after bof) ?=) 0)
-               ((listp (setq indent (perl-calculate-indent bof))) indent)
+         (cond ((eq 1 (nth 7 (syntax-ppss))) 0) ;For doc sections!
+               ((listp (setq indent (perl-calculate-indent))) indent)
                 ((eq 'noindent indent) indent)
                ((looking-at (or nochange perl-nochange)) 0)
                (t
                 (skip-chars-forward " \t\f")
-                (setq indent (perl-indent-new-calculate nil indent bof))
+                (setq indent (perl-indent-new-calculate nil indent))
                 (- indent (current-column)))))
     (skip-chars-forward " \t\f")
     (if (and (numberp shift-amt) (/= 0 shift-amt))
@@ -824,23 +814,21 @@ changed by, or (parse-state) if line starts in a quoted string."
        (goto-char (- (point-max) pos)))
     shift-amt))
 
-(defun perl-continuation-line-p (limit)
+(defun perl-continuation-line-p ()
   "Move to end of previous line and return non-nil if continued."
   ;; Statement level.  Is it a continuation or a new statement?
   ;; Find previous non-comment character.
   (perl-backward-to-noncomment)
   ;; Back up over label lines, since they don't
   ;; affect whether our line is a continuation.
-  (while (or (eq (preceding-char) ?\,)
-            (and (eq (preceding-char) ?:)
-                 (memq (char-syntax (char-after (- (point) 2)))
-                       '(?w ?_))))
-    (if (eq (preceding-char) ?\,)
-       (perl-backward-to-start-of-continued-exp limit)
-      (beginning-of-line))
+  (while (and (eq (preceding-char) ?:)
+              (memq (char-syntax (char-after (- (point) 2)))
+                    '(?w ?_)))
+    (beginning-of-line)
     (perl-backward-to-noncomment))
   ;; Now we get the answer.
-  (not (memq (preceding-char) '(?\; ?\} ?\{))))
+  (unless (memq (preceding-char) '(?\; ?\} ?\{))
+    (preceding-char)))
 
 (defun perl-hanging-paren-p ()
   "Non-nil if we are right after a hanging parenthesis-like char."
@@ -848,173 +836,151 @@ changed by, or (parse-state) if line starts in a quoted string."
        (save-excursion
         (skip-syntax-backward " (") (not (bolp)))))
 
-(defun perl-indent-new-calculate (&optional virtual default parse-start)
+(defun perl-indent-new-calculate (&optional virtual default)
   (or
    (and virtual (save-excursion (skip-chars-backward " \t") (bolp))
        (current-column))
    (and (looking-at "\\(\\w\\|\\s_\\)+:[^:]")
-       (max 1 (+ (or default (perl-calculate-indent parse-start))
+       (max 1 (+ (or default (perl-calculate-indent))
                  perl-label-offset)))
    (and (= (char-syntax (following-char)) ?\))
        (save-excursion
          (forward-char 1)
           (when (condition-case nil (progn (forward-sexp -1) t)
                   (scan-error nil))
-            (perl-indent-new-calculate
-             ;; Recalculate the parsing-start, since we may have jumped
-             ;; dangerously close (typically in the case of nested functions).
-             'virtual nil (save-excursion (perl-beginning-of-function))))))
+            (perl-indent-new-calculate 'virtual))))
    (and (and (= (following-char) ?{)
             (save-excursion (forward-char) (perl-hanging-paren-p)))
-       (+ (or default (perl-calculate-indent parse-start))
+       (+ (or default (perl-calculate-indent))
           perl-brace-offset))
-   (or default (perl-calculate-indent parse-start))))
+   (or default (perl-calculate-indent))))
 
-(defun perl-calculate-indent (&optional parse-start)
+(defun perl-calculate-indent ()
   "Return appropriate indentation for current line as Perl code.
 In usual case returns an integer: the column to indent to.
-Returns (parse-state) if line starts inside a string.
-Optional argument PARSE-START should be the position of `beginning-of-defun'."
+Returns (parse-state) if line starts inside a string."
   (save-excursion
     (let ((indent-point (point))
          (case-fold-search nil)
          (colon-line-end 0)
+          prev-char
          state containing-sexp)
-      (if parse-start                  ;used to avoid searching
-         (goto-char parse-start)
-       (perl-beginning-of-function))
-      ;; We might be now looking at a local function that has nothing to
-      ;; do with us because `indent-point' is past it.  In this case
-      ;; look further back up for another `perl-beginning-of-function'.
-      (while (and (looking-at "{")
-                 (save-excursion
-                   (beginning-of-line)
-                   (looking-at "\\s-+sub\\>"))
-                 (> indent-point (save-excursion
-                                   (condition-case nil
-                                       (forward-sexp 1)
-                                     (scan-error nil))
-                                   (point))))
-       (perl-beginning-of-function))
-      (while (< (point) indent-point)  ;repeat until right sexp
-       (setq state (parse-partial-sexp (point) indent-point 0))
-       ;; state = (depth_in_parens innermost_containing_list
-       ;;          last_complete_sexp string_terminator_or_nil inside_commentp
-       ;;          following_quotep minimum_paren-depth_this_scan)
-       ;; Parsing stops if depth in parentheses becomes equal to third arg.
-       (setq containing-sexp (nth 1 state)))
+      (setq containing-sexp (nth 1 (syntax-ppss indent-point)))
       (cond
        ;; Don't auto-indent in a quoted string or a here-document.
        ((or (nth 3 state) (eq 2 (nth 7 state))) 'noindent)
-           ((null containing-sexp)     ; Line is at top level.
-            (skip-chars-forward " \t\f")
-            (if (memq (following-char)
-                      (if perl-indent-parens-as-block '(?\{ ?\( ?\[) '(?\{)))
-                0  ; move to beginning of line if it starts a function body
-              ;; indent a little if this is a continuation line
-              (perl-backward-to-noncomment)
-              (if (or (bobp)
-                      (memq (preceding-char) '(?\; ?\})))
-                  0 perl-continued-statement-offset)))
-           ((/= (char-after containing-sexp) ?{)
-            ;; line is expression, not statement:
-            ;; indent to just after the surrounding open.
-            (goto-char (1+ containing-sexp))
-            (if (perl-hanging-paren-p)
-                ;; We're indenting an arg of a call like:
-                ;;    $a = foobarlongnamefun (
-                ;;             arg1
-                ;;             arg2
-                ;;         );
-                (progn
-                  (skip-syntax-backward "(")
-                  (condition-case nil
-                      (while (save-excursion
-                               (skip-syntax-backward " ") (not (bolp)))
-                        (forward-sexp -1))
-                    (scan-error nil))
-                  (+ (current-column) perl-indent-level))
-              (if perl-indent-continued-arguments
-                  (+ perl-indent-continued-arguments (current-indentation))
-                (skip-chars-forward " \t")
-                (current-column))))
-           (t
-            ;; Statement level.  Is it a continuation or a new statement?
-            (if (perl-continuation-line-p containing-sexp)
-                ;; This line is continuation of preceding line's statement;
-                ;; indent  perl-continued-statement-offset  more than the
-                ;; previous line of the statement.
-                (progn
-                  (perl-backward-to-start-of-continued-exp containing-sexp)
-                  (+ (if (save-excursion
-                           (perl-continuation-line-p containing-sexp))
-                         ;; If the continued line is itself a continuation
-                         ;; line, then align, otherwise add an offset.
-                         0 perl-continued-statement-offset)
-                     (current-column)
-                     (if (save-excursion (goto-char indent-point)
-                                         (looking-at
-                                          (if perl-indent-parens-as-block
-                                              "[ \t]*[{(\[]" "[ \t]*{")))
-                         perl-continued-brace-offset 0)))
-              ;; This line starts a new statement.
-              ;; Position at last unclosed open.
-              (goto-char containing-sexp)
-              (or
-               ;; Is line first statement after an open-brace?
-               ;; If no, find that first statement and indent like it.
-               (save-excursion
-                 (forward-char 1)
-                 ;; Skip over comments and labels following openbrace.
-                 (while (progn
-                          (skip-chars-forward " \t\f\n")
-                          (cond ((looking-at ";?#")
-                                 (forward-line 1) t)
-                                ((looking-at "\\(\\w\\|\\s_\\)+:[^:]")
-                                 (setq colon-line-end (line-end-position))
-                                 (search-forward ":")))))
-                 ;; The first following code counts
-                 ;; if it is before the line we want to indent.
-                 (and (< (point) indent-point)
-                      (if (> colon-line-end (point))
-                          (- (current-indentation) perl-label-offset)
-                        (current-column))))
-               ;; If no previous statement,
-               ;; indent it relative to line brace is on.
-               ;; For open paren in column zero, don't let statement
-               ;; start there too.  If perl-indent-level is zero,
-               ;; use perl-brace-offset + perl-continued-statement-offset
-               ;; For open-braces not the first thing in a line,
-               ;; add in perl-brace-imaginary-offset.
-               (+ (if (and (bolp) (zerop perl-indent-level))
-                      (+ perl-brace-offset perl-continued-statement-offset)
-                    perl-indent-level)
-                  ;; Move back over whitespace before the openbrace.
-                  ;; If openbrace is not first nonwhite thing on the line,
-                  ;; add the perl-brace-imaginary-offset.
-                  (progn (skip-chars-backward " \t")
-                         (if (bolp) 0 perl-brace-imaginary-offset))
-                  ;; If the openbrace is preceded by a parenthesized exp,
-                  ;; move to the beginning of that;
-                  ;; possibly a different line
-                  (progn
-                    (if (eq (preceding-char) ?\))
-                        (forward-sexp -1))
-                    ;; Get initial indentation of the line we are on.
-                    (current-indentation))))))))))
+       ((null containing-sexp)          ; Line is at top level.
+        (skip-chars-forward " \t\f")
+        (if (memq (following-char)
+                  (if perl-indent-parens-as-block '(?\{ ?\( ?\[) '(?\{)))
+            0          ; move to beginning of line if it starts a function body
+          ;; indent a little if this is a continuation line
+          (perl-backward-to-noncomment)
+          (if (or (bobp)
+                  (memq (preceding-char) '(?\; ?\})))
+              0 perl-continued-statement-offset)))
+       ((/= (char-after containing-sexp) ?{)
+        ;; line is expression, not statement:
+        ;; indent to just after the surrounding open.
+        (goto-char (1+ containing-sexp))
+        (if (perl-hanging-paren-p)
+            ;; We're indenting an arg of a call like:
+            ;;    $a = foobarlongnamefun (
+            ;;             arg1
+            ;;             arg2
+            ;;         );
+            (progn
+              (skip-syntax-backward "(")
+              (condition-case nil
+                  (while (save-excursion
+                           (skip-syntax-backward " ") (not (bolp)))
+                    (forward-sexp -1))
+                (scan-error nil))
+              (+ (current-column) perl-indent-level))
+          (if perl-indent-continued-arguments
+              (+ perl-indent-continued-arguments (current-indentation))
+            (skip-chars-forward " \t")
+            (current-column))))
+       ;; Statement level.  Is it a continuation or a new statement?
+       ((setq prev-char (perl-continuation-line-p))
+        ;; This line is continuation of preceding line's statement;
+        ;; indent  perl-continued-statement-offset  more than the
+        ;; previous line of the statement.
+        (perl-backward-to-start-of-continued-exp)
+        (+ (if (or (save-excursion
+                     (perl-continuation-line-p))
+                   (and (eq prev-char ?\,)
+                        (looking-at "[[:alnum:]_]+[ \t\n]*=>")))
+               ;; If the continued line is itself a continuation
+               ;; line, then align, otherwise add an offset.
+               0 perl-continued-statement-offset)
+           (current-column)
+           (if (save-excursion (goto-char indent-point)
+                               (looking-at
+                                (if perl-indent-parens-as-block
+                                    "[ \t]*[{(\[]" "[ \t]*{")))
+               perl-continued-brace-offset 0)))
+       (t
+        ;; This line starts a new statement.
+        ;; Position at last unclosed open.
+        (goto-char containing-sexp)
+        (or
+         ;; Is line first statement after an open-brace?
+         ;; If no, find that first statement and indent like it.
+         (save-excursion
+           (forward-char 1)
+           ;; Skip over comments and labels following openbrace.
+           (while (progn
+                    (skip-chars-forward " \t\f\n")
+                    (cond ((looking-at ";?#")
+                           (forward-line 1) t)
+                          ((looking-at "\\(\\w\\|\\s_\\)+:[^:]")
+                           (setq colon-line-end (line-end-position))
+                           (search-forward ":")))))
+           ;; The first following code counts
+           ;; if it is before the line we want to indent.
+           (and (< (point) indent-point)
+                (if (> colon-line-end (point))
+                    (- (current-indentation) perl-label-offset)
+                  (current-column))))
+         ;; If no previous statement,
+         ;; indent it relative to line brace is on.
+         ;; For open paren in column zero, don't let statement
+         ;; start there too.  If perl-indent-level is zero,
+         ;; use perl-brace-offset + perl-continued-statement-offset
+         ;; For open-braces not the first thing in a line,
+         ;; add in perl-brace-imaginary-offset.
+         (+ (if (and (bolp) (zerop perl-indent-level))
+                (+ perl-brace-offset perl-continued-statement-offset)
+              perl-indent-level)
+            ;; Move back over whitespace before the openbrace.
+            ;; If openbrace is not first nonwhite thing on the line,
+            ;; add the perl-brace-imaginary-offset.
+            (progn (skip-chars-backward " \t")
+                   (if (bolp) 0 perl-brace-imaginary-offset))
+            ;; If the openbrace is preceded by a parenthesized exp,
+            ;; move to the beginning of that;
+            ;; possibly a different line
+            (progn
+              (if (eq (preceding-char) ?\))
+                  (forward-sexp -1))
+              ;; Get initial indentation of the line we are on.
+              (current-indentation)))))))))
 
 (defun perl-backward-to-noncomment ()
   "Move point backward to after the first non-white-space, skipping comments."
-  (interactive)
   (forward-comment (- (point-max))))
 
-(defun perl-backward-to-start-of-continued-exp (lim)
-  (if (= (preceding-char) ?\))
-      (forward-sexp -1))
-  (beginning-of-line)
-  (if (<= (point) lim)
-      (goto-char (1+ lim)))
-  (skip-chars-forward " \t\f"))
+(defun perl-backward-to-start-of-continued-exp ()
+  (while
+      (let ((c (preceding-char)))
+      (cond
+        ((memq c '(?\; ?\{ ?\[ ?\()) (forward-comment (point-max)) nil)
+        ((memq c '(?\) ?\] ?\} ?\"))
+         (forward-sexp -1) (forward-comment (- (point))) t)
+        ((eq ?w (char-syntax c))
+         (forward-word -1) (forward-comment (- (point))) t)
+        (t (forward-char -1) (forward-comment (- (point))) t)))))
 \f
 ;; note: this may be slower than the c-mode version, but I can understand it.
 (defalias 'indent-perl-exp 'perl-indent-exp)
@@ -1039,7 +1005,7 @@ Optional argument PARSE-START should be the position of `beginning-of-defun'."
       (setq lsexp-mark bof-mark)
       (beginning-of-line)
       (while (< (point) (marker-position last-mark))
-       (setq delta (perl-indent-line nil (marker-position bof-mark)))
+       (setq delta (perl-indent-line nil))
        (if (numberp delta)             ; unquoted start-of-line?
            (progn
              (if (eolp)
index 407466932d9cf049daf7d916137939dd81aa9b46..d0745d59955749b15fd7f1a3ef8142a759bd916c 100644 (file)
@@ -116,7 +116,7 @@ support it."
         (font-lock-add-keywords nil prettify-symbols--keywords)
         (setq-local font-lock-extra-managed-props
                     (cons 'composition font-lock-extra-managed-props))
-        (font-lock-fontify-buffer))
+        (font-lock-flush))
     ;; Turn off
     (when prettify-symbols--keywords
       (font-lock-remove-keywords nil prettify-symbols--keywords)
index 07d88b3f0fb9a6a369937e285c72d0ef7ae50ea1..853f2d0dad2d00741fe0c1da46ffa4fa94a34e8f 100644 (file)
@@ -3342,8 +3342,6 @@ PREFIX is the prefix of the search regexp."
     ["Mark clause" prolog-mark-clause t]
     ["Mark predicate" prolog-mark-predicate t]
     ["Mark paragraph" mark-paragraph t]
-    ;;"---"
-    ;;["Fontify buffer" font-lock-fontify-buffer t]
     ))
 
 (defun prolog-menu ()
index f7de331f73bfc45b98c5248518615115e66832b4..7cf53cbe45cadf51df1a88052e8ea3fef7371701 100644 (file)
@@ -41,6 +41,7 @@
 
 (require 'comint)
 (require 'easymenu)
+(require 'smie)
 
 ;; Define core `PostScript' group.
 (defgroup PostScript nil
 
 ;; User variables.
 
-(defcustom ps-mode-auto-indent t
-  "Should we use autoindent?"
-  :group 'PostScript-edit
-  :type 'boolean)
+(make-obsolete-variable 'ps-mode-auto-indent 'electric-indent-mode "24.5")
 
 (defcustom ps-mode-tab 4
   "Number of spaces to use when indenting."
@@ -204,7 +202,7 @@ If nil, use `temporary-file-directory'."
               "bind" "null"
               "gsave" "grestore" "grestoreall"
               "showpage")))
-    (concat "\\<" (regexp-opt ops t) "\\>"))
+    (concat "\\_<" (regexp-opt ops t) "\\_>"))
   "Regexp of PostScript operators that will be fontified.")
 
 ;; Level 1 font-lock:
@@ -214,13 +212,9 @@ If nil, use `temporary-file-directory'."
 ;;  - 8bit characters (warning face)
 ;; Multiline strings are not supported. Strings with nested brackets are.
 (defconst ps-mode-font-lock-keywords-1
-  '(("\\`%!PS.*" . font-lock-constant-face)
+  '(("\\`%!PS.*" (0 font-lock-constant-face t))
     ("^%%BoundingBox:[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]*$"
-     . font-lock-constant-face)
-    (ps-mode-match-string-or-comment
-     (1 font-lock-comment-face nil t)
-     (2 font-lock-string-face nil t))
-    ("([^()\n%]*\\|[^()\n]*)" . font-lock-warning-face)
+     (0 font-lock-constant-face t))
     ("[\200-\377]+" (0 font-lock-warning-face prepend nil)))
   "Subdued level highlighting for PostScript mode.")
 
@@ -255,19 +249,17 @@ If nil, use `temporary-file-directory'."
 ;; Names are fontified before PostScript operators, allowing the use of
 ;; a more simple (efficient) regexp than the one used in level 2.
 (defconst ps-mode-font-lock-keywords-3
-  (append
-   ps-mode-font-lock-keywords-1
-   (list
-    '("//\\w+" . font-lock-type-face)
-    `(,(concat
-       "^\\(/\\w+\\)\\>"
-       "\\([[ \t]*\\(%.*\\)?\r?$"      ; Nothing but `[' or comment after the name.
-       "\\|[ \t]*\\({\\|<<\\)"         ; `{' or `<<' following the name.
-       "\\|[ \t]+[0-9]+[ \t]+dict\\>"  ; `[0-9]+ dict' following the name.
-       "\\|.*\\<def\\>\\)")            ; `def' somewhere on the same line.
-      . (1 font-lock-function-name-face))
-    '("/\\w+" . font-lock-variable-name-face)
-    (cons ps-mode-operators 'font-lock-keyword-face)))
+  `(,@ps-mode-font-lock-keywords-1
+    ("//\\(?:\\sw\\|\\s_\\)+" . font-lock-type-face)
+    (,(concat
+       "^\\(/\\(?:\\sw\\|\\s_\\)+\\)\\_>"
+       "\\([[ \t]*\\(%.*\\)?\r?$"  ; Nothing but `[' or comment after the name.
+       "\\|[ \t]*\\({\\|<<\\)"     ; `{' or `<<' following the name.
+       "\\|[ \t]+[0-9]+[ \t]+dict\\_>" ; `[0-9]+ dict' following the name.
+       "\\|.*\\_<def\\_>\\)")          ; `def' somewhere on the same line.
+     . (1 font-lock-function-name-face))
+    ("/\\(?:\\sw\\|\\s_\\)+" . font-lock-variable-name-face)
+    (,ps-mode-operators . font-lock-keyword-face))
   "High level highlighting for PostScript mode.")
 
 (defconst ps-mode-font-lock-keywords ps-mode-font-lock-keywords-1
@@ -289,13 +281,68 @@ If nil, use `temporary-file-directory'."
 \f
 ;; Variables.
 
-(defvar ps-mode-map nil
+(defvar ps-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\C-c\C-v" 'ps-run-boundingbox)
+    (define-key map "\C-c\C-u" 'ps-mode-uncomment-region)
+    (define-key map "\C-c\C-t" 'ps-mode-epsf-rich)
+    (define-key map "\C-c\C-s" 'ps-run-start)
+    (define-key map "\C-c\C-r" 'ps-run-region)
+    (define-key map "\C-c\C-q" 'ps-run-quit)
+    (define-key map "\C-c\C-p" 'ps-mode-print-buffer)
+    (define-key map "\C-c\C-o" 'ps-mode-comment-out-region)
+    (define-key map "\C-c\C-k" 'ps-run-kill)
+    (define-key map "\C-c\C-j" 'ps-mode-other-newline)
+    (define-key map "\C-c\C-l" 'ps-run-clear)
+    (define-key map "\C-c\C-b" 'ps-run-buffer)
+    ;; FIXME: Add `indent' to backward-delete-char-untabify-method instead?
+    (define-key map "\177" 'ps-mode-backward-delete-char)
+    map)
   "Local keymap to use in PostScript mode.")
 
-(defvar ps-mode-syntax-table nil
+(defvar ps-mode-syntax-table
+  (let ((st (make-syntax-table)))
+
+    (modify-syntax-entry ?\% "< " st)
+    (modify-syntax-entry ?\n "> " st)
+    (modify-syntax-entry ?\r "> " st)
+    (modify-syntax-entry ?\f "> " st)
+    (modify-syntax-entry ?\< "(>" st)
+    (modify-syntax-entry ?\> ")<" st)
+
+    (modify-syntax-entry ?\! "_ " st)
+    (modify-syntax-entry ?\" "_ " st)
+    (modify-syntax-entry ?\# "_ " st)
+    (modify-syntax-entry ?\$ "_ " st)
+    (modify-syntax-entry ?\& "_ " st)
+    (modify-syntax-entry ?\' "_ " st)
+    (modify-syntax-entry ?\* "_ " st)
+    (modify-syntax-entry ?\+ "_ " st)
+    (modify-syntax-entry ?\, "_ " st)
+    (modify-syntax-entry ?\- "_ " st)
+    (modify-syntax-entry ?\. "_ " st)
+    (modify-syntax-entry ?\: "_ " st)
+    (modify-syntax-entry ?\; "_ " st)
+    (modify-syntax-entry ?\= "_ " st)
+    (modify-syntax-entry ?\? "_ " st)
+    (modify-syntax-entry ?\@ "_ " st)
+    (modify-syntax-entry ?\\ "\\" st)
+    (modify-syntax-entry ?^  "_ " st)   ; NOT: ?\^
+    (modify-syntax-entry ?\_ "_ " st)
+    (modify-syntax-entry ?\` "_ " st)
+    (modify-syntax-entry ?\| "_ " st)
+    (modify-syntax-entry ?\~ "_ " st)
+    st)
   "Syntax table used while in PostScript mode.")
 
-(defvar ps-run-mode-map nil
+(defvar ps-run-mode-map
+  (let ((map (make-sparse-keymap)))
+    (set-keymap-parent map comint-mode-map)
+    (define-key map "\C-c\C-q" 'ps-run-quit)
+    (define-key map "\C-c\C-k" 'ps-run-kill)
+    (define-key map "\C-c\C-e" 'ps-run-goto-error)
+    (define-key map [mouse-2] 'ps-run-mouse-goto-error)
+    map)
   "Local keymap to use in PostScript run mode.")
 
 (defvar ps-mode-tmp-file nil
@@ -365,9 +412,6 @@ If nil, use `temporary-file-directory'."
     ["8-bit to Octal Buffer" ps-mode-octal-buffer t]
     ["8-bit to Octal Region" ps-mode-octal-region (mark t)]
     "---"
-    ["Auto Indent" (setq ps-mode-auto-indent (not ps-mode-auto-indent))
-     :style toggle :selected ps-mode-auto-indent]
-    "---"
     ["Start PostScript"
      ps-run-start
      t]
@@ -404,79 +448,7 @@ If nil, use `temporary-file-directory'."
      ps-mode-submit-bug-report
      t]))
 
-\f
-;; Mode maps for PostScript edit mode and PostScript interaction mode.
-
-(unless ps-mode-map
-  (setq ps-mode-map (make-sparse-keymap))
-  (define-key ps-mode-map "\C-c\C-v" 'ps-run-boundingbox)
-  (define-key ps-mode-map "\C-c\C-u" 'ps-mode-uncomment-region)
-  (define-key ps-mode-map "\C-c\C-t" 'ps-mode-epsf-rich)
-  (define-key ps-mode-map "\C-c\C-s" 'ps-run-start)
-  (define-key ps-mode-map "\C-c\C-r" 'ps-run-region)
-  (define-key ps-mode-map "\C-c\C-q" 'ps-run-quit)
-  (define-key ps-mode-map "\C-c\C-p" 'ps-mode-print-buffer)
-  (define-key ps-mode-map "\C-c\C-o" 'ps-mode-comment-out-region)
-  (define-key ps-mode-map "\C-c\C-k" 'ps-run-kill)
-  (define-key ps-mode-map "\C-c\C-j" 'ps-mode-other-newline)
-  (define-key ps-mode-map "\C-c\C-l" 'ps-run-clear)
-  (define-key ps-mode-map "\C-c\C-b" 'ps-run-buffer)
-  (define-key ps-mode-map ">" 'ps-mode-r-gt)
-  (define-key ps-mode-map "]" 'ps-mode-r-angle)
-  (define-key ps-mode-map "}" 'ps-mode-r-brace)
-  (define-key ps-mode-map "\177" 'ps-mode-backward-delete-char)
-  (define-key ps-mode-map "\t" 'ps-mode-tabkey)
-  (define-key ps-mode-map "\r" 'ps-mode-newline)
-  (easy-menu-define ps-mode-main ps-mode-map "PostScript" ps-mode-menu-main))
-
-(unless ps-run-mode-map
-  (setq ps-run-mode-map (make-sparse-keymap))
-  (set-keymap-parent ps-run-mode-map comint-mode-map)
-  (define-key ps-run-mode-map "\C-c\C-q" 'ps-run-quit)
-  (define-key ps-run-mode-map "\C-c\C-k" 'ps-run-kill)
-  (define-key ps-run-mode-map "\C-c\C-e" 'ps-run-goto-error)
-  (define-key ps-run-mode-map [mouse-2] 'ps-run-mouse-goto-error))
-
-\f
-;; Syntax table.
-
-(unless ps-mode-syntax-table
-  (setq ps-mode-syntax-table (make-syntax-table))
-
-  (modify-syntax-entry ?\% "< " ps-mode-syntax-table)
-  (modify-syntax-entry ?\n "> " ps-mode-syntax-table)
-  (modify-syntax-entry ?\r "> " ps-mode-syntax-table)
-  (modify-syntax-entry ?\f "> " ps-mode-syntax-table)
-  (modify-syntax-entry ?\< "(>" ps-mode-syntax-table)
-  (modify-syntax-entry ?\> ")<" ps-mode-syntax-table)
-
-  (modify-syntax-entry ?\! "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\" "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\# "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\$ "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\& "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\' "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\* "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\+ "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\, "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\- "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\. "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\: "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\; "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\= "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\? "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\@ "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\\ "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?^  "w " ps-mode-syntax-table) ; NOT: ?\^
-  (modify-syntax-entry ?\_ "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\` "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\| "w " ps-mode-syntax-table)
-  (modify-syntax-entry ?\~ "w " ps-mode-syntax-table)
-
-  (let ((i 128))
-    (while (< i 256)
-      (modify-syntax-entry i "w " ps-mode-syntax-table)
-      (setq i (1+ i)))))
+(easy-menu-define ps-mode-main ps-mode-map "PostScript" ps-mode-menu-main)
 
 \f
 
@@ -484,6 +456,13 @@ If nil, use `temporary-file-directory'."
 
 ;; PostScript mode.
 
+(defun ps-mode-smie-rules (kind token)
+  (pcase (cons kind token)
+    (`(:after . "<") (when (smie-rule-next-p "<") 0))
+    (`(:elem . basic) ps-mode-tab)
+    (`(:close-all . ">") t)
+    (`(:list-intro . ,_) t)))
+
 ;;;###autoload
 (define-derived-mode ps-mode prog-mode "PostScript"
   "Major mode for editing PostScript with GNU Emacs.
@@ -493,7 +472,6 @@ Entry to this mode calls `ps-mode-hook'.
 The following variables hold user options, and can
 be set through the `customize' command:
 
-  `ps-mode-auto-indent'
   `ps-mode-tab'
   `ps-mode-paper-size'
   `ps-mode-print-function'
@@ -523,12 +501,16 @@ with a file position. Clicking mouse-2 on this number will bring
 point to the corresponding spot in the PostScript window, if input
 to the interpreter was sent from that window.
 Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number has the same effect."
+  (setq-local syntax-propertize-function #'ps-mode-syntax-propertize)
   (set (make-local-variable 'font-lock-defaults)
        '((ps-mode-font-lock-keywords
          ps-mode-font-lock-keywords-1
          ps-mode-font-lock-keywords-2
          ps-mode-font-lock-keywords-3)
-        t))
+        nil))
+  (smie-setup nil #'ps-mode-smie-rules)
+  (setq-local electric-indent-chars
+              (append '(?> ?\] ?\}) electric-indent-chars))
   (set (make-local-variable 'comment-start) "%")
   ;; NOTE: `\' has a special meaning in strings only
   (set (make-local-variable 'comment-start-skip) "%+[ \t]*")
@@ -555,8 +537,7 @@ Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number
       (reporter-submit-bug-report
        ps-mode-maintainer-address
        (format "ps-mode.el %s [%s]" ps-mode-version system-type)
-       '(ps-mode-auto-indent
-        ps-mode-tab
+       '(ps-mode-tab
         ps-mode-paper-size
         ps-mode-print-function
         ps-run-prompt
@@ -570,53 +551,54 @@ Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number
 \f
 ;; Helper functions for font-lock.
 
-;; When this function is called, point is at an opening bracket.
-;; This function should test if point is at the start of a string
-;; with nested brackets.
-;; If true:  move point to end of string
-;;           set string to match data nr 2
-;;           return new point
-;; If false: return nil
-(defun ps-mode-looking-at-nested (limit)
-  (let ((first (point))
-       (level 1)
-       pos)
-    ;; Move past opening bracket.
-    (forward-char 1)
-    (setq pos (point))
-    (while (and (> level 0) (< pos limit))
-      ;; Search next bracket, stepping over escaped brackets.
-      (if (not (looking-at "\\([^()\\\n]\\|\\\\.\\)*\\([()]\\)"))
-          (setq level -1)
-       (setq level (+ level (if (string= "(" (match-string 2)) 1 -1)))
-       (goto-char (setq pos (match-end 0)))))
-    (if (not (= level 0))
-        nil
-      ;; Found string with nested brackets, now set match data nr 2.
-      (set-match-data (list first pos nil nil first pos))
-      pos)))
-
-;; This function should search for a string or comment
-;; If comment, return as match data nr 1
-;; If string, return as match data nr 2
-(defun ps-mode-match-string-or-comment (limit)
-  ;; Find the first potential match.
-  (if (not (re-search-forward "[%(]" limit t))
-      ;; Nothing found: return failure.
-      nil
-    (let ((end (match-end 0)))
-      (goto-char (match-beginning 0))
-      (cond ((looking-at "\\(%.*\\)\\|\\((\\([^()\\\n]\\|\\\\.\\)*)\\)")
-            ;; It's a comment or string without nested, unescaped brackets.
-            (goto-char (match-end 0))
-            (point))
-           ((ps-mode-looking-at-nested limit)
-            ;; It's a string with nested brackets.
-            (point))
-           (t
-            ;; Try next match.
-            (goto-char end)
-            (ps-mode-match-string-or-comment limit))))))
+(defconst ps-mode--string-syntax-table
+  (let ((st (make-syntax-table ps-mode-syntax-table)))
+    (modify-syntax-entry ?% "." st)
+    (modify-syntax-entry ?< "." st)
+    (modify-syntax-entry ?> "." st)
+    (modify-syntax-entry ?\{ "." st)
+    (modify-syntax-entry ?\} "." st)
+    (modify-syntax-entry ?\[ "." st)
+    (modify-syntax-entry ?\] "." st)
+    st))
+
+(defun ps-mode--syntax-propertize-special (end)
+  (let ((ppss (syntax-ppss))
+        char)
+    (cond
+     ((not (nth 3 ppss)))          ;Not in (...), <~..base85..~>, or <..hex..>.
+     ((eq ?\( (setq char (char-after (nth 8 ppss))))
+      (save-restriction
+        (narrow-to-region (point-min) end)
+        (goto-char (nth 8 ppss))
+        (condition-case nil
+            (with-syntax-table ps-mode--string-syntax-table
+              (let ((parse-sexp-lookup-properties nil))
+                (forward-sexp 1))
+              (put-text-property (1- (point)) (point)
+                                 'syntax-table (string-to-syntax "|")))
+          (scan-error (goto-char end)))))
+     ((eq char ?<)
+      (when (re-search-forward (if (eq ?~ (char-after (1+ (nth 8 ppss))))
+                                   "~>" ">")
+                               end 'move)
+        (put-text-property (1- (point)) (point)
+                           'syntax-table (string-to-syntax "|")))))))
+
+(defun ps-mode-syntax-propertize (start end)
+  (goto-char start)
+  (ps-mode--syntax-propertize-special end)
+  (funcall
+   (syntax-propertize-rules
+    ("\\(<\\)\\(?:~\\|[ \n\t]*[[:xdigit:]]\\)\\|\\(?1:(\\)"
+     (1 (unless (or (eq (char-after (match-beginning 0))
+                        (char-before (match-beginning 0))) ;Avoid "<<".
+                    (nth 8 (save-excursion (syntax-ppss (match-beginning 1)))))
+          (put-text-property (match-beginning 1) (match-end 1)
+                             'syntax-table (string-to-syntax "|"))
+          (ps-mode--syntax-propertize-special end)
+          nil))))
+   (point) end))
 
 \f
 ;; Key-handlers.
@@ -654,34 +636,12 @@ defines the beginning of a group. These tokens are:  {  [  <<"
              (setq target (+ target ps-mode-tab)))
          target)))))
 
-(defun ps-mode-newline ()
-  "Insert newline with proper indentation."
-  (interactive)
-  (delete-horizontal-space)
-  (insert "\n")
-  (if ps-mode-auto-indent
-      (indent-to (ps-mode-target-column))))
-
-(defun ps-mode-tabkey ()
-  "Indent/reindent current line, or insert tab."
-  (interactive)
-  (let ((column (current-column))
-       target)
-    (if (or (not ps-mode-auto-indent)
-           (< ps-mode-tab 1)
-           (not (re-search-backward "^[ \t]*\\=" nil t)))
-       (insert "\t")
-      (setq target (ps-mode-target-column))
-      (while (<= target column)
-       (setq target (+ target ps-mode-tab)))
-      (indent-line-to target))))
-
 (defun ps-mode-backward-delete-char ()
   "Delete backward indentation, or delete backward character."
   (interactive)
   (let ((column (current-column))
        target)
-    (if (or (not ps-mode-auto-indent)
+    (if (or (not electric-indent-mode)
            (< ps-mode-tab 1)
            (not (re-search-backward "^[ \t]+\\=" nil t)))
        (call-interactively 'delete-backward-char)
@@ -694,32 +654,6 @@ defines the beginning of a group. These tokens are:  {  [  <<"
          (setq target 0))
       (indent-line-to target))))
 
-(defun ps-mode-r-brace ()
-  "Insert `}' and perform balance."
-  (interactive)
-  (insert "}")
-  (ps-mode-r-balance "}"))
-
-(defun ps-mode-r-angle ()
-  "Insert `]' and perform balance."
-  (interactive)
-  (insert "]")
-  (ps-mode-r-balance "]"))
-
-(defun ps-mode-r-gt ()
-  "Insert `>' and perform balance."
-  (interactive)
-  (insert ">")
-  (ps-mode-r-balance ">>"))
-
-(defun ps-mode-r-balance (right)
-  "Adjust indenting if point after RIGHT."
-  (if ps-mode-auto-indent
-      (save-excursion
-       (when (re-search-backward (concat "^[ \t]*" (regexp-quote right) "\\=") nil t)
-         (indent-line-to (ps-mode-target-column)))))
-  (blink-matching-open))
-
 (defun ps-mode-other-newline ()
   "Perform newline in `*ps-run*' buffer."
   (interactive)
index 60121ac6b41df13f45324d0b6e96bf9eee8290dd..7d7cd9de19eb53f1a2c669b6cb0de9a27b89a779 100644 (file)
@@ -31,9 +31,9 @@
 ;; found in GNU/Emacs.
 
 ;; Implements Syntax highlighting, Indentation, Movement, Shell
-;; interaction, Shell completion, Shell virtualenv support, Pdb
-;; tracking, Symbol completion, Skeletons, FFAP, Code Check, Eldoc,
-;; Imenu.
+;; interaction, Shell completion, Shell virtualenv support, Shell
+;; package support, Shell syntax highlighting, Pdb tracking, Symbol
+;; completion, Skeletons, FFAP, Code Check, Eldoc, Imenu.
 
 ;; Syntax highlighting: Fontification of code is provided and supports
 ;; python's triple quoted strings properly.
 ;; introduced as simple way of adding paths to the PYTHONPATH without
 ;; affecting existing values.
 
+;; Shell package support: you can enable a package in the current
+;; shell so that relative imports work properly using the
+;; `python-shell-package-enable' command.
+
+;; Shell syntax highlighting: when enabled current input in shell is
+;; highlighted.  The variable `python-shell-font-lock-enable' controls
+;; activation of this feature globally when shells are started.
+;; Activation/deactivation can be also controlled on the fly via the
+;; `python-shell-font-lock-toggle' command.
+
 ;; Pdb tracking: when you execute a block of code that contains some
 ;; call to pdb (or ipdb) it will prompt the block of code and will
 ;; follow the execution of pdb marking the current line with an arrow.
 ;; the shell completion in background so you should run
 ;; `python-shell-send-buffer' from time to time to get better results.
 
-;; Skeletons: 6 skeletons are provided for simple inserting of class,
-;; def, for, if, try and while.  These skeletons are integrated with
-;; abbrev.  If you have `abbrev-mode' activated and
+;; Skeletons: skeletons are provided for simple inserting of things like class,
+;; def, for, import, if, try, and while.  These skeletons are
+;; integrated with abbrev.  If you have `abbrev-mode' activated and
 ;; `python-skeleton-autoinsert' is set to t, then whenever you type
 ;; the name of any of those defined and hit SPC, they will be
 ;; automatically expanded.  As an alternative you can use the defined
-;; skeleton commands: `python-skeleton-class', `python-skeleton-def'
-;; `python-skeleton-for', `python-skeleton-if', `python-skeleton-try'
-;; and `python-skeleton-while'.
+;; skeleton commands: `python-skeleton-<foo>'.
 
 ;; FFAP: You can find the filename for a given module when using ffap
 ;; out of the box.  This feature needs an inferior python shell
     (define-key map "\C-c\C-td" 'python-skeleton-def)
     (define-key map "\C-c\C-tf" 'python-skeleton-for)
     (define-key map "\C-c\C-ti" 'python-skeleton-if)
+    (define-key map "\C-c\C-tm" 'python-skeleton-import)
     (define-key map "\C-c\C-tt" 'python-skeleton-try)
     (define-key map "\C-c\C-tw" 'python-skeleton-while)
     ;; Shell interaction
@@ -1102,12 +1111,10 @@ any lines in the region are indented less than COUNT columns."
         (while (< (point) end)
           (if (and (< (current-indentation) count)
                    (not (looking-at "[ \t]*$")))
-              (error "Can't shift all lines enough"))
+              (user-error "Can't shift all lines enough"))
           (forward-line))
         (indent-rigidly start end (- count))))))
 
-(add-to-list 'debug-ignored-errors "^Can't shift all lines enough")
-
 (defun python-indent-shift-right (start end &optional count)
   "Shift lines contained in region START END by COUNT columns to the right.
 COUNT defaults to `python-indent-offset'.  If region isn't
@@ -1751,6 +1758,7 @@ position, else returns nil."
 (defcustom python-shell-prompt-input-regexps
   '(">>> " "\\.\\.\\. "                 ; Python
     "In \\[[0-9]+\\]: "                 ; IPython
+    "   \\.\\.\\.: "                    ; IPython
     ;; Using ipdb outside IPython may fail to cleanup and leave static
     ;; IPython prompts activated, this adds some safeguard for that.
     "In : " "\\.\\.\\.: ")
@@ -1786,7 +1794,10 @@ It should not contain a caret (^) at the beginning."
 It should not contain a caret (^) at the beginning."
   :type 'string)
 
-(defcustom python-shell-enable-font-lock t
+(define-obsolete-variable-alias
+  'python-shell-enable-font-lock 'python-shell-font-lock-enable "24.5")
+
+(defcustom python-shell-font-lock-enable t
   "Should syntax highlighting be enabled in the Python shell buffer?
 Restart the Python shell after changing this variable for it to take effect."
   :type 'boolean
@@ -1922,7 +1933,9 @@ detection and just returns nil."
               nil)))
       (when (and (not prompts)
                  python-shell-prompt-detect-failure-warning)
-        (warn
+        (lwarn
+         '(python python-shell-prompt-regexp)
+         :warning
          (concat
           "Python shell prompts cannot be detected.\n"
           "If your emacs session hangs when starting python shells\n"
@@ -2091,26 +2104,242 @@ uniqueness for different types of configurations."
                     (directory-file-name python-shell-virtualenv-path))
             path))))
 
-(defun python-comint-output-filter-function (output)
-  "Hook run after content is put into comint buffer.
-OUTPUT is a string with the contents of the buffer."
-  (ansi-color-filter-apply output))
+(defvar python-shell--package-depth 10)
+
+(defun python-shell-package-enable (directory package)
+  "Add DIRECTORY parent to $PYTHONPATH and enable PACKAGE."
+  (interactive
+   (let* ((dir (expand-file-name
+                (read-directory-name
+                 "Package root: "
+                 (file-name-directory
+                  (or (buffer-file-name) default-directory)))))
+          (name (completing-read
+                 "Package: "
+                 (python-util-list-packages
+                  dir python-shell--package-depth))))
+     (list dir name)))
+  (python-shell-send-string
+   (format
+    (concat
+     "import os.path;import sys;"
+     "sys.path.append(os.path.dirname(os.path.dirname('''%s''')));"
+     "__package__ = '''%s''';"
+     "import %s")
+    directory package package)
+   (python-shell-get-process)))
+
+(defun python-shell-accept-process-output (process &optional timeout regexp)
+  "Accept PROCESS output with TIMEOUT until REGEXP is found.
+Optional argument TIMEOUT is the timeout argument to
+`accept-process-output' calls.  Optional argument REGEXP
+overrides the regexp to match the end of output, defaults to
+`comint-prompt-regexp.'.  Returns non-nil when output was
+properly captured.
+
+This utility is useful in situations where the output may be
+received in chunks, since `accept-process-output' gives no
+guarantees they will be grabbed in a single call.  An example use
+case for this would be the CPython shell start-up, where the
+banner and the initial prompt are received separetely."
+  (let ((regexp (or regexp comint-prompt-regexp)))
+    (catch 'found
+      (while t
+        (when (not (accept-process-output process timeout))
+          (throw 'found nil))
+        (when (looking-back regexp)
+          (throw 'found t))))))
+
+(defun python-shell-comint-end-of-output-p (output)
+  "Return non-nil if OUTPUT is ends with input prompt."
+  (string-match
+   ;; XXX: It seems on OSX an extra carriage return is attached
+   ;; at the end of output, this handles that too.
+   (concat
+    "\r?\n?"
+    ;; Remove initial caret from calculated regexp
+    (replace-regexp-in-string
+     (rx string-start ?^) ""
+     python-shell--prompt-calculated-input-regexp)
+    (rx eos))
+   output))
+
+(define-obsolete-function-alias
+  'python-comint-output-filter-function
+  'ansi-color-filter-apply
+  "24.5")
+
+(defun python-comint-postoutput-scroll-to-bottom (output)
+  "Faster version of `comint-postoutput-scroll-to-bottom'.
+Avoids `recenter' calls until OUTPUT is completely sent."
+  (when (and (not (string= "" output))
+             (python-shell-comint-end-of-output-p
+              (ansi-color-filter-apply output)))
+    (comint-postoutput-scroll-to-bottom output))
+  output)
 
 (defvar python-shell--parent-buffer nil)
 
-(defvar python-shell-output-syntax-table
-  (let ((table (make-syntax-table python-dotty-syntax-table)))
-    (modify-syntax-entry ?\' "." table)
-    (modify-syntax-entry ?\" "." table)
-    (modify-syntax-entry ?\( "." table)
-    (modify-syntax-entry ?\[ "." table)
-    (modify-syntax-entry ?\{ "." table)
-    (modify-syntax-entry ?\) "." table)
-    (modify-syntax-entry ?\] "." table)
-    (modify-syntax-entry ?\} "." table)
-    table)
-  "Syntax table for shell output.
-It makes parens and quotes be treated as punctuation chars.")
+(defmacro python-shell-with-shell-buffer (&rest body)
+  "Execute the forms in BODY with the shell buffer temporarily current.
+Signals an error if no shell buffer is available for current buffer."
+  (declare (indent 0) (debug t))
+  (let ((shell-buffer (make-symbol "shell-buffer")))
+    `(let ((,shell-buffer (python-shell-get-buffer)))
+       (when (not ,shell-buffer)
+         (error "No inferior Python buffer available."))
+       (with-current-buffer ,shell-buffer
+         ,@body))))
+
+(defvar python-shell--font-lock-buffer nil)
+
+(defun python-shell-font-lock-get-or-create-buffer ()
+  "Get or create a font-lock buffer for current inferior process."
+  (python-shell-with-shell-buffer
+    (if python-shell--font-lock-buffer
+        python-shell--font-lock-buffer
+      (let ((process-name
+             (process-name (get-buffer-process (current-buffer)))))
+        (generate-new-buffer
+         (format "*%s-font-lock*" process-name))))))
+
+(defun python-shell-font-lock-kill-buffer ()
+  "Kill the font-lock buffer safely."
+  (python-shell-with-shell-buffer
+    (when (and python-shell--font-lock-buffer
+               (buffer-live-p python-shell--font-lock-buffer))
+      (kill-buffer python-shell--font-lock-buffer)
+      (when (eq major-mode 'inferior-python-mode)
+        (setq python-shell--font-lock-buffer nil)))))
+
+(defmacro python-shell-font-lock-with-font-lock-buffer (&rest body)
+  "Execute the forms in BODY in the font-lock buffer.
+The value returned is the value of the last form in BODY.  See
+also `with-current-buffer'."
+  (declare (indent 0) (debug t))
+  `(python-shell-with-shell-buffer
+     (save-current-buffer
+       (when (not (and python-shell--font-lock-buffer
+                       (get-buffer python-shell--font-lock-buffer)))
+         (setq python-shell--font-lock-buffer
+               (python-shell-font-lock-get-or-create-buffer)))
+       (set-buffer python-shell--font-lock-buffer)
+       (set (make-local-variable 'delay-mode-hooks) t)
+       (let ((python-indent-guess-indent-offset nil))
+         (when (not (eq major-mode 'python-mode))
+           (python-mode))
+         ,@body))))
+
+(defun python-shell-font-lock-cleanup-buffer ()
+  "Cleanup the font-lock buffer.
+Provided as a command because this might be handy if something
+goes wrong and syntax highlighting in the shell gets messed up."
+  (interactive)
+  (python-shell-with-shell-buffer
+    (python-shell-font-lock-with-font-lock-buffer
+      (delete-region (point-min) (point-max)))))
+
+(defun python-shell-font-lock-comint-output-filter-function (output)
+  "Clean up the font-lock buffer after any OUTPUT."
+  (when (and (not (string= "" output))
+             ;; Is end of output and is not just a prompt.
+             (not (member
+                   (python-shell-comint-end-of-output-p
+                    (ansi-color-filter-apply output))
+                   '(nil 0))))
+    ;; If output is other than an input prompt then "real" output has
+    ;; been received and the font-lock buffer must be cleaned up.
+    (python-shell-font-lock-cleanup-buffer))
+  output)
+
+(defun python-shell-font-lock-post-command-hook ()
+  "Fontifies current line in shell buffer."
+  (if (eq this-command 'comint-send-input)
+      ;; Add a newline when user sends input as this may be a block.
+      (python-shell-font-lock-with-font-lock-buffer
+        (goto-char (line-end-position))
+        (newline))
+    (when (and (python-util-comint-last-prompt)
+               (> (point) (cdr (python-util-comint-last-prompt))))
+      (let ((input (buffer-substring-no-properties
+                    (cdr (python-util-comint-last-prompt)) (point-max)))
+            (old-input (python-shell-font-lock-with-font-lock-buffer
+                         (buffer-substring-no-properties
+                          (line-beginning-position) (point-max))))
+            (current-point (point))
+            (buffer-undo-list t))
+        ;; When input hasn't changed, do nothing.
+        (when (not (string= input old-input))
+          (delete-region (cdr (python-util-comint-last-prompt)) (point-max))
+          (insert
+           (python-shell-font-lock-with-font-lock-buffer
+             (delete-region (line-beginning-position)
+                            (line-end-position))
+             (insert input)
+             ;; Ensure buffer is fontified, keeping it
+             ;; compatible with Emacs < 24.4.
+             (if (fboundp 'font-lock-ensure)
+                 (funcall 'font-lock-ensure)
+               (font-lock-default-fontify-buffer))
+             ;; Replace FACE text properties with FONT-LOCK-FACE so
+             ;; they are not overwritten by comint buffer's font lock.
+             (python-util-text-properties-replace-name
+              'face 'font-lock-face)
+             (buffer-substring (line-beginning-position)
+                               (line-end-position))))
+          (goto-char current-point))))))
+
+(defun python-shell-font-lock-turn-on (&optional msg)
+  "Turn on shell font-lock.
+With argument MSG show activation message."
+  (interactive "p")
+  (python-shell-with-shell-buffer
+    (python-shell-font-lock-kill-buffer)
+    (set (make-local-variable 'python-shell--font-lock-buffer) nil)
+    (add-hook 'post-command-hook
+              #'python-shell-font-lock-post-command-hook nil 'local)
+    (add-hook 'kill-buffer-hook
+              #'python-shell-font-lock-kill-buffer nil 'local)
+    (add-hook 'comint-output-filter-functions
+              #'python-shell-font-lock-comint-output-filter-function
+              'append 'local)
+    (when msg
+      (message "Shell font-lock is enabled"))))
+
+(defun python-shell-font-lock-turn-off (&optional msg)
+  "Turn off shell font-lock.
+With argument MSG show deactivation message."
+  (interactive "p")
+  (python-shell-with-shell-buffer
+    (python-shell-font-lock-kill-buffer)
+    (when (python-util-comint-last-prompt)
+      ;; Cleanup current fontification
+      (remove-text-properties
+       (cdr (python-util-comint-last-prompt))
+       (line-end-position)
+       '(face nil font-lock-face nil)))
+    (set (make-local-variable 'python-shell--font-lock-buffer) nil)
+    (remove-hook 'post-command-hook
+                 #'python-shell-font-lock-post-command-hook'local)
+    (remove-hook 'kill-buffer-hook
+                 #'python-shell-font-lock-kill-buffer 'local)
+    (remove-hook 'comint-output-filter-functions
+                 #'python-shell-font-lock-comint-output-filter-function
+                 'local)
+    (when msg
+      (message "Shell font-lock is disabled"))))
+
+(defun python-shell-font-lock-toggle (&optional msg)
+  "Toggle font-lock for shell.
+With argument MSG show activation/deactivation message."
+  (interactive "p")
+  (python-shell-with-shell-buffer
+    (set (make-local-variable 'python-shell-font-lock-enable)
+         (not python-shell-font-lock-enable))
+    (if python-shell-font-lock-enable
+        (python-shell-font-lock-turn-on msg)
+      (python-shell-font-lock-turn-off msg))
+    python-shell-font-lock-enable))
 
 (define-derived-mode inferior-python-mode comint-mode "Inferior Python"
   "Major mode for Python inferior process.
@@ -2121,13 +2350,17 @@ interpreter is run.  Variables
 `python-shell-prompt-regexp',
 `python-shell-prompt-output-regexp',
 `python-shell-prompt-block-regexp',
-`python-shell-enable-font-lock',
+`python-shell-font-lock-enable',
 `python-shell-completion-setup-code',
 `python-shell-completion-string-code',
 `python-eldoc-setup-code', `python-eldoc-string-code',
 `python-ffap-setup-code' and `python-ffap-string-code' can
 customize this mode for different Python interpreters.
 
+This mode resets `comint-output-filter-functions' locally, so you
+may want to re-add custom functions to it using the
+`inferior-python-mode-hook'.
+
 You can also add additional setup code to be run at
 initialization of the interpreter via `python-shell-setup-codes'
 variable.
@@ -2145,50 +2378,31 @@ variable.
   (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil)
   (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) nil)
   (python-shell-prompt-set-calculated-regexps)
-  (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp)
+  (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp
+        comint-prompt-read-only t)
   (setq mode-line-process '(":%s"))
-  (make-local-variable 'comint-output-filter-functions)
-  (add-hook 'comint-output-filter-functions
-            'python-comint-output-filter-function)
-  (add-hook 'comint-output-filter-functions
-            'python-pdbtrack-comint-output-filter-function)
+  (set (make-local-variable 'comint-output-filter-functions)
+       '(ansi-color-process-output
+         python-pdbtrack-comint-output-filter-function
+         python-comint-postoutput-scroll-to-bottom))
   (set (make-local-variable 'compilation-error-regexp-alist)
        python-shell-compilation-regexp-alist)
   (define-key inferior-python-mode-map [remap complete-symbol]
     'completion-at-point)
   (add-hook 'completion-at-point-functions
-            'python-shell-completion-complete-at-point nil 'local)
+            'python-shell-completion-at-point nil 'local)
   (add-to-list (make-local-variable 'comint-dynamic-complete-functions)
-               'python-shell-completion-complete-at-point)
+               'python-shell-completion-at-point)
   (define-key inferior-python-mode-map "\t"
     'python-shell-completion-complete-or-indent)
   (make-local-variable 'python-pdbtrack-buffers-to-kill)
   (make-local-variable 'python-pdbtrack-tracked-buffer)
   (make-local-variable 'python-shell-internal-last-output)
-  (when python-shell-enable-font-lock
-    (set-syntax-table python-mode-syntax-table)
-    (set (make-local-variable 'font-lock-defaults)
-         '(python-font-lock-keywords nil nil nil nil))
-    (set (make-local-variable 'syntax-propertize-function)
-         (eval
-          ;; XXX: Unfortunately eval is needed here to make use of the
-          ;; dynamic value of `comint-prompt-regexp'.
-          `(syntax-propertize-rules
-            (,comint-prompt-regexp
-             (0 (ignore
-                 (put-text-property
-                  comint-last-input-start end 'syntax-table
-                  python-shell-output-syntax-table)
-                 ;; XXX: This might look weird, but it is the easiest
-                 ;; way to ensure font lock gets cleaned up before the
-                 ;; current prompt, which is needed for unclosed
-                 ;; strings to not mess up with current input.
-                 (font-lock-unfontify-region comint-last-input-start end))))
-            (,(python-rx string-delimiter)
-             (0 (ignore
-                 (and (not (eq (get-text-property start 'field) 'output))
-                      (python-syntax-stringify)))))))))
-  (compilation-shell-minor-mode 1))
+  (when python-shell-font-lock-enable
+    (python-shell-font-lock-turn-on))
+  (compilation-shell-minor-mode 1)
+  (python-shell-accept-process-output
+   (get-buffer-process (current-buffer))))
 
 (defun python-shell-make-comint (cmd proc-name &optional pop internal)
   "Create a Python shell comint buffer.
@@ -2224,7 +2438,6 @@ killed."
                 (mapconcat #'identity args " ")))
           (with-current-buffer buffer
             (inferior-python-mode))
-          (accept-process-output process)
           (and pop (pop-to-buffer buffer t))
           (and internal (set-process-query-on-exit-flag process nil))))
       proc-buffer-name)))
@@ -2247,7 +2460,7 @@ process buffer for a list of commands.)"
   (interactive
    (if current-prefix-arg
        (list
-        (read-string "Run Python: " (python-shell-parse-command))
+        (read-shell-command "Run Python: " (python-shell-parse-command))
         (y-or-n-p "Make dedicated process? ")
         (= (prefix-numeric-value current-prefix-arg) 4))
      (list (python-shell-parse-command) nil t)))
@@ -2267,10 +2480,10 @@ difference with global or dedicated shells is that these ones are
 attached to a configuration, not a buffer.  This means that can
 be used for example to retrieve the sys.path and other stuff,
 without messing with user shells.  Note that
-`python-shell-enable-font-lock' and `inferior-python-mode-hook'
+`python-shell-font-lock-enable' and `inferior-python-mode-hook'
 are set to nil for these shells, so setup codes are not sent at
 startup."
-  (let ((python-shell-enable-font-lock nil)
+  (let ((python-shell-font-lock-enable nil)
         (inferior-python-mode-hook nil))
     (get-buffer-process
      (python-shell-make-comint
@@ -2278,16 +2491,19 @@ startup."
       (python-shell-internal-get-process-name) nil t))))
 
 (defun python-shell-get-buffer ()
-  "Return inferior Python buffer for current buffer."
-  (let* ((dedicated-proc-name (python-shell-get-process-name t))
-         (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name))
-         (global-proc-name  (python-shell-get-process-name nil))
-         (global-proc-buffer-name (format "*%s*" global-proc-name))
-         (dedicated-running (comint-check-proc dedicated-proc-buffer-name))
-         (global-running (comint-check-proc global-proc-buffer-name)))
-    ;; Always prefer dedicated
-    (or (and dedicated-running dedicated-proc-buffer-name)
-        (and global-running global-proc-buffer-name))))
+  "Return inferior Python buffer for current buffer.
+If current buffer is in `inferior-python-mode', return it."
+  (if (eq major-mode 'inferior-python-mode)
+      (current-buffer)
+    (let* ((dedicated-proc-name (python-shell-get-process-name t))
+           (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name))
+           (global-proc-name  (python-shell-get-process-name nil))
+           (global-proc-buffer-name (format "*%s*" global-proc-name))
+           (dedicated-running (comint-check-proc dedicated-proc-buffer-name))
+           (global-running (comint-check-proc global-proc-buffer-name)))
+      ;; Always prefer dedicated
+      (or (and dedicated-running dedicated-proc-buffer-name)
+          (and global-running global-proc-buffer-name)))))
 
 (defun python-shell-get-process ()
   "Return inferior Python process for current buffer."
@@ -2299,25 +2515,14 @@ Arguments CMD, DEDICATED and SHOW are those of `run-python' and
 are used to start the shell.  If those arguments are not
 provided, `run-python' is called interactively and the user will
 be asked for their values."
-  (let* ((dedicated-proc-name (python-shell-get-process-name t))
-         (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name))
-         (global-proc-name  (python-shell-get-process-name nil))
-         (global-proc-buffer-name (format "*%s*" global-proc-name))
-         (dedicated-running (comint-check-proc dedicated-proc-buffer-name))
-         (global-running (comint-check-proc global-proc-buffer-name))
-         (current-prefix-arg 16))
-    (when (and (not dedicated-running) (not global-running))
-      (if (if (not cmd)
-              ;; XXX: Refactor code such that calling `run-python'
-              ;; interactively is not needed anymore.
-              (call-interactively 'run-python)
-            (run-python cmd dedicated show))
-          (setq dedicated-running t)
-        (setq global-running t)))
-    ;; Always prefer dedicated
-    (get-buffer-process (if dedicated-running
-                            dedicated-proc-buffer-name
-                          global-proc-buffer-name))))
+  (let ((shell-process (python-shell-get-process)))
+    (when (not shell-process)
+      (if (not cmd)
+          ;; XXX: Refactor code such that calling `run-python'
+          ;; interactively is not needed anymore.
+          (call-interactively 'run-python)
+        (run-python cmd dedicated show)))
+    (or shell-process (python-shell-get-process))))
 
 (defvar python-shell-internal-buffer nil
   "Current internal shell buffer for the current buffer.
@@ -2335,13 +2540,7 @@ there for compatibility with CEDET.")
          (proc-buffer-name (format " *%s*" proc-name)))
     (when (not (process-live-p proc-name))
       (run-python-internal)
-      (setq python-shell-internal-buffer proc-buffer-name)
-      ;; XXX: Why is this `sit-for' needed?
-      ;; `python-shell-make-comint' calls `accept-process-output'
-      ;; already but it is not helping to get proper output on
-      ;; 'gnu/linux when the internal shell process is not running and
-      ;; a call to `python-shell-internal-send-string' is issued.
-      (sit-for 0.1 t))
+      (setq python-shell-internal-buffer proc-buffer-name))
     (get-buffer-process proc-buffer-name)))
 
 (define-obsolete-function-alias
@@ -2391,16 +2590,7 @@ detecting a prompt at the end of the buffer."
    string (ansi-color-filter-apply string)
    python-shell-output-filter-buffer
    (concat python-shell-output-filter-buffer string))
-  (when (string-match
-         ;; XXX: It seems on OSX an extra carriage return is attached
-         ;; at the end of output, this handles that too.
-         (concat
-          "\r?\n"
-          ;; Remove initial caret from calculated regexp
-          (replace-regexp-in-string
-           (rx string-start ?^) ""
-           python-shell--prompt-calculated-input-regexp)
-          "$")
+  (when (python-shell-comint-end-of-output-p
          python-shell-output-filter-buffer)
     ;; Output ends when `python-shell-output-filter-buffer' contains
     ;; the prompt attached at the end of it.
@@ -2600,18 +2790,24 @@ If DELETE is non-nil, delete the file afterwards."
 (defun python-shell-switch-to-shell ()
   "Switch to inferior Python process buffer."
   (interactive)
-  (pop-to-buffer (process-buffer (python-shell-get-or-create-process)) t))
+  (process-buffer (python-shell-get-or-create-process)) t)
 
 (defun python-shell-send-setup-code ()
   "Send all setup code for shell.
 This function takes the list of setup code to send from the
 `python-shell-setup-codes' list."
-  (let ((process (get-buffer-process (current-buffer))))
-    (dolist (code python-shell-setup-codes)
-      (when code
-        (message "Sent %s" code)
-        (python-shell-send-string
-         (symbol-value code) process)))))
+  (let ((process (python-shell-get-process))
+        (code (concat
+               (mapconcat
+                (lambda (elt)
+                  (cond ((stringp elt) elt)
+                        ((symbolp elt) (symbol-value elt))
+                        (t "")))
+                python-shell-setup-codes
+                "\n\n")
+               "\n\nprint ('python.el: sent setup code')")))
+    (python-shell-send-string code process)
+    (python-shell-accept-process-output process)))
 
 (add-hook 'inferior-python-mode-hook
           #'python-shell-send-setup-code)
@@ -2720,32 +2916,21 @@ LINE is used to detect the context on how to complete given INPUT."
                   (split-string completions
                                 "^'\\|^\"\\|;\\|'$\\|\"$" t)))))))
 
-(defun python-shell-completion-complete-at-point (&optional process)
-  "Perform completion at point in inferior Python.
+(defun python-shell-completion-at-point (&optional process)
+  "Function for `completion-at-point-functions' in `inferior-python-mode'.
 Optional argument PROCESS forces completions to be retrieved
 using that one instead of current buffer's process."
   (setq process (or process (get-buffer-process (current-buffer))))
   (let* ((start
           (save-excursion
-            (with-syntax-table python-dotty-syntax-table
-              (let* ((paren-depth (car (syntax-ppss)))
-                     (syntax-string "w_")
-                     (syntax-list (string-to-syntax syntax-string)))
-                ;; Stop scanning for the beginning of the completion
-                ;; subject after the char before point matches a
-                ;; delimiter
-                (while (member
-                        (car (syntax-after (1- (point)))) syntax-list)
-                  (skip-syntax-backward syntax-string)
-                  (when (or (equal (char-before) ?\))
-                            (equal (char-before) ?\"))
-                    (forward-char -1))
-                  (while (or
-                          ;; honor initial paren depth
-                          (> (car (syntax-ppss)) paren-depth)
-                          (python-syntax-context 'string))
-                    (forward-char -1)))
-                (point)))))
+            (if (not (re-search-backward
+                      (python-rx
+                       (or whitespace open-paren close-paren string-delimiter))
+                      (cdr (python-util-comint-last-prompt))
+                      t 1))
+                (cdr (python-util-comint-last-prompt))
+              (forward-char (length (match-string-no-properties 0)))
+              (point))))
          (end (point)))
     (list start end
           (completion-table-dynamic
@@ -2754,6 +2939,11 @@ using that one instead of current buffer's process."
             process (buffer-substring-no-properties
                      (line-beginning-position) end))))))
 
+(define-obsolete-function-alias
+  'python-shell-completion-complete-at-point
+  'python-shell-completion-at-point
+  "24.5")
+
 (defun python-shell-completion-complete-or-indent ()
   "Complete or indent depending on the context.
 If content before pointer is all whitespace, indent.
@@ -2860,18 +3050,19 @@ Argument OUTPUT is a string with the output from the comint process."
 \f
 ;;; Symbol completion
 
-(defun python-completion-complete-at-point ()
-  "Complete current symbol at point.
+(defun python-completion-at-point ()
+  "Function for `completion-at-point-functions' in `python-mode'.
 For this to work as best as possible you should call
 `python-shell-send-buffer' from time to time so context in
 inferior Python process is updated properly."
   (let ((process (python-shell-get-process)))
-    (if (not process)
-        (error "Completion needs an inferior Python process running")
-      (python-shell-completion-complete-at-point process))))
+    (when process
+      (python-shell-completion-at-point process))))
 
-(add-to-list 'debug-ignored-errors
-             "^Completion needs an inferior Python process running.")
+(define-obsolete-function-alias
+  'python-completion-complete-at-point
+  'python-completion-at-point
+  "24.5")
 
 \f
 ;;; Fill paragraph
@@ -3209,6 +3400,12 @@ The skeleton will be bound to python-skeleton-NAME."
   > _ \n
   '(python-skeleton--else) | ^)
 
+(python-skeleton-define import nil
+  "Import from module: "
+  "from " str & " " | -5
+  "import "
+  ("Identifier: " str ", ") -2 \n _)
+
 (python-skeleton-define try nil
   nil
   "try:" \n
@@ -3235,7 +3432,7 @@ The skeleton will be bound to python-skeleton-NAME."
   "class " str "(" ("Inheritance, %s: "
                     (unless (equal ?\( (char-before)) ", ")
                     str)
-  & ")" | -2
+  & ")" | -1
   ":" \n
   "\"\"\"" - "\"\"\"" \n
   > _ \n)
@@ -3383,8 +3580,7 @@ If not FORCE-INPUT is passed then what `python-info-current-symbol'
 returns will be used.  If not FORCE-PROCESS is passed what
 `python-shell-get-process' returns is used."
   (let ((process (or force-process (python-shell-get-process))))
-    (if (not process)
-        (error "Eldoc needs an inferior Python process running")
+    (when process
       (let ((input (or force-input
                        (python-info-current-symbol t))))
         (and input
@@ -3411,9 +3607,6 @@ Interactively, prompt for symbol."
                         nil nil symbol))))
   (message (python-eldoc--get-doc-at-point symbol)))
 
-(add-to-list 'debug-ignored-errors
-             "^Eldoc needs an inferior Python process running.")
-
 \f
 ;;; Imenu
 
@@ -3907,6 +4100,18 @@ to \"^python-\"."
                (cdr pair))))
    (buffer-local-variables from-buffer)))
 
+(defvar comint-last-prompt-overlay)     ; Shut up, bytecompiler
+
+(defun python-util-comint-last-prompt ()
+  "Return comint last prompt overlay start and end.
+This is for compatibility with Emacs < 24.4."
+  (cond ((bound-and-true-p comint-last-prompt-overlay)
+         (cons (overlay-start comint-last-prompt-overlay)
+               (overlay-end comint-last-prompt-overlay)))
+        ((bound-and-true-p comint-last-prompt)
+         comint-last-prompt)
+        (t nil)))
+
 (defun python-util-forward-comment (&optional direction)
   "Python mode specific version of `forward-comment'.
 Optional argument DIRECTION defines the direction to move to."
@@ -3918,6 +4123,68 @@ Optional argument DIRECTION defines the direction to move to."
       (goto-char comment-start))
     (forward-comment factor)))
 
+(defun python-util-list-directories (directory &optional predicate max-depth)
+  "List DIRECTORY subdirs, filtered by PREDICATE and limited by MAX-DEPTH.
+Argument PREDICATE defaults to `identity' and must be a function
+that takes one argument (a full path) and returns non-nil for
+allowed files.  When optional argument MAX-DEPTH is non-nil, stop
+searching when depth is reached, else don't limit."
+  (let* ((dir (expand-file-name directory))
+         (dir-length (length dir))
+         (predicate (or predicate #'identity))
+         (to-scan (list dir))
+         (tally nil))
+    (while to-scan
+      (let ((current-dir (car to-scan)))
+        (when (funcall predicate current-dir)
+          (setq tally (cons current-dir tally)))
+        (setq to-scan (append (cdr to-scan)
+                              (python-util-list-files
+                               current-dir #'file-directory-p)
+                              nil))
+        (when (and max-depth
+                   (<= max-depth
+                       (length (split-string
+                                (substring current-dir dir-length)
+                                "/\\|\\\\" t))))
+          (setq to-scan nil))))
+    (nreverse tally)))
+
+(defun python-util-list-files (dir &optional predicate)
+  "List files in DIR, filtering with PREDICATE.
+Argument PREDICATE defaults to `identity' and must be a function
+that takes one argument (a full path) and returns non-nil for
+allowed files."
+  (let ((dir-name (file-name-as-directory dir)))
+    (apply #'nconc
+           (mapcar (lambda (file-name)
+                     (let ((full-file-name (expand-file-name file-name dir-name)))
+                       (when (and
+                              (not (member file-name '("." "..")))
+                              (funcall (or predicate #'identity) full-file-name))
+                         (list full-file-name))))
+                   (directory-files dir-name)))))
+
+(defun python-util-list-packages (dir &optional max-depth)
+  "List packages in DIR, limited by MAX-DEPTH.
+When optional argument MAX-DEPTH is non-nil, stop searching when
+depth is reached, else don't limit."
+  (let* ((dir (expand-file-name dir))
+         (parent-dir (file-name-directory
+                      (directory-file-name
+                       (file-name-directory
+                        (file-name-as-directory dir)))))
+         (subpath-length (length parent-dir)))
+    (mapcar
+     (lambda (file-name)
+       (replace-regexp-in-string
+        (rx (or ?\\ ?/)) "." (substring file-name subpath-length)))
+     (python-util-list-directories
+      (directory-file-name dir)
+      (lambda (dir)
+        (file-exists-p (expand-file-name "__init__.py" dir)))
+      max-depth))))
+
 (defun python-util-popn (lst n)
   "Return LST first N elements.
 N should be an integer, when negative its opposite is used.
@@ -3934,6 +4201,23 @@ returned as is."
               n (1- n)))
       (reverse acc))))
 
+(defun python-util-text-properties-replace-name
+  (from to &optional start end)
+  "Replace properties named FROM to TO, keeping its value.
+Arguments START and END narrow the buffer region to work on."
+  (save-excursion
+    (goto-char (or start (point-min)))
+    (while (not (eobp))
+      (let ((plist (text-properties-at (point)))
+            (next-change (or (next-property-change (point) (current-buffer))
+                             (or end (point-max)))))
+        (when (plist-get plist from)
+          (let* ((face (plist-get plist from))
+                 (plist (plist-put plist from nil))
+                 (plist (plist-put plist to face)))
+            (set-text-properties (point) next-change plist (current-buffer))))
+        (goto-char next-change)))))
+
 (defun python-util-strip-string (string)
   "Strip STRING whitespace and newlines from end and beginning."
   (replace-regexp-in-string
@@ -4003,7 +4287,7 @@ returned as is."
        #'python-nav-end-of-defun)
 
   (add-hook 'completion-at-point-functions
-            #'python-completion-complete-at-point nil 'local)
+            #'python-completion-at-point nil 'local)
 
   (add-hook 'post-self-insert-hook
             #'python-indent-post-self-insert-function 'append 'local)
index 5ad5633fa852e103ecbfc07bb6facab7bb74b387..c47a3bd6fbe697fb5ee5a8dfc06f6de0cdd9fcd0 100644 (file)
@@ -1,4 +1,4 @@
-;;; scheme.el --- Scheme (and DSSSL) editing mode
+;;; scheme.el --- Scheme (and DSSSL) editing mode    -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1986-1988, 1997-1998, 2001-2014 Free Software
 ;; Foundation, Inc.
@@ -280,7 +280,9 @@ See `run-hooks'."
                    "\\|-module"
                   "\\)\\)\\>"
                   ;; Any whitespace and declared object.
-                  "[ \t]*(?"
+                  ;; The "(*" is for curried definitions, e.g.,
+                  ;;  (define ((sum a) b) (+ a b))
+                  "[ \t]*(*"
                   "\\(\\sw+\\)?")
           '(1 font-lock-keyword-face)
           '(6 (cond ((match-beginning 3) font-lock-function-name-face)
@@ -491,20 +493,20 @@ indentation."
 \f
 ;;; Let is different in Scheme
 
-(defun would-be-symbol (string)
-  (not (string-equal (substring string 0 1) "(")))
+;; (defun scheme-would-be-symbol (string)
+;;   (not (string-equal (substring string 0 1) "(")))
 
-(defun next-sexp-as-string ()
-  ;; Assumes that it is protected by a save-excursion
-  (forward-sexp 1)
-  (let ((the-end (point)))
-    (backward-sexp 1)
-    (buffer-substring (point) the-end)))
+;; (defun scheme-next-sexp-as-string ()
+;;   ;; Assumes that it is protected by a save-excursion
+;;   (forward-sexp 1)
+;;   (let ((the-end (point)))
+;;     (backward-sexp 1)
+;;     (buffer-substring (point) the-end)))
 
 ;; This is correct but too slow.
 ;; The one below works almost always.
 ;;(defun scheme-let-indent (state indent-point)
-;;  (if (would-be-symbol (next-sexp-as-string))
+;;  (if (scheme-would-be-symbol (scheme-next-sexp-as-string))
 ;;      (scheme-indent-specform 2 state indent-point)
 ;;      (scheme-indent-specform 1 state indent-point)))
 
index 724d22ab69b633201d44b22d25587a28ed38c98e..3b0550dcccaaa858aeb60236a5e10f2ba52864cb 100644 (file)
     (ksh88 . jsh)
     (oash . sh)
     (pdksh . ksh88)
+    (mksh . pdksh)
     (posix . sh)
     (tcsh . csh)
     (wksh . ksh88)
@@ -262,6 +263,7 @@ sh          Bourne Shell
       ksh      Korn Shell '93
        dtksh   CDE Desktop Korn Shell
       pdksh    Public Domain Korn Shell
+        mksh    MirOS BSD Korn Shell
       wksh     Window Korn Shell
       zsh      Z Shell
   oash         SCO OA (curses) Shell
@@ -271,7 +273,6 @@ sh          Bourne Shell
   :version "24.4"                       ; added dash
   :group 'sh-script)
 
-
 (defcustom sh-alias-alist
   (append (if (eq system-type 'gnu/linux)
             '((csh . tcsh)
@@ -279,11 +280,20 @@ sh                Bourne Shell
         ;; for the time being
         '((ksh . ksh88)
            (bash2 . bash)
-          (sh5 . sh)))
+          (sh5 . sh)
+           ;; Android's system shell
+           ("^/system/bin/sh$" . mksh)))
   "Alist for transforming shell names to what they really are.
-Use this where the name of the executable doesn't correspond to the type of
-shell it really is."
-  :type '(repeat (cons symbol symbol))
+Use this where the name of the executable doesn't correspond to
+the type of shell it really is.  Keys are regular expressions
+matched against the full path of the interpreter.  (For backward
+compatibility, keys may also be symbols, which are matched
+against the interpreter's basename.  The values are symbols
+naming the shell."
+  :type '(repeat (cons (radio
+                        (regexp :tag "Regular expression")
+                        (symbol :tag "Basename"))
+                       (symbol :tag "Shell")))
   :group 'sh-script)
 
 
@@ -387,15 +397,20 @@ the car and cdr are the same symbol.")
   "Non-nil if `sh-shell-variables' is initialized.")
 
 (defun sh-canonicalize-shell (shell)
-  "Convert a shell name SHELL to the one we should handle it as."
-  (if (string-match "\\.exe\\'" shell)
-      (setq shell (substring shell 0 (match-beginning 0))))
-  (or (symbolp shell)
-      (setq shell (intern shell)))
-  (or (cdr (assq shell sh-alias-alist))
-      shell))
-
-(defvar sh-shell (sh-canonicalize-shell (file-name-nondirectory sh-shell-file))
+  "Convert a shell name SHELL to the one we should handle it as.
+SHELL is a full path to the shell interpreter; return a shell
+name symbol."
+  (cl-loop
+     with shell = (cond ((string-match "\\.exe\\'" shell)
+                         (substring shell 0 (match-beginning 0)))
+                        (t shell))
+     with shell-base = (intern (file-name-nondirectory shell))
+     for (key . value) in sh-alias-alist
+     if (and (stringp key) (string-match key shell)) return value
+     if (eq key shell-base) return value
+     finally return shell-base))
+
+(defvar sh-shell (sh-canonicalize-shell sh-shell-file)
   "The shell being programmed.  This is set by \\[sh-set-shell].")
 ;;;###autoload(put 'sh-shell 'safe-local-variable 'symbolp)
 
@@ -680,7 +695,7 @@ removed when closing the here document."
           "jobs" "kill" "let" "local" "popd" "printf" "pushd" "shopt"
           "source" "suspend" "typeset" "unalias"
           ;; bash4
-          "mapfile" "readarray")
+          "mapfile" "readarray" "coproc")
 
     ;; The next entry is only used for defining the others
     (bourne sh-append shell
@@ -895,7 +910,7 @@ See `sh-feature'.")
      (:foreground "tan1" ))
     (t
      (:weight bold)))
-  "Face to show a here-document"
+  "Face to show a here-document."
   :group 'sh-indentation)
 
 ;; These colors are probably icky.  It's just a placeholder though.
@@ -906,7 +921,7 @@ See `sh-feature'.")
      (:foreground "magenta"))
     (t
      (:weight bold)))
-  "Face to show quoted execs like ``"
+  "Face to show quoted execs like `blabla`."
   :group 'sh-indentation)
 (define-obsolete-face-alias 'sh-heredoc-face 'sh-heredoc "22.1")
 (defvar sh-heredoc-face 'sh-heredoc)
@@ -1536,6 +1551,12 @@ When the region is active, send the region instead."
 \f
 ;; mode-command and utility functions
 
+(defun sh-after-hack-local-variables ()
+  (when (assq 'sh-shell file-local-variables-alist)
+    (sh-set-shell (if (symbolp sh-shell)
+                      (symbol-name sh-shell)
+                    sh-shell))))
+
 ;;;###autoload
 (define-derived-mode sh-mode prog-mode "Shell-script"
   "Major mode for editing shell scripts.
@@ -1646,7 +1667,9 @@ with your script for an edit-interpret-debug cycle."
          ((string-match "[.]csh\\>"    buffer-file-name) "csh")
         ((equal (file-name-nondirectory buffer-file-name) ".profile") "sh")
          (t sh-shell-file))
-   nil nil))
+   nil nil)
+  (add-hook 'hack-local-variables-hook
+    #'sh-after-hack-local-variables nil t))
 
 ;;;###autoload
 (defalias 'shell-script-mode 'sh-mode)
@@ -2300,9 +2323,7 @@ Calls the value of `sh-set-shell-hook' if set."
                     t))
   (if (string-match "\\.exe\\'" shell)
       (setq shell (substring shell 0 (match-beginning 0))))
-  (setq sh-shell (intern (file-name-nondirectory shell))
-       sh-shell (or (cdr (assq sh-shell sh-alias-alist))
-                    sh-shell))
+  (setq sh-shell (sh-canonicalize-shell shell))
   (if insert-flag
       (setq sh-shell-file
            (executable-set-magic shell (sh-feature sh-shell-arg)
@@ -2354,7 +2375,7 @@ Calls the value of `sh-set-shell-hook' if set."
   (when font-lock-mode
     (setq font-lock-set-defaults nil)
     (font-lock-set-defaults)
-    (font-lock-fontify-buffer))
+    (font-lock-flush))
   (setq sh-shell-process nil)
   (run-hooks 'sh-set-shell-hook))
 
index f9efa3732c75e7121adf3a3a5f0d949af16a8d13..a8455c500643fd1771207c193c77ed790a5dfe4e 100644 (file)
@@ -1,4 +1,4 @@
-;;; subword.el --- Handling capitalized subwords in a nomenclature
+;;; subword.el --- Handling capitalized subwords in a nomenclature -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
 
 
 ;;; Commentary:
 
-;; This package was cc-submode.el before it was recognized being
-;; useful in general and not tied to C and c-mode at all.
-
-;; This package provides `subword' oriented commands and a minor mode
-;; (`subword-mode') that substitutes the common word handling
-;; functions with them.  It also provides the `superword-mode' minor
-;; mode that treats symbols as words, the opposite of `subword-mode'.
+;; This package provides the `subword' minor mode, which merges the
+;; old remap-based subword.el (derived from cc-mode code) and
+;; cap-words.el, which takes advantage of core Emacs
+;; word-motion-customization functionality.
 
 ;; In spite of GNU Coding Standards, it is popular to name a symbol by
 ;; mixing uppercase and lowercase letters, e.g. "GtkWidget",
 ;; words.  You also get a mode to treat symbols as words instead,
 ;; called `superword-mode' (the opposite of `subword-mode').
 
-;; In the minor mode, all common key bindings for word oriented
-;; commands are overridden by the subword oriented commands:
-
-;; Key     Word oriented command      Subword oriented command (also superword)
-;; ============================================================
-;; M-f     `forward-word'             `subword-forward'
-;; M-b     `backward-word'            `subword-backward'
-;; M-@     `mark-word'                `subword-mark'
-;; M-d     `kill-word'                `subword-kill'
-;; M-DEL   `backward-kill-word'       `subword-backward-kill'
-;; M-t     `transpose-words'          `subword-transpose'
-;; M-c     `capitalize-word'          `subword-capitalize'
-;; M-u     `upcase-word'              `subword-upcase'
-;; M-l     `downcase-word'            `subword-downcase'
-;;
-;; Note: If you have changed the key bindings for the word oriented
-;; commands in your .emacs or a similar place, the keys you've changed
-;; to are also used for the corresponding subword oriented commands.
-
 ;; To make the mode turn on automatically, put the following code in
 ;; your .emacs:
 ;;
   "Regexp used by `subword-backward-internal'.")
 
 (defvar subword-mode-map
-  (let ((map (make-sparse-keymap)))
-    (dolist (cmd '(forward-word backward-word mark-word kill-word
-                               backward-kill-word transpose-words
-                                capitalize-word upcase-word downcase-word
-                                left-word right-word))
-      (let ((othercmd (let ((name (symbol-name cmd)))
-                        (string-match "\\([[:alpha:]-]+\\)-word[s]?" name)
-                        (intern (concat "subword-" (match-string 1 name))))))
-        (define-key map (vector 'remap cmd) othercmd)))
-    map)
+  ;; We originally remapped motion keys here, but now use Emacs core
+  ;; hooks.  Leave this keymap around so that user additions to it
+  ;; keep working.
+  (make-sparse-keymap)
   "Keymap used in `subword-mode' minor mode.")
 
+;;;###autoload
+(define-obsolete-function-alias
+  'capitalized-words-mode 'subword-mode "24.5")
+
 ;;;###autoload
 (define-minor-mode subword-mode
   "Toggle subword movement and editing (Subword mode).
@@ -121,8 +97,8 @@ With a prefix argument ARG, enable Subword mode if ARG is
 positive, and disable it otherwise.  If called from Lisp, enable
 the mode if ARG is omitted or nil.
 
-Subword mode is a buffer-local minor mode.  Enabling it remaps
-word-based editing commands to subword-based commands that handle
+Subword mode is a buffer-local minor mode.  Enabling it changes
+the definition of a word so that word-based commands stop inside
 symbols with mixed uppercase and lowercase letters,
 e.g. \"GtkWidget\", \"EmacsFrameClass\", \"NSGraphicsContext\".
 
@@ -136,13 +112,13 @@ called a `subword'.  Here are some examples:
   EmacsFrameClass    =>  \"Emacs\", \"Frame\" and \"Class\"
   NSGraphicsContext  =>  \"NS\", \"Graphics\" and \"Context\"
 
-The subword oriented commands activated in this minor mode recognize
-subwords in a nomenclature to move between subwords and to edit them
-as words.
+This mode changes the definition of a word so that word commands
+treat nomenclature boundaries as word bounaries.
 
 \\{subword-mode-map}"
     :lighter " ,"
-    (when subword-mode (superword-mode -1)))
+    (when subword-mode (superword-mode -1))
+    (subword-setup-buffer))
 
 (define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2")
 
@@ -151,6 +127,13 @@ as words.
   (lambda () (subword-mode 1))
   :group 'convenience)
 
+;; N.B. These commands aren't used unless explicitly invoked; they're
+;; here for compatibility.  Today, subword-mode leaves motion commands
+;; alone and uses `find-word-boundary-function-table' to change how
+;; `forward-word' and other low-level commands detect word bounaries.
+;; This way, all word-related activities, not just the images we
+;; imagine here, get subword treatment.
+
 (defun subword-forward (&optional arg)
   "Do the same as `forward-word' but on subwords.
 See the command `subword-mode' for a description of subwords.
@@ -159,10 +142,10 @@ Optional argument ARG is the same as for `forward-word'."
   (unless arg (setq arg 1))
   (cond
    ((< 0 arg)
-    (dotimes (i arg (point))
+    (dotimes (_i arg (point))
       (funcall subword-forward-function)))
    ((> 0 arg)
-    (dotimes (i (- arg) (point))
+    (dotimes (_i (- arg) (point))
       (funcall subword-backward-function)))
    (t
     (point))))
@@ -262,7 +245,7 @@ Optional argument ARG is the same as for `capitalize-word'."
             (start (point))
             (advance (>= arg 0)))
 
-        (dotimes (i count)
+        (dotimes (_i count)
           (if advance
               (progn
                 (re-search-forward "[[:alpha:]]")
@@ -290,17 +273,15 @@ With a prefix argument ARG, enable Superword mode if ARG is
 positive, and disable it otherwise.  If called from Lisp, enable
 the mode if ARG is omitted or nil.
 
-Superword mode is a buffer-local minor mode.  Enabling it remaps
-word-based editing commands to superword-based commands that
-treat symbols as words, e.g. \"this_is_a_symbol\".
-
-The superword oriented commands activated in this minor mode
-recognize symbols as superwords to move between superwords and to
-edit them as words.
+Superword mode is a buffer-local minor mode.  Enabling it changes
+the definition of words such that symbols characters are treated
+as parts of words: e.g., in `superword-mode',
+\"this_is_a_symbol\" counts as one word.
 
 \\{superword-mode-map}"
     :lighter " ²"
-    (when superword-mode (subword-mode -1)))
+    (when superword-mode (subword-mode -1))
+    (subword-setup-buffer))
 
 ;;;###autoload
 (define-global-minor-mode global-superword-mode superword-mode
@@ -347,9 +328,45 @@ edit them as words.
            (1+ (match-beginning 0)))))
       (backward-word 1))))
 
+(defconst subword-find-word-boundary-function-table
+  (let ((tab (make-char-table nil)))
+    (set-char-table-range tab t #'subword-find-word-boundary)
+    tab)
+  "Assigned to `find-word-boundary-function-table' in
+`subword-mode' and `superword-mode'; defers to
+`subword-find-word-bounary'.")
+
+(defconst subword-empty-char-table
+  (make-char-table nil)
+  "Assigned to `find-word-boundary-function-table' while we're
+searching subwords in order to avoid unwanted reentrancy.")
+
+(defun subword-setup-buffer ()
+  (set (make-local-variable 'find-word-boundary-function-table)
+       (if (or subword-mode superword-mode)
+           subword-find-word-boundary-function-table
+         subword-empty-char-table)))
+
+(defun subword-find-word-boundary (pos limit)
+  "Catch-all handler in `subword-find-word-boundary-function-table'."
+  (let ((find-word-boundary-function-table subword-empty-char-table))
+    (save-match-data
+      (save-excursion
+        (save-restriction
+          (if (< pos limit)
+              (progn
+                (goto-char pos)
+                (narrow-to-region (point-min) limit)
+                (funcall subword-forward-function))
+            (goto-char (1+ pos))
+            (narrow-to-region limit (point-max))
+            (funcall subword-backward-function))
+          (point))))))
+
 \f
 
 (provide 'subword)
 (provide 'superword)
+(provide 'cap-words) ; Obsolete alias
 
 ;;; subword.el ends here
index 069e7119b906c5baaf035ead6fd9872418f68d88..7cb8f457e3f206caca10e5236d54d79507e50ed8 100644 (file)
@@ -138,7 +138,6 @@ If nil, TAB always indents current line."
     (define-key map "\C-c\t"   'indent-according-to-mode)
     (define-key map "\M-\C-\\" 'vera-indent-region)
     (define-key map "\C-c\C-c" 'vera-comment-uncomment-region)
-    (define-key map "\C-c\C-f" 'vera-fontify-buffer)
     (define-key map "\C-c\C-v" 'vera-version)
     (define-key map "\M-\t"    'tab-to-tab-stop)
     ;; Electric key bindings.
@@ -172,8 +171,6 @@ If nil, TAB always indents current line."
     ["Indent Region"           vera-indent-region (mark)]
     ["Indent Buffer"           vera-indent-buffer t]
     "--"
-    ["Fontify Buffer"          vera-fontify-buffer t]
-    "--"
     ["Documentation"           describe-mode]
     ["Version"                 vera-version t]
     ["Bug Report..."           vera-submit-bug-report t]
@@ -686,7 +683,8 @@ Adapted from `font-lock-match-c-style-declaration-item-and-skip-to-next'."
   "Font lock mode face used to highlight interface names."
   :group 'font-lock-highlighting-faces)
 
-(defalias 'vera-fontify-buffer 'font-lock-fontify-buffer)
+(define-obsolete-function-alias 'vera-fontify-buffer
+  'font-lock-fontify-buffer "24.5")
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Indentation
index 84d7c15f76ceddaaa2ec11144f4c634728f1a03f..b649959bae318f88620b3a1b352d24176c0ade46 100644 (file)
 ;;; Code:
 
 ;; This variable will always hold the version number of the mode
-(defconst verilog-mode-version "2013-11-05-78e66ba-vpo"
+(defconst verilog-mode-version "2014-05-31-3cd8144-vpo"
   "Version of this Verilog mode.")
 (defconst verilog-mode-release-emacs t
   "If non-nil, this version of Verilog mode was released with Emacs itself.")
@@ -1020,6 +1020,20 @@ SystemVerilog designs."
   :type 'string)
 (put 'verilog-assignment-delay 'safe-local-variable 'stringp)
 
+(defcustom verilog-auto-arg-format 'packed
+  "Formatting to use for AUTOARG signal names.
+If 'packed', then as many inputs and outputs that fit within
+`fill-column' will be put onto one line.
+
+If 'single', then a single input or output will be put onto each
+line."
+  :version "24.5"
+  :type '(radio (const :tag "Line up Assignments and Declarations" packed)
+               (const :tag "Line up Assignment statements" single))
+  :group 'verilog-mode-auto)
+(put 'verilog-auto-arg-format 'safe-local-variable
+     '(lambda (x) (memq x '(packed single))))
+
 (defcustom verilog-auto-arg-sort nil
   "Non-nil means AUTOARG signal names will be sorted, not in declaration order.
 Declaration order is advantageous with order based instantiations
@@ -1634,7 +1648,7 @@ will break, as the o's continuously replace.  xa -> x works ok though."
     string))
 
 (defsubst verilog-re-search-forward (REGEXP BOUND NOERROR)
-  ; checkdoc-params: (REGEXP BOUND NOERROR)
+  ;; checkdoc-params: (REGEXP BOUND NOERROR)
   "Like `re-search-forward', but skips over match in comments or strings."
   (let ((mdata '(nil nil)))  ;; So match-end will return nil if no matches found
     (while (and
@@ -1650,7 +1664,7 @@ will break, as the o's continuously replace.  xa -> x works ok though."
     (match-end 0)))
 
 (defsubst verilog-re-search-backward (REGEXP BOUND NOERROR)
-  ; checkdoc-params: (REGEXP BOUND NOERROR)
+  ;; checkdoc-params: (REGEXP BOUND NOERROR)
   "Like `re-search-backward', but skips over match in comments or strings."
   (let ((mdata '(nil nil)))  ;; So match-end will return nil if no matches found
     (while (and
@@ -1679,7 +1693,7 @@ so there may be a large up front penalty for the first search."
     pt))
 
 (defsubst verilog-re-search-backward-quick (regexp bound noerror)
-  ; checkdoc-params: (REGEXP BOUND NOERROR)
+  ;; checkdoc-params: (REGEXP BOUND NOERROR)
   "Like `verilog-re-search-backward', including use of REGEXP BOUND and NOERROR,
 but trashes match data and is faster for REGEXP that doesn't match often.
 This uses `verilog-scan' and text properties to ignore comments,
@@ -1748,6 +1762,7 @@ To call on \\[verilog-auto], set `verilog-auto-delete-trailing-whitespace'."
     (unless (bolp) (insert "\n"))))
 
 (defvar compile-command)
+(defvar create-lockfiles)  ;; Emacs 24
 
 ;; compilation program
 (defun verilog-set-compile-command ()
@@ -2788,8 +2803,8 @@ find the errors."
      "sync_reject_on" "unique0" "until" "until_with" "untyped" "weak"
      ;; 1800-2012
      "implements" "interconnect" "nettype" "soft"
- )
- "List of Verilog keywords.")
    )
 "List of Verilog keywords.")
 
 (defconst verilog-comment-start-regexp "//\\|/\\*"
   "Dual comment value for `comment-start-regexp'.")
@@ -2906,7 +2921,7 @@ See also `verilog-font-lock-extra-types'.")
           '(
             "and" "bit" "buf" "bufif0" "bufif1" "cmos" "defparam"
             "event" "genvar" "inout" "input" "integer" "localparam"
-            "logic" "mailbox" "nand" "nmos" "not" "notif0" "notif1" "or"
+            "logic" "mailbox" "nand" "nmos" "nor" "not" "notif0" "notif1" "or"
             "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup"
             "rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran"
             "rtranif0" "rtranif1" "semaphore" "signed" "struct" "supply"
@@ -3332,9 +3347,9 @@ Use filename, if current buffer being edited shorten to just buffer name."
                  (verilog-re-search-backward reg nil 'move))
        (cond
         ((match-end 1) ; matched verilog-end-block-re
-       ; try to leap back to matching outward block by striding across
-       ; indent level changing tokens then immediately
-       ; previous line governs indentation.
+         ;; try to leap back to matching outward block by striding across
+         ;; indent level changing tokens then immediately
+         ;; previous line governs indentation.
          (verilog-leap-to-head))
         ((match-end 2) ; else, we're in deep
          (setq elsec (1+ elsec)))
@@ -3992,7 +4007,7 @@ This puts the mark at the end, and point at the beginning."
     (mark-defun)))
 
 (defun verilog-comment-region (start end)
-  ; checkdoc-params: (start end)
+  ;; checkdoc-params: (start end)
   "Put the region into a Verilog comment.
 The comments that are in this area are \"deformed\":
 `*)' becomes `!(*' and `}' becomes `!{'.
@@ -4223,7 +4238,7 @@ Uses `verilog-scan' cache."
      ((equal (char-after) ?\})
       (forward-char))
 
-      ;; Skip to end of statement
+     ;; Skip to end of statement
      ((condition-case nil
        (setq pos
              (catch 'found
@@ -4285,7 +4300,7 @@ More specifically, point @ in the line foo : @ begin"
                (setq nest (1+ nest)))
               ((match-end 2)
                (if (= nest 1)
-               (throw 'found 1))
+                   (throw 'found 1))
                (setq nest (1- nest)))
               (t
                (throw 'found (= nest 0)))))))
@@ -4430,6 +4445,7 @@ Limit search to point LIM."
          "\\(`ifdef\\>\\)\\|"
          "\\(`ifndef\\>\\)\\|"
          "\\(`elsif\\>\\)"))
+
 (defun verilog-set-auto-endcomments (indent-str kill-existing-comment)
   "Add ending comment with given INDENT-STR.
 With KILL-EXISTING-COMMENT, remove what was there before.
@@ -5078,13 +5094,13 @@ FILENAME to find directory to run in, or defaults to `buffer-file-name`."
    (list
     (let ((default (verilog-expand-command verilog-preprocessor)))
       (set (make-local-variable `verilog-preprocessor)
-             (read-from-minibuffer "Run Preprocessor (like this): "
-                                    default nil nil
-                                     'verilog-preprocess-history default)))))
+          (read-from-minibuffer "Run Preprocessor (like this): "
+                                default nil nil
+                                'verilog-preprocess-history default)))))
   (unless command (setq command (verilog-expand-command verilog-preprocessor)))
   (let* ((fontlocked (and (boundp 'font-lock-mode) font-lock-mode))
-         (dir (file-name-directory (or filename buffer-file-name)))
-          (cmd (concat "cd " dir "; " command)))
+        (dir (file-name-directory (or filename buffer-file-name)))
+        (cmd (concat "cd " dir "; " command)))
     (with-output-to-temp-buffer "*Verilog-Preprocessed*"
       (with-current-buffer (get-buffer "*Verilog-Preprocessed*")
        (insert (concat "// " cmd "\n"))
@@ -5092,7 +5108,11 @@ FILENAME to find directory to run in, or defaults to `buffer-file-name`."
        (verilog-mode)
        ;; Without this force, it takes a few idle seconds
        ;; to get the color, which is very jarring
-       (when fontlocked (font-lock-fontify-buffer))))))
+        (unless (fboundp 'font-lock-ensure)
+          ;; We should use font-lock-ensure in preference to
+          ;; font-lock-fontify-buffer, but IIUC the problem this is supposed to
+          ;; solve only appears in Emacsen older than font-lock-ensure anyway.
+          (when fontlocked (font-lock-fontify-buffer)))))))
 \f
 
 ;;
@@ -5138,23 +5158,29 @@ Save the result unless optional NO-SAVE is t."
    ;; Make sure any sub-files we read get proper mode
    (setq-default major-mode 'verilog-mode)
    ;; Ditto files already read in
-   (mapc (lambda (buf)
-          (when (buffer-file-name buf)
-            (with-current-buffer buf
-              (verilog-mode))))
-        (buffer-list))
-   ;; Process the files
-   (mapcar (lambda (buf)
+   ;; Remember buffer list, so don't later pickup any verilog-getopt files
+   (let ((orig-buffer-list (buffer-list)))
+     (mapc (lambda (buf)
             (when (buffer-file-name buf)
-              (save-excursion
-                (if (not (file-exists-p (buffer-file-name buf)))
-                    (error
-                     (concat "File not found: " (buffer-file-name buf))))
-                (message (concat "Processing " (buffer-file-name buf)))
-                (set-buffer buf)
-                (funcall funref)
-                (unless no-save (save-buffer)))))
-          (buffer-list))))
+              (with-current-buffer buf
+                (verilog-mode)
+                (verilog-auto-reeval-locals)
+                (verilog-getopt-flags))))
+          orig-buffer-list)
+     ;; Process the files
+     (mapcar (lambda (buf)
+              (when (buffer-file-name buf)
+                (save-excursion
+                  (if (not (file-exists-p (buffer-file-name buf)))
+                      (error
+                       (concat "File not found: " (buffer-file-name buf))))
+                  (message (concat "Processing " (buffer-file-name buf)))
+                  (set-buffer buf)
+                  (funcall funref)
+                  (when (and (not no-save)
+                             (buffer-modified-p)) ;; Avoid "no changes to be saved"
+                    (save-buffer)))))
+            orig-buffer-list))))
 
 (defun verilog-batch-auto ()
   "For use with --batch, perform automatic expansions as a stand-alone tool.
@@ -5271,7 +5297,7 @@ Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
                   (if (save-excursion (beginning-of-line)
                                       (and (looking-at verilog-directive-re-1)
                                            (not (or (looking-at "[ \t]*`[ou]vm_")
-                                 (looking-at "[ \t]*`vmm_")))))
+                                                    (looking-at "[ \t]*`vmm_")))))
                       (throw 'nesting 'directive))
            ;; indent structs as if there were module level
            (setq structres (verilog-in-struct-nested-p))
@@ -5510,10 +5536,10 @@ Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
                                        ; endfunction
              (verilog-beg-of-statement)
              (if (looking-at verilog-beg-block-re-ordered)
-              (throw 'nesting 'block)
-            (throw 'nesting 'defun)))
+                 (throw 'nesting 'block)
+               (throw 'nesting 'defun)))
 
-         ;;
+            ;;
             ((looking-at "\\<property\\>")
                                        ; *sigh*
                                        ;    {assert|assume|cover} property (); are complete
@@ -5704,7 +5730,7 @@ Jump from end to matching begin, from endcase to matching case, and so on."
                    (setq sreg reg)
                    (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" ))
                   )))
-           ;no nesting
+           ;no nesting
            (if (and
                 (verilog-re-search-backward reg nil 'move)
                 (match-end 1)) ; task -> could be virtual and/or protected
@@ -6547,10 +6573,9 @@ Be verbose about progress unless optional QUIET set."
                      endpos (set-marker (make-marker) end)
                      base-ind (progn
                                 (goto-char start)
-                 (forward-char 1)
-                 (skip-chars-forward " \t")
-                 (current-column))
-                     )
+                                (forward-char 1)
+                                (skip-chars-forward " \t")
+                                (current-column)))
              ;; in a declaration block (not in argument list)
              (setq
               start (progn
@@ -8065,7 +8090,7 @@ Optional NUM-PARAM and MAX-PARAM check for a specific number of parameters."
 Return an array of [outputs inouts inputs wire reg assign const]."
   (let ((end-mod-point (or (verilog-get-end-of-defun) (point-max)))
        (functask 0) (paren 0) (sig-paren 0) (v2kargs-ok t)
-       in-modport in-clocking ptype ign-prop
+       in-modport in-clocking in-ign-to-semi ptype ign-prop
        sigs-in sigs-out sigs-inout sigs-var sigs-assign sigs-const
        sigs-gparam sigs-intf sigs-modports
        vec expect-signal keywd newsig rvalue enum io signed typedefed multidim
@@ -8097,19 +8122,24 @@ Return an array of [outputs inouts inputs wire reg assign const]."
          (or (re-search-forward "[^\\]\"" nil t)       ;; don't forward-char first, since we look for a non backslash first
              (error "%s: Unmatched quotes, at char %d" (verilog-point-text) (point))))
         ((eq ?\; (following-char))
-         (when (and in-modport (not (eq in-modport t))) ;; end of a modport declaration
-           (verilog-modport-decls-set
-            in-modport
-            (verilog-decls-new sigs-out sigs-inout sigs-in
-                               nil nil nil nil nil nil))
-           ;; Pop from varstack to restore state to pre-clocking
-           (setq tmp (car varstack)
-                 varstack (cdr varstack)
-                 sigs-out (aref tmp 0)
-                 sigs-inout (aref tmp 1)
-                 sigs-in (aref tmp 2)))
-         (setq vec nil  io nil  expect-signal nil  newsig nil  paren 0  rvalue nil
-               v2kargs-ok nil  in-modport nil  ign-prop nil)
+         (cond (in-ign-to-semi  ;; Such as inside a "import ...;" in a module header
+                (setq in-ign-to-semi nil))
+               ((and in-modport (not (eq in-modport t))) ;; end of a modport declaration
+                (verilog-modport-decls-set
+                 in-modport
+                 (verilog-decls-new sigs-out sigs-inout sigs-in
+                                    nil nil nil nil nil nil))
+                ;; Pop from varstack to restore state to pre-clocking
+                (setq tmp (car varstack)
+                      varstack (cdr varstack)
+                      sigs-out (aref tmp 0)
+                      sigs-inout (aref tmp 1)
+                      sigs-in (aref tmp 2))
+                (setq vec nil  io nil  expect-signal nil  newsig nil  paren 0  rvalue nil
+                      v2kargs-ok nil  in-modport nil  ign-prop nil))
+               (t
+                (setq vec nil  io nil  expect-signal nil  newsig nil  paren 0  rvalue nil
+                      v2kargs-ok nil  in-modport nil  ign-prop nil)))
          (forward-char 1))
         ((eq ?= (following-char))
          (setq rvalue t  newsig nil)
@@ -8212,8 +8242,12 @@ Return an array of [outputs inouts inputs wire reg assign const]."
                 (setq in-modport t))
                ((equal keywd "clocking")
                 (setq in-clocking t))
+               ((equal keywd "import")
+                (if v2kargs-ok  ;; import in module header, not a modport import
+                    (setq in-ign-to-semi t  rvalue t)))
                ((equal keywd "type")
                 (setq ptype t))
+               ((equal keywd "var"))
                ;; Ifdef?  Ignore name of define
                ((member keywd '("`ifdef" "`ifndef" "`elsif"))
                 (setq rvalue t))
@@ -8285,6 +8319,7 @@ Return an array of [outputs inouts inputs wire reg assign const]."
                      (eq functask 0)
                      (not (member keywd verilog-keywords)))
                 ;; Add new signal to expect-signal's variable
+                ;;(if dbg (setq dbg (concat dbg (format "Pt %s  New sig %s'\n" (point) keywd))))
                 (setq newsig (verilog-sig-new keywd vec nil nil enum signed typedefed multidim modport))
                 (set expect-signal (cons newsig
                                          (symbol-value expect-signal))))))
@@ -9138,7 +9173,7 @@ foo.v (an include file):
        `define _FOO_V
        ... contents of file
        `endif // _FOO_V"
-;;slow:  (verilog-read-defines nil t))
+  ;;slow:  (verilog-read-defines nil t)
   (save-excursion
     (verilog-getopt-flags)
     (goto-char (point-min))
@@ -9527,7 +9562,7 @@ variables to build the path.  With optional CHECK-EXT also check
                   (setq outlist (cons (expand-file-name
                                        fn (file-name-directory current))
                                       outlist)))
-                (setq chkexts (cdr chkexts)))
+              (setq chkexts (cdr chkexts)))
             (setq chkdirs (cdr chkdirs)))
           (setq outlist (nreverse outlist))
           (setq verilog-dir-cache-lib-filenames
@@ -9624,7 +9659,7 @@ Return modi if successful, else print message unless IGNORE-ERROR is true."
                allow-cache
                (setq modi (gethash module verilog-modi-lookup-cache))
                (equal verilog-modi-lookup-last-current current)
-               ;; Iff hit is in current buffer, then tick must match
+               ;; If hit is in current buffer, then tick must match
                (or (equal verilog-modi-lookup-last-tick (buffer-chars-modified-tick))
                    (not (equal current (verilog-modi-file-or-buffer modi)))))
           ;;(message "verilog-modi-lookup: HIT %S" modi)
@@ -10602,7 +10637,7 @@ If FORCE, always reread it."
 ;;
 
 (defun verilog-auto-arg-ports (sigs message indent-pt)
-  "Print a list of ports for an AUTOINST.
+  "Print a list of ports for AUTOARG.
 Takes SIGS list, adds MESSAGE to front and inserts each at INDENT-PT."
   (when sigs
     (when verilog-auto-arg-sort
@@ -10614,13 +10649,19 @@ Takes SIGS list, adds MESSAGE to front and inserts each at INDENT-PT."
     (let ((space ""))
       (indent-to indent-pt)
       (while sigs
-       (cond ((> (+ 2 (current-column) (length (verilog-sig-name (car sigs)))) fill-column)
+       (cond ((equal verilog-auto-arg-format 'single)
+              (indent-to indent-pt)
+              (setq space "\n"))
+             ;; verilog-auto-arg-format 'packed
+             ((> (+ 2 (current-column) (length (verilog-sig-name (car sigs)))) fill-column)
               (insert "\n")
-              (indent-to indent-pt))
-             (t (insert space)))
+              (indent-to indent-pt)
+              (setq space " "))
+             (t
+              (insert space)
+              (setq space " ")))
        (insert (verilog-sig-name (car sigs)) ",")
-       (setq sigs (cdr sigs)
-             space " ")))))
+       (setq sigs (cdr sigs))))))
 
 (defun verilog-auto-arg ()
   "Expand AUTOARG statements.
@@ -10655,9 +10696,11 @@ Typing \\[verilog-auto] will make this into:
          output o;
        endmodule
 
-The argument declarations may be printed in declaration order to best suit
-order based instantiations, or alphabetically, based on the
-`verilog-auto-arg-sort' variable.
+The argument declarations may be printed in declaration order to
+best suit order based instantiations, or alphabetically, based on
+the `verilog-auto-arg-sort' variable.
+
+Formatting is controlled with `verilog-auto-arg-format' variable.
 
 Any ports declared between the ( and /*AUTOARG*/ are presumed to be
 predeclared and are not redeclared by AUTOARG.  AUTOARG will make a
@@ -12071,7 +12114,7 @@ against the previous example's module:
                             (verilog-signals-matching-regexp sig-list-if regexp)
                             "interface" direction-re))
          (when v2k (verilog-repair-open-comma))
-         (when (or sig-list-i sig-list-o sig-list-io)
+         (when (or sig-list-i sig-list-o sig-list-io sig-list-if)
            (verilog-insert-indent "// Beginning of automatic in/out/inouts (from specific module)\n")
            ;; Don't sort them so an upper AUTOINST will match the main module
            (verilog-insert-definition modi sig-list-o  "output" indent-pt v2k t)
@@ -13538,8 +13581,7 @@ for sensitivity list."
   ()
   > "begin" '(verilog-sk-prompt-name) \n
   > _ \n
-  > (- verilog-indent-level-behavioral) "end"
-)
+  > (- verilog-indent-level-behavioral) "end" )
 
 (define-skeleton verilog-sk-fork
   "Insert a fork join block."
index b422cf6c989c4061c665c440e8bf689ebda418f3..3d5a3980a94d51a8d2e798b4c9ae657d74a6ec2f 100644 (file)
 ;; filed in the Emacs bug reporting system against this file, a copy
 ;; of the bug report be sent to the maintainer's email address.
 
-(defconst vhdl-version "3.34.2"
+(defconst vhdl-version "3.35.2"
   "VHDL Mode version number.")
 
-(defconst vhdl-time-stamp "2012-11-21"
+(defconst vhdl-time-stamp "2014-03-28"
   "VHDL Mode time stamp for last update.")
 
 ;; This file is part of GNU Emacs.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Emacs Versions
 
-;; this updated version was only tested on: GNU Emacs 20.4
+;; this updated version was only tested on: GNU Emacs 24.1
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Installation
 
-;; Prerequisites:  GNU Emacs 20.X/21.X/22.X/23.X, XEmacs 20.X/21.X.
+;; Prerequisites:  GNU Emacs 20/21/22/23/24, XEmacs 20/21.
 
 ;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation
 ;; or into an arbitrary directory that is added to the load path by the
@@ -392,7 +392,8 @@ File message:
 Unit-to-file name mapping: mapping of library unit names to names of files
                      generated by the compiler (used for Makefile generation)
   To string        : string a name is mapped to (\"\\1\" inserts the unit name,
-                     \"\\2\" inserts the entity name for architectures)
+                     \"\\2\" inserts the entity name for architectures,
+                     \"\\3\" inserts the library name)
   Case adjustment  : adjust case of inserted unit names
 
 \(*) The regular expression must match the error message starting from the
@@ -1069,7 +1070,7 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
   "Customizations for sequential processes."
   :group 'vhdl-template)
 
-(defcustom  vhdl-reset-kind 'async
+(defcustom vhdl-reset-kind 'async
   "Specifies which kind of reset to use in sequential processes."
   :type '(choice (const :tag "None" none)
                 (const :tag "Synchronous" sync)
@@ -2125,7 +2126,6 @@ your style, only those that are different from the default.")
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; mandatory
-(require 'assoc)
 (require 'compile)                     ; XEmacs
 (require 'easymenu)
 (require 'hippie-exp)
@@ -2137,6 +2137,73 @@ your style, only those that are different from the default.")
   (require 'ps-print)
     (require 'speedbar)))              ; for speedbar-with-writable
 
+;; functions from obsolete assoc.el package (obsoleted in GNU Emacs 24.3)
+(defun vhdl-asort (alist-symbol key)
+  "Move a specified key-value pair to the head of an alist.
+The alist is referenced by ALIST-SYMBOL.  Key-value pair to move to
+head is one matching KEY.  Returns the sorted list and doesn't affect
+the order of any other key-value pair.  Side effect sets alist to new
+sorted list."
+  (set alist-symbol
+       (sort (copy-alist (symbol-value alist-symbol))
+             (lambda (a _b) (equal (car a) key)))))
+
+(defun vhdl-anot-head-p (alist key)
+  "Find out if a specified key-value pair is not at the head of an alist.
+The alist to check is specified by ALIST and the key-value pair is the
+one matching the supplied KEY.  Returns nil if ALIST is nil, or if
+key-value pair is at the head of the alist.  Returns t if key-value
+pair is not at the head of alist.  ALIST is not altered."
+  (not (equal (car (car alist)) key)))
+
+(defun vhdl-aput (alist-symbol key &optional value)
+  "Insert a key-value pair into an alist.
+The alist is referenced by ALIST-SYMBOL.  The key-value pair is made
+from KEY and optionally, VALUE.  Returns the altered alist.
+
+If the key-value pair referenced by KEY can be found in the alist, and
+VALUE is supplied non-nil, then the value of KEY will be set to VALUE.
+If VALUE is not supplied, or is nil, the key-value pair will not be
+modified, but will be moved to the head of the alist.  If the key-value
+pair cannot be found in the alist, it will be inserted into the head
+of the alist (with value nil if VALUE is nil or not supplied)."
+  (let ((elem (list (cons key value)))
+        alist)
+    (vhdl-asort alist-symbol key)
+    (setq alist (symbol-value alist-symbol))
+    (cond ((null alist) (set alist-symbol elem))
+         ((vhdl-anot-head-p alist key) (set alist-symbol (nconc elem alist)))
+         (value (setcar alist (car elem)) alist)
+         (t alist))))
+
+(defun vhdl-adelete (alist-symbol key)
+  "Delete a key-value pair from the alist.
+Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
+is pair matching KEY.  Returns the altered alist."
+  (vhdl-asort alist-symbol key)
+  (let ((alist (symbol-value alist-symbol)))
+    (cond ((null alist) nil)
+         ((vhdl-anot-head-p alist key) alist)
+         (t (set alist-symbol (cdr alist))))))
+
+(defun vhdl-aget (alist key &optional keynil-p)
+  "Return the value in ALIST that is associated with KEY.
+Optional KEYNIL-P describes what to do if the value associated with
+KEY is nil.  If KEYNIL-P is not supplied or is nil, and the value is
+nil, then KEY is returned.  If KEYNIL-P is non-nil, then nil would be
+returned.
+
+If no key-value pair matching KEY could be found in ALIST, or ALIST is
+nil then nil is returned.  ALIST is not altered."
+  (let ((copy (copy-alist alist)))
+    (cond ((null alist) nil)
+         ((progn (vhdl-asort 'copy key)
+                 (vhdl-anot-head-p copy key)) nil)
+         ((cdr (car copy)))
+         (keynil-p nil)
+         ((car (car copy)))
+         (t nil))))
+
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Compatibility
@@ -2256,7 +2323,6 @@ Ignore byte-compiler warnings you might see."
   "Wait until idle, then run FUNCTION."
   (if (fboundp 'start-itimer)
       (start-itimer "vhdl-mode" function secs repeat t)
-;    (run-with-idle-timer secs repeat function)))
     ;; explicitly activate timer (necessary when Emacs is already idle)
     (aset (run-with-idle-timer secs repeat function) 0 nil)))
 
@@ -2429,7 +2495,7 @@ specified."
 current buffer if no project is defined."
   (if (vhdl-project-p)
       (expand-file-name (vhdl-resolve-env-variable
-                        (nth 1 (aget vhdl-project-alist vhdl-project))))
+                        (nth 1 (vhdl-aget vhdl-project-alist vhdl-project))))
     default-directory))
 
 (defmacro vhdl-prepare-search-1 (&rest body)
@@ -2537,11 +2603,11 @@ conversion."
       (setq file-list (cdr file-list)))
     dir-list))
 
-(defun vhdl-aput (alist-symbol key &optional value)
+(defun vhdl-aput-delete-if-nil (alist-symbol key &optional value)
   "As `aput', but delete key-value pair if VALUE is nil."
   (if value
-      (aput alist-symbol key value)
-    (adelete alist-symbol key)))
+      (vhdl-aput alist-symbol key value)
+    (vhdl-adelete alist-symbol key)))
 
 (defun vhdl-delete (elt list)
   "Delete by side effect the first occurrence of ELT as a member of LIST."
@@ -2596,11 +2662,6 @@ conversion."
     (set-buffer (marker-buffer marker)))
   (goto-char marker))
 
-(defun vhdl-goto-line (line)
-  "Use this instead of calling user level function `goto-line'."
-  (goto-char (point-min))
-  (forward-line (1- line)))
-
 (defun vhdl-menu-split (list title)
   "Split menu LIST into several submenus, if number of
 elements > `vhdl-menu-max-size'."
@@ -2975,7 +3036,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
 (make-variable-buffer-local 'vhdl-syntactic-context)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Abbrev ook bindings
+;; Abbrev hook bindings
 
 (defvar vhdl-mode-abbrev-table nil
   "Abbrev table to use in `vhdl-mode' buffers.")
@@ -2985,8 +3046,10 @@ STRING are replaced by `-' and substrings are converted to lower case."
   (define-abbrev-table 'vhdl-mode-abbrev-table
     (append
      (when (memq 'vhdl vhdl-electric-keywords)
-       ;; VHDL'93 keywords
-       (mapcar (lambda (x) (list (car x) "" (cdr x) 0 'system))
+       ;; VHDL'02 keywords
+       (mapcar (if (featurep 'xemacs)
+                  (lambda (x) (list (car x) "" (cdr x) 0))
+                (lambda (x) (list (car x) "" (cdr x) 0 'system)))
                '(
                  ("--"           . vhdl-template-display-comment-hook)
                  ("abs"                  . vhdl-template-default-hook)
@@ -3102,7 +3165,9 @@ STRING are replaced by `-' and substrings are converted to lower case."
                  )))
      ;; VHDL-AMS keywords
      (when (and (memq 'vhdl vhdl-electric-keywords) (vhdl-standard-p 'ams))
-       (mapcar (lambda (x) (list (car x) "" (cdr x) 0 'system))
+       (mapcar (if (featurep 'xemacs)
+                  (lambda (x) (list (car x) "" (cdr x) 0))
+                (lambda (x) (list (car x) "" (cdr x) 0 'system)))
                '(
                  ("across"     . vhdl-template-default-hook)
                  ("break"      . vhdl-template-break-hook)
@@ -4822,7 +4887,7 @@ Key bindings:
 
   ;; set local variables
   (set (make-local-variable 'paragraph-start)
-       "\\s-*\\(--+\\s-*$\\|[^ -]\\|$\\)")
+       "\\s-*\\(--+\\s-*$\\|$\\)")
   (set (make-local-variable 'paragraph-separate) paragraph-start)
   (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
@@ -4860,9 +4925,7 @@ Key bindings:
     (set (make-local-variable 'font-lock-support-mode) 'lazy-lock-mode)
     (set (make-local-variable 'lazy-lock-defer-contextually) nil)
     (set (make-local-variable 'lazy-lock-defer-on-the-fly) t)
-;    (set (make-local-variable 'lazy-lock-defer-time) 0.1)
     (set (make-local-variable 'lazy-lock-defer-on-scrolling) t))
-;  (turn-on-font-lock)
 
   ;; variables for source file compilation
   (when vhdl-compile-use-local-error-regexp
@@ -7566,7 +7629,6 @@ indentation is done before aligning."
       (setq end (point-marker))
       (goto-char begin)
       (setq bol (setq begin (progn (beginning-of-line) (point))))
-;      (untabify bol end)
       (when indent
        (indent-region bol end nil))))
   (let ((copy (copy-alist alignment-list)))
@@ -7962,7 +8024,6 @@ end of line, do nothing in comments and strings."
               (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t)
                    (progn (replace-match " " nil nil) t))
               (and (looking-at "-") (re-search-forward "-" end t))
-;             (re-search-forward "[^ \t-]+" end t))))
               (re-search-forward "[^ \t\"-]+" end t))))
   (unless no-message (message "Fixing up whitespace...done")))
 
@@ -8080,7 +8141,7 @@ Currently supported keywords: 'begin', 'if'."
        (while (re-search-forward "\\<\\(for\\|if\\)\\>" end t)
         (goto-char (match-end 1))
         (setq point (point-marker))
-        ;; exception: in literal or preceded by `end' or label
+        ;; exception: in literal or preceded by `end', `wait' or label
         (when (and (not (save-excursion (goto-char (match-beginning 1))
                                         (vhdl-in-literal)))
                    (save-excursion
@@ -8089,7 +8150,7 @@ Currently supported keywords: 'begin', 'if'."
                        (and (re-search-forward "^\\s-*\\([^ \t\n].*\\)"
                                                (match-beginning 1) t)
                             (not (string-match
-                                  "\\(\\<end\\>\\|\\<wait\\>\\|\\w+\\s-*:\\)\\s-*$"
+                                  "\\(\\<end\\>\\|\\<wait .*\\|\\w+\\s-*:\\)\\s-*$"
                                   (match-string 1)))))))
           (goto-char (match-beginning 1))
           (insert "\n")
@@ -8138,10 +8199,12 @@ case fixing to a region.  Calls functions `vhdl-indent-buffer',
   (when (nth 0 vhdl-beautify-options) (vhdl-fixup-whitespace-region beg end t))
   (when (nth 1 vhdl-beautify-options) (vhdl-fix-statement-region beg end))
   (when (nth 2 vhdl-beautify-options) (vhdl-indent-region beg end))
-  (let ((vhdl-align-groups t))
-    (when (nth 3 vhdl-beautify-options) (vhdl-align-region beg end)))
+  (when (nth 3 vhdl-beautify-options)
+    (let ((vhdl-align-groups t)) (vhdl-align-region beg end)))
   (when (nth 4 vhdl-beautify-options) (vhdl-fix-case-region beg end))
-  (when (nth 0 vhdl-beautify-options) (vhdl-remove-trailing-spaces-region beg end)))
+  (when (nth 0 vhdl-beautify-options)
+    (vhdl-remove-trailing-spaces-region beg end)
+    (if vhdl-indent-tabs-mode (tabify beg end) (untabify beg end))))
 
 (defun vhdl-beautify-buffer ()
   "Beautify buffer by applying indentation, whitespace fixup, alignment, and
@@ -8447,11 +8510,11 @@ buffer."
             (setq beg (point))))))
      ;; search for signals declared in surrounding block declarative parts
      (save-excursion
-       (while (and (progn (while (and (setq beg (re-search-backward "^\\s-*\\(\\w+\\s-*:\\s-*block\\|\\(end\\)\\s-+block\\)\\>" nil t))
-                                     (match-string 2))
-                           (goto-char (match-end 2))
+       (while (and (progn (while (and (setq beg (re-search-backward "^\\s-*\\(\\w+\\s-*:\\s-*\\(block\\|\\(for\\|if\\).*\\<generate\\>\\)\\|\\(end\\)\\s-+block\\)\\>" nil t))
+                                     (match-string 4))
+                           (goto-char (match-end 4))
                            (vhdl-backward-sexp)
-                           (re-search-backward "^\\s-*\\w+\\s-*:\\s-*block\\>" nil t))
+                           (re-search-backward "^\\s-*\\w+\\s-*:\\s-*\\(block\\|generate\\)\\>" nil t))
                          beg)
                   (setq end (re-search-forward "^\\s-*begin\\>" nil t)))
         ;; scan for all declared signal names
@@ -8548,7 +8611,8 @@ Used for undoing after template abortion.")
   "Return the working library name of the current project or \"work\" if no
 project is defined."
   (vhdl-resolve-env-variable
-   (or (nth 6 (aget vhdl-project-alist vhdl-project)) vhdl-default-library)))
+   (or (nth 6 (vhdl-aget vhdl-project-alist vhdl-project))
+       vhdl-default-library)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;  Enabling/disabling
@@ -8966,8 +9030,6 @@ since these are almost equivalent)."
   (interactive)
   (when (vhdl-template-field "target signal")
     (insert " <= ")
-;    (if (not (equal (vhdl-template-field "[GUARDED] [TRANSPORT]") ""))
-;       (insert " "))
     (let ((margin (current-column))
          (start (point))
          position)
@@ -9903,7 +9965,7 @@ otherwise."
 (defun vhdl-template-record (kind &optional name secondary)
   "Insert a record type declaration."
   (interactive)
-  (let ((margin (current-column))
+  (let ((margin (current-indentation))
        (start (point))
        (first t))
     (vhdl-insert-keyword "RECORD\n")
@@ -9965,7 +10027,6 @@ otherwise."
       (insert "\n")
       (indent-to (+ margin vhdl-basic-offset))
       (vhdl-template-field "target signal" " <= ")
-;      (vhdl-template-field "[GUARDED] [TRANSPORT]")
       (insert "\n")
       (indent-to (+ margin vhdl-basic-offset))
       (vhdl-template-field "waveform")
@@ -10466,8 +10527,10 @@ specification, if not already there."
 (defun vhdl-template-replace-header-keywords (beg end &optional file-title
                                                  is-model)
   "Replace keywords in header and footer."
-  (let ((project-title (or (nth 0 (aget vhdl-project-alist vhdl-project)) ""))
-       (project-desc (or (nth 9 (aget vhdl-project-alist vhdl-project)) ""))
+  (let ((project-title (or (nth 0 (vhdl-aget vhdl-project-alist vhdl-project))
+                          ""))
+       (project-desc (or (nth 9 (vhdl-aget vhdl-project-alist vhdl-project))
+                         ""))
        pos)
     (vhdl-prepare-search-2
      (save-excursion
@@ -10525,9 +10588,9 @@ specification, if not already there."
           (replace-match file-title t t))
         (goto-char beg))
        (let (string)
-        (while
-            (re-search-forward "<\\(\\(\\w\\|\\s_\\)*\\) string>" end t)
-          (setq string (read-string (concat (match-string 1) ": ")))
+        (while (re-search-forward "<\\(\\(\\w\\|\\s_\\)*\\) string>" end t)
+          (save-match-data
+            (setq string (read-string (concat (match-string 1) ": "))))
           (replace-match string t t)))
        (goto-char beg)
        (when (and (not is-model) (search-forward "<cursor>" end t))
@@ -10635,14 +10698,7 @@ If starting after end-comment-column, start a new line."
       (if (not (or (and string (progn (insert string) t))
                   (vhdl-template-field "[comment]" nil t)))
          (delete-region position (point))
-       (while (= (preceding-char) ?\ ) (delete-char -1))
-       ;; (when (> (current-column) end-comment-column)
-       ;;   (setq position (point-marker))
-       ;;   (re-search-backward "-- ")
-       ;;   (insert "\n")
-       ;;   (indent-to comment-column)
-       ;;   (goto-char position))
-       ))))
+       (while (= (preceding-char) ?\ ) (delete-char -1))))))
 
 (defun vhdl-comment-block ()
   "Insert comment for code block."
@@ -10882,8 +10938,6 @@ Point is left between them."
 (defun vhdl-template-generate-body (margin label)
   "Insert body for generate template."
   (vhdl-insert-keyword " GENERATE")
-;   (if (not (vhdl-standard-p '87))
-;       (vhdl-template-begin-end "GENERATE" label margin)
   (insert "\n\n")
   (indent-to margin)
   (vhdl-insert-keyword "END GENERATE ")
@@ -11670,7 +11724,6 @@ reflected in a subsequent paste operation."
                                                  comment group-comment))))
              ;; parse group comment and spacing
              (setq group-comment (vhdl-parse-group-comment))))
-;        (vhdl-parse-string "end\\>")
          ;; parse context clause
          (setq context-clause (vhdl-scan-context-clause))
 ;        ;; add surrounding package to context clause
@@ -12622,7 +12675,6 @@ reflected in a subsequent paste operation."
   (while (and he-expand-list
              (or (not (stringp (car he-expand-list)))
                  (he-string-member (car he-expand-list) he-tried-table t)))
-;                (equal (car he-expand-list) he-search-string)))
     (unless (stringp (car he-expand-list))
       (setq vhdl-expand-upper-case (car he-expand-list)))
     (setq he-expand-list (cdr he-expand-list)))
@@ -12908,8 +12960,8 @@ File statistics: \"%s\"\n\
              ";; project name\n"
              "(setq vhdl-project \"" vhdl-project "\")\n\n"
              ";; project setup\n"
-             "(aput 'vhdl-project-alist vhdl-project\n'")
-      (pp (aget vhdl-project-alist vhdl-project) (current-buffer))
+             "(vhdl-aput 'vhdl-project-alist vhdl-project\n'")
+      (pp (vhdl-aget vhdl-project-alist vhdl-project) (current-buffer))
       (insert ")\n")
       (save-buffer)
       (kill-buffer (current-buffer))
@@ -12929,8 +12981,8 @@ File statistics: \"%s\"\n\
     (condition-case ()
        (let ((current-project vhdl-project))
          (load-file file-name)
-         (when (/= (length (aget vhdl-project-alist vhdl-project t)) 10)
-           (adelete 'vhdl-project-alist vhdl-project)
+         (when (/= (length (vhdl-aget vhdl-project-alist vhdl-project t)) 10)
+           (vhdl-adelete 'vhdl-project-alist vhdl-project)
            (error ""))
          (when not-make-current
            (setq vhdl-project current-project))
@@ -12946,7 +12998,7 @@ File statistics: \"%s\"\n\
   "Duplicate setup of current project."
   (interactive)
   (let ((new-name (read-from-minibuffer "New project name: "))
-       (project-entry (aget vhdl-project-alist vhdl-project t)))
+       (project-entry (vhdl-aget vhdl-project-alist vhdl-project t)))
     (setq vhdl-project-alist
          (append vhdl-project-alist
                  (list (cons new-name project-entry))))
@@ -13275,7 +13327,6 @@ This does highlighting of keywords and standard identifiers.")
                    (skip-syntax-backward " ")
                    (skip-syntax-backward "w_")
                    (skip-syntax-backward " ")))
-;                (skip-chars-backward "^-(\n\";")
           (goto-char (match-end 1)) (1 font-lock-variable-name-face)))
 
    ;; highlight formal parameters in component instantiations and subprogram
@@ -13676,8 +13727,6 @@ hierarchy otherwise.")
                                          non-final)
   "Scan contents of VHDL files in directory or file pattern NAME."
   (string-match "\\(.*[/\\]\\)\\(.*\\)" name)
-;   (unless (file-directory-p (match-string 1 name))
-;     (message "No such directory: \"%s\"" (match-string 1 name)))
   (let* ((dir-name (match-string 1 name))
         (file-pattern (match-string 2 name))
         (is-directory (= 0 (length file-pattern)))
@@ -13690,18 +13739,18 @@ hierarchy otherwise.")
               dir-name t (wildcard-to-regexp file-pattern)))))
         (key (or project dir-name))
         (file-exclude-regexp
-         (or (nth 3 (aget vhdl-project-alist project)) ""))
+         (or (nth 3 (vhdl-aget vhdl-project-alist project)) ""))
         (limit-design-file-size (nth 0 vhdl-speedbar-scan-limit))
         (limit-hier-file-size (nth 0 (nth 1 vhdl-speedbar-scan-limit)))
         (limit-hier-inst-no (nth 1 (nth 1 vhdl-speedbar-scan-limit)))
         ent-alist conf-alist pack-alist ent-inst-list file-alist
         tmp-list tmp-entry no-files files-exist big-files)
     (when (or project update)
-      (setq ent-alist (aget vhdl-entity-alist key t)
-           conf-alist (aget vhdl-config-alist key t)
-           pack-alist (aget vhdl-package-alist key t)
-           ent-inst-list (car (aget vhdl-ent-inst-alist key t))
-           file-alist (aget vhdl-file-alist key t)))
+      (setq ent-alist (vhdl-aget vhdl-entity-alist key t)
+           conf-alist (vhdl-aget vhdl-config-alist key t)
+           pack-alist (vhdl-aget vhdl-package-alist key t)
+           ent-inst-list (car (vhdl-aget vhdl-ent-inst-alist key t))
+           file-alist (vhdl-aget vhdl-file-alist key t)))
     (when (and (not is-directory) (null file-list))
       (message "No such file: \"%s\"" name))
     (setq files-exist file-list)
@@ -13743,7 +13792,7 @@ hierarchy otherwise.")
                (while (re-search-forward "^[ \t]*entity[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
                  (let* ((ent-name (match-string-no-properties 1))
                         (ent-key (downcase ent-name))
-                        (ent-entry (aget ent-alist ent-key t))
+                        (ent-entry (vhdl-aget ent-alist ent-key t))
                         (lib-alist (vhdl-scan-context-clause)))
                    (if (nth 1 ent-entry)
                        (vhdl-warning-when-idle
@@ -13751,10 +13800,10 @@ hierarchy otherwise.")
                         ent-name  (nth 1 ent-entry) (nth 2 ent-entry)
                         file-name (vhdl-current-line))
                      (push ent-key ent-list)
-                     (aput 'ent-alist ent-key
-                           (list ent-name file-name (vhdl-current-line)
-                                 (nth 3 ent-entry) (nth 4 ent-entry)
-                                 lib-alist)))))
+                     (vhdl-aput 'ent-alist ent-key
+                                (list ent-name file-name (vhdl-current-line)
+                                      (nth 3 ent-entry) (nth 4 ent-entry)
+                                      lib-alist)))))
                ;; scan for architectures
                (goto-char (point-min))
                (while (re-search-forward "^[ \t]*architecture[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
@@ -13762,9 +13811,9 @@ hierarchy otherwise.")
                         (arch-key (downcase arch-name))
                         (ent-name (match-string-no-properties 2))
                         (ent-key (downcase ent-name))
-                        (ent-entry (aget ent-alist ent-key t))
+                        (ent-entry (vhdl-aget ent-alist ent-key t))
                         (arch-alist (nth 3 ent-entry))
-                        (arch-entry (aget arch-alist arch-key t))
+                        (arch-entry (vhdl-aget arch-alist arch-key t))
                         (lib-arch-alist (vhdl-scan-context-clause)))
                    (if arch-entry
                        (vhdl-warning-when-idle
@@ -13773,20 +13822,20 @@ hierarchy otherwise.")
                         (nth 2 arch-entry) file-name (vhdl-current-line))
                      (setq arch-list (cons arch-key arch-list)
                            arch-ent-list (cons ent-key arch-ent-list))
-                     (aput 'arch-alist arch-key
-                           (list arch-name file-name (vhdl-current-line) nil
-                                 lib-arch-alist))
-                     (aput 'ent-alist ent-key
-                           (list (or (nth 0 ent-entry) ent-name)
-                                 (nth 1 ent-entry) (nth 2 ent-entry)
-                                 (vhdl-sort-alist arch-alist)
-                                 arch-key (nth 5 ent-entry))))))
+                     (vhdl-aput 'arch-alist arch-key
+                                (list arch-name file-name (vhdl-current-line)
+                                      nil lib-arch-alist))
+                     (vhdl-aput 'ent-alist ent-key
+                                (list (or (nth 0 ent-entry) ent-name)
+                                      (nth 1 ent-entry) (nth 2 ent-entry)
+                                      (vhdl-sort-alist arch-alist)
+                                      arch-key (nth 5 ent-entry))))))
                ;; scan for configurations
                (goto-char (point-min))
                (while (re-search-forward "^[ \t]*configuration[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
                  (let* ((conf-name (match-string-no-properties 1))
                         (conf-key (downcase conf-name))
-                        (conf-entry (aget conf-alist conf-key t))
+                        (conf-entry (vhdl-aget conf-alist conf-key t))
                         (ent-name (match-string-no-properties 2))
                         (ent-key (downcase ent-name))
                         (lib-alist (vhdl-scan-context-clause))
@@ -13827,16 +13876,16 @@ hierarchy otherwise.")
                                              inst-lib-key)
                                        comp-conf-list))
                            (setq inst-key-list (cdr inst-key-list)))))
-                     (aput 'conf-alist conf-key
-                           (list conf-name file-name conf-line ent-key
-                                 arch-key comp-conf-list lib-alist)))))
+                     (vhdl-aput 'conf-alist conf-key
+                                (list conf-name file-name conf-line ent-key
+                                      arch-key comp-conf-list lib-alist)))))
                ;; scan for packages
                (goto-char (point-min))
                (while (re-search-forward "^[ \t]*package[ \t\n\r\f]+\\(body[ \t\n\r\f]+\\)?\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
                  (let* ((pack-name (match-string-no-properties 2))
                         (pack-key (downcase pack-name))
                         (is-body (match-string-no-properties 1))
-                        (pack-entry (aget pack-alist pack-key t))
+                        (pack-entry (vhdl-aget pack-alist pack-key t))
                         (pack-line (vhdl-current-line))
                         (end-of-unit (vhdl-get-end-of-unit))
                         comp-name func-name comp-alist func-alist lib-alist)
@@ -13867,7 +13916,7 @@ hierarchy otherwise.")
                      (if is-body
                          (push pack-key pack-body-list)
                        (push pack-key pack-list))
-                     (aput
+                     (vhdl-aput
                       'pack-alist pack-key
                       (if is-body
                           (list (or (nth 0 pack-entry) pack-name)
@@ -13891,9 +13940,9 @@ hierarchy otherwise.")
                         (ent-key (downcase ent-name))
                         (arch-name (match-string-no-properties 1))
                         (arch-key (downcase arch-name))
-                        (ent-entry (aget ent-alist ent-key t))
+                        (ent-entry (vhdl-aget ent-alist ent-key t))
                         (arch-alist (nth 3 ent-entry))
-                        (arch-entry (aget arch-alist arch-key t))
+                        (arch-entry (vhdl-aget arch-alist arch-key t))
                         (beg-of-unit (point))
                         (end-of-unit (vhdl-get-end-of-unit))
                         (inst-no 0)
@@ -13907,7 +13956,10 @@ hierarchy otherwise.")
                                         "\\(\\(for\\|if\\)\\>[^;:]+\\<generate\\>\\|block\\>\\)\\)\\|"
                                         "\\(^[ \t]*end[ \t\n\r\f]+\\(generate\\|block\\)\\>\\)") end-of-unit t)
                                (or (not limit-hier-inst-no)
-                                   (<= (setq inst-no (1+ inst-no))
+                                   (<= (if (or (match-string 14)
+                                               (match-string 16))
+                                           inst-no
+                                         (setq inst-no (1+ inst-no)))
                                        limit-hier-inst-no)))
                      (cond
                       ;; block/generate beginning found
@@ -13988,23 +14040,25 @@ hierarchy otherwise.")
                            (setcar tmp-inst-alist inst-entry))
                          (setq tmp-inst-alist (cdr tmp-inst-alist)))))
                    ;; save in cache
-                   (aput 'arch-alist arch-key
-                         (list (nth 0 arch-entry) (nth 1 arch-entry)
-                               (nth 2 arch-entry) inst-alist
-                               (nth 4 arch-entry)))
-                   (aput 'ent-alist ent-key
-                         (list (nth 0 ent-entry) (nth 1 ent-entry)
-                               (nth 2 ent-entry) (vhdl-sort-alist arch-alist)
-                               (nth 4 ent-entry) (nth 5 ent-entry)))
+                   (vhdl-aput 'arch-alist arch-key
+                              (list (nth 0 arch-entry) (nth 1 arch-entry)
+                                    (nth 2 arch-entry) inst-alist
+                                    (nth 4 arch-entry)))
+                   (vhdl-aput 'ent-alist ent-key
+                              (list (nth 0 ent-entry) (nth 1 ent-entry)
+                                    (nth 2 ent-entry)
+                                    (vhdl-sort-alist arch-alist)
+                                    (nth 4 ent-entry) (nth 5 ent-entry)))
                    (when (and limit-hier-inst-no
                               (> inst-no limit-hier-inst-no))
                      (message "WARNING:  Scan limit (hierarchy: instances per architecture) reached in file:\n  \"%s\"" file-name)
                      (setq big-files t))
                    (goto-char end-of-unit))))
              ;; remember design units for this file
-             (aput 'file-alist file-name
-                   (list ent-list arch-list arch-ent-list conf-list
-                         pack-list pack-body-list inst-list inst-ent-list))
+             (vhdl-aput 'file-alist file-name
+                        (list ent-list arch-list arch-ent-list conf-list
+                              pack-list pack-body-list
+                              inst-list inst-ent-list))
              (setq ent-inst-list (append inst-ent-list ent-inst-list))))))
        (setq file-list (cdr file-list))))
     (when (or (and (not project) files-exist)
@@ -14023,8 +14077,8 @@ hierarchy otherwise.")
       ;; check whether configuration has a corresponding entity/architecture
       (setq tmp-list conf-alist)
       (while tmp-list
-       (if (setq tmp-entry (aget ent-alist (nth 4 (car tmp-list)) t))
-           (unless (aget (nth 3 tmp-entry) (nth 5 (car tmp-list)) t)
+       (if (setq tmp-entry (vhdl-aget ent-alist (nth 4 (car tmp-list)) t))
+           (unless (vhdl-aget (nth 3 tmp-entry) (nth 5 (car tmp-list)) t)
              (setq tmp-entry (car tmp-list))
              (vhdl-warning-when-idle
               "Configuration of non-existing architecture: \"%s\" of \"%s(%s)\"\n  in \"%s\" (line %d)"
@@ -14053,17 +14107,17 @@ hierarchy otherwise.")
       (add-to-list 'vhdl-updated-project-list (or project dir-name)))
     ;; clear directory alists
     (unless project
-      (adelete 'vhdl-entity-alist key)
-      (adelete 'vhdl-config-alist key)
-      (adelete 'vhdl-package-alist key)
-      (adelete 'vhdl-ent-inst-alist key)
-      (adelete 'vhdl-file-alist key))
+      (vhdl-adelete 'vhdl-entity-alist key)
+      (vhdl-adelete 'vhdl-config-alist key)
+      (vhdl-adelete 'vhdl-package-alist key)
+      (vhdl-adelete 'vhdl-ent-inst-alist key)
+      (vhdl-adelete 'vhdl-file-alist key))
     ;; put directory contents into cache
-    (aput 'vhdl-entity-alist key ent-alist)
-    (aput 'vhdl-config-alist key conf-alist)
-    (aput 'vhdl-package-alist key pack-alist)
-    (aput 'vhdl-ent-inst-alist key (list ent-inst-list))
-    (aput 'vhdl-file-alist key file-alist)
+    (vhdl-aput 'vhdl-entity-alist key ent-alist)
+    (vhdl-aput 'vhdl-config-alist key conf-alist)
+    (vhdl-aput 'vhdl-package-alist key pack-alist)
+    (vhdl-aput 'vhdl-ent-inst-alist key (list ent-inst-list))
+    (vhdl-aput 'vhdl-file-alist key file-alist)
     ;; final messages
     (message "Scanning %s %s\"%s\"...done"
             (if is-directory "directory" "files") (or num-string "") name)
@@ -14079,18 +14133,18 @@ hierarchy otherwise.")
 (defun vhdl-scan-project-contents (project)
   "Scan the contents of all VHDL files found in the directories and files
 of PROJECT."
-  (let ((dir-list (or (nth 2 (aget vhdl-project-alist project)) '("")))
+  (let ((dir-list (or (nth 2 (vhdl-aget vhdl-project-alist project)) '("")))
        (default-dir (vhdl-resolve-env-variable
-                     (nth 1 (aget vhdl-project-alist project))))
+                     (nth 1 (vhdl-aget vhdl-project-alist project))))
        (file-exclude-regexp
-         (or (nth 3 (aget vhdl-project-alist project)) ""))
+        (or (nth 3 (vhdl-aget vhdl-project-alist project)) ""))
        dir-list-tmp dir dir-name num-dir act-dir recursive)
     ;; clear project alists
-    (adelete 'vhdl-entity-alist project)
-    (adelete 'vhdl-config-alist project)
-    (adelete 'vhdl-package-alist project)
-    (adelete 'vhdl-ent-inst-alist project)
-    (adelete 'vhdl-file-alist project)
+    (vhdl-adelete 'vhdl-entity-alist project)
+    (vhdl-adelete 'vhdl-config-alist project)
+    (vhdl-adelete 'vhdl-package-alist project)
+    (vhdl-adelete 'vhdl-ent-inst-alist project)
+    (vhdl-adelete 'vhdl-file-alist project)
     ;; expand directory names by default-directory
     (message "Collecting source files...")
     (while dir-list
@@ -14137,7 +14191,7 @@ of PROJECT."
       (add-to-list 'dir-list-tmp (file-name-directory dir-name))
       (setq dir-list (cdr dir-list)
            act-dir (1+ act-dir)))
-    (aput 'vhdl-directory-alist project (list (nreverse dir-list-tmp)))
+    (vhdl-aput 'vhdl-directory-alist project (list (nreverse dir-list-tmp)))
     (message "Scanning project \"%s\"...done" project)))
 
 (defun vhdl-update-file-contents (file-name)
@@ -14150,13 +14204,16 @@ of PROJECT."
       (when (member dir-name (nth 1 (car directory-alist)))
        (let* ((vhdl-project (nth 0 (car directory-alist)))
               (project (vhdl-project-p))
-              (ent-alist (aget vhdl-entity-alist (or project dir-name) t))
-              (conf-alist (aget vhdl-config-alist (or project dir-name) t))
-              (pack-alist (aget vhdl-package-alist (or project dir-name) t))
-              (ent-inst-list (car (aget vhdl-ent-inst-alist
+              (ent-alist (vhdl-aget vhdl-entity-alist
+                                    (or project dir-name) t))
+              (conf-alist (vhdl-aget vhdl-config-alist
+                                     (or project dir-name) t))
+              (pack-alist (vhdl-aget vhdl-package-alist
+                                     (or project dir-name) t))
+              (ent-inst-list (car (vhdl-aget vhdl-ent-inst-alist
                                         (or project dir-name) t)))
-              (file-alist (aget vhdl-file-alist (or project dir-name) t))
-              (file-entry (aget file-alist file-name t))
+              (file-alist (vhdl-aget vhdl-file-alist (or project dir-name) t))
+              (file-entry (vhdl-aget file-alist file-name t))
               (ent-list (nth 0 file-entry))
               (arch-list (nth 1 file-entry))
               (arch-ent-list (nth 2 file-entry))
@@ -14170,57 +14227,57 @@ of PROJECT."
          ;; entities
          (while ent-list
            (setq key (car ent-list)
-                 entry (aget ent-alist key t))
+                 entry (vhdl-aget ent-alist key t))
            (when (equal file-name (nth 1 entry))
              (if (nth 3 entry)
-                 (aput 'ent-alist key
-                       (list (nth 0 entry) nil nil (nth 3 entry) nil))
-               (adelete 'ent-alist key)))
+                 (vhdl-aput 'ent-alist key
+                            (list (nth 0 entry) nil nil (nth 3 entry) nil))
+               (vhdl-adelete 'ent-alist key)))
            (setq ent-list (cdr ent-list)))
          ;; architectures
          (while arch-list
            (setq key (car arch-list)
                  ent-key (car arch-ent-list)
-                 entry (aget ent-alist ent-key t)
+                 entry (vhdl-aget ent-alist ent-key t)
                  arch-alist (nth 3 entry))
-           (when (equal file-name (nth 1 (aget arch-alist key t)))
-             (adelete 'arch-alist key)
+           (when (equal file-name (nth 1 (vhdl-aget arch-alist key t)))
+             (vhdl-adelete 'arch-alist key)
              (if (or (nth 1 entry) arch-alist)
-                 (aput 'ent-alist ent-key
-                       (list (nth 0 entry) (nth 1 entry) (nth 2 entry)
-                             arch-alist (nth 4 entry) (nth 5 entry)))
-               (adelete 'ent-alist ent-key)))
+                 (vhdl-aput 'ent-alist ent-key
+                            (list (nth 0 entry) (nth 1 entry) (nth 2 entry)
+                                  arch-alist (nth 4 entry) (nth 5 entry)))
+               (vhdl-adelete 'ent-alist ent-key)))
            (setq arch-list (cdr arch-list)
                  arch-ent-list (cdr arch-ent-list)))
          ;; configurations
          (while conf-list
            (setq key (car conf-list))
-           (when (equal file-name (nth 1 (aget conf-alist key t)))
-             (adelete 'conf-alist key))
+           (when (equal file-name (nth 1 (vhdl-aget conf-alist key t)))
+             (vhdl-adelete 'conf-alist key))
            (setq conf-list (cdr conf-list)))
          ;; package declarations
          (while pack-list
            (setq key (car pack-list)
-                 entry (aget pack-alist key t))
+                 entry (vhdl-aget pack-alist key t))
            (when (equal file-name (nth 1 entry))
              (if (nth 6 entry)
-                 (aput 'pack-alist key
-                       (list (nth 0 entry) nil nil nil nil nil
-                             (nth 6 entry) (nth 7 entry) (nth 8 entry)
-                             (nth 9 entry)))
-               (adelete 'pack-alist key)))
+                 (vhdl-aput 'pack-alist key
+                            (list (nth 0 entry) nil nil nil nil nil
+                                  (nth 6 entry) (nth 7 entry) (nth 8 entry)
+                                  (nth 9 entry)))
+               (vhdl-adelete 'pack-alist key)))
            (setq pack-list (cdr pack-list)))
          ;; package bodies
          (while pack-body-list
            (setq key (car pack-body-list)
-                 entry (aget pack-alist key t))
+                 entry (vhdl-aget pack-alist key t))
            (when (equal file-name (nth 6 entry))
              (if (nth 1 entry)
-                 (aput 'pack-alist key
-                       (list (nth 0 entry) (nth 1 entry) (nth 2 entry)
-                             (nth 3 entry) (nth 4 entry) (nth 5 entry)
-                             nil nil nil nil))
-               (adelete 'pack-alist key)))
+                 (vhdl-aput 'pack-alist key
+                            (list (nth 0 entry) (nth 1 entry) (nth 2 entry)
+                                  (nth 3 entry) (nth 4 entry) (nth 5 entry)
+                                  nil nil nil nil))
+               (vhdl-adelete 'pack-alist key)))
            (setq pack-body-list (cdr pack-body-list)))
          ;; instantiated entities
          (while inst-ent-list
@@ -14228,10 +14285,10 @@ of PROJECT."
                  (vhdl-delete (car inst-ent-list) ent-inst-list))
            (setq inst-ent-list (cdr inst-ent-list)))
          ;; update caches
-         (vhdl-aput 'vhdl-entity-alist cache-key ent-alist)
-         (vhdl-aput 'vhdl-config-alist cache-key conf-alist)
-         (vhdl-aput 'vhdl-package-alist cache-key pack-alist)
-         (vhdl-aput 'vhdl-ent-inst-alist cache-key (list ent-inst-list))
+         (vhdl-aput-delete-if-nil 'vhdl-entity-alist cache-key ent-alist)
+         (vhdl-aput-delete-if-nil 'vhdl-config-alist cache-key conf-alist)
+         (vhdl-aput-delete-if-nil 'vhdl-package-alist cache-key pack-alist)
+         (vhdl-aput-delete-if-nil 'vhdl-ent-inst-alist cache-key (list ent-inst-list))
          ;; scan file
          (vhdl-scan-directory-contents file-name project t)
          (when (or (and vhdl-speedbar-show-projects project)
@@ -14264,8 +14321,8 @@ of PROJECT."
                                     &optional include-top ent-hier)
   "Get instantiation hierarchy beginning in architecture ARCH-KEY of
 entity ENT-KEY."
-  (let* ((ent-entry (aget ent-alist ent-key t))
-        (arch-entry (if arch-key (aget (nth 3 ent-entry) arch-key t)
+  (let* ((ent-entry (vhdl-aget ent-alist ent-key t))
+        (arch-entry (if arch-key (vhdl-aget (nth 3 ent-entry) arch-key t)
                       (cdar (last (nth 3 ent-entry)))))
         (inst-alist (nth 3 arch-entry))
         inst-entry inst-ent-entry inst-arch-entry inst-conf-entry comp-entry
@@ -14276,9 +14333,6 @@ entity ENT-KEY."
       (setq level (1+ level)))
     (when (member ent-key ent-hier)
       (error "ERROR:  Instantiation loop detected, component instantiates itself: \"%s\"" ent-key))
-    ;; check configured architecture (already checked during scanning)
-;     (unless (or (null conf-inst-alist) (assoc arch-key (nth 3 ent-entry)))
-;       (vhdl-warning-when-idle "Configuration for non-existing architecture used: \"%s\"" conf-key))
     ;; process all instances
     (while inst-alist
       (setq inst-entry (car inst-alist)
@@ -14294,27 +14348,27 @@ entity ENT-KEY."
                                   (downcase (or inst-comp-name ""))))))
        (setq tmp-list (cdr tmp-list)))
       (setq inst-conf-key (or (nth 4 (car tmp-list)) inst-conf-key))
-      (setq inst-conf-entry (aget conf-alist inst-conf-key t))
+      (setq inst-conf-entry (vhdl-aget conf-alist inst-conf-key t))
       (when (and inst-conf-key (not inst-conf-entry))
        (vhdl-warning-when-idle "Configuration not found: \"%s\"" inst-conf-key))
       ;; determine entity
       (setq inst-ent-key
            (or (nth 2 (car tmp-list))  ; from configuration
                (nth 3 inst-conf-entry) ; from subconfiguration
-               (nth 3 (aget conf-alist (nth 7 inst-entry) t))
+               (nth 3 (vhdl-aget conf-alist (nth 7 inst-entry) t))
                                        ; from configuration spec.
                (nth 5 inst-entry)))    ; from direct instantiation
-      (setq inst-ent-entry (aget ent-alist inst-ent-key t))
+      (setq inst-ent-entry (vhdl-aget ent-alist inst-ent-key t))
       ;; determine architecture
       (setq inst-arch-key
            (or (nth 3 (car tmp-list))          ; from configuration
                (nth 4 inst-conf-entry)         ; from subconfiguration
                (nth 6 inst-entry)              ; from direct instantiation
-               (nth 4 (aget conf-alist (nth 7 inst-entry)))
+               (nth 4 (vhdl-aget conf-alist (nth 7 inst-entry)))
                                                ; from configuration spec.
                (nth 4 inst-ent-entry)          ; MRA
                (caar (nth 3 inst-ent-entry)))) ; first alphabetically
-      (setq inst-arch-entry (aget (nth 3 inst-ent-entry) inst-arch-key t))
+      (setq inst-arch-entry (vhdl-aget (nth 3 inst-ent-entry) inst-arch-key t))
       ;; set library
       (setq inst-lib-key
            (or (nth 5 (car tmp-list))          ; from configuration
@@ -14353,7 +14407,8 @@ entity ENT-KEY."
 
 (defun vhdl-get-instantiations (ent-key indent)
   "Get all instantiations of entity ENT-KEY."
-  (let ((ent-alist (aget vhdl-entity-alist (vhdl-speedbar-line-key indent) t))
+  (let ((ent-alist (vhdl-aget vhdl-entity-alist
+                             (vhdl-speedbar-line-key indent) t))
        arch-alist inst-alist ent-inst-list
        ent-entry arch-entry inst-entry)
     (while ent-alist
@@ -14439,29 +14494,29 @@ entity ENT-KEY."
       (insert ")\n")
       (when (member 'hierarchy vhdl-speedbar-save-cache)
        (insert "\n;; entity and architecture cache\n"
-               "(aput 'vhdl-entity-alist " key " '")
-       (print (aget vhdl-entity-alist cache-key t) (current-buffer))
+               "(vhdl-aput 'vhdl-entity-alist " key " '")
+       (print (vhdl-aget vhdl-entity-alist cache-key t) (current-buffer))
        (insert ")\n\n;; configuration cache\n"
-               "(aput 'vhdl-config-alist " key " '")
-       (print (aget vhdl-config-alist cache-key t) (current-buffer))
+               "(vhdl-aput 'vhdl-config-alist " key " '")
+       (print (vhdl-aget vhdl-config-alist cache-key t) (current-buffer))
        (insert ")\n\n;; package cache\n"
-               "(aput 'vhdl-package-alist " key " '")
-       (print (aget vhdl-package-alist cache-key t) (current-buffer))
+               "(vhdl-aput 'vhdl-package-alist " key " '")
+       (print (vhdl-aget vhdl-package-alist cache-key t) (current-buffer))
        (insert ")\n\n;; instantiated entities cache\n"
-               "(aput 'vhdl-ent-inst-alist " key " '")
-       (print (aget vhdl-ent-inst-alist cache-key t) (current-buffer))
+               "(vhdl-aput 'vhdl-ent-inst-alist " key " '")
+       (print (vhdl-aget vhdl-ent-inst-alist cache-key t) (current-buffer))
        (insert ")\n\n;; design units per file cache\n"
-               "(aput 'vhdl-file-alist " key " '")
-       (print (aget vhdl-file-alist cache-key t) (current-buffer))
+               "(vhdl-aput 'vhdl-file-alist " key " '")
+       (print (vhdl-aget vhdl-file-alist cache-key t) (current-buffer))
        (when project
          (insert ")\n\n;; source directories in project cache\n"
-                 "(aput 'vhdl-directory-alist " key " '")
-         (print (aget vhdl-directory-alist cache-key t) (current-buffer)))
+                 "(vhdl-aput 'vhdl-directory-alist " key " '")
+         (print (vhdl-aget vhdl-directory-alist cache-key t) (current-buffer)))
        (insert ")\n"))
       (when (member 'display vhdl-speedbar-save-cache)
        (insert "\n;; shown design units cache\n"
-               "(aput 'vhdl-speedbar-shown-unit-alist " key " '")
-       (print (aget vhdl-speedbar-shown-unit-alist cache-key t)
+               "(vhdl-aput 'vhdl-speedbar-shown-unit-alist " key " '")
+       (print (vhdl-aget vhdl-speedbar-shown-unit-alist cache-key t)
               (current-buffer))
        (insert ")\n"))
       (setq vhdl-updated-project-list
@@ -14528,7 +14583,6 @@ if required."
 (defun vhdl-speedbar-initialize ()
   "Initialize speedbar."
   ;; general settings
-;  (set (make-local-variable 'speedbar-tag-hierarchy-method) nil)
   ;; VHDL file extensions (extracted from `auto-mode-alist')
   (let ((mode-alist auto-mode-alist))
     (while mode-alist
@@ -14626,11 +14680,7 @@ if required."
          (append
           '(("vhdl directory" vhdl-speedbar-update-current-unit)
             ("vhdl project" vhdl-speedbar-update-current-project
-             vhdl-speedbar-update-current-unit)
-;           ("files" (lambda () (setq speedbar-ignored-path-regexp
-;                                     (speedbar-extension-list-to-regex
-;                                      speedbar-ignored-path-expressions))))
-            )
+             vhdl-speedbar-update-current-unit))
           speedbar-stealthy-function-list))
     (when (eq vhdl-speedbar-display-mode 'directory)
       (setq speedbar-initial-expansion-list-name "vhdl directory"))
@@ -14724,10 +14774,7 @@ if required."
               (concat "^\\([0-9]+:\\s-*<\\)[+]>\\s-+" (caar project-alist) "$") nil t)
          (goto-char (match-end 1))
          (speedbar-do-function-pointer)))
-      (setq project-alist (cdr project-alist))))
-;   (vhdl-speedbar-update-current-project)
-;   (vhdl-speedbar-update-current-unit nil t)
-  )
+      (setq project-alist (cdr project-alist)))))
 
 (defun vhdl-speedbar-insert-project-hierarchy (project indent &optional rescan)
   "Insert hierarchy of PROJECT.  Rescan directories if RESCAN is non-nil,
@@ -14737,10 +14784,10 @@ otherwise use cached data."
     (vhdl-scan-project-contents project))
   ;; insert design hierarchy
   (vhdl-speedbar-insert-hierarchy
-   (aget vhdl-entity-alist project t)
-   (aget vhdl-config-alist project t)
-   (aget vhdl-package-alist project t)
-   (car (aget vhdl-ent-inst-alist project t)) indent)
+   (vhdl-aget vhdl-entity-alist project t)
+   (vhdl-aget vhdl-config-alist project t)
+   (vhdl-aget vhdl-package-alist project t)
+   (car (vhdl-aget vhdl-ent-inst-alist project t)) indent)
   (insert (int-to-string indent) ":\n")
   (put-text-property (- (point) 3) (1- (point)) 'invisible t)
   (put-text-property (1- (point)) (point) 'invisible nil)
@@ -14755,13 +14802,13 @@ otherwise use cached data."
     (vhdl-scan-directory-contents directory))
   ;; insert design hierarchy
   (vhdl-speedbar-insert-hierarchy
-   (aget vhdl-entity-alist directory t)
-   (aget vhdl-config-alist directory t)
-   (aget vhdl-package-alist directory t)
-   (car (aget vhdl-ent-inst-alist directory t)) depth)
+   (vhdl-aget vhdl-entity-alist directory t)
+   (vhdl-aget vhdl-config-alist directory t)
+   (vhdl-aget vhdl-package-alist directory t)
+   (car (vhdl-aget vhdl-ent-inst-alist directory t)) depth)
   ;; expand design units
   (vhdl-speedbar-expand-units directory)
-  (aput 'vhdl-directory-alist directory (list (list directory))))
+  (vhdl-aput 'vhdl-directory-alist directory (list (list directory))))
 
 (defun vhdl-speedbar-insert-hierarchy (ent-alist conf-alist pack-alist
                                                 ent-inst-list depth)
@@ -14849,10 +14896,10 @@ otherwise use cached data."
 (defun vhdl-speedbar-expand-units (key)
   "Expand design units in directory/project KEY according to
 `vhdl-speedbar-shown-unit-alist'."
-  (let ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t))
+  (let ((unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t))
        (vhdl-speedbar-update-current-unit nil)
        vhdl-updated-project-list)
-    (adelete 'vhdl-speedbar-shown-unit-alist key)
+    (vhdl-adelete 'vhdl-speedbar-shown-unit-alist key)
     (vhdl-prepare-search-1
      (while unit-alist                 ; expand units
        (vhdl-speedbar-goto-this-unit key (caar unit-alist))
@@ -14902,7 +14949,7 @@ otherwise use cached data."
       (progn (setq vhdl-speedbar-shown-project-list nil)
             (vhdl-speedbar-refresh))
     (let ((key (vhdl-speedbar-line-key)))
-      (adelete 'vhdl-speedbar-shown-unit-alist key)
+      (vhdl-adelete 'vhdl-speedbar-shown-unit-alist key)
       (vhdl-speedbar-refresh (and vhdl-speedbar-show-projects key))
       (when (memq 'display vhdl-speedbar-save-cache)
        (add-to-list 'vhdl-updated-project-list key)))))
@@ -14911,9 +14958,9 @@ otherwise use cached data."
   "Expand all design units in current directory/project."
   (interactive)
   (let* ((key (vhdl-speedbar-line-key))
-        (ent-alist (aget vhdl-entity-alist key t))
-        (conf-alist (aget vhdl-config-alist key t))
-        (pack-alist (aget vhdl-package-alist key t))
+        (ent-alist (vhdl-aget vhdl-entity-alist key t))
+        (conf-alist (vhdl-aget vhdl-config-alist key t))
+        (pack-alist (vhdl-aget vhdl-package-alist key t))
         arch-alist unit-alist subunit-alist)
     (add-to-list 'vhdl-speedbar-shown-project-list key)
     (while ent-alist
@@ -14930,7 +14977,7 @@ otherwise use cached data."
     (while pack-alist
       (push (list (caar pack-alist)) unit-alist)
       (setq pack-alist (cdr pack-alist)))
-    (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
+    (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
     (vhdl-speedbar-refresh)
     (when (memq 'display vhdl-speedbar-save-cache)
       (add-to-list 'vhdl-updated-project-list key))))
@@ -14965,8 +15012,8 @@ otherwise use cached data."
   (cond
    ((string-match "+" text)            ; expand entity
     (let* ((key (vhdl-speedbar-line-key indent))
-          (ent-alist (aget vhdl-entity-alist key t))
-          (ent-entry (aget ent-alist token t))
+          (ent-alist (vhdl-aget vhdl-entity-alist key t))
+          (ent-entry (vhdl-aget ent-alist token t))
           (arch-alist (nth 3 ent-entry))
           (inst-alist (vhdl-get-instantiations token indent))
           (subpack-alist (nth 5 ent-entry))
@@ -14976,9 +15023,9 @@ otherwise use cached data."
          (speedbar-change-expand-button-char ??)
        (speedbar-change-expand-button-char ?-)
        ;; add entity to `vhdl-speedbar-shown-unit-alist'
-       (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
-         (aput 'unit-alist token nil)
-         (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
+       (let* ((unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t)))
+         (vhdl-aput 'unit-alist token nil)
+         (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
        (speedbar-with-writable
         (save-excursion
           (end-of-line) (forward-char 1)
@@ -15017,11 +15064,11 @@ otherwise use cached data."
     (speedbar-change-expand-button-char ?+)
     ;; remove entity from `vhdl-speedbar-shown-unit-alist'
     (let* ((key (vhdl-speedbar-line-key indent))
-          (unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
-      (adelete 'unit-alist token)
+          (unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t)))
+      (vhdl-adelete 'unit-alist token)
       (if unit-alist
-         (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
-       (adelete 'vhdl-speedbar-shown-unit-alist key))
+         (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
+       (vhdl-adelete 'vhdl-speedbar-shown-unit-alist key))
       (speedbar-delete-subblock indent)
       (when (memq 'display vhdl-speedbar-save-cache)
        (add-to-list 'vhdl-updated-project-list key))))
@@ -15034,23 +15081,24 @@ otherwise use cached data."
   (cond
    ((string-match "+" text)            ; expand architecture
     (let* ((key (vhdl-speedbar-line-key (1- indent)))
-          (ent-alist (aget vhdl-entity-alist key t))
-          (conf-alist (aget vhdl-config-alist key t))
+          (ent-alist (vhdl-aget vhdl-entity-alist key t))
+          (conf-alist (vhdl-aget vhdl-config-alist key t))
           (hier-alist (vhdl-get-hierarchy
                        ent-alist conf-alist (car token) (cdr token) nil nil
                        0 (1- indent)))
-          (ent-entry (aget ent-alist (car token) t))
-          (arch-entry (aget (nth 3 ent-entry) (cdr token) t))
+          (ent-entry (vhdl-aget ent-alist (car token) t))
+          (arch-entry (vhdl-aget (nth 3 ent-entry) (cdr token) t))
           (subpack-alist (nth 4 arch-entry))
           entry)
       (if (not (or hier-alist subpack-alist))
          (speedbar-change-expand-button-char ??)
        (speedbar-change-expand-button-char ?-)
        ;; add architecture to `vhdl-speedbar-shown-unit-alist'
-       (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t))
-              (arch-alist (nth 0 (aget unit-alist (car token) t))))
-         (aput 'unit-alist (car token) (list (cons (cdr token) arch-alist)))
-         (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
+       (let* ((unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t))
+              (arch-alist (nth 0 (vhdl-aget unit-alist (car token) t))))
+         (vhdl-aput 'unit-alist (car token)
+                    (list (cons (cdr token) arch-alist)))
+         (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
        (speedbar-with-writable
          (save-excursion
            (end-of-line) (forward-char 1)
@@ -15077,10 +15125,10 @@ otherwise use cached data."
     (speedbar-change-expand-button-char ?+)
     ;; remove architecture from `vhdl-speedbar-shown-unit-alist'
     (let* ((key (vhdl-speedbar-line-key (1- indent)))
-          (unit-alist (aget vhdl-speedbar-shown-unit-alist key t))
-          (arch-alist (nth 0 (aget unit-alist (car token) t))))
-      (aput 'unit-alist (car token) (list (delete (cdr token) arch-alist)))
-      (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
+          (unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t))
+          (arch-alist (nth 0 (vhdl-aget unit-alist (car token) t))))
+      (vhdl-aput 'unit-alist (car token) (list (delete (cdr token) arch-alist)))
+      (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
       (speedbar-delete-subblock indent)
       (when (memq 'display vhdl-speedbar-save-cache)
        (add-to-list 'vhdl-updated-project-list key))))
@@ -15093,9 +15141,9 @@ otherwise use cached data."
   (cond
    ((string-match "+" text)            ; expand configuration
     (let* ((key (vhdl-speedbar-line-key indent))
-          (conf-alist (aget vhdl-config-alist key t))
-          (conf-entry (aget conf-alist token))
-          (ent-alist (aget vhdl-entity-alist key t))
+          (conf-alist (vhdl-aget vhdl-config-alist key t))
+          (conf-entry (vhdl-aget conf-alist token))
+          (ent-alist (vhdl-aget vhdl-entity-alist key t))
           (hier-alist (vhdl-get-hierarchy
                        ent-alist conf-alist (nth 3 conf-entry)
                        (nth 4 conf-entry) token (nth 5 conf-entry)
@@ -15106,9 +15154,9 @@ otherwise use cached data."
          (speedbar-change-expand-button-char ??)
        (speedbar-change-expand-button-char ?-)
        ;; add configuration to `vhdl-speedbar-shown-unit-alist'
-       (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
-         (aput 'unit-alist token nil)
-         (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
+       (let* ((unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t)))
+         (vhdl-aput 'unit-alist token nil)
+         (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
        (speedbar-with-writable
         (save-excursion
           (end-of-line) (forward-char 1)
@@ -15134,11 +15182,11 @@ otherwise use cached data."
     (speedbar-change-expand-button-char ?+)
     ;; remove configuration from `vhdl-speedbar-shown-unit-alist'
     (let* ((key (vhdl-speedbar-line-key indent))
-          (unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
-      (adelete 'unit-alist token)
+          (unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t)))
+      (vhdl-adelete 'unit-alist token)
       (if unit-alist
-         (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
-       (adelete 'vhdl-speedbar-shown-unit-alist key))
+         (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
+       (vhdl-adelete 'vhdl-speedbar-shown-unit-alist key))
       (speedbar-delete-subblock indent)
       (when (memq 'display vhdl-speedbar-save-cache)
        (add-to-list 'vhdl-updated-project-list key))))
@@ -15151,8 +15199,8 @@ otherwise use cached data."
   (cond
    ((string-match "+" text)            ; expand package
     (let* ((key (vhdl-speedbar-line-key indent))
-          (pack-alist (aget vhdl-package-alist key t))
-          (pack-entry (aget pack-alist token t))
+          (pack-alist (vhdl-aget vhdl-package-alist key t))
+          (pack-entry (vhdl-aget pack-alist token t))
           (comp-alist (nth 3 pack-entry))
           (func-alist (nth 4 pack-entry))
           (func-body-alist (nth 8 pack-entry))
@@ -15162,9 +15210,9 @@ otherwise use cached data."
          (speedbar-change-expand-button-char ??)
        (speedbar-change-expand-button-char ?-)
        ;; add package to `vhdl-speedbar-shown-unit-alist'
-       (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
-         (aput 'unit-alist token nil)
-         (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
+       (let* ((unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t)))
+         (vhdl-aput 'unit-alist token nil)
+         (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
        (speedbar-with-writable
          (save-excursion
            (end-of-line) (forward-char 1)
@@ -15185,7 +15233,8 @@ otherwise use cached data."
              (vhdl-speedbar-make-title-line "Subprograms:" (1+ indent)))
            (while func-alist
              (setq func-entry (car func-alist)
-                   func-body-entry (aget func-body-alist (car func-entry) t))
+                   func-body-entry (vhdl-aget func-body-alist
+                                              (car func-entry) t))
              (when (nth 2 func-entry)
                (vhdl-speedbar-make-subprogram-line
                 (nth 1 func-entry)
@@ -15203,11 +15252,11 @@ otherwise use cached data."
     (speedbar-change-expand-button-char ?+)
     ;; remove package from `vhdl-speedbar-shown-unit-alist'
     (let* ((key (vhdl-speedbar-line-key indent))
-          (unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
-      (adelete 'unit-alist token)
+          (unit-alist (vhdl-aget vhdl-speedbar-shown-unit-alist key t)))
+      (vhdl-adelete 'unit-alist token)
       (if unit-alist
-         (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
-       (adelete 'vhdl-speedbar-shown-unit-alist key))
+         (vhdl-aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
+       (vhdl-adelete 'vhdl-speedbar-shown-unit-alist key))
       (speedbar-delete-subblock indent)
       (when (memq 'display vhdl-speedbar-save-cache)
        (add-to-list 'vhdl-updated-project-list key))))
@@ -15217,15 +15266,15 @@ otherwise use cached data."
 
 (defun vhdl-speedbar-insert-subpackages (subpack-alist indent dir-indent)
   "Insert required packages."
-  (let* ((pack-alist (aget vhdl-package-alist
-                          (vhdl-speedbar-line-key dir-indent) t))
+  (let* ((pack-alist (vhdl-aget vhdl-package-alist
+                               (vhdl-speedbar-line-key dir-indent) t))
         pack-key lib-name pack-entry)
     (when subpack-alist
       (vhdl-speedbar-make-title-line "Packages Used:" indent))
     (while subpack-alist
       (setq pack-key (cdar subpack-alist)
            lib-name (caar subpack-alist))
-      (setq pack-entry (aget pack-alist pack-key t))
+      (setq pack-entry (vhdl-aget pack-alist pack-key t))
       (vhdl-speedbar-make-subpack-line
        (or (nth 0 pack-entry) pack-key) lib-name
        (cons (nth 1 pack-entry) (nth 2 pack-entry))
@@ -15283,18 +15332,21 @@ NO-POSITION non-nil means do not re-position cursor."
               (or always (not (equal file-name speedbar-last-selected-file))))
       (if vhdl-speedbar-show-projects
          (while project-list
-           (setq file-alist (append file-alist (aget vhdl-file-alist
-                                                     (car project-list) t)))
+           (setq file-alist (append file-alist
+                                    (vhdl-aget vhdl-file-alist
+                                               (car project-list) t)))
            (setq project-list (cdr project-list)))
-       (setq file-alist (aget vhdl-file-alist
-                              (abbreviate-file-name default-directory) t)))
+       (setq file-alist
+             (vhdl-aget vhdl-file-alist
+                        (abbreviate-file-name default-directory) t)))
       (select-frame speedbar-frame)
       (set-buffer speedbar-buffer)
       (speedbar-with-writable
        (vhdl-prepare-search-1
        (save-excursion
          ;; unhighlight last units
-         (let* ((file-entry (aget file-alist speedbar-last-selected-file t)))
+         (let* ((file-entry (vhdl-aget file-alist
+                                       speedbar-last-selected-file t)))
            (vhdl-speedbar-update-units
             "\\[.\\] " (nth 0 file-entry)
             speedbar-last-selected-file 'vhdl-speedbar-entity-face)
@@ -15314,7 +15366,7 @@ NO-POSITION non-nil means do not re-position cursor."
             "> " (nth 6 file-entry)
             speedbar-last-selected-file 'vhdl-speedbar-instantiation-face))
          ;; highlight current units
-         (let* ((file-entry (aget file-alist file-name t)))
+         (let* ((file-entry (vhdl-aget file-alist file-name t)))
            (setq
             pos (vhdl-speedbar-update-units
                  "\\[.\\] " (nth 0 file-entry)
@@ -15747,7 +15799,8 @@ is already shown in a buffer."
     (let ((buffer (get-file-buffer (car token))))
       (speedbar-find-file-in-frame (car token))
       (when (or vhdl-speedbar-jump-to-unit buffer)
-       (vhdl-goto-line (cdr token))
+       (goto-char (point-min))
+       (forward-line (1- (cdr token)))
        (recenter))
       (vhdl-speedbar-update-current-unit t t)
       (speedbar-set-timer dframe-update-speed)
@@ -15765,7 +15818,8 @@ is already shown in a buffer."
              (let ((token (get-text-property
                            (match-beginning 3) 'speedbar-token)))
                (vhdl-visit-file (car token) t
-                                (progn (vhdl-goto-line (cdr token))
+                                (progn (goto-char (point-min))
+                                       (forward-line (1- (cdr token)))
                                        (end-of-line)
                                        (if is-entity
                                            (vhdl-port-copy)
@@ -15805,9 +15859,11 @@ is already shown in a buffer."
       (error "ERROR:  No architecture under cursor")
     (let* ((arch-key (downcase (vhdl-speedbar-line-text)))
           (ent-key (downcase (vhdl-speedbar-higher-text)))
-          (ent-alist (aget vhdl-entity-alist
-                           (or (vhdl-project-p) default-directory) t))
-          (ent-entry (aget ent-alist ent-key t)))
+          (ent-alist (vhdl-aget
+                      vhdl-entity-alist
+                      (or (vhdl-project-p)
+                          (abbreviate-file-name default-directory)) t))
+          (ent-entry (vhdl-aget ent-alist ent-key t)))
       (setcar (cddr (cddr ent-entry)) arch-key) ; (nth 4 ent-entry)
       (speedbar-refresh))))
 
@@ -15946,15 +16002,14 @@ expansion function)."
 
 ;; add speedbar
 (when (fboundp 'speedbar)
-  (condition-case ()
-      (when (and vhdl-speedbar-auto-open
-                (not (and (boundp 'speedbar-frame)
-                          (frame-live-p speedbar-frame))))
-       (speedbar-frame-mode 1)
-       (if (fboundp 'speedbar-select-attached-frame)
-           (speedbar-select-attached-frame)
-         (select-frame speedbar-attached-frame)))
-    (error (vhdl-warning-when-idle "ERROR:  An error occurred while opening speedbar"))))
+  (let ((current-frame (selected-frame)))
+    (condition-case ()
+       (when (and vhdl-speedbar-auto-open
+                  (not (and (boundp 'speedbar-frame)
+                            (frame-live-p speedbar-frame))))
+         (speedbar-frame-mode 1))
+      (error (vhdl-warning-when-idle "ERROR:  An error occurred while opening speedbar")))
+    (select-frame current-frame)))
 
 ;; initialize speedbar
 (if (not (boundp 'speedbar-frame))
@@ -16217,7 +16272,7 @@ component instantiation."
             (setq constant-entry
                   (cons constant-name
                         (if (match-string 1)
-                            (or (aget generic-alist (match-string 2) t)
+                            (or (vhdl-aget generic-alist (match-string 2) t)
                                 (error "ERROR:  Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
                           (cdar generic-alist))))
             (push constant-entry constant-alist)
@@ -16235,11 +16290,12 @@ component instantiation."
         (vhdl-forward-syntactic-ws)
         (while (vhdl-parse-string "\\(\\(\\w+\\)[ \t\n\r\f]*=>[ \t\n\r\f]*\\)?\\(\\w+\\),?" t)
           (setq signal-name (match-string-no-properties 3))
-          (setq signal-entry (cons signal-name
-                                   (if (match-string 1)
-                                       (or (aget port-alist (match-string 2) t)
-                                           (error "ERROR:  Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
-                                     (cdar port-alist))))
+          (setq signal-entry
+                (cons signal-name
+                      (if (match-string 1)
+                          (or (vhdl-aget port-alist (match-string 2) t)
+                              (error "ERROR:  Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
+                        (cdar port-alist))))
           (push signal-entry signal-alist)
           (setq signal-name (downcase signal-name))
           (if (equal (upcase (nth 2 signal-entry)) "IN")
@@ -16478,8 +16534,9 @@ current project/directory."
         (pack-file-name
          (concat (vhdl-replace-string vhdl-package-file-name pack-name t)
                  "." (file-name-extension (buffer-file-name))))
-        (ent-alist (aget vhdl-entity-alist
-                         (or project default-directory) t))
+        (ent-alist (vhdl-aget vhdl-entity-alist
+                              (or project
+                                  (abbreviate-file-name default-directory)) t))
         (lazy-lock-minimum-size 0)
         clause-pos component-pos)
     (message "Generating components package \"%s\"..." pack-name)
@@ -16519,7 +16576,8 @@ current project/directory."
     ;; insert component declarations
     (while ent-alist
       (vhdl-visit-file (nth 2 (car ent-alist)) nil
-                      (progn (vhdl-goto-line (nth 3 (car ent-alist)))
+                      (progn (goto-char (point-min))
+                             (forward-line (1- (nth 3 (car ent-alist))))
                              (end-of-line)
                              (vhdl-port-copy)))
       (goto-char component-pos)
@@ -16581,7 +16639,7 @@ current project/directory."
          (when (equal (nth 5 inst-entry) (nth 4 (car tmp-alist)))
            (setq conf-key (nth 0 (car tmp-alist))))
          (setq tmp-alist (cdr tmp-alist)))
-       (setq conf-entry (aget conf-alist conf-key t))
+       (setq conf-entry (vhdl-aget conf-alist conf-key t))
        ;; insert binding indication ...
        ;; ... with subconfiguration (if exists)
        (if (and vhdl-compose-configuration-use-subconfiguration conf-entry)
@@ -16591,7 +16649,7 @@ current project/directory."
              (insert (vhdl-work-library) "." (nth 0 conf-entry))
              (insert ";\n"))
          ;; ... with entity (if exists)
-         (setq ent-entry (aget ent-alist (nth 5 inst-entry) t))
+         (setq ent-entry (vhdl-aget ent-alist (nth 5 inst-entry) t))
          (when ent-entry
            (indent-to (+ margin vhdl-basic-offset))
            (vhdl-insert-keyword "USE ENTITY ")
@@ -16601,9 +16659,9 @@ current project/directory."
              (setq arch-name
                    ;; choose architecture name a) from configuration,
                    ;; b) from mra, or c) from first architecture
-                   (or (nth 0 (aget (nth 3 ent-entry)
-                                    (or (nth 6 inst-entry)
-                                        (nth 4 ent-entry)) t))
+                   (or (nth 0 (vhdl-aget (nth 3 ent-entry)
+                                         (or (nth 6 inst-entry)
+                                             (nth 4 ent-entry)) t))
                        (nth 1 (car (nth 3 ent-entry)))))
              (insert "(" arch-name ")"))
            (insert ";\n")
@@ -16613,7 +16671,7 @@ current project/directory."
              (indent-to (+ margin vhdl-basic-offset))
              (vhdl-compose-configuration-architecture
               (nth 0 ent-entry) arch-name ent-alist conf-alist
-              (nth 3 (aget (nth 3 ent-entry) (downcase arch-name) t))))))
+              (nth 3 (vhdl-aget (nth 3 ent-entry) (downcase arch-name) t))))))
        ;; insert component configuration end
        (indent-to margin)
        (vhdl-insert-keyword "END FOR;\n")
@@ -16635,10 +16693,12 @@ current project/directory."
   "Generate configuration declaration."
   (interactive)
   (vhdl-require-hierarchy-info)
-  (let ((ent-alist (aget vhdl-entity-alist
-                        (or (vhdl-project-p) default-directory) t))
-       (conf-alist (aget vhdl-config-alist
-                         (or (vhdl-project-p) default-directory) t))
+  (let ((ent-alist (vhdl-aget vhdl-entity-alist
+                             (or (vhdl-project-p)
+                                 (abbreviate-file-name default-directory)) t))
+       (conf-alist (vhdl-aget vhdl-config-alist
+                              (or (vhdl-project-p)
+                                  (abbreviate-file-name default-directory)) t))
        (from-speedbar ent-name)
        inst-alist conf-name conf-file-name pos)
     (vhdl-prepare-search-2
@@ -16654,8 +16714,8 @@ current project/directory."
                      vhdl-compose-configuration-name
                      (concat ent-name " " arch-name)))
      (setq inst-alist
-          (nth 3 (aget (nth 3 (aget ent-alist (downcase ent-name) t))
-                       (downcase arch-name) t))))
+          (nth 3 (vhdl-aget (nth 3 (vhdl-aget ent-alist (downcase ent-name) t))
+                            (downcase arch-name) t))))
      (message "Generating configuration \"%s\"..." conf-name)
      (if vhdl-compose-configuration-create-file
         ;; open configuration file
@@ -16721,8 +16781,8 @@ current project/directory."
 (defun vhdl-makefile-name ()
   "Return the Makefile name of the current project or the current compiler if
 no project is defined."
-  (let ((project-alist (aget vhdl-project-alist vhdl-project))
-       (compiler-alist (aget vhdl-compiler-alist vhdl-compiler)))
+  (let ((project-alist (vhdl-aget vhdl-project-alist vhdl-project))
+       (compiler-alist (vhdl-aget vhdl-compiler-alist vhdl-compiler)))
     (vhdl-replace-string
      (cons "\\(.*\\)\n\\(.*\\)"
           (or (nth 8 project-alist) (nth 8 compiler-alist)))
@@ -16730,8 +16790,8 @@ no project is defined."
 
 (defun vhdl-compile-directory ()
   "Return the directory where compilation/make should be run."
-  (let* ((project (aget vhdl-project-alist (vhdl-project-p t)))
-        (compiler (aget vhdl-compiler-alist vhdl-compiler))
+  (let* ((project (vhdl-aget vhdl-project-alist (vhdl-project-p t)))
+        (compiler (vhdl-aget vhdl-compiler-alist vhdl-compiler))
         (directory (vhdl-resolve-env-variable
                     (if project
                         (vhdl-replace-string
@@ -16765,9 +16825,10 @@ no project is defined."
 
 (defun vhdl-compile-init ()
   "Initialize for compilation."
-  (when (or (null compilation-error-regexp-alist)
-           (not (assoc (car (nth 11 (car vhdl-compiler-alist)))
-                       compilation-error-regexp-alist)))
+  (when (and (not vhdl-emacs-22)
+            (or (null compilation-error-regexp-alist)
+                (not (assoc (car (nth 11 (car vhdl-compiler-alist)))
+                            compilation-error-regexp-alist))))
     ;; `compilation-error-regexp-alist'
     (let ((commands-alist vhdl-compiler-alist)
          regexp-alist sublist)
@@ -16810,7 +16871,7 @@ do not print any file names."
                                         &optional file-options-only)
   "Get compiler options.  Returning nil means do not compile this file."
   (let* ((compiler-options (nth 1 compiler))
-        (project-entry (aget (nth 4 project) vhdl-compiler))
+        (project-entry (vhdl-aget (nth 4 project) vhdl-compiler))
         (project-options (nth 0 project-entry))
         (exception-list (and file-name (nth 2 project-entry)))
         (work-library (vhdl-work-library))
@@ -16847,7 +16908,7 @@ do not print any file names."
 (defun vhdl-get-make-options (project compiler)
   "Get make options."
   (let* ((compiler-options (nth 3 compiler))
-        (project-entry (aget (nth 4 project) vhdl-compiler))
+        (project-entry (vhdl-aget (nth 4 project) vhdl-compiler))
         (project-options (nth 1 project-entry))
         (makefile-name (vhdl-makefile-name)))
     ;; insert Makefile name in compiler-specific options
@@ -16868,8 +16929,8 @@ do not print any file names."
 `vhdl-compiler'."
   (interactive)
   (vhdl-compile-init)
-  (let* ((project (aget vhdl-project-alist vhdl-project))
-        (compiler (or (aget vhdl-compiler-alist vhdl-compiler nil)
+  (let* ((project (vhdl-aget vhdl-project-alist vhdl-project))
+        (compiler (or (vhdl-aget vhdl-compiler-alist vhdl-compiler nil)
                       (error "ERROR:  No such compiler: \"%s\"" vhdl-compiler)))
         (command (nth 0 compiler))
         (default-directory (vhdl-compile-directory))
@@ -16910,8 +16971,8 @@ specified by a target."
        (or target (read-from-minibuffer "Target: " vhdl-make-target
                                         vhdl-minibuffer-local-map)))
   (vhdl-compile-init)
-  (let* ((project (aget vhdl-project-alist vhdl-project))
-        (compiler (or (aget vhdl-compiler-alist vhdl-compiler)
+  (let* ((project (vhdl-aget vhdl-project-alist vhdl-project))
+        (compiler (or (vhdl-aget vhdl-compiler-alist vhdl-compiler)
                       (error "ERROR:  No such compiler: \"%s\"" vhdl-compiler)))
         (command (nth 2 compiler))
         (options (vhdl-get-make-options project compiler))
@@ -16928,17 +16989,20 @@ specified by a target."
   (let ((compiler-alist vhdl-compiler-alist)
        (error-regexp-alist '((vhdl-directory "^ *Compiling \"\\(.+\\)\"" 1))))
    (while compiler-alist
-     ;; add error message regexps
-     (setq error-regexp-alist
-          (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ?  ?- (downcase (nth 0 (car compiler-alist)))))))
-                        (nth 11 (car compiler-alist)))
-                error-regexp-alist))
-     ;; add filename regexps
-     (when (/= 0 (nth 1 (nth 12 (car compiler-alist))))
+     ;; only add regexps for currently selected compiler
+     (when (or (not vhdl-compile-use-local-error-regexp)
+              (equal vhdl-compiler (nth 0 (car compiler-alist))))
+       ;; add error message regexps
        (setq error-regexp-alist
-            (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ?  ?- (downcase (nth 0 (car compiler-alist)))) "-file")))
-                          (nth 12 (car compiler-alist)))
-                  error-regexp-alist)))
+            (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ?  ?- (downcase (nth 0 (car compiler-alist)))))))
+                          (nth 11 (car compiler-alist)))
+                  error-regexp-alist))
+       ;; add filename regexps
+       (when (/= 0 (nth 1 (nth 12 (car compiler-alist))))
+        (setq error-regexp-alist
+              (cons (append (list (make-symbol (concat "vhdl-" (subst-char-in-string ?  ?- (downcase (nth 0 (car compiler-alist)))) "-file")))
+                            (nth 12 (car compiler-alist)))
+                    error-regexp-alist))))
      (setq compiler-alist (cdr compiler-alist)))
    error-regexp-alist)
   "List of regexps for VHDL compilers.  For Emacs 22+.")
@@ -16949,6 +17013,10 @@ specified by a target."
   (interactive)
   (when (and (boundp 'compilation-error-regexp-alist-alist)
             (not (assoc 'vhdl-modelsim compilation-error-regexp-alist-alist)))
+    ;; remove all other compilers
+    (when vhdl-compile-use-local-error-regexp
+      (setq compilation-error-regexp-alist nil))
+    ;; add VHDL compilers
     (mapcar
      (lambda (item)
        (push (car item) compilation-error-regexp-alist)
@@ -16964,7 +17032,7 @@ specified by a target."
 (defun vhdl-generate-makefile ()
   "Generate `Makefile'."
   (interactive)
-  (let* ((compiler (or (aget vhdl-compiler-alist vhdl-compiler)
+  (let* ((compiler (or (vhdl-aget vhdl-compiler-alist vhdl-compiler)
                       (error "ERROR:  No such compiler: \"%s\"" vhdl-compiler)))
         (command (nth 4 compiler)))
     ;; generate makefile
@@ -16997,15 +17065,19 @@ specified by a target."
        (vhdl-scan-directory-contents directory))))
   (let* ((directory (abbreviate-file-name (vhdl-default-directory)))
         (project (vhdl-project-p))
-        (ent-alist (aget vhdl-entity-alist (or project directory) t))
-        (conf-alist (aget vhdl-config-alist (or project directory) t))
-        (pack-alist (aget vhdl-package-alist (or project directory) t))
-        (regexp-list (nth 12 (aget vhdl-compiler-alist vhdl-compiler)))
-        (ent-regexp (cons "\\(.*\\)" (nth 0 regexp-list)))
-        (arch-regexp (cons "\\(.*\\) \\(.*\\)" (nth 1 regexp-list)))
-        (conf-regexp (cons "\\(.*\\)" (nth 2 regexp-list)))
-        (pack-regexp (cons "\\(.*\\)" (nth 3 regexp-list)))
-        (pack-body-regexp (cons "\\(.*\\)" (nth 4 regexp-list)))
+        (ent-alist (vhdl-aget vhdl-entity-alist (or project directory) t))
+        (conf-alist (vhdl-aget vhdl-config-alist (or project directory) t))
+        (pack-alist (vhdl-aget vhdl-package-alist (or project directory) t))
+        (regexp-list (or (nth 12 (vhdl-aget vhdl-compiler-alist vhdl-compiler))
+                         '("\\1.vhd" "\\2_\\1.vhd" "\\1.vhd"
+                           "\\1.vhd" "\\1_body.vhd" identity)))
+        (mapping-exist
+         (if (nth 12 (vhdl-aget vhdl-compiler-alist vhdl-compiler)) t nil))
+        (ent-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 0 regexp-list)))
+        (arch-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 1 regexp-list)))
+        (conf-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 2 regexp-list)))
+        (pack-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 3 regexp-list)))
+        (pack-body-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 4 regexp-list)))
         (adjust-case (nth 5 regexp-list))
         (work-library (downcase (vhdl-work-library)))
         (compile-directory (expand-file-name (vhdl-compile-directory)
@@ -17022,9 +17094,10 @@ specified by a target."
     ;; check prerequisites
     (unless (file-exists-p compile-directory)
       (make-directory compile-directory t))
-    (unless regexp-list
-      (error "Please contact the VHDL Mode maintainer for support of \"%s\""
-            vhdl-compiler))
+    (unless mapping-exist
+      (vhdl-warning
+       (format "No unit-to-file name mapping found for compiler \"%s\".\n  Directory of dummy files is created instead (to be used as dependencies).\n  Please contact the VHDL Mode maintainer for full support of \"%s\""
+              vhdl-compiler vhdl-compiler) t))
     (message "Generating makefile \"%s\"..." makefile-name)
     ;; rules for all entities
     (setq tmp-list ent-alist)
@@ -17038,13 +17111,15 @@ specified by a target."
                                                  compile-directory))
              arch-alist (nth 4 ent-entry)
              lib-alist (nth 6 ent-entry)
-             rule (aget rule-alist ent-file-name)
+             rule (vhdl-aget rule-alist ent-file-name)
              target-list (nth 0 rule)
              depend-list (nth 1 rule)
              second-list nil
              subcomp-list nil)
        (setq tmp-key (vhdl-replace-string
-                      ent-regexp (funcall adjust-case ent-key)))
+                      ent-regexp
+                      (funcall adjust-case
+                               (concat ent-key "  " work-library))))
        (push (cons ent-key tmp-key) unit-list)
        ;; rule target for this entity
        (push ent-key target-list)
@@ -17053,7 +17128,7 @@ specified by a target."
        (setq depend-list (append depend-list pack-list))
        (setq all-pack-list pack-list)
        ;; add rule
-       (aput 'rule-alist ent-file-name (list target-list depend-list))
+       (vhdl-aput 'rule-alist ent-file-name (list target-list depend-list))
        ;; rules for all corresponding architectures
        (while arch-alist
          (setq arch-entry (car arch-alist)
@@ -17065,12 +17140,14 @@ specified by a target."
                                                     compile-directory))
                inst-alist (nth 4 arch-entry)
                lib-alist (nth 5 arch-entry)
-               rule (aget rule-alist arch-file-name)
+               rule (vhdl-aget rule-alist arch-file-name)
                target-list (nth 0 rule)
                depend-list (nth 1 rule))
          (setq tmp-key (vhdl-replace-string
                         arch-regexp
-                        (funcall adjust-case (concat arch-key " " ent-key))))
+                        (funcall adjust-case
+                                 (concat arch-key " " ent-key " "
+                                         work-library))))
          (setq unit-list
                (cons (cons ent-arch-key tmp-key) unit-list))
          (push ent-arch-key second-list)
@@ -17093,7 +17170,7 @@ specified by a target."
          (setq depend-list (append depend-list pack-list))
          (setq all-pack-list (append all-pack-list pack-list))
          ;; add rule
-         (aput 'rule-alist arch-file-name (list target-list depend-list))
+         (vhdl-aput 'rule-alist arch-file-name (list target-list depend-list))
          (setq arch-alist (cdr arch-alist)))
        (push (list ent-key second-list (append subcomp-list all-pack-list))
              prim-list))
@@ -17112,12 +17189,14 @@ specified by a target."
            arch-key (nth 5 conf-entry)
            inst-alist (nth 6 conf-entry)
            lib-alist (nth 7 conf-entry)
-           rule (aget rule-alist conf-file-name)
+           rule (vhdl-aget rule-alist conf-file-name)
            target-list (nth 0 rule)
            depend-list (nth 1 rule)
            subcomp-list (list ent-key))
       (setq tmp-key (vhdl-replace-string
-                    conf-regexp (funcall adjust-case conf-key)))
+                    conf-regexp
+                    (funcall adjust-case
+                             (concat conf-key "  " work-library))))
       (push (cons conf-key tmp-key) unit-list)
       ;; rule target for this configuration
       (push conf-key target-list)
@@ -17131,20 +17210,17 @@ specified by a target."
       (while inst-alist
        (setq inst-entry (car inst-alist))
        (setq inst-ent-key (nth 2 inst-entry)
-;             comp-arch-key (nth 2 inst-entry))
              inst-conf-key (nth 4 inst-entry))
        (when (equal (downcase (nth 5 inst-entry)) work-library)
          (when inst-ent-key
            (setq depend-list (cons inst-ent-key depend-list)
                  subcomp-list (cons inst-ent-key subcomp-list)))
-;          (when comp-arch-key
-;            (push (concat comp-ent-key "-" comp-arch-key) depend-list))
          (when inst-conf-key
            (setq depend-list (cons inst-conf-key depend-list)
                  subcomp-list (cons inst-conf-key subcomp-list))))
        (setq inst-alist (cdr inst-alist)))
       ;; add rule
-      (aput 'rule-alist conf-file-name (list target-list depend-list))
+      (vhdl-aput 'rule-alist conf-file-name (list target-list depend-list))
       (push (list conf-key nil (append subcomp-list pack-list)) prim-list)
       (setq conf-alist (cdr conf-alist)))
     (setq conf-alist tmp-list)
@@ -17160,10 +17236,12 @@ specified by a target."
                               (file-relative-name (nth 2 pack-entry)
                                                   compile-directory))
              lib-alist (nth 6 pack-entry) lib-body-alist (nth 10 pack-entry)
-             rule (aget rule-alist pack-file-name)
+             rule (vhdl-aget rule-alist pack-file-name)
              target-list (nth 0 rule) depend-list (nth 1 rule))
        (setq tmp-key (vhdl-replace-string
-                      pack-regexp (funcall adjust-case pack-key)))
+                      pack-regexp
+                      (funcall adjust-case
+                               (concat pack-key "  " work-library))))
        (push (cons pack-key tmp-key) unit-list)
        ;; rule target for this package
        (push pack-key target-list)
@@ -17172,7 +17250,7 @@ specified by a target."
        (setq depend-list (append depend-list pack-list))
        (setq all-pack-list pack-list)
        ;; add rule
-       (aput 'rule-alist pack-file-name (list target-list depend-list))
+       (vhdl-aput 'rule-alist pack-file-name (list target-list depend-list))
        ;; rules for this package's body
        (when (nth 7 pack-entry)
          (setq pack-body-key (concat pack-key "-body")
@@ -17180,11 +17258,13 @@ specified by a target."
                                        (nth 7 pack-entry)
                                      (file-relative-name (nth 7 pack-entry)
                                                          compile-directory))
-               rule (aget rule-alist pack-body-file-name)
+               rule (vhdl-aget rule-alist pack-body-file-name)
                target-list (nth 0 rule)
                depend-list (nth 1 rule))
          (setq tmp-key (vhdl-replace-string
-                        pack-body-regexp (funcall adjust-case pack-key)))
+                        pack-body-regexp
+                        (funcall adjust-case
+                                 (concat pack-key "  " work-library))))
          (setq unit-list
                (cons (cons pack-body-key tmp-key) unit-list))
          ;; rule target for this package's body
@@ -17196,8 +17276,8 @@ specified by a target."
          (setq depend-list (append depend-list pack-list))
          (setq all-pack-list (append all-pack-list pack-list))
          ;; add rule
-         (aput 'rule-alist pack-body-file-name
-               (list target-list depend-list)))
+         (vhdl-aput 'rule-alist pack-body-file-name
+                    (list target-list depend-list)))
        (setq prim-list
              (cons (list pack-key (when pack-body-key (list pack-body-key))
                          all-pack-list)
@@ -17205,8 +17285,8 @@ specified by a target."
       (setq pack-alist (cdr pack-alist)))
     (setq pack-alist tmp-list)
     ;; generate Makefile
-    (let* ((project (aget vhdl-project-alist project))
-          (compiler (aget vhdl-compiler-alist vhdl-compiler))
+    (let* ((project (vhdl-aget vhdl-project-alist project))
+          (compiler (vhdl-aget vhdl-compiler-alist vhdl-compiler))
           (compiler-id (nth 9 compiler))
           (library-directory
            (vhdl-resolve-env-variable
@@ -17259,12 +17339,16 @@ specified by a target."
                compile-directory))))
       (insert "\n\n# Define library paths\n"
              "\nLIBRARY-" work-library " = " library-directory "\n")
+      (unless mapping-exist
+       (insert "LIBRARY-" work-library "-make = " "$(LIBRARY-" work-library
+               ")/make" "\n"))
       ;; insert variable definitions for all library unit files
       (insert "\n\n# Define library unit files\n")
       (setq tmp-list unit-list)
       (while unit-list
        (insert "\nUNIT-" work-library "-" (caar unit-list)
-               " = \\\n\t$(LIBRARY-" work-library ")/" (cdar unit-list))
+               " = \\\n\t$(LIBRARY-" work-library
+               (if mapping-exist "" "-make") ")/" (cdar unit-list))
        (setq unit-list (cdr unit-list)))
       ;; insert variable definition for list of all library unit files
       (insert "\n\n\n# Define list of all library unit files\n"
@@ -17287,13 +17371,20 @@ specified by a target."
       ;; insert `make library' rule
       (insert "\n\n# Rule for creating library directory\n"
              "\n" (nth 2 vhdl-makefile-default-targets) " :"
-             " \\\n\t\t$(LIBRARY-" work-library ")\n"
+             " \\\n\t\t$(LIBRARY-" work-library ")"
+             (if mapping-exist ""
+               (concat " \\\n\t\t$(LIBRARY-" work-library "-make)\n"))
+             "\n"
              "\n$(LIBRARY-" work-library ") :"
              "\n\t"
              (vhdl-replace-string
               (cons "\\(.*\\)\n\\(.*\\)" (nth 5 compiler))
               (concat "$(LIBRARY-" work-library ")\n" (vhdl-work-library)))
              "\n")
+      (unless mapping-exist
+       (insert "\n$(LIBRARY-" work-library "-make) :"
+               "\n\t"
+               "mkdir -p $(LIBRARY-" work-library "-make)\n"))
       ;; insert '.PHONY' declaration
       (insert "\n\n.PHONY : "
              (nth 0 vhdl-makefile-default-targets) " "
@@ -17306,9 +17397,9 @@ specified by a target."
        (setq subcomp-list
              (sort (vhdl-uniquify (nth 2 (car prim-list))) 'string<))
        (setq unit-key (caar prim-list)
-             unit-name (or (nth 0 (aget ent-alist unit-key t))
-                           (nth 0 (aget conf-alist unit-key t))
-                           (nth 0 (aget pack-alist unit-key t))))
+             unit-name (or (nth 0 (vhdl-aget ent-alist unit-key t))
+                           (nth 0 (vhdl-aget conf-alist unit-key t))
+                           (nth 0 (vhdl-aget pack-alist unit-key t))))
        (insert "\n" unit-key)
        (unless (equal unit-key unit-name)
          (insert " \\\n" unit-name))
@@ -17358,13 +17449,15 @@ specified by a target."
                    (nth 0 rule)
                    (if (equal vhdl-compile-post-command "") ""
                      " $(POST-COMPILE)") "\n")
+         (insert "\n"))
+       (unless (and options mapping-exist)
          (setq tmp-list target-list)
          (while target-list
-           (insert "\n\t@touch $(UNIT-" work-library "-" (car target-list) ")"
-                   (if (cdr target-list) " \\" "\n"))
+           (insert "\t@touch $(UNIT-" work-library "-" (car target-list) ")\n")
            (setq target-list (cdr target-list)))
          (setq target-list tmp-list))
        (setq rule-alist (cdr rule-alist)))
+
       (insert "\n\n### " makefile-name " ends here\n")
       ;; run Makefile generation hook
       (run-hooks 'vhdl-makefile-generation-hook)
@@ -17374,7 +17467,8 @@ specified by a target."
          (progn (save-buffer)
                 (kill-buffer (current-buffer))
                 (set-buffer orig-buffer)
-                (add-to-history 'file-name-history makefile-path-name))
+                (when (fboundp 'add-to-history)
+                  (add-to-history 'file-name-history makefile-path-name)))
        (vhdl-warning-when-idle
         (format "File not writable: \"%s\""
                 (abbreviate-file-name makefile-path-name)))
index e22581445e5596ec9362dd8eec4a28f309d2a732..4ab882b71fb254cd18dfadd3e9f8d366b5a43cdb 100644 (file)
@@ -1,4 +1,4 @@
-;;; xscheme.el --- run MIT Scheme under Emacs
+;;; xscheme.el --- run MIT Scheme under Emacs        -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 1986-1987, 1989-1990, 2001-2014 Free Software
 ;; Foundation, Inc.
 (defvar xscheme-expressions-ring-max 30
   "Maximum length of Scheme expressions ring.")
 
-(defvar xscheme-expressions-ring nil
+(defvar-local xscheme-expressions-ring nil
   "List of expressions recently transmitted to the Scheme process.")
 
-(defvar xscheme-expressions-ring-yank-pointer nil
+(defvar-local xscheme-expressions-ring-yank-pointer nil
   "The tail of the Scheme expressions ring whose car is the last thing yanked.")
 
-(defvar xscheme-running-p nil
+(defvar-local xscheme-running-p nil
   "This variable, if nil, indicates that the scheme process is
 waiting for input.  Otherwise, it is busy evaluating something.")
 
@@ -64,7 +64,7 @@ waiting for input.  Otherwise, it is busy evaluating something.")
 control-g interrupts were signaled.  Do not allow more control-g's to be
 signaled until the scheme process acknowledges receipt.")
 
-(defvar xscheme-control-g-disabled-p nil
+(defvar-local xscheme-control-g-disabled-p nil
   "This variable, if non-nil, indicates that a control-g is being processed
 by the scheme process, so additional control-g's are to be ignored.")
 
@@ -78,37 +78,26 @@ by the scheme process, so additional control-g's are to be ignored.")
 (defvar xscheme-runlight "")
 (defvar xscheme-runlight-string nil)
 
-(defvar xscheme-process-filter-state 'idle
+(defvar-local xscheme-process-filter-state 'idle
   "State of scheme process escape reader state machine:
 idle                   waiting for an escape sequence
 reading-type           received an altmode but nothing else
 reading-string         reading prompt string")
 
-(defvar xscheme-allow-output-p t
+(defvar-local xscheme-allow-output-p t
   "This variable, if nil, prevents output from the scheme process
 from being inserted into the process-buffer.")
 
-(defvar xscheme-prompt ""
+(defvar-local xscheme-prompt ""
   "The current scheme prompt string.")
 
-(defvar xscheme-string-accumulator ""
+(defvar-local xscheme-string-accumulator ""
   "Accumulator for the string being received from the scheme process.")
 
-(defvar xscheme-mode-string nil)
-(setq-default scheme-mode-line-process
-             '("" xscheme-runlight))
-
-(mapc 'make-variable-buffer-local
-      '(xscheme-expressions-ring
-       xscheme-expressions-ring-yank-pointer
-       xscheme-process-filter-state
-       xscheme-running-p
-       xscheme-control-g-disabled-p
-       xscheme-allow-output-p
-       xscheme-prompt
-       xscheme-string-accumulator
-       xscheme-mode-string
-       scheme-mode-line-process))
+(defvar-local xscheme-mode-string nil)
+(setq-default scheme-mode-line-process '("" xscheme-runlight))
+(make-variable-buffer-local 'scheme-mode-line-process)
+
 \f
 (defgroup xscheme nil
   "Major mode for editing Scheme and interacting with MIT's C-Scheme."
index 319a26d71fc923c068c231bdde0a0deb023282a9..488c9c05a094a643f2c6ad6102e626b40de907c0 100644 (file)
 
 ;;; Commentary:
 
-;; See ps-print.el for documentation.
-
-;;; Code:
-
-
-(require 'ps-print)
-
-\f
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Sample Setup Code:
-
-
+;; Some example hacks for ps-print.el.
 ;; This stuff is for anybody that's brave enough to look this far,
 ;; and able to figure out how to use it.  It isn't really part of
 ;; ps-print, but I'll leave it here in hopes it might be useful:
 ;; WARNING!!! The following code is *sample* code only.
 ;; Don't use it unless you understand what it does!
 
-;; The key `f22' should probably be replaced by `print'.  --Stef
+;;; Code:
 
-;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set the
-;; `ps-left-headers' specially for mail messages.
-(defun ps-rmail-mode-hook ()
-  (local-set-key [(f22)] 'ps-rmail-print-message-from-summary)
-  (setq ps-header-lines 3
-       ps-left-header
-       ;; The left headers will display the message's subject, its
-       ;; author, and the name of the folder it was in.
-       '(ps-article-subject ps-article-author buffer-name)))
+(require 'ps-print)
+
+\f
 
-;; See `ps-gnus-print-article-from-summary'.  This function does the
-;; same thing for rmail.
+;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set
+;; `ps-left-header' specially for mail messages.
+(defun ps-rmail-mode-hook ()
+  (local-set-key [print] 'ps-rmail-print-message-from-summary)
+  (setq-local ps-header-lines 3)
+  ;; The left header will display the message's subject, its
+  ;; author, and the name of the folder it was in.
+  (setq-local ps-left-header
+             '(ps-article-subject ps-article-author buffer-name)))
+
+;; Like `ps-gnus-print-article-from-summary', but for rmail.
 (defun ps-rmail-print-message-from-summary ()
   (interactive)
   (ps-print-message-from-summary 'rmail-summary-buffer "RMAIL"))
         (with-current-buffer ps-buf
           (ps-spool-buffer-with-faces)))))
 
-;; Look in an article or mail message for the Subject: line.  To be
-;; placed in `ps-left-headers'.
+;; Look in an article or mail message for the Subject: line.
 (defun ps-article-subject ()
   (save-excursion
-    (goto-char (point-min))
-    (if (re-search-forward "^Subject:[ \t]+\\(.*\\)$" nil t)
-       (buffer-substring (match-beginning 1) (match-end 1))
-      "Subject ???")))
+    (save-restriction
+      (narrow-to-region (point-min) (progn (rfc822-goto-eoh) (point)))
+      (concat "Subject: " (or (mail-fetch-field "Subject") "???")))))
 
 ;; Look in an article or mail message for the From: line.  Sorta-kinda
 ;; understands RFC-822 addresses and can pull the real name out where
-;; it's provided.  To be placed in `ps-left-headers'.
+;; it's provided.
 (defun ps-article-author ()
   (save-excursion
-    (goto-char (point-min))
-    (if (re-search-forward "^From:[ \t]+\\(.*\\)$" nil t)
-       (let ((fromstring (buffer-substring (match-beginning 1) (match-end 1))))
-         (cond
-
-          ;; Try first to match addresses that look like
-          ;; thompson@wg2.waii.com (Jim Thompson)
-          ((string-match ".*[ \t]+(\\(.*\\))" fromstring)
-           (substring fromstring (match-beginning 1) (match-end 1)))
-
-          ;; Next try to match addresses that look like
-          ;; Jim Thompson <thompson@wg2.waii.com> or
-          ;; "Jim Thompson" <thompson@wg2.waii.com>
-          ((string-match "\\(\"?\\)\\(.*\\)\\1[ \t]+<.*>" fromstring)
-           (substring fromstring (match-beginning 2) (match-end 2)))
-
-          ;; Couldn't find a real name -- show the address instead.
-          (t fromstring)))
-      "From ???")))
-
-;; A hook to bind to `gnus-article-prepare-hook'.  This will set the
-;; `ps-left-headers' specially for gnus articles.  Unfortunately,
+    (save-restriction
+      (narrow-to-region (point-min) (progn (rfc822-goto-eoh) (point)))
+      (let ((fromstring (mail-fetch-field "From")))
+       (cond
+        ;; Try first to match addresses that look like
+        ;; thompson@wg2.waii.com (Jim Thompson)
+        ((and fromstring (string-match ".*[ \t]+(\\(.*\\))" fromstring))
+         (match-string 1 fromstring))
+        ;; Next try to match addresses that look like
+        ;; Jim Thompson <thompson@wg2.waii.com> or
+        ;; "Jim Thompson" <thompson@wg2.waii.com>
+        ((and fromstring
+              (string-match "\\(\"?\\)\\(.*\\)\\1[ \t]+<.*>" fromstring))
+         (match-string 2 fromstring))
+        ;; Couldn't find a real name -- show the address instead.
+        (fromstring)
+        (t "From ???"))))))
+
+;; A hook to bind to `gnus-article-prepare-hook'.  This will set
+;; `ps-left-header' specially for gnus articles.  Unfortunately,
 ;; `gnus-article-mode-hook' is called only once, the first time the *Article*
 ;; buffer enters that mode, so it would only work for the first time
 ;; we ran gnus.  The second time, this hook wouldn't get set up.  The
 ;; only alternative is `gnus-article-prepare-hook'.
 (defun ps-gnus-article-prepare-hook ()
-  (setq ps-header-lines 3
-       ps-left-header
-       ;; The left headers will display the article's subject, its
-       ;; author, and the newsgroup it was in.
-       '(ps-article-subject ps-article-author gnus-newsgroup-name)))
-
-;; A hook to bind to `vm-mode-hook' to locally bind prsc and set the
-;; `ps-left-headers' specially for mail messages.
+  (setq-local ps-header-lines 3)
+  ;; The left headers will display the article's subject, its
+  ;; author, and the newsgroup it was in.
+  (setq-local ps-left-header
+             '(ps-article-subject ps-article-author gnus-newsgroup-name)))
+
+;; A hook to bind to `vm-mode-hook' to locally bind prsc and set
+;; `ps-left-header' specially for mail messages.
 (defun ps-vm-mode-hook ()
-  (local-set-key [(f22)] 'ps-vm-print-message-from-summary)
-  (setq ps-header-lines 3
-       ps-left-header
-       ;; The left headers will display the message's subject, its
-       ;; author, and the name of the folder it was in.
+  (local-set-key [print] 'ps-vm-print-message-from-summary)
+  (setq-local ps-header-lines 3)
+  ;; The left headers will display the message's subject, its
+  ;; author, and the name of the folder it was in.
+  (setq-local ps-left-header
        '(ps-article-subject ps-article-author buffer-name)))
 
 ;; Every now and then I forget to switch from the *Summary* buffer to
 ;; article subjects shows up at the printer.  This function, bound to
 ;; prsc for the gnus *Summary* buffer means I don't have to switch
 ;; buffers first.
-;; sb:  Updated for Gnus 5.
 (defun ps-gnus-print-article-from-summary ()
   (interactive)
   (ps-print-message-from-summary 'gnus-article-buffer "*Article*"))
 
-;; See `ps-gnus-print-article-from-summary'.  This function does the
-;; same thing for vm.
+;; Like `ps-gnus-print-article-from-summary', but for vm.
 (defun ps-vm-print-message-from-summary ()
   (interactive)
   (ps-print-message-from-summary 'vm-mail-buffer ""))
 
-;; A hook to bind to bind to `gnus-summary-setup-buffer' to locally bind
-;; prsc.
+;; A hook to bind to `gnus-summary-setup-buffer' to locally bind prsc.
 (defun ps-gnus-summary-setup ()
-  (local-set-key [(f22)] 'ps-gnus-print-article-from-summary))
+  (local-set-key [print] 'ps-gnus-print-article-from-summary))
 
-;; Look in an article or mail message for the Subject: line.  To be
-;; placed in `ps-left-headers'.
 (defun ps-info-file ()
   (save-excursion
     (goto-char (point-min))
     (if (re-search-forward "File:[ \t]+\\([^, \t\n]*\\)" nil t)
-       (buffer-substring (match-beginning 1) (match-end 1))
+       (match-string 1)
       "File ???")))
 
-;; Look in an article or mail message for the Subject: line.  To be
-;; placed in `ps-left-headers'.
 (defun ps-info-node ()
   (save-excursion
     (goto-char (point-min))
     (if (re-search-forward "Node:[ \t]+\\([^,\t\n]*\\)" nil t)
-       (buffer-substring (match-beginning 1) (match-end 1))
+       (match-string 1)
       "Node ???")))
 
 (defun ps-info-mode-hook ()
-  (setq ps-left-header
-       ;; The left headers will display the node name and file name.
-       '(ps-info-node ps-info-file)))
-
-;; WARNING! The following function is a *sample* only, and is *not*
-;; meant to be used as a whole unless you understand what the effects
-;; will be!  (In fact, this is a copy of Jim's setup for ps-print --
-;; I'd be very surprised if it was useful to *anybody*, without
-;; modification.)
-
-(defun ps-jts-ps-setup ()
-  (global-set-key [(f22)] 'ps-spool-buffer-with-faces) ;f22 is prsc
-  (global-set-key [(shift f22)] 'ps-spool-region-with-faces)
-  (global-set-key [(control f22)] 'ps-despool)
+  ;; The left headers will display the node name and file name.
+  (setq-local ps-left-header '(ps-info-node ps-info-file)))
+
+;; WARNING! The following function is a *sample* only, and is *not* meant
+;; to be used as a whole unless you understand what the effects will be!
+(defun ps-samp-ps-setup ()
+  (global-set-key [print] 'ps-spool-buffer-with-faces)
+  (global-set-key [S-print] 'ps-spool-region-with-faces)
+  (global-set-key [C-print] 'ps-despool)
   (add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook)
   (add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup)
   (add-hook 'vm-mode-hook 'ps-vm-mode-hook)
   (setq ps-spool-duplex t
        ps-print-color-p nil
        ps-lpr-command "lpr"
-       ps-lpr-switches '("-Jjct,duplex_long"))
-  'ps-jts-ps-setup)
-
-;; WARNING! The following function is a *sample* only, and is *not*
-;; meant to be used as a whole unless it corresponds to your needs.
-;; (In fact, this is a copy of Jack's setup for ps-print --
-;; I would not be that surprised if it was useful to *anybody*,
-;; without modification.)
-
-(defun ps-jack-setup ()
-  (setq ps-print-color-p  nil
-       ps-lpr-command    "lpr"
-       ps-lpr-switches   nil
-
+       ps-lpr-switches '("-Jjct,duplex_long")
        ps-paper-type        'a4
        ps-landscape-mode    t
        ps-number-of-columns 2
-
        ps-left-margin   (/ (* 72  1.0) 2.54) ;  1.0 cm
        ps-right-margin  (/ (* 72  1.0) 2.54) ;  1.0 cm
        ps-inter-column  (/ (* 72  1.0) 2.54) ;  1.0 cm
        ps-header-lines       2
        ps-show-n-of-n        t
        ps-spool-duplex       nil
-
        ps-font-family             'Courier
        ps-font-size               5.5
        ps-header-font-family      'Helvetica
        ps-header-font-size        6
-       ps-header-title-font-size  8)
-  'ps-jack-setup)
+       ps-header-title-font-size  8))
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
index e798b07b556f46a13ed276ebbff727fc627ef7a9..e536e3e372c156e66ce7b460f53061010f4845cd 100644 (file)
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
+(defgroup rectangle nil
+  "Operations on rectangles."
+  :version "24.5"
+  :group 'editing)
+
 ;; FIXME: this function should be replaced by `apply-on-rectangle'
 (defun operate-on-rectangle (function start end coerce-tabs)
   "Call FUNCTION for each line of rectangle with corners at START, END.
@@ -42,42 +49,95 @@ FUNCTION is called with three arguments:
  number of columns that belong to rectangle but are before that position,
  number of columns that belong to rectangle but are after point.
 Point is at the end of the segment of this line within the rectangle."
-  (let (startcol startlinepos endcol endlinepos)
-    (save-excursion
-     (goto-char start)
-     (setq startcol (current-column))
-     (beginning-of-line)
-     (setq startlinepos (point)))
-    (save-excursion
-     (goto-char end)
-     (setq endcol (current-column))
-     (forward-line 1)
-     (setq endlinepos (point-marker)))
-    (if (< endcol startcol)
-       (setq startcol (prog1 endcol (setq endcol startcol))))
-    (save-excursion
-     (goto-char startlinepos)
-     (while (< (point) endlinepos)
-       (let (startpos begextra endextra)
-        (if coerce-tabs
-            (move-to-column startcol t)
-          (move-to-column startcol))
-        (setq begextra (- (current-column) startcol))
-        (setq startpos (point))
-        (if coerce-tabs
-            (move-to-column endcol t)
-          (move-to-column endcol))
-        ;; If we overshot, move back one character
-        ;; so that endextra will be positive.
-        (if (and (not coerce-tabs) (> (current-column) endcol))
-            (backward-char 1))
-        (setq endextra (- endcol (current-column)))
-        (if (< begextra 0)
-            (setq endextra (+ endextra begextra)
-                  begextra 0))
-        (funcall function startpos begextra endextra))
-       (forward-line 1)))
-    (- endcol startcol)))
+  (apply-on-rectangle
+   (lambda (startcol endcol)
+     (let (startpos begextra endextra)
+       (move-to-column startcol coerce-tabs)
+       (setq begextra (- (current-column) startcol))
+       (setq startpos (point))
+       (move-to-column endcol coerce-tabs)
+       ;; If we overshot, move back one character
+       ;; so that endextra will be positive.
+       (if (and (not coerce-tabs) (> (current-column) endcol))
+           (backward-char 1))
+       (setq endextra (- endcol (current-column)))
+       (if (< begextra 0)
+           (setq endextra (+ endextra begextra)
+                 begextra 0))
+       (funcall function startpos begextra endextra)))
+   start end))
+
+;;; Crutches to let rectangle's corners be where point can't be
+;; (e.g. in the middle of a TAB, or past the EOL).
+
+(defvar-local rectangle--mark-crutches nil
+  "(POS . COL) to override the column to use for the mark.")
+
+(defun rectangle--pos-cols (start end &optional window)
+  ;; At this stage, we don't know which of start/end is point/mark :-(
+  ;; And in case start=end, it might still be that point and mark have
+  ;; different crutches!
+  (let ((cw (window-parameter window 'rectangle--point-crutches)))
+    (cond
+     ((eq start (car cw))
+      (let ((sc (cdr cw))
+            (ec (if (eq end (car rectangle--mark-crutches))
+                    (cdr rectangle--mark-crutches)
+                  (if rectangle--mark-crutches
+                      (setq rectangle--mark-crutches nil))
+                  (goto-char end) (current-column))))
+        (if (eq start end) (cons (min sc ec) (max sc ec)) (cons sc ec))))
+     ((eq end (car cw))
+      (if (eq start (car rectangle--mark-crutches))
+          (cons (cdr rectangle--mark-crutches) (cdr cw))
+        (if rectangle--mark-crutches (setq rectangle--mark-crutches nil))
+        (cons (progn (goto-char start) (current-column)) (cdr cw))))
+     ((progn
+        (if cw (setf (window-parameter nil 'rectangle--point-crutches) nil))
+        (eq start (car rectangle--mark-crutches)))
+      (let ((sc (cdr rectangle--mark-crutches))
+            (ec (progn (goto-char end) (current-column))))
+        (if (eq start end) (cons (min sc ec) (max sc ec)) (cons sc ec))))
+     ((eq end (car rectangle--mark-crutches))
+      (cons (progn (goto-char start) (current-column))
+            (cdr rectangle--mark-crutches)))
+     (t
+      (if rectangle--mark-crutches (setq rectangle--mark-crutches nil))
+      (cons (progn (goto-char start) (current-column))
+            (progn (goto-char end) (current-column)))))))
+
+(defun rectangle--col-pos (col kind)
+  (let ((c (move-to-column col)))
+    (if (= c col)
+        (if (eq kind 'point)
+            (if (window-parameter nil 'rectangle--point-crutches)
+                (setf (window-parameter nil 'rectangle--point-crutches) nil))
+          (if rectangle--mark-crutches (setq rectangle--mark-crutches nil)))
+      ;; If move-to-column over-shooted, move back one char so we're
+      ;; at the position where rectangle--highlight-for-redisplay
+      ;; will add the overlay (so that the cursor can be drawn at the
+      ;; right place).
+      (when (> c col) (forward-char -1))
+      (setf (if (eq kind 'point)
+                (window-parameter nil 'rectangle--point-crutches)
+              rectangle--mark-crutches)
+            (cons (point) col)))))
+
+(defun rectangle--point-col (pos)
+  (let ((pc (window-parameter nil 'rectangle--point-crutches)))
+    (if (eq pos (car pc)) (cdr pc)
+      (goto-char pos)
+      (current-column))))
+
+(defun rectangle--crutches ()
+  (cons rectangle--mark-crutches
+        (window-parameter nil 'rectangle--point-crutches)))
+(defun rectangle--reset-crutches ()
+  (kill-local-variable 'rectangle--mark-crutches)
+  (if (window-parameter nil 'rectangle--point-crutches)
+      (setf (window-parameter nil 'rectangle--point-crutches) nil)))
+
+;;; Rectangle operations.
 
 (defun apply-on-rectangle (function start end &rest args)
   "Call FUNCTION for each line of rectangle with corners at START, END.
@@ -85,27 +145,27 @@ FUNCTION is called with two arguments: the start and end columns of the
 rectangle, plus ARGS extra arguments.  Point is at the beginning of line when
 the function is called.
 The final point after the last operation will be returned."
-  (let (startcol startpt endcol endpt final-point)
-    (save-excursion
-      (goto-char start)
-      (setq startcol (current-column))
-      (beginning-of-line)
-      (setq startpt (point))
-      (goto-char end)
-      (setq endcol (current-column))
-      (forward-line 1)
-      (setq endpt (point-marker))
-      ;; ensure the start column is the left one.
+  (save-excursion
+    (let* ((cols (rectangle--pos-cols start end))
+           (startcol (car cols))
+           (endcol (cdr cols))
+           (startpt (progn (goto-char start) (line-beginning-position)))
+           (endpt (progn (goto-char end)
+                         (copy-marker (line-end-position))))
+           final-point)
+      ;; Ensure the start column is the left one.
       (if (< endcol startcol)
          (let ((col startcol))
            (setq startcol endcol endcol col)))
-      ;; start looping over lines
+      ;; Start looping over lines.
       (goto-char startpt)
-      (while (< (point) endpt)
-       (apply function startcol endcol args)
-       (setq final-point (point))
-       (forward-line 1)))
-    final-point))
+      (while
+          (progn
+            (apply function startcol endcol args)
+            (setq final-point (point))
+            (and (zerop (forward-line 1)) (bolp)
+                 (<= (point) endpt))))
+      final-point)))
 
 (defun delete-rectangle-line (startcol endcol fill)
   (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
@@ -310,6 +370,67 @@ With a prefix (or a FILL) argument, also fill too short lines."
       (delete-rectangle-line startcol endcol nil))
   (insert string))
 
+(defvar-local rectangle--string-preview-state nil)
+(defvar-local rectangle--string-preview-window nil)
+
+(defun rectangle--string-flush-preview ()
+  (mapc #'delete-overlay (nthcdr 3 rectangle--string-preview-state))
+  (setf (nthcdr 3 rectangle--string-preview-state) nil))
+
+(defun rectangle--string-erase-preview ()
+  (with-selected-window rectangle--string-preview-window
+    (rectangle--string-flush-preview)))
+
+(defun rectangle--space-to (col)
+  (propertize " " 'display `(space :align-to ,col)))
+
+(defface rectangle-preview-face '((t :inherit region))
+  "The face to use for the `string-rectangle' preview.")
+
+(defcustom rectangle-preview t
+  "If non-nil, `string-rectangle' will show an-the-fly preview."
+  :type 'boolean)
+
+(defun rectangle--string-preview ()
+  (let ((str (minibuffer-contents)))
+    (when (equal str "")
+      (setq str (or (car-safe minibuffer-default)
+                    (if (stringp minibuffer-default) minibuffer-default))))
+    (when str (setq str (propertize str 'face 'region)))
+    (with-selected-window rectangle--string-preview-window
+      (unless (or (null rectangle--string-preview-state)
+                  (equal str (car rectangle--string-preview-state)))
+        (rectangle--string-flush-preview)
+        (apply-on-rectangle
+         (lambda (startcol endcol)
+           (let* ((sc (move-to-column startcol))
+                  (start (if (<= sc startcol) (point)
+                           (forward-char -1)
+                           (setq sc (current-column))
+                           (point)))
+                  (ec (move-to-column endcol))
+                  (end (point))
+                  (ol (make-overlay start end)))
+             (push ol (nthcdr 3 rectangle--string-preview-state))
+             ;; FIXME: The extra spacing doesn't interact correctly with
+             ;; the extra spacing added by the rectangular-region-highlight.
+             (when (< sc startcol)
+               (overlay-put ol 'before-string (rectangle--space-to startcol)))
+             (let ((as (when (< endcol ec)
+                         ;; (rectangle--space-to ec)
+                         (spaces-string (- ec endcol))
+                         )))
+               (if (= start end)
+                   (overlay-put ol 'after-string (if as (concat str as) str))
+                 (overlay-put ol 'display str)
+                 (if as (overlay-put ol 'after-string as))))))
+         (nth 1 rectangle--string-preview-state)
+         (nth 2 rectangle--string-preview-state))))))
+
+;; FIXME: Should this be turned into inhibit-region-highlight and made to apply
+;; to non-rectangular regions as well?
+(defvar rectangle--inhibit-region-highlight nil)
+
 ;;;###autoload
 (defun string-rectangle (start end string)
   "Replace rectangle contents with STRING on each line.
@@ -317,14 +438,31 @@ The length of STRING need not be the same as the rectangle width.
 
 Called from a program, takes three args; START, END and STRING."
   (interactive
-   (progn (barf-if-buffer-read-only)
-         (list
-          (region-beginning)
-          (region-end)
+   (progn
+     (make-local-variable 'rectangle--string-preview-state)
+     (make-local-variable 'rectangle--inhibit-region-highlight)
+     (let* ((buf (current-buffer))
+            (win (if (eq (window-buffer) buf) (selected-window)))
+            (start (region-beginning))
+            (end (region-end))
+            (rectangle--string-preview-state `(nil ,start ,end))
+            ;; Rectangle-region-highlighting doesn't work well in the presence
+            ;; of the preview overlays.  We could work harder to try and make
+            ;; it work better, but it's easier to just disable it temporarily.
+            (rectangle--inhibit-region-highlight t))
+       (barf-if-buffer-read-only)
+       (list start end
+             (minibuffer-with-setup-hook
+                 (lambda ()
+                   (setq rectangle--string-preview-window win)
+                   (add-hook 'minibuffer-exit-hook
+                             #'rectangle--string-erase-preview nil t)
+                   (add-hook 'post-command-hook
+                             #'rectangle--string-preview nil t))
           (read-string (format "String rectangle (default %s): "
                                (or (car string-rectangle-history) ""))
                        nil 'string-rectangle-history
-                       (car string-rectangle-history)))))
+                            (car string-rectangle-history)))))))
   (goto-char
    (apply-on-rectangle 'string-rectangle-line start end string t)))
 
@@ -429,8 +567,12 @@ with a prefix argument, prompt for START-AT and FORMAT."
   (let ((map (make-sparse-keymap)))
     (define-key map [?\C-o] 'open-rectangle)
     (define-key map [?\C-t] 'string-rectangle)
-    ;; (define-key map [remap open-line] 'open-rectangle)
-    ;; (define-key map [remap transpose-chars] 'string-rectangle)
+    (define-key map [remap exchange-point-and-mark]
+      'rectangle-exchange-point-and-mark)
+    (dolist (cmd '(right-char left-char forward-char backward-char
+                   next-line previous-line))
+      (define-key map (vector 'remap cmd)
+        (intern (format "rectangle-%s" cmd))))
     map)
   "Keymap used while marking a rectangular region.")
 
@@ -439,6 +581,7 @@ with a prefix argument, prompt for START-AT and FORMAT."
   "Toggle the region as rectangular.
 Activates the region if needed.  Only lasts until the region is deactivated."
   nil nil nil
+  (rectangle--reset-crutches)
   (when rectangle-mark-mode
     (add-hook 'deactivate-mark-hook
               (lambda () (rectangle-mark-mode -1)))
@@ -447,6 +590,96 @@ Activates the region if needed.  Only lasts until the region is deactivated."
       (activate-mark)
       (message "Mark set (rectangle mode)"))))
 
+(defun rectangle-exchange-point-and-mark (&optional arg)
+  "Like `exchange-point-and-mark' but cycles through the rectangle's corners."
+  (interactive "P")
+  (if arg
+      (progn
+        (setq this-command 'exchange-point-and-mark)
+        (exchange-point-and-mark arg))
+    (let* ((p (point))
+           (repeat (eq this-command last-command))
+          (m (mark))
+           (p<m (< p m))
+           (cols (if p<m (rectangle--pos-cols p m) (rectangle--pos-cols m p)))
+           (cp (if p<m (car cols) (cdr cols)))
+           (cm (if p<m (cdr cols) (car cols))))
+      (if repeat (setq this-command 'exchange-point-and-mark))
+      (rectangle--reset-crutches)
+      (goto-char p)
+      (rectangle--col-pos (if repeat cm cp) 'mark)
+      (set-mark (point))
+      (goto-char m)
+      (rectangle--col-pos (if repeat cp cm) 'point))))
+
+(defun rectangle--*-char (cmd n &optional other-cmd)
+  ;; Part of the complexity here is that I'm trying to avoid making assumptions
+  ;; about the L2R/R2L direction of text around point, but this is largely
+  ;; useless since the rectangles implemented in this file are "logical
+  ;; rectangles" and not "visual rectangles", so in the presence of
+  ;; bidirectional text things won't work well anyway.
+  (if (< n 0) (rectangle--*-char other-cmd (- n))
+    (let ((col (rectangle--point-col (point))))
+      (while (> n 0)
+        (let* ((bol (line-beginning-position))
+               (eol (line-end-position))
+               (curcol (current-column))
+               (nextcol
+                (condition-case nil
+                    (save-excursion
+                      (funcall cmd 1)
+                      (cond
+                       ((> bol (point)) (- curcol 1))
+                       ((< eol (point)) (+ col (1+ n)))
+                       (t (current-column))))
+                  (end-of-buffer (+ col (1+ n)))
+                  (beginning-of-buffer (- curcol 1))))
+               (diff (abs (- nextcol col))))
+          (cond
+           ((and (< nextcol curcol) (< curcol col))
+            (let ((curdiff (- col curcol)))
+              (if (<= curdiff n)
+                (progn (cl-decf n curdiff) (setq col curcol))
+                (setq col (- col n) n 0))))
+           ((< nextcol 0) (ding) (setq n 0 col 0)) ;Bumping into BOL!
+           ((= nextcol curcol) (funcall cmd 1))
+           (t ;; (> nextcol curcol)
+            (if (<= diff n)
+                (progn (cl-decf n diff) (setq col nextcol))
+              (setq col (if (< col nextcol) (+ col n) (- col n)) n 0))))))
+      ;; FIXME: This rectangle--col-pos's move-to-column is wasted!
+      (rectangle--col-pos col 'point))))
+
+(defun rectangle-right-char (&optional n)
+  "Like `right-char' but steps into wide chars and moves past EOL."
+  (interactive "p") (rectangle--*-char #'right-char n #'left-char))
+(defun rectangle-left-char (&optional n)
+  "Like `left-char' but steps into wide chars and moves past EOL."
+  (interactive "p") (rectangle--*-char #'left-char n #'right-char))
+
+(defun rectangle-forward-char (&optional n)
+  "Like `forward-char' but steps into wide chars and moves past EOL."
+  (interactive "p") (rectangle--*-char #'forward-char n #'backward-char))
+(defun rectangle-backward-char (&optional n)
+  "Like `backward-char' but steps into wide chars and moves past EOL."
+  (interactive "p") (rectangle--*-char #'backward-char n #'forward-char))
+
+(defun rectangle-next-line (&optional n)
+  "Like `next-line' but steps into wide chars and moves past EOL.
+Ignores `line-move-visual'."
+  (interactive "p")
+  (let ((col (rectangle--point-col (point))))
+    (forward-line n)
+    (rectangle--col-pos col 'point)))
+(defun rectangle-previous-line (&optional n)
+  "Like `previous-line' but steps into wide chars and moves past EOL.
+Ignores `line-move-visual'."
+  (interactive "p")
+  (let ((col (rectangle--point-col (point))))
+    (forward-line (- n))
+    (rectangle--col-pos col 'point)))
+
+
 (defun rectangle--extract-region (orig &optional delete)
   (if (not rectangle-mark-mode)
       (funcall orig delete)
@@ -476,100 +709,118 @@ Activates the region if needed.  Only lasts until the region is deactivated."
             (while (not (eq pending-undo-list (cdr undo-at-start)))
               (undo-more 1))))))
 
+(defun rectangle--place-cursor (leftcol left str)
+  (let ((pc (window-parameter nil 'rectangle--point-crutches)))
+    (if (and (eq left (car pc)) (eq leftcol (cdr pc)))
+        (put-text-property 0 1 'cursor 1 str))))
+
 (defun rectangle--highlight-for-redisplay (orig start end window rol)
   (cond
    ((not rectangle-mark-mode)
     (funcall orig start end window rol))
+   (rectangle--inhibit-region-highlight
+    (funcall redisplay-unhighlight-region-function rol)
+    nil)
    ((and (eq 'rectangle (car-safe rol))
          (eq (nth 1 rol) (buffer-chars-modified-tick))
          (eq start (nth 2 rol))
-         (eq end (nth 3 rol)))
+         (eq end (nth 3 rol))
+         (equal (rectangle--crutches) (nth 4 rol)))
     rol)
    (t
     (save-excursion
       (let* ((nrol nil)
              (old (if (eq 'rectangle (car-safe rol))
-                      (nthcdr 4 rol)
+                      (nthcdr 5 rol)
                     (funcall redisplay-unhighlight-region-function rol)
-                    nil))
-             (ptcol (progn (goto-char start) (current-column)))
-             (markcol (progn (goto-char end) (current-column)))
-             (leftcol  (min ptcol markcol))
-             (rightcol (max ptcol markcol)))
-        (goto-char start)
-        (while
-            (let* ((mleft (move-to-column leftcol))
-                   (left (point))
-                   (mright (move-to-column rightcol))
-                   (right (point))
-                   (ol
-                    (if (not old)
-                        (let ((ol (make-overlay left right)))
-                          (overlay-put ol 'window window)
-                          (overlay-put ol 'face 'region)
-                          ol)
-                      (let ((ol (pop old)))
-                        (move-overlay ol left right (current-buffer))
-                        ol))))
-              ;; `move-to-column' may stop before the column (if bumping into
-              ;; EOL) or overshoot it a little, when column is in the middle
-              ;; of a char.
-              (cond
-               ((< mleft leftcol)       ;`leftcol' is past EOL.
-                (overlay-put ol 'before-string
-                             (spaces-string (- leftcol mleft)))
-                (setq mright (max mright leftcol)))
-               ((and (> mleft leftcol)  ;`leftcol' is in the middle of a char.
-                     (eq (char-before left) ?\t))
-                (setq left (1- left))
-                (move-overlay ol left right)
-                (goto-char left)
-                (overlay-put ol 'before-string
-                             (spaces-string (- leftcol (current-column)))))
-               ((overlay-get ol 'before-string)
-                (overlay-put ol 'before-string nil)))
-              (cond
-               ((< mright rightcol)     ;`rightcol' is past EOL.
-                (let ((str (make-string (- rightcol mright) ?\s)))
-                  (put-text-property 0 (length str) 'face 'region str)
-                  ;; If cursor happens to be here, draw it *before* rather than
-                  ;; after this highlighted pseudo-text.
-                  (put-text-property 0 1 'cursor t str)
-                  (overlay-put ol 'after-string str)))
-               ((and (> mright rightcol) ;`rightcol's in the middle of a char.
-                     (eq (char-before right) ?\t))
-                (setq right (1- right))
-                (move-overlay ol left right)
-                (if (= rightcol leftcol)
-                    (overlay-put ol 'after-string nil)
-                  (goto-char right)
-                  (let ((str (make-string
-                              (- rightcol (max leftcol (current-column)))
-                              ?\s)))
-                    (put-text-property 0 (length str) 'face 'region str)
-                    (when (= left right)
-                      ;; If cursor happens to be here, draw it *before* rather
-                      ;; than after this highlighted pseudo-text.
-                      (put-text-property 0 1 'cursor 1 str))
-                    (overlay-put ol 'after-string str))))
-               ((overlay-get ol 'after-string)
-                (overlay-put ol 'after-string nil)))
-              (when (and (= leftcol rightcol) (display-graphic-p))
-                ;; Make zero-width rectangles visible!
-               (overlay-put ol 'after-string
-                            (concat (propertize " "
-                                                 'face '(region (:height 0.2)))
-                                     (overlay-get ol 'after-string))))
-              (push ol nrol)
-              (and (zerop (forward-line 1))
-                   (<= (point) end))))
+                    nil)))
+        (cl-assert (eq (window-buffer window) (current-buffer)))
+        ;; `rectangle--pos-cols' looks up the `selected-window's parameter!
+        (with-selected-window window
+          (apply-on-rectangle
+           (lambda (leftcol rightcol)
+             (let* ((mleft (move-to-column leftcol))
+                    (left (point))
+                    ;; BEWARE: In the presence of other overlays with
+                    ;; before/after/display-strings, this happens to move to
+                    ;; the column "as if the overlays were not applied", which
+                    ;; is sometimes what we want, tho it can be
+                    ;; considered a bug in move-to-column (it should arguably
+                    ;; pay attention to the before/after-string/display
+                    ;; properties when computing the column).
+                    (mright (move-to-column rightcol))
+                    (right (point))
+                    (ol
+                     (if (not old)
+                         (let ((ol (make-overlay left right)))
+                           (overlay-put ol 'window window)
+                           (overlay-put ol 'face 'region)
+                           ol)
+                       (let ((ol (pop old)))
+                         (move-overlay ol left right (current-buffer))
+                         ol))))
+               ;; `move-to-column' may stop before the column (if bumping into
+               ;; EOL) or overshoot it a little, when column is in the middle
+               ;; of a char.
+               (cond
+                ((< mleft leftcol)      ;`leftcol' is past EOL.
+                 (overlay-put ol 'before-string (rectangle--space-to leftcol))
+                 (setq mright (max mright leftcol)))
+                ((and (> mleft leftcol) ;`leftcol' is in the middle of a char.
+                      (eq (char-before left) ?\t))
+                 (setq left (1- left))
+                 (move-overlay ol left right)
+                 (goto-char left)
+                 (overlay-put ol 'before-string (rectangle--space-to leftcol)))
+                ((overlay-get ol 'before-string)
+                 (overlay-put ol 'before-string nil)))
+               (cond
+                ;; While doing rectangle--string-preview, the two sets of
+                ;; overlays steps on the other's toes.  I fixed some of the
+                ;; problems, but others remain.  The main one is the two
+                ;; (rectangle--space-to rightcol) below which try to virtually
+                ;; insert missing text, but during "preview", the text is not
+                ;; missing (it's provided by preview's own overlay).
+                (rectangle--string-preview-state
+                 (if (overlay-get ol 'after-string)
+                     (overlay-put ol 'after-string nil)))
+                ((< mright rightcol)    ;`rightcol' is past EOL.
+                 (let ((str (rectangle--space-to rightcol)))
+                   (put-text-property 0 (length str) 'face 'region str)
+                   ;; If cursor happens to be here, draw it at the right place.
+                   (rectangle--place-cursor leftcol left str)
+                   (overlay-put ol 'after-string str)))
+                ((and (> mright rightcol) ;`rightcol's in the middle of a char.
+                      (eq (char-before right) ?\t))
+                 (setq right (1- right))
+                 (move-overlay ol left right)
+                 (if (= rightcol leftcol)
+                     (overlay-put ol 'after-string nil)
+                   (goto-char right)
+                   (let ((str (rectangle--space-to rightcol)))
+                     (put-text-property 0 (length str) 'face 'region str)
+                     (when (= left right)
+                       (rectangle--place-cursor leftcol left str))
+                     (overlay-put ol 'after-string str))))
+                ((overlay-get ol 'after-string)
+                 (overlay-put ol 'after-string nil)))
+               (when (and (= leftcol rightcol) (display-graphic-p))
+                 ;; Make zero-width rectangles visible!
+                 (overlay-put ol 'after-string
+                              (concat (propertize " "
+                                                  'face '(region (:height 0.2)))
+                                      (overlay-get ol 'after-string))))
+               (push ol nrol)))
+           start end))
         (mapc #'delete-overlay old)
-        `(rectangle ,(buffer-chars-modified-tick) ,start ,end ,@nrol))))))
+        `(rectangle ,(buffer-chars-modified-tick)
+                    ,start ,end ,(rectangle--crutches)
+                    ,@nrol))))))
 
 (defun rectangle--unhighlight-for-redisplay (orig rol)
   (if (not (eq 'rectangle (car-safe rol)))
       (funcall orig rol)
-    (mapc #'delete-overlay (nthcdr 4 rol))
+    (mapc #'delete-overlay (nthcdr 5 rol))
     (setcar (cdr rol) nil)))
 
 (provide 'rect)
index 1c64a9a8e6414d4ccc1eaf47e63c13827311dd4c..eb3c71afecec6e1ab6fe9ac0cd42a25f85b8bbaa 100644 (file)
@@ -27,7 +27,7 @@
 ;; This package of functions emulates and somewhat extends the venerable
 ;; TECO's `register' feature, which permits you to save various useful
 ;; pieces of buffer state to named variables.  The entry points are
-;; documented in the Emacs user's manual.
+;; documented in the Emacs user's manual: (info "(emacs) Registers").
 
 (eval-when-compile (require 'cl-lib))
 
@@ -161,7 +161,7 @@ display such a window regardless."
                              collect c)))
     (unwind-protect
        (progn
-         (while (memq (read-event (propertize prompt 'face 'minibuffer-prompt))
+         (while (memq (read-key (propertize prompt 'face 'minibuffer-prompt))
                       help-chars)
            (unless (get-buffer-window buffer)
              (register-preview buffer 'show-empty)))
index fda2213236bfd2e4daaa89b6bdad3ca9fbda3b02..cf88cb57b8945f22ee0da13f88a59b8fa41f658a 100644 (file)
@@ -523,6 +523,8 @@ What you probably want is a loop like this:
 which will run faster and will not set the mark or print anything.
 \(You may need a more complex loop if FROM-STRING can match the null string
 and TO-STRING is also null.)"
+  (declare (interactive-only
+           "use `search-forward' and `replace-match' instead."))
   (interactive
    (let ((common
          (query-replace-read-args
@@ -540,8 +542,6 @@ and TO-STRING is also null.)"
               (region-end))
           (nth 3 common))))
   (perform-replace from-string to-string nil nil delimited nil nil start end backward))
-(put 'replace-string 'interactive-only
-     "use `search-forward' and `replace-match' instead.")
 
 (defun replace-regexp (regexp to-string &optional delimited start end backward)
   "Replace things after point matching REGEXP with TO-STRING.
@@ -597,6 +597,8 @@ What you probably want is a loop like this:
   (while (re-search-forward REGEXP nil t)
     (replace-match TO-STRING nil nil))
 which will run faster and will not set the mark or print anything."
+  (declare (interactive-only
+           "use `re-search-forward' and `replace-match' instead."))
   (interactive
    (let ((common
          (query-replace-read-args
@@ -614,8 +616,6 @@ which will run faster and will not set the mark or print anything."
               (region-end))
           (nth 3 common))))
   (perform-replace regexp to-string nil t delimited nil nil start end backward))
-(put 'replace-regexp 'interactive-only
-     "use `re-search-forward' and `replace-match' instead.")
 
 \f
 (defvar regexp-history nil
index f251c05f5eb8b74c9ea2c23b9acb4b1bcbf6e494..8d611ea04df571d77c74859c66099c1398cd5222 100644 (file)
@@ -83,7 +83,8 @@ Each element has the form (WINDOW . OVERLAY).")
                       (cond
                        ((eq (car x) (selected-window)) (cdr x))
                        ((not (and (window-live-p (car x))
-                                  (eq (window-buffer (car x)) (current-buffer))))
+                                  (eq (window-buffer (car x))
+                                      (current-buffer))))
                         ;; Adopt this since it's owned by a window that's
                         ;; either not live or at least not showing this
                         ;; buffer any more.
@@ -135,8 +136,9 @@ Each element has the form (WINDOW . OVERLAY).")
   old-ols)
 
 (defun reveal-close-old-overlays (old-ols)
-  (if (not (eq reveal-last-tick
-               (setq reveal-last-tick (buffer-modified-tick))))
+  (if (or track-mouse                   ;Don't close in the middle of a click.
+          (not (eq reveal-last-tick
+                   (setq reveal-last-tick (buffer-modified-tick)))))
       ;; The buffer was modified since last command: let's refrain from
       ;; closing any overlay because it tends to behave poorly when
       ;; inserting text at the end of an overlay (basically the overlay
index bcd9c5463a161b6285c6905f354aa94cf7215d2d..de31f2ec4ae9880c9fd539ddfa2c26b6e61de912 100644 (file)
@@ -306,7 +306,6 @@ or remove a tab stop.  \\[ruler-mode-toggle-show-tab-stops] or
   "Return a column number relative to the selected window.
 N is a column number relative to selected frame."
   (- n
-     (car (window-edges))
      (or (car (window-margins)) 0)
      (fringe-columns 'left)
      (scroll-bar-columns 'left)))
@@ -321,7 +320,7 @@ START-EVENT is the mouse click event."
     (when (eq start end) ;; mouse click
       (save-selected-window
         (select-window (posn-window start))
-        (setq col (- (car (posn-col-row start)) (car (window-edges))
+        (setq col (- (car (posn-col-row start))
                      (scroll-bar-columns 'left))
               w   (- (ruler-mode-full-window-width)
                      (scroll-bar-columns 'left)
@@ -343,7 +342,7 @@ START-EVENT is the mouse click event."
     (when (eq start end) ;; mouse click
       (save-selected-window
         (select-window (posn-window start))
-        (setq col (- (car (posn-col-row start)) (car (window-edges))
+        (setq col (- (car (posn-col-row start))
                      (scroll-bar-columns 'left))
               w   (- (ruler-mode-full-window-width)
                      (scroll-bar-columns 'left)
index 6abc29cccc24c22b14b7ca214351fe5c34dfac4c..26e9d0b881dbcaf794cd33435acad512e2d19443 100644 (file)
@@ -278,13 +278,6 @@ If AUTO-SAVE is non-nil, compare the saved contents to the one last saved,
          (print-level nil)
          (print-readably t)
          (print-quoted t))
-      ;; During the 24.3 development, read-passwd had a bug which resulted in
-      ;; the passwords being saved by savehist.  Trim them, retroactively.
-      ;; This code can be removed after the 24.3 release.
-      (dolist (sym savehist-minibuffer-history-variables)
-        (if (and (symbolp sym) (equal (symbol-name sym) "forget-history"))
-            (setq savehist-minibuffer-history-variables
-                  (delq sym savehist-minibuffer-history-variables))))
       ;; Save the minibuffer histories, along with the value of
       ;; savehist-minibuffer-history-variables itself.
       (when savehist-save-minibuffer-history
index b56a020c79520a7513964204c915264667116af7..1aa2fc7d2bbfd7d5461cead0077da1e9699ee937 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1997, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Gary D. Foster <Gary.Foster@corp.sun.com>
-;; Keywords: scroll crisp brief lock
+;; Keywords: convenience scroll lock
 
 ;; This file is part of GNU Emacs.
 
index 2990e8e5ffacd82e8f9b7f38aaa7393073e950e3..739670cb1c93437acaf193562f828aa3317799de 100644 (file)
@@ -70,16 +70,36 @@ SIDE must be the symbol `left' or `right'."
                (frame-char-width)))
      (0))))
 
+(defun scroll-bar-lines ()
+  "Return the height, measured in lines, of the horizontal scrollbar."
+  (let* ((wsb   (window-scroll-bars))
+         (htype (nth 5 wsb))
+         (lines  (nth 4 wsb)))
+    (cond
+     (htype lines)
+     ((frame-parameter nil 'horizontal-scroll-bars)
+      ;; nil means it's a non-toolkit scroll bar (which is currently
+      ;; impossible), and its width in columns is 14 pixels rounded up.
+      (ceiling (or (frame-parameter nil 'scroll-bar-height) 14)
+               (frame-char-width)))
+     (0))))
+
 \f
 ;;;; Helpful functions for enabling and disabling scroll bars.
 
 (defvar scroll-bar-mode)
+(defvar horizontal-scroll-bar-mode)
 (defvar previous-scroll-bar-mode nil)
+(defvar previous-horizontal-scroll-bar-mode nil)
 
 (defvar scroll-bar-mode-explicit nil
   "Non-nil means `set-scroll-bar-mode' should really do something.
 This is nil while loading `scroll-bar.el', and t afterward.")
 
+(defvar horizontal-scroll-bar-mode-explicit nil
+  "Non-nil means `set-horizontal-scroll-bar-mode' should really do something.
+This is nil while loading `scroll-bar.el', and t afterward.")
+
 (defun set-scroll-bar-mode (value)
   "Set the scroll bar mode to VALUE and put the new value into effect.
 See the `scroll-bar-mode' variable for possible values to use."
@@ -92,6 +112,18 @@ See the `scroll-bar-mode' variable for possible values to use."
     (modify-all-frames-parameters (list (cons 'vertical-scroll-bars
                                              scroll-bar-mode)))))
 
+(defun set-horizontal-scroll-bar-mode (value)
+  "Set the horizontal scroll bar mode to VALUE and put the new value into effect.
+See the `horizontal-scroll-bar-mode' variable for possible values to use."
+  (if horizontal-scroll-bar-mode
+      (setq previous-horizontal-scroll-bar-mode horizontal-scroll-bar-mode))
+
+  (setq horizontal-scroll-bar-mode value)
+
+  (when horizontal-scroll-bar-mode-explicit
+    (modify-all-frames-parameters (list (cons 'horizontal-scroll-bars
+                                             horizontal-scroll-bar-mode)))))
+
 (defcustom scroll-bar-mode default-frame-scroll-bars
   "Specify whether to have vertical scroll bars, and on which side.
 Possible values are nil (no scroll bars), `left' (scroll bars on left)
@@ -108,14 +140,32 @@ Setting the variable with a customization buffer also takes effect."
   :initialize 'custom-initialize-default
   :set (lambda (_sym val) (set-scroll-bar-mode val)))
 
+(defcustom horizontal-scroll-bar-mode default-frame-horizontal-scroll-bars
+  "Specify whether to have horizontal scroll bars, and on which side.
+To set this variable in a Lisp program, use `set-horizontal-scroll-bar-mode'
+to make it take real effect.
+Setting the variable with a customization buffer also takes effect."
+  :type '(choice (const :tag "none (nil)" nil)
+                (const t))
+  :group 'frames
+  ;; The default value for :initialize would try to use :set
+  ;; when processing the file in cus-dep.el.
+  :initialize 'custom-initialize-default
+  :set (lambda (_sym val) (set-horizontal-scroll-bar-mode val)))
+
 ;; We just set scroll-bar-mode, but that was the default.
 ;; If it is set again, that is for real.
 (setq scroll-bar-mode-explicit t)
+(setq horizontal-scroll-bar-mode-explicit t)
 
 (defun get-scroll-bar-mode ()
   (declare (gv-setter set-scroll-bar-mode))
   scroll-bar-mode)
 
+(defun get-horizontal-scroll-bar-mode ()
+  (declare (gv-setter set-horizontal-scroll-bar-mode))
+  horizontal-scroll-bar-mode)
+
 (define-minor-mode scroll-bar-mode
   "Toggle vertical scroll bars on all frames (Scroll Bar mode).
 With a prefix argument ARG, enable Scroll Bar mode if ARG is
@@ -126,8 +176,21 @@ This command applies to all frames that exist and frames to be
 created in the future."
   :variable ((get-scroll-bar-mode)
              . (lambda (v) (set-scroll-bar-mode
-                       (if v (or previous-scroll-bar-mode
-                                 default-frame-scroll-bars))))))
+                           (if v (or previous-scroll-bar-mode
+                                     default-frame-scroll-bars))))))
+
+(define-minor-mode horizontal-scroll-bar-mode
+  "Toggle horizontal scroll bars on all frames (Horizontal Scroll Bar mode).
+With a prefix argument ARG, enable Horizontal Scroll Bar mode if
+ARG is positive, and disable it otherwise.  If called from Lisp,
+enable the mode if ARG is omitted or nil.
+
+This command applies to all frames that exist and frames to be
+created in the future."
+  :variable ((get-horizontal-scroll-bar-mode)
+             . (lambda (v) (set-horizontal-scroll-bar-mode
+                           (if v (or previous-scroll-bar-mode
+                                     default-frame-horizontal-scroll-bars))))))
 
 (defun toggle-scroll-bar (arg)
   "Toggle whether or not the selected frame has vertical scroll bars.
@@ -147,12 +210,21 @@ when they are turned on; if it is nil, they go on the left."
               (if (> arg 0)
                   (or scroll-bar-mode default-frame-scroll-bars))))))
 
-(defun toggle-horizontal-scroll-bar (_arg)
+(defun toggle-horizontal-scroll-bar (arg)
   "Toggle whether or not the selected frame has horizontal scroll bars.
-With arg, turn horizontal scroll bars on if and only if arg is positive.
-Horizontal scroll bars aren't implemented yet."
+With arg, turn horizontal scroll bars on if and only if arg is positive."
   (interactive "P")
-  (error "Horizontal scroll bars aren't implemented yet"))
+  (if (null arg)
+      (setq arg
+           (if (cdr (assq 'horizontal-scroll-bars
+                          (frame-parameters (selected-frame))))
+               -1 1))
+    (setq arg (prefix-numeric-value arg)))
+  (modify-frame-parameters
+   (selected-frame)
+   (list (cons 'horizontal-scroll-bars
+              (if (> arg 0)
+                  (or horizontal-scroll-bar-mode default-frame-horizontal-scroll-bars))))))
 \f
 ;;;; Buffer navigation using the scroll bar.
 
@@ -249,6 +321,45 @@ If you click outside the slider, the window scrolls to bring the slider there."
     (with-current-buffer (window-buffer window)
       (setq point-before-scroll before-scroll))))
 
+;; Scroll the window to the proper position for EVENT.
+(defun scroll-bar-horizontal-drag-1 (event)
+  (let* ((start-position (event-start event))
+        (window (nth 0 start-position))
+        (portion-whole (nth 2 start-position))
+        (unit (frame-char-width (window-frame window))))
+    (set-window-hscroll
+     window (/ (1- (+ (car portion-whole) unit)) unit))))
+
+(defun scroll-bar-horizontal-drag (event)
+  "Scroll the window horizontally by dragging the scroll bar slider.
+If you click outside the slider, the window scrolls to bring the slider there."
+  (interactive "e")
+  (let* (done
+        (echo-keystrokes 0)
+        (end-position (event-end event))
+        (window (nth 0 end-position))
+        (before-scroll))
+    (with-current-buffer (window-buffer window)
+      (setq before-scroll point-before-scroll))
+    (save-selected-window
+      (select-window window)
+      (setq before-scroll
+           (or before-scroll (point))))
+    (scroll-bar-horizontal-drag-1 event)
+    (track-mouse
+      (while (not done)
+       (setq event (read-event))
+       (if (eq (car-safe event) 'mouse-movement)
+           (setq event (read-event)))
+       (cond ((eq (car-safe event) 'scroll-bar-movement)
+              (scroll-bar-horizontal-drag-1 event))
+             (t
+              ;; Exit when we get the drag event; ignore that event.
+              (setq done t)))))
+    (sit-for 0)
+    (with-current-buffer (window-buffer window)
+      (setq point-before-scroll before-scroll))))
+
 (defun scroll-bar-scroll-down (event)
   "Scroll the window's top line down to the location of the scroll bar click.
 EVENT should be a scroll bar click."
@@ -300,47 +411,100 @@ EVENT should be a scroll bar click."
         (window (nth 0 end-position))
         (part (nth 4 end-position))
         before-scroll)
-    (cond ((eq part 'end-scroll))
-         (t
-          (with-current-buffer (window-buffer window)
-            (setq before-scroll point-before-scroll))
-          (save-selected-window
-            (select-window window)
-            (setq before-scroll (or before-scroll (point)))
-            (cond ((eq part 'above-handle)
-                   (scroll-up '-))
-                  ((eq part 'below-handle)
-                   (scroll-up nil))
-                  ((eq part 'ratio)
-                   (let* ((portion-whole (nth 2 end-position))
-                          (lines (scroll-bar-scale portion-whole
-                                                   (1- (window-height)))))
-                     (scroll-up (cond ((not (zerop lines)) lines)
-                                      ((< (car portion-whole) 0) -1)
-                                      (t 1)))))
-                  ((eq part 'up)
-                   (scroll-up -1))
-                  ((eq part 'down)
-                   (scroll-up 1))
-                  ((eq part 'top)
-                   (set-window-start window (point-min)))
-                  ((eq part 'bottom)
-                   (goto-char (point-max))
-                   (recenter))
-                  ((eq part 'handle)
-                   (scroll-bar-drag-1 event))))
-          (sit-for 0)
-          (with-current-buffer (window-buffer window)
-            (setq point-before-scroll before-scroll))))))
-
+    (cond
+     ((eq part 'end-scroll))
+     (t
+      (with-current-buffer (window-buffer window)
+       (setq before-scroll point-before-scroll))
+      (save-selected-window
+       (select-window window)
+       (setq before-scroll (or before-scroll (point)))
+       (cond
+        ((eq part 'above-handle)
+         (scroll-up '-))
+        ((eq part 'below-handle)
+         (scroll-up nil))
+        ((eq part 'ratio)
+         (let* ((portion-whole (nth 2 end-position))
+                (lines (scroll-bar-scale portion-whole
+                                         (1- (window-height)))))
+           (scroll-up (cond ((not (zerop lines)) lines)
+                            ((< (car portion-whole) 0) -1)
+                            (t 1)))))
+        ((eq part 'up)
+         (scroll-up -1))
+        ((eq part 'down)
+         (scroll-up 1))
+        ((eq part 'top)
+         (set-window-start window (point-min)))
+        ((eq part 'bottom)
+         (goto-char (point-max))
+         (recenter))
+        ((eq part 'handle)
+         (scroll-bar-drag-1 event))))
+      (sit-for 0)
+      (with-current-buffer (window-buffer window)
+       (setq point-before-scroll before-scroll))))))
 
+(defun scroll-bar-toolkit-horizontal-scroll (event)
+  (interactive "e")
+  (let* ((end-position (event-end event))
+        (window (nth 0 end-position))
+        (part (nth 4 end-position))
+        (bidi-factor (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+                         1
+                       -1))
+        before-scroll)
+    (cond
+     ((eq part 'end-scroll))
+     (t
+      (with-current-buffer (window-buffer window)
+       (setq before-scroll point-before-scroll))
+      (save-selected-window
+       (select-window window)
+       (setq before-scroll (or before-scroll (point)))
+       (cond
+        ((eq part 'before-handle)
+         (scroll-right (* bidi-factor 4)))
+        ((eq part 'after-handle)
+         (scroll-left (* bidi-factor 4)))
+        ((eq part 'ratio)
+         (let* ((portion-whole (nth 2 end-position))
+                (columns (scroll-bar-scale portion-whole
+                                           (1- (window-width)))))
+           (scroll-right
+            (* (cond
+                ((not (zerop columns))
+                 columns)
+                ((< (car portion-whole) 0) -1)
+                (t 1))
+               bidi-factor))))
+        ((eq part 'left)
+         (scroll-right (* bidi-factor 1)))
+        ((eq part 'right)
+         (scroll-left (* bidi-factor 1)))
+        ((eq part 'leftmost)
+         (goto-char (if (eq bidi-factor 1)
+                        (line-beginning-position)
+                      (line-end-position))))
+        ((eq part 'rightmost)
+         (goto-char (if (eq bidi-factor 1)
+                        (line-end-position)
+                      (line-beginning-position))))
+        ((eq part 'horizontal-handle)
+         (scroll-bar-horizontal-drag-1 event))))
+      (sit-for 0)
+      (with-current-buffer (window-buffer window)
+       (setq point-before-scroll before-scroll))))))
 \f
 ;;;; Bindings.
 
 ;; For now, we'll set things up to work like xterm.
 (cond ((and (boundp 'x-toolkit-scroll-bars) x-toolkit-scroll-bars)
        (global-set-key [vertical-scroll-bar mouse-1]
-                      'scroll-bar-toolkit-scroll))
+                      'scroll-bar-toolkit-scroll)
+       (global-set-key [horizontal-scroll-bar mouse-1]
+                      'scroll-bar-toolkit-horizontal-scroll))
       (t
        (global-set-key [vertical-scroll-bar mouse-1]
                       'scroll-bar-scroll-up)
index 0c645889d754b0517c901d381b57ef6c30b43de6..19c3c050bc537d6d831e7db845c8611a39b814e1 100644 (file)
@@ -642,8 +642,6 @@ server or call `M-x server-force-delete' to forcibly disconnect it.")
        (cl-letf (((default-file-modes) ?\700))
          (add-hook 'suspend-tty-functions 'server-handle-suspend-tty)
          (add-hook 'delete-frame-functions 'server-handle-delete-frame)
-         (add-hook 'kill-buffer-query-functions
-                    'server-kill-buffer-query-function)
          (add-hook 'kill-emacs-query-functions
                     'server-kill-emacs-query-function)
          (add-hook 'kill-emacs-hook 'server-force-stop) ;Cleanup upon exit.
@@ -796,32 +794,33 @@ This handles splitting the command if it would be bigger than
     (error "Invalid terminal type"))
   (add-to-list 'frame-inherited-parameters 'client)
   (let ((frame
-         (server-with-environment (process-get proc 'env)
-                                 '("LANG" "LC_CTYPE" "LC_ALL"
-                                   ;; For tgetent(3); list according to ncurses(3).
-                                   "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES"
-                                   "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING"
-                                   "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO"
-                                   "TERMINFO_DIRS" "TERMPATH"
-                                   ;; rxvt wants these
-                                   "COLORFGBG" "COLORTERM")
-                                 (make-frame `((window-system . nil)
-                                               (tty . ,tty)
-                                               (tty-type . ,type)
-                                               ;; Ignore nowait here; we always need to
-                                               ;; clean up opened ttys when the client dies.
-                                               (client . ,proc)
-                                               ;; This is a leftover from an earlier
-                                               ;; attempt at making it possible for process
-                                               ;; run in the server process to use the
-                                               ;; environment of the client process.
-                                               ;; It has no effect now and to make it work
-                                               ;; we'd need to decide how to make
-                                               ;; process-environment interact with client
-                                               ;; envvars, and then to change the
-                                               ;; C functions `child_setup' and
-                                               ;; `getenv_internal' accordingly.
-                                               (environment . ,(process-get proc 'env)))))))
+         (server-with-environment
+             (process-get proc 'env)
+             '("LANG" "LC_CTYPE" "LC_ALL"
+               ;; For tgetent(3); list according to ncurses(3).
+               "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES"
+               "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING"
+               "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO"
+               "TERMINFO_DIRS" "TERMPATH"
+               ;; rxvt wants these
+               "COLORFGBG" "COLORTERM")
+           (make-frame `((window-system . nil)
+                         (tty . ,tty)
+                         (tty-type . ,type)
+                         ;; Ignore nowait here; we always need to
+                         ;; clean up opened ttys when the client dies.
+                         (client . ,proc)
+                         ;; This is a leftover from an earlier
+                         ;; attempt at making it possible for process
+                         ;; run in the server process to use the
+                         ;; environment of the client process.
+                         ;; It has no effect now and to make it work
+                         ;; we'd need to decide how to make
+                         ;; process-environment interact with client
+                         ;; envvars, and then to change the
+                         ;; C functions `child_setup' and
+                         ;; `getenv_internal' accordingly.
+                         (environment . ,(process-get proc 'env)))))))
 
     ;; ttys don't use the `display' parameter, but callproc.c does to set
     ;; the DISPLAY environment on subprocesses.
@@ -1472,22 +1471,6 @@ specifically for the clients and did not exist before their request for it."
        (save-buffer)))
     (server-buffer-done (current-buffer))))
 
-;; Ask before killing a server buffer.
-;; It was suggested to release its client instead,
-;; but I think that is dangerous--the client would proceed
-;; using whatever is on disk in that file. -- rms.
-(defun server-kill-buffer-query-function ()
-  "Ask before killing a server buffer."
-  (or (not server-buffer-clients)
-      (let ((res t))
-       (dolist (proc server-buffer-clients)
-          (when (and (memq proc server-clients)
-                     (eq (process-status proc) 'open))
-            (setq res nil)))
-         res)
-      (yes-or-no-p (format "Buffer `%s' still has clients; kill it? "
-                          (buffer-name (current-buffer))))))
-
 (defun server-kill-emacs-query-function ()
   "Ask before exiting Emacs if it has live clients."
   (or (not server-clients)
index 1626147dab477675974dc94043083b96e9d9843b..bfe021f5300a7120cd977898b3e35b6931d61a73 100644 (file)
@@ -1,4 +1,4 @@
-;;; ses.el -- Simple Emacs Spreadsheet  -*- coding: utf-8 -*-
+;;; ses.el -- Simple Emacs Spreadsheet  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2002-2014 Free Software Foundation, Inc.
 
@@ -239,6 +239,10 @@ Each function is called with ARG=1."
   "\n( ;Global parameters (these are read first)\n 2 ;SES file-format\n 1 ;numrows\n 1 ;numcols\n)\n\n"
   "Initial contents for the three-element list at the bottom of the data area.")
 
+(defconst ses-initial-global-parameters-re
+  "\n( ;Global parameters (these are read first)\n [23] ;SES file-format\n [0-9]+ ;numrows\n [0-9]+ ;numcols\n\\( [0-9]+ ;numlocprn\n\\)?)\n\n"
+  "Match Global parameters for .")
+
 (defconst ses-initial-file-trailer
   ";; Local Variables:\n;; mode: ses\n;; End:\n"
   "Initial contents for the file-trailer area at the bottom of the file.")
@@ -277,6 +281,8 @@ default printer and then modify its output.")
     '(ses--blank-line ses--cells ses--col-printers
       ses--col-widths ses--curcell ses--curcell-overlay
       ses--default-printer
+      (ses--local-printer-hashmap . :hashmap)
+      (ses--numlocprn . 0); count of local printers
       ses--deferred-narrow ses--deferred-recalc
       ses--deferred-write ses--file-format
       ses--named-cell-hashmap
@@ -290,8 +296,12 @@ default printer and then modify its output.")
       ses--renamed-cell-symb-list
       ;; Global variables that we override
       mode-line-process next-line-add-newlines transient-mark-mode)
-    "Buffer-local variables used by SES.")
+    "Buffer-local variables used by SES."))
 
+(defmacro ses--metaprogramming (exp) (declare (debug t)) (eval exp t))
+(ses--metaprogramming
+ `(progn ,@(mapcar (lambda (x) `(defvar ,(or (car-safe x) x))) ses-localvars)))
 (defun ses-set-localvars ()
   "Set buffer-local and initialize some SES variables."
   (dolist (x ses-localvars)
@@ -299,11 +309,14 @@ default printer and then modify its output.")
      ((symbolp x)
       (set (make-local-variable x) nil))
      ((consp x)
-      (set (make-local-variable (car x)) (cdr x)))
-     (t (error "Unexpected elements `%S' in list `ses-localvars'" x))))))
-
-(eval-when-compile                     ; silence compiler
-  (ses-set-localvars))
+      (cond
+       ((integerp (cdr x))
+       (set (make-local-variable (car x)) (cdr x)))
+       ((eq (cdr x) :hashmap)
+       (set (make-local-variable (car x)) (make-hash-table :test 'eq)))
+       (t (error "Unexpected initializer `%S' in list `ses-localvars' for entry %S"
+                (cdr x) (car x)) )     ))
+     (t (error "Unexpected elements `%S' in list `ses-localvars'" x)))))
 
 ;;; This variable is documented as being permitted in file-locals:
 (put 'ses--symbolic-formulas 'safe-local-variable 'consp)
@@ -311,10 +324,21 @@ default printer and then modify its output.")
 (defconst ses-paramlines-plist
   '(ses--col-widths  -5 ses--col-printers -4 ses--default-printer -3
     ses--header-row  -2 ses--file-format   1 ses--numrows          2
-    ses--numcols      3)
+    ses--numcols      3 ses--numlocprn     4)
   "Offsets from 'Global parameters' line to various parameter lines in the
 data area of a spreadsheet.")
 
+(defconst ses-paramfmt-plist
+  '(ses--col-widths       "(ses-column-widths %S)"
+    ses--col-printers     "(ses-column-printers %S)"
+    ses--default-printer  "(ses-default-printer %S)"
+    ses--header-row       "(ses-header-row %S)"
+    ses--file-format      " %S ;SES file-format"
+    ses--numrows          " %S ;numrows"
+    ses--numcols          " %S ;numcols"
+    ses--numlocprn        " %S ;numlocprn")
+  "Formats of 'Global parameters' various parameters in the data
+area of a spreadsheet.")
 
 ;;
 ;;  "Side-effect variables".  They are set in one function, altered in
@@ -347,158 +371,115 @@ when to emit a progress message.")
 
 (defmacro ses-get-cell (row col)
   "Return the cell structure that stores information about cell (ROW,COL)."
+  (declare (debug t))
   `(aref (aref ses--cells ,row) ,col))
 
-;; We might want to use defstruct here, but cells are explicitly used as
-;; arrays in ses-set-cell, so we'd need to fix this first.  --Stef
-(defsubst ses-make-cell (&optional symbol formula printer references
-                                  property-list)
-  (vector symbol formula printer references property-list))
+(cl-defstruct (ses-cell
+              (:constructor nil)
+              (:constructor ses-make-cell
+               (&optional symbol formula printer references))
+              (:copier nil)
+              ;; This is treated as an 4-elem array in various places.
+              ;; Mostly in ses-set-cell.
+              (:type vector)           ;Not named.
+              (:conc-name ses-cell--))
+  symbol formula printer references properties)
+
+(cl-defstruct (ses--locprn
+               (:constructor)
+               (:constructor ses-make-local-printer-info
+                (def &optional (compiled (ses-local-printer-compile def))
+                     (number ses--numlocprn))))
+  def
+  compiled
+  number
+  local-printer-list)
 
 (defmacro ses-cell-symbol (row &optional col)
   "From a CELL or a pair (ROW,COL), get the symbol that names the local-variable holding its value.  (0,0) => A1."
-  `(aref ,(if col `(ses-get-cell ,row ,col) row) 0))
+  (declare (debug t))
+  `(ses-cell--symbol ,(if col `(ses-get-cell ,row ,col) row)))
 (put 'ses-cell-symbol 'safe-function t)
 
 (defmacro ses-cell-formula (row &optional col)
   "From a CELL or a pair (ROW,COL), get the function that computes its value."
-  `(aref ,(if col `(ses-get-cell ,row ,col) row) 1))
-
-(defmacro ses-cell-formula-aset (cell formula)
-  "From a CELL set the function that computes its value."
-  `(aset ,cell 1 ,formula))
+  (declare (debug t))
+  `(ses-cell--formula ,(if col `(ses-get-cell ,row ,col) row)))
 
 (defmacro ses-cell-printer (row &optional col)
   "From a CELL or a pair (ROW,COL), get the function that prints its value."
-  `(aref ,(if col `(ses-get-cell ,row ,col) row) 2))
+  (declare (debug t))
+  `(ses-cell--printer ,(if col `(ses-get-cell ,row ,col) row)))
 
 (defmacro ses-cell-references (row &optional col)
   "From a CELL or a pair (ROW,COL), get the list of symbols for cells whose
 functions refer to its value."
-  `(aref ,(if col `(ses-get-cell ,row ,col) row) 3))
-
-(defmacro ses-cell-references-aset (cell references)
-  "From a CELL set the list REFERENCES of symbols for cells the
-function of which refer to its value."
-  `(aset ,cell 3 ,references))
+  (declare (debug t))
+  `(ses-cell--references ,(if col `(ses-get-cell ,row ,col) row)))
 
 (defun ses-cell-p (cell)
-  "Return non `nil' is CELL is a cell of current buffer."
+  "Return non-nil if CELL is a cell of current buffer."
   (and (vectorp cell)
        (= (length cell) 5)
        (eq cell (let ((rowcol (ses-sym-rowcol (ses-cell-symbol cell))))
                  (and (consp rowcol)
                       (ses-get-cell (car rowcol) (cdr rowcol)))))))
 
-(defun ses-cell-property-get-fun (property-name cell)
-  ;; To speed up property fetching, each time a property is found it is placed
-  ;; in the first position.  This way, after the first get, the full property
-  ;; list needs to be scanned only when the property does not exist for that
-  ;; cell.
-  (let* ((plist  (aref cell 4))
-        (ret (plist-member plist property-name)))
-    (if ret
-       ;; Property was found.
-       (let ((val (cadr ret)))
-         (if (eq ret plist)
-             ;; Property found is already in the first position, so just return
-             ;; its value.
-             val
-           ;; Property is not in the first position, the following will move it
-           ;; there before returning its value.
-           (let ((next (cddr ret)))
-             (if next
-                 (progn
-                   (setcdr ret (cdr next))
-                   (setcar ret (car next)))
-               (setcdr (last plist 1) nil)))
-           (aset cell 4
-                 `(,property-name ,val ,@plist))
-           val)))))
-
-(defmacro ses-cell-property-get (property-name row &optional col)
-   "Get property named PROPERTY-NAME from a CELL or a pair (ROW,COL).
+
+(defun ses--alist-get (key alist &optional remove)
+  "Get the value associated to KEY in ALIST."
+  (declare
+   (gv-expander
+    (lambda (do)
+      (macroexp-let2 macroexp-copyable-p k key
+        (gv-letplace (getter setter) alist
+          (macroexp-let2 nil p `(assq ,k ,getter)
+            (funcall do `(cdr ,p)
+                     (lambda (v)
+                       (let ((set-exp
+                              `(if ,p (setcdr ,p ,v)
+                                 ,(funcall setter
+                                           `(cons (setq ,p (cons ,k ,v))
+                                                  ,getter)))))
+                         (cond
+                          ((null remove) set-exp)
+                          ((null v)
+                           `(if ,p ,(funcall setter `(delq ,p ,getter))))
+                          (t
+                           `(cond
+                             (,v ,set-exp)
+                             (,p ,(funcall setter
+                                           `(delq ,p ,getter)))))))))))))))
+  (ignore remove) ;;Silence byte-compiler.
+  (cdr (assoc key alist)))
+
+(defmacro ses--letref (vars place &rest body)
+  (declare (indent 2) (debug (sexp form &rest body)))
+  (gv-letplace (getter setter) place
+    `(cl-macrolet ((,(nth 0 vars) () ',getter)
+                   (,(nth 1 vars) (v) (funcall ,setter v)))
+       ,@body)))
+
+(defmacro ses-cell-property (property-name row &optional col)
+  "Get property named PROPERTY-NAME from a CELL or a pair (ROW,COL).
 
 When COL is omitted, CELL=ROW is a cell object.  When COL is
 present ROW and COL are the integer coordinates of the cell of
 interest."
-   (declare (debug t))
-   `(ses-cell-property-get-fun
-     ,property-name
-     ,(if col `(ses-get-cell ,row ,col) row)))
-
-(defun ses-cell-property-delq-fun (property-name cell)
-  (let ((ret (plist-get (aref cell 4) property-name)))
-    (if ret
-      (setcdr ret (cddr ret)))))
-
-(defun ses-cell-property-set-fun (property-name property-val cell)
-  (let*        ((plist  (aref cell 4))
-        (ret (plist-member plist property-name)))
-    (if ret
-       (setcar (cdr ret) property-val)
-      (aset cell 4 `(,property-name ,property-val ,@plist)))))
-
-(defmacro ses-cell-property-set (property-name property-value row &optional col)
-   "From a CELL or a pair (ROW,COL), set the property value of
-the corresponding cell with name PROPERTY-NAME to PROPERTY-VALUE."
-   (if property-value
-       `(ses-cell-property-set-fun ,property-name ,property-value
-                                  ,(if col `(ses-get-cell ,row ,col) row))
-       `(ses-cell-property-delq-fun ,property-name
-                                   ,(if col `(ses-get-cell ,row ,col) row))))
-
-(defun ses-cell-property-pop-fun (property-name cell)
-  (let* ((plist  (aref cell 4))
-        (ret (plist-member plist property-name)))
-    (if ret
-       (prog1 (cadr ret)
-         (let ((next (cddr ret)))
-           (if next
-               (progn
-                 (setcdr ret (cdr next))
-                 (setcar ret (car next)))
-             (if (eq plist ret)
-                 (aset cell 4 nil)
-               (setcdr (last plist 2) nil))))))))
-
+  (declare (debug t))
+  `(ses--alist-get ,property-name
+                   (ses-cell--properties
+                    ,(if col `(ses-get-cell ,row ,col) row))))
 
 (defmacro ses-cell-property-pop (property-name row &optional col)
-   "From a CELL or a pair (ROW,COL), get and remove the property value of
+  "From a CELL or a pair (ROW,COL), get and remove the property value of
 the corresponding cell with name PROPERTY-NAME."
-   `(ses-cell-property-pop-fun  ,property-name
-                               ,(if col `(ses-get-cell ,row ,col) row)))
-
-(defun ses-cell-property-get-handle-fun (property-name cell)
-  (let*        ((plist  (aref cell 4))
-        (ret (plist-member plist property-name)))
-    (if ret
-       (if (eq ret plist)
-           (cdr ret)
-         (let ((val (cadr ret))
-               (next (cddr ret)))
-           (if next
-               (progn
-                 (setcdr ret (cdr next))
-                 (setcar ret (car next)))
-             (setcdr (last plist 2) nil))
-           (setq ret (cons val plist))
-           (aset cell 4 (cons property-name ret))
-           ret))
-      (setq ret (cons nil plist))
-      (aset cell 4 (cons property-name ret))
-      ret)))
-
-(defmacro ses-cell-property-get-handle (property-name row &optional col)
-   "From a CELL or a pair (ROW,COL), get a cons cell whose car is
-the property value of the corresponding cell property with name
-PROPERTY-NAME."
-   `(ses-cell-property-get-handle-fun  ,property-name
-                               ,(if col `(ses-get-cell ,row ,col) row)))
-
-
-(defalias 'ses-cell-property-handle-car 'car)
-(defalias 'ses-cell-property-handle-setcar 'setcar)
+  `(ses--letref (pget pset)
+       (ses--alist-get ,property-name
+                       (ses-cell--properties
+                        ,(if col `(ses-get-cell ,row ,col) row))
+                       t)
+     (prog1 (pget) (pset nil))))
 
 (defmacro ses-cell-value (row &optional col)
   "From a CELL or a pair (ROW,COL), get the current value for that cell."
@@ -530,14 +511,14 @@ is nil if SYM is not a symbol that names a cell."
                (< (cdr rowcol) ses--numcols)
                (eq (ses-cell-symbol (car rowcol) (cdr rowcol)) sym))))))
 
-(defmacro ses-cell (sym value formula printer references)
+(defun ses--cell (sym value formula printer references)
   "Load a cell SYM from the spreadsheet file.  Does not recompute VALUE from
-FORMULA, does not reprint using PRINTER, does not check REFERENCES.  This is a
-macro to prevent propagate-on-load viruses.  Safety-checking for FORMULA and
-PRINTER are deferred until first use."
+FORMULA, does not reprint using PRINTER, does not check REFERENCES.
+Safety-checking for FORMULA and PRINTER are deferred until first use."
   (let ((rowcol (ses-sym-rowcol sym)))
     (ses-formula-record formula)
     (ses-printer-record printer)
+    (unless formula (setq formula value))
     (or (atom formula)
        (eq safe-functions t)
        (setq formula `(ses-safe-formula ,formula)))
@@ -545,11 +526,32 @@ PRINTER are deferred until first use."
        (stringp printer)
        (eq safe-functions t)
        (setq printer `(ses-safe-printer ,printer)))
-    (aset (aref ses--cells (car rowcol))
-         (cdr rowcol)
+    (setf (ses-get-cell (car rowcol) (cdr rowcol))
          (ses-make-cell sym formula printer references)))
-  (set sym value)
-  sym)
+  (set sym value))
+
+(defun ses-local-printer-compile (printer)
+  "Convert local printer function into faster printer
+definition."
+  (cond
+   ((functionp printer) printer)
+   ((stringp printer)
+    `(lambda (x) (format ,printer x)))
+   (t (error "Invalid printer %S" printer))))
+
+(defun ses--local-printer (name def)
+  "Define a local printer with name NAME and definition DEF.
+Return the printer info."
+  (or
+   (and (symbolp name)
+       (ses-printer-validate def))
+   (error "Invalid local printer definition"))
+  (and (gethash name ses--local-printer-hashmap)
+       (error "Duplicate printer definition %S" name))
+  (add-to-list 'ses-read-printer-history (symbol-name name))
+  (puthash name
+          (ses-make-local-printer-info (ses-safe-printer def))
+          ses--local-printer-hashmap))
 
 (defmacro ses-column-widths (widths)
   "Load the vector of column widths from the spreadsheet file.  This is a
@@ -619,9 +621,11 @@ variables `minrow', `maxrow', `mincol', and `maxcol'."
 (defmacro 1value (form)
   "For code-coverage testing, indicate that FORM is expected to always have
 the same value."
+  (declare (debug t))
   form)
 (defmacro noreturn (form)
   "For code-coverage testing, indicate that FORM will always signal an error."
+  (declare (debug t))
   form)
 
 
@@ -664,9 +668,11 @@ is a vector--if a symbol, the new vector is assigned as the symbol's value."
   "Signal an error if PRINTER is not a valid SES cell printer."
   (or (not printer)
       (stringp printer)
+      ;; printer is a local printer
+      (and (symbolp printer) (gethash printer ses--local-printer-hashmap))
       (functionp printer)
       (and (stringp (car-safe printer)) (not (cdr printer)))
-      (error "Invalid printer function"))
+      (error "Invalid printer function %S" printer))
   printer)
 
 (defun ses-printer-record (printer)
@@ -698,20 +704,22 @@ for this spreadsheet."
   (intern (concat (ses-column-letter col) (number-to-string (1+ row)))))
 
 (defun ses-decode-cell-symbol (str)
-  "Decode a symbol \"A1\" => (0,0). Returns `nil' if STR is not a
-  canonical cell name. Does not save match data."
+  "Decode a symbol \"A1\" => (0,0).  Return nil if STR is not a
+canonical cell name."
   (let (case-fold-search)
     (and (string-match "\\`\\([A-Z]+\\)\\([0-9]+\\)\\'" str)
         (let* ((col-str (match-string-no-properties 1 str))
-              (col 0)
-              (col-base 1)
-              (col-idx (1- (length col-str)))
-              (row (1- (string-to-number (match-string-no-properties 2 str)))))
+                (col 0)
+                (col-base 1)
+                (col-idx (1- (length col-str)))
+                (row (1- (string-to-number
+                          (match-string-no-properties 2 str)))))
           (and (>= row 0)
                (progn
                  (while
                      (progn
-                       (setq col (+ col (* (- (aref col-str col-idx) ?A) col-base))
+                       (setq col (+ col (* (- (aref col-str col-idx) ?A)
+                                            col-base))
                              col-base (* col-base 26)
                              col-idx (1- col-idx))
                        (and (>= col-idx 0)
@@ -785,21 +793,34 @@ and (eval ARG) and reset `ses-start-time' to the current time."
 ;; The cells
 ;;----------------------------------------------------------------------------
 
-(defun ses-set-cell (row col field val)
+(defmacro ses-set-cell (row col field val)
   "Install VAL as the contents for field FIELD (named by a quoted symbol) of
 cell (ROW,COL).  This is undoable.  The cell's data will be updated through
 `post-command-hook'."
-  (let ((cell (ses-get-cell row col))
-       (elt  (plist-get '(value t symbol 0 formula 1 printer 2 references 3)
-                        field))
-       change)
-    (or elt (signal 'args-out-of-range nil))
-    (setq change (if (eq elt t)
-                    (ses-set-with-undo (ses-cell-symbol cell) val)
-                  (ses-aset-with-undo cell elt val)))
-    (if change
-       (add-to-list 'ses--deferred-write (cons row col))))
-  nil) ; Make coverage-tester happy.
+  `(let ((row ,row)
+         (col ,col)
+         (val ,val))
+     (let* ((cell (ses-get-cell row col))
+            (change
+             ,(let ((field (eval field t)))
+                (if (eq field 'value)
+                    `(ses-set-with-undo (ses-cell-symbol cell) val)
+                  ;; (let* ((slots (get 'ses-cell 'cl-struct-slots))
+                  ;;        (slot (or (assq field slots)
+                  ;;                  (error "Unknown field %S" field)))
+                  ;;        (idx (- (length slots)
+                  ;;                (length (memq slot slots)))))
+                  ;;   `(ses-aset-with-undo cell ,idx val))
+                  (let ((getter (intern-soft (format "ses-cell--%s" field))))
+                    `(ses-setter-with-undo
+                      (eval-when-compile
+                        (cons #',getter
+                              (lambda (newval cell)
+                                (setf (,getter cell) newval))))
+                      val cell))))))
+       (if change
+           (add-to-list 'ses--deferred-write (cons row col))))
+     nil)) ; Make coverage-tester happy.
 
 (defun ses-cell-set-formula (row col formula)
   "Store a new formula for (ROW . COL) and enqueue the cell for
@@ -814,7 +835,7 @@ means Emacs will crash if FORMULA contains a circular list."
          (newref (ses-formula-references formula))
          (inhibit-quit t)
          x xrow xcol)
-      (add-to-list 'ses--deferred-recalc sym)
+      (cl-pushnew sym ses--deferred-recalc)
       ;;Delete old references from this cell.  Skip the ones that are also
       ;;in the new list.
       (dolist (ref oldref)
@@ -845,11 +866,11 @@ means Emacs will crash if FORMULA contains a circular list."
       (dotimes (col ses--numcols)
        (let ((references  (ses-cell-property-pop :ses-repair-reference
                                                  row col)))
-       (when references
-         (push (list
-                (ses-cell-symbol row col)
-                :corrupt-property
-                references) errors)))))
+          (when references
+            (push (list (ses-cell-symbol row col)
+                        :corrupt-property
+                        references)
+                  errors)))))
 
     ;; Step 2, build new.
     (dotimes (row ses--numrows)
@@ -859,21 +880,17 @@ means Emacs will crash if FORMULA contains a circular list."
               (formula (ses-cell-formula cell))
               (new-ref (ses-formula-references formula)))
          (dolist (ref new-ref)
-           (let* ((rowcol (ses-sym-rowcol ref))
-                 (h (ses-cell-property-get-handle :ses-repair-reference
-                                                 (car rowcol) (cdr rowcol))))
-             (unless (memq ref (ses-cell-property-handle-car h))
-               (ses-cell-property-handle-setcar
-                h
-                (cons sym
-                      (ses-cell-property-handle-car h)))))))))
+           (let ((rowcol (ses-sym-rowcol ref)))
+              (cl-pushnew sym (ses-cell-property :ses-repair-reference
+                                                 (car rowcol)
+                                                 (cdr rowcol))))))))
 
     ;; Step 3, overwrite with check.
     (dotimes (row ses--numrows)
       (dotimes (col ses--numcols)
        (let* ((cell (ses-get-cell row col))
               (irrelevant (ses-cell-references cell))
-              (new-ref (ses-cell-property-pop  :ses-repair-reference cell))
+              (new-ref (ses-cell-property-pop :ses-repair-reference cell))
               missing)
          (dolist (ref new-ref)
            (if (memq ref irrelevant)
@@ -886,7 +903,7 @@ means Emacs will crash if FORMULA contains a circular list."
                     ,@(and irrelevant  (list :irrelevant irrelevant)))
                  errors)))))
     (if errors
-      (warn "----------------------------------------------------------------
+        (warn "----------------------------------------------------------------
 Some references were corrupted.
 
 The following is a list where each element ELT is such
@@ -917,12 +934,7 @@ the old and FORCE is nil."
     (let ((oldval  (ses-cell-value   cell))
          (formula (ses-cell-formula cell))
          newval
-         this-cell-Dijkstra-attempt-h
-         this-cell-Dijkstra-attempt
-         this-cell-Dijkstra-attempt+1
-         ref-cell-Dijkstra-attempt-h
-         ref-cell-Dijkstra-attempt
-         ref-rowcol)
+         this-cell-Dijkstra-attempt+1)
       (when (eq (car-safe formula) 'ses-safe-formula)
        (setq formula (ses-safe-formula (cadr formula)))
        (ses-set-cell row col 'formula formula))
@@ -938,46 +950,42 @@ the old and FORCE is nil."
          (setq newval '*skip*))
       (catch 'cycle
        (when (or force (not (eq newval oldval)))
-         (add-to-list 'ses--deferred-write (cons row col)) ; In case force=t.
-         (setq this-cell-Dijkstra-attempt-h
-               (ses-cell-property-get-handle :ses-Dijkstra-attempt cell);
-               this-cell-Dijkstra-attempt
-               (ses-cell-property-handle-car this-cell-Dijkstra-attempt-h))
-         (if (null this-cell-Dijkstra-attempt)
-             (ses-cell-property-handle-setcar
-              this-cell-Dijkstra-attempt-h
-              (setq this-cell-Dijkstra-attempt
-                    (cons ses--Dijkstra-attempt-nb 0)))
-           (unless (= ses--Dijkstra-attempt-nb
-                      (car this-cell-Dijkstra-attempt))
-               (setcar this-cell-Dijkstra-attempt ses--Dijkstra-attempt-nb)
-               (setcdr this-cell-Dijkstra-attempt 0)))
-         (setq this-cell-Dijkstra-attempt+1
-               (1+ (cdr this-cell-Dijkstra-attempt)))
+         (cl-pushnew (cons row col) ses--deferred-write :test #'equal) ; In case force=t.
+          (ses--letref (pget pset)
+              (ses-cell-property :ses-Dijkstra-attempt cell)
+            (let ((this-cell-Dijkstra-attempt (pget)))
+              (if (null this-cell-Dijkstra-attempt)
+                  (pset
+                   (setq this-cell-Dijkstra-attempt
+                         (cons ses--Dijkstra-attempt-nb 0)))
+                (unless (= ses--Dijkstra-attempt-nb
+                           (car this-cell-Dijkstra-attempt))
+                  (setcar this-cell-Dijkstra-attempt ses--Dijkstra-attempt-nb)
+                  (setcdr this-cell-Dijkstra-attempt 0)))
+              (setq this-cell-Dijkstra-attempt+1
+                    (1+ (cdr this-cell-Dijkstra-attempt)))))
          (ses-set-cell row col 'value newval)
          (dolist (ref (ses-cell-references cell))
-           (add-to-list 'ses--deferred-recalc ref)
-           (setq ref-rowcol (ses-sym-rowcol ref)
-                 ref-cell-Dijkstra-attempt-h
-                 (ses-cell-property-get-handle
-                  :ses-Dijkstra-attempt
-                  (car ref-rowcol) (cdr ref-rowcol))
-                 ref-cell-Dijkstra-attempt
-                 (ses-cell-property-handle-car ref-cell-Dijkstra-attempt-h))
-
-           (if (null ref-cell-Dijkstra-attempt)
-             (ses-cell-property-handle-setcar
-              ref-cell-Dijkstra-attempt-h
-              (setq ref-cell-Dijkstra-attempt
-                     (cons ses--Dijkstra-attempt-nb
-                           this-cell-Dijkstra-attempt+1)))
-             (if (= (car ref-cell-Dijkstra-attempt) ses--Dijkstra-attempt-nb)
-                 (setcdr ref-cell-Dijkstra-attempt
-                         (max (cdr ref-cell-Dijkstra-attempt)
-                              this-cell-Dijkstra-attempt+1))
-               (setcar ref-cell-Dijkstra-attempt ses--Dijkstra-attempt-nb)
-               (setcdr ref-cell-Dijkstra-attempt
-                       this-cell-Dijkstra-attempt+1)))
+           (cl-pushnew ref ses--deferred-recalc)
+            (ses--letref (pget pset)
+                (let ((ref-rowcol (ses-sym-rowcol ref)))
+                  (ses-cell-property
+                   :ses-Dijkstra-attempt
+                   (car ref-rowcol) (cdr ref-rowcol)))
+              (let ((ref-cell-Dijkstra-attempt (pget)))
+
+                (if (null ref-cell-Dijkstra-attempt)
+                    (pset
+                     (setq ref-cell-Dijkstra-attempt
+                           (cons ses--Dijkstra-attempt-nb
+                                 this-cell-Dijkstra-attempt+1)))
+                  (if (= (car ref-cell-Dijkstra-attempt) ses--Dijkstra-attempt-nb)
+                      (setcdr ref-cell-Dijkstra-attempt
+                              (max (cdr ref-cell-Dijkstra-attempt)
+                                   this-cell-Dijkstra-attempt+1))
+                    (setcar ref-cell-Dijkstra-attempt ses--Dijkstra-attempt-nb)
+                    (setcdr ref-cell-Dijkstra-attempt
+                            this-cell-Dijkstra-attempt+1)))))
 
            (when (> this-cell-Dijkstra-attempt+1 ses--Dijkstra-weight-bound)
              ;; Update print of this cell.
@@ -1036,7 +1044,7 @@ if the cell's value is unchanged and FORCE is nil."
                    (when (or (memq ref curlist)
                              (memq ref ses--deferred-recalc))
                      ;; This cell refers to another that isn't done yet
-                     (add-to-list 'ses--deferred-recalc this-sym)
+                     (cl-pushnew this-sym ses--deferred-recalc :test #'equal)
                      (throw 'ref t)))))
              ;; ses-update-cells is called from post-command-hook, so
              ;; inhibit-quit is implicitly bound to t.
@@ -1045,7 +1053,7 @@ if the cell's value is unchanged and FORCE is nil."
                (error "Quit"))
              (ses-calculate-cell (car this-rowcol) (cdr this-rowcol) force)))
        (dolist (ref ses--deferred-recalc)
-         (add-to-list 'nextlist ref)))
+          (cl-pushnew ref nextlist :test #'equal)))
       (when ses--deferred-recalc
        ;; Just couldn't finish these.
        (dolist (x ses--deferred-recalc)
@@ -1164,7 +1172,8 @@ preceding cell has spilled over."
         ((< len width)
          ;; Fill field to length with spaces.
          (setq len  (make-string (- width len) ?\s)
-               text (if (eq ses-call-printer-return t)
+               text (if (or (stringp value)
+                            (eq ses-call-printer-return t))
                         (concat text len)
                       (concat len text))))
         ((> len width)
@@ -1261,7 +1270,13 @@ printer signaled one (and \"%s\" is used as the default printer), else nil."
            (format (car printer) value)
          ""))
        (t
-       (setq value (funcall printer (or value "")))
+       (setq value  (funcall
+                     (or (and (symbolp printer)
+                              (let ((locprn (gethash printer ses--local-printer-hashmap)))
+                                (and locprn
+                                     (ses--locprn-compiled locprn))))
+                         printer)
+                     (or value "")))
        (if (stringp value)
            value
          (or (stringp (car-safe value))
@@ -1334,6 +1349,24 @@ ses--default-printer, ses--numrows, or ses--numcols."
       (goto-char ses--params-marker)
       (forward-line def))))
 
+(defun ses-file-format-extend-paramter-list (new-file-format)
+  "Extend the global parameters list when file format is updated
+from 2 to 3. This happens when local printer function are added
+to a sheet that was created with SES version 2. This is not
+undoable. Return nil when there was no change, and non nil otherwise."  
+  (save-excursion
+    (cond
+     ((and (= ses--file-format 2) (= 3 new-file-format))
+      (ses-set-parameter 'ses--file-format 3)
+      (message "Upgrading from SES-2 to SES-3 file format")
+      (ses-widen)
+      (goto-char ses--params-marker)
+      (forward-line   (plist-get ses-paramlines-plist 'ses--numlocprn ))
+      (insert (format (plist-get ses-paramfmt-plist 'ses--numlocprn)
+                      ses--numlocprn)
+             ?\n)
+      t) )))
+
 (defun ses-set-parameter (def value &optional elem)
   "Set parameter DEF to VALUE (with undo) and write the value to the data area.
 See `ses-goto-data' for meaning of DEF.  Newlines in the data are escaped.
@@ -1343,13 +1376,7 @@ If ELEM is specified, it is the array subscript within DEF to be set to VALUE."
     ;; in case one of them is being changed.
     (ses-goto-data def)
     (let ((inhibit-read-only t)
-         (fmt (plist-get '(ses--col-widths      "(ses-column-widths %S)"
-                           ses--col-printers    "(ses-column-printers %S)"
-                           ses--default-printer "(ses-default-printer %S)"
-                           ses--header-row      "(ses-header-row %S)"
-                           ses--file-format     " %S ;SES file-format"
-                           ses--numrows         " %S ;numrows"
-                           ses--numcols         " %S ;numcols")
+         (fmt (plist-get ses-paramfmt-plist
                          def))
          oldval)
       (if elem
@@ -1388,24 +1415,17 @@ Newlines in the data are escaped."
              (setq formula (cadr formula)))
          (if (eq (car-safe printer) 'ses-safe-printer)
              (setq printer (cadr printer)))
-         ;; This is noticeably faster than (format "%S %S %S %S %S")
-         (setq text    (concat "(ses-cell "
-                               (symbol-name sym)
-                               " "
-                               (prin1-to-string (symbol-value sym))
-                               " "
-                               (prin1-to-string formula)
-                               " "
-                               (prin1-to-string printer)
-                               " "
-                               (if (atom (ses-cell-references cell))
-                                   "nil"
-                                 (concat "("
-                                         (mapconcat 'symbol-name
-                                                    (ses-cell-references cell)
-                                                    " ")
-                                         ")"))
-                               ")"))
+         (setq text (prin1-to-string
+                      ;; We could shorten it to (ses-cell SYM VAL) when
+                      ;; the other parameters are nil, but in practice most
+                      ;; cells have non-nil `references', so it's
+                      ;; rather pointless.
+                      `(ses-cell ,sym
+                                 ,(symbol-value sym)
+                                 ,(unless (equal formula (symbol-value sym))
+                                    formula)
+                                 ,printer
+                                 ,(ses-cell-references cell))))
          (ses-goto-data row col)
          (delete-region (point) (line-end-position))
          (insert text)))
@@ -1422,8 +1442,8 @@ refers to.  For recursive calls, RESULT-SO-FAR is the list being
 constructed, or t to get a wrong-type-argument error when the
 first reference is found."
   (if (ses-sym-rowcol formula)
-      ;;Entire formula is one symbol
-      (add-to-list 'result-so-far formula)
+      ;; Entire formula is one symbol.
+      (cl-pushnew formula result-so-far :test #'equal)
     (if (consp formula)
        (cond
         ((eq (car formula) 'ses-range)
@@ -1431,7 +1451,7 @@ first reference is found."
                   (cdr (funcall 'macroexpand
                                 (list 'ses-range (nth 1 formula)
                                       (nth 2 formula)))))
-           (add-to-list 'result-so-far cur)))
+           (cl-pushnew cur result-so-far :test #'equal)))
         ((null (eq (car formula) 'quote))
          ;;Recursive call for subformulas
          (dolist (cur formula)
@@ -1600,8 +1620,8 @@ to each symbol."
              ;; This cell referred to a cell that's been deleted or is no
              ;; longer part of the range.  We can't fix that now because
              ;; reference lists cells have been partially updated.
-             (add-to-list 'ses--deferred-recalc
-                          (ses-create-cell-symbol row col)))
+             (cl-pushnew (ses-create-cell-symbol row col)
+                          ses--deferred-recalc :test #'equal))
          (setq newval (ses-relocate-formula (ses-cell-references mycell)
                                             minrow mincol rowincr colincr))
          (ses-set-cell row col 'references newval)
@@ -1691,36 +1711,30 @@ to each symbol."
     (insert-and-inherit "X")
     (delete-region (1- (point)) (point))))
 
-(defun ses-set-with-undo (sym newval)
-  "Like set, but undoable.  Result is t if value has changed."
-  ;; We try to avoid adding redundant entries to the undo list, but this is
-  ;; unavoidable for strings because equal ignores text properties and there's
-  ;; no easy way to get the whole property list to see if it's different!
-  (unless (and (boundp sym)
-              (equal (symbol-value sym) newval)
-              (not (stringp newval)))
-    (push (if (boundp sym)
-             `(apply ses-set-with-undo ,sym ,(symbol-value sym))
-           `(apply ses-unset-with-undo ,sym))
-         buffer-undo-list)
-    (set sym newval)
-    t))
-
-(defun ses-unset-with-undo (sym)
-  "Set SYM to be unbound.  This is undoable."
-  (when (1value (boundp sym)) ; Always bound, except after a programming error.
-    (push `(apply ses-set-with-undo ,sym ,(symbol-value sym)) buffer-undo-list)
-    (makunbound sym)))
+(defun ses-setter-with-undo (accessors newval &rest args)
+  "Set a field/variable and record it so it can be undone.
+Result is non-nil if field/variable has changed."
+  (let ((oldval (apply (car accessors) args)))
+    (unless (equal-including-properties oldval newval)
+      (push `(apply ses-setter-with-undo ,accessors ,oldval ,@args)
+            buffer-undo-list)
+      (apply (cdr accessors) newval args)
+      t)))
 
 (defun ses-aset-with-undo (array idx newval)
-  "Like `aset', but undoable.
-Result is t if element has changed."
-  (unless (equal (aref array idx) newval)
-    (push `(apply ses-aset-with-undo ,array ,idx
-                 ,(aref array idx)) buffer-undo-list)
-    (aset array idx newval)
-    t))
+  (ses-setter-with-undo (eval-when-compile
+                          (cons #'aref
+                                (lambda (newval array idx) (aset array idx newval))))
+                        newval array idx))
 
+(defun ses-set-with-undo (sym newval)
+  (ses-setter-with-undo
+   (eval-when-compile
+     (cons (lambda (sym) (if (boundp sym) (symbol-value sym) :ses--unbound))
+           (lambda (newval sym) (if (eq newval :ses--unbound)
+                               (makunbound sym)
+                             (set sym newval)))))
+   newval sym))
 
 ;;----------------------------------------------------------------------------
 ;; Startup for major mode
@@ -1735,29 +1749,38 @@ Does not execute cell formulas or print functions."
   (search-backward ";; Local Variables:\n" nil t)
   (backward-list 1)
   (setq ses--params-marker (point-marker))
-  (let ((params (ignore-errors (read (current-buffer)))))
-    (or (and (= (safe-length params) 3)
+  (let* ((params (ignore-errors (read (current-buffer))))
+        (params-len (safe-length params)))
+    (or (and (>=  params-len 3)
+            (<=  params-len 4)
             (numberp (car params))
             (numberp (cadr params))
             (>= (cadr params) 0)
             (numberp (nth 2 params))
-            (> (nth 2 params) 0))
+            (> (nth 2 params) 0)
+            (or (<= params-len 3)
+                (let ((numlocprn (nth 3 params))) 
+                  (and (integerp numlocprn) (>= numlocprn 0)))))
        (error "Invalid SES file"))
     (setq ses--file-format (car params)
          ses--numrows     (cadr params)
-         ses--numcols     (nth 2 params))
+         ses--numcols     (nth 2 params)
+         ses--numlocprn (or (nth 3 params) 0))
     (when (= ses--file-format 1)
       (let (buffer-undo-list) ; This is not undoable.
        (ses-goto-data 'ses--header-row)
        (insert "(ses-header-row 0)\n")
-       (ses-set-parameter 'ses--file-format 2)
-       (message "Upgrading from SES-1 file format")))
-    (or (= ses--file-format 2)
+       (ses-set-parameter 'ses--file-format 3)
+       (message "Upgrading from SES-1 to SES-2 file format")))
+    (or (<= ses--file-format 3)
        (error "This file needs a newer version of the SES library code"))
     ;; Initialize cell array.
     (setq ses--cells (make-vector ses--numrows nil))
     (dotimes (row ses--numrows)
-      (aset ses--cells row (make-vector ses--numcols nil))))
+      (aset ses--cells row (make-vector ses--numcols nil)))
+    ;; initialize local printer map.
+    (clrhash ses--local-printer-hashmap))
+
   ;; Skip over print area, which we assume is correct.
   (goto-char (point-min))
   (forward-line ses--numrows)
@@ -1768,7 +1791,22 @@ Does not execute cell formulas or print functions."
   (forward-char (1- (length ses-print-data-boundary)))
   ;; Initialize printer and symbol lists.
   (mapc 'ses-printer-record ses-standard-printer-functions)
-  (setq ses--symbolic-formulas nil)
+  (setq ses--symbolic-formulas                   nil)
+
+  ;; Load local printer definitions.  
+  ;; This must be loaded *BEFORE* cells and column printers because the latters
+  ;; may call them.
+  (save-excursion
+    (forward-line (* ses--numrows (1+ ses--numcols)))
+    (let ((numlocprn ses--numlocprn))
+      (setq ses--numlocprn 0)
+      (dotimes (_ numlocprn)
+       (let ((x      (read (current-buffer))))
+         (or (and (looking-at-p "\n")
+                  (eq (car-safe x) 'ses-local-printer)
+                  (apply #'ses--local-printer (cdr x)))
+             (error "local printer-def error"))
+         (setq ses--numlocprn (1+ ses--numlocprn))))))
   ;; Load cell definitions.
   (dotimes (row ses--numrows)
     (dotimes (col ses--numcols)
@@ -1778,9 +1816,11 @@ Does not execute cell formulas or print functions."
                 (eq (car-safe x) 'ses-cell)
                 (ses-create-cell-variable sym row col))
            (error "Cell-def error"))
-       (eval x)))
+       (apply #'ses--cell (cdr x))))
     (or (looking-at-p "\n\n")
        (error "Missing blank line between rows")))
+  ;; Skip local printer function declaration --- that were already loaded.
+  (forward-line (+ 2 ses--numlocprn))
   ;; Load global parameters.
   (let ((widths      (read (current-buffer)))
        (n1          (char-after (point)))
@@ -1805,8 +1845,7 @@ Does not execute cell formulas or print functions."
     (1value (eval head-row)))
   ;; Should be back at global-params.
   (forward-char 1)
-  (or (looking-at-p (replace-regexp-in-string "1" "[0-9]+"
-                                             ses-initial-global-parameters))
+  (or (looking-at-p ses-initial-global-parameters-re)
       (error "Problem with column-defs or global-params"))
   ;; Check for overall newline count in definitions area.
   (forward-line 3)
@@ -1938,7 +1977,8 @@ formula:
          ;; calculation).
          indent-tabs-mode       nil)
     (1value (add-hook 'change-major-mode-hook 'ses-cleanup nil t))
-    (1value (add-hook 'before-revert-hook 'ses-cleanup nil t))
+    ;; This makes revert impossible if the buffer is read-only.
+    ;; (1value (add-hook 'before-revert-hook 'ses-cleanup nil t))
     (setq header-line-format   '(:eval (progn
                                         (when (/= (window-hscroll)
                                                   ses--header-hscroll)
@@ -2122,7 +2162,7 @@ print area if NONARROW is nil."
     (delete-region (point-min) (point))
     ;; Insert all blank lines before printing anything, so ses-print-cell can
     ;; find the data area when inserting or deleting *skip* values for cells.
-    (dotimes (row ses--numrows)
+    (dotimes (_ ses--numrows)
       (insert-and-inherit ses--blank-line))
     (dotimes-with-progress-reporter (row ses--numrows) "Reprinting..."
       (if (eq (ses-cell-value row 0) '*skip*)
@@ -2154,9 +2194,10 @@ to are recalculated first."
        (when
          (setq cur-rowcol (ses-sym-rowcol ses--curcell)
                sig (progn
-                     (ses-cell-property-set :ses-Dijkstra-attempt
-                                            (cons ses--Dijkstra-attempt-nb 0)
-                                            (car cur-rowcol) (cdr cur-rowcol) )
+                     (setf (ses-cell-property :ses-Dijkstra-attempt
+                                               (car cur-rowcol)
+                                               (cdr cur-rowcol))
+                            (cons ses--Dijkstra-attempt-nb 0))
                      (ses-calculate-cell (car cur-rowcol) (cdr cur-rowcol) t)))
          (nconc sig (list (ses-cell-symbol (car cur-rowcol)
                                            (cdr cur-rowcol)))))
@@ -2169,14 +2210,14 @@ to are recalculated first."
              ;; The t causes an error if the cell has references.  If no
              ;; references, the t will be the result value.
              (1value (ses-formula-references (ses-cell-formula row col) t))
-             (ses-cell-property-set :ses-Dijkstra-attempt
-                                    (cons ses--Dijkstra-attempt-nb 0)
-                                    row col)
+             (setf (ses-cell-property :ses-Dijkstra-attempt row col)
+                    (cons ses--Dijkstra-attempt-nb 0))
              (when (setq sig (ses-calculate-cell row col t))
                (nconc sig (list (ses-cell-symbol row col)))))
          (wrong-type-argument
           ;; The formula contains a reference.
-          (add-to-list 'ses--deferred-recalc (ses-cell-symbol row col))))))
+          (cl-pushnew (ses-cell-symbol row col) ses--deferred-recalc
+                       :test #'equal)))))
     ;; Do the update now, so we can force recalculation.
     (let ((x ses--deferred-recalc))
       (setq ses--deferred-recalc nil)
@@ -2211,8 +2252,10 @@ to are recalculated first."
               (eq (ses-cell-value row (1+ col)) '*skip*))
       ;; This cell has spill-over.  We'll momentarily pretend the following cell
       ;; has a `t' in it.
-      (eval `(let ((,(ses-cell-symbol row (1+ col)) t))
-              (ses-print-cell row col)))
+      (cl-progv
+         (list (ses-cell-symbol row (1+ col)))
+         '(t)
+              (ses-print-cell row col))
       ;; Now remove the *skip*.  ses-print-cell is always nil here.
       (ses-set-cell row (1+ col) 'value nil)
       (1value (ses-print-cell row (1+ col))))))
@@ -2251,7 +2294,7 @@ to are recalculated first."
       (insert ses-initial-file-trailer)
       (goto-char (point-min)))
     ;; Create a blank display area.
-    (dotimes (row ses--numrows)
+    (dotimes (_ ses--numrows)
       (insert ses--blank-line))
     (insert ses-print-data-boundary)
     (backward-char (1- (length ses-print-data-boundary)))
@@ -2321,16 +2364,23 @@ cell formula was unsafe and user declined confirmation."
      (barf-if-buffer-read-only)
      (list (car rowcol)
           (cdr rowcol)
-           (read-from-minibuffer
-            (format "Cell %s: " ses--curcell)
-            (cons (if (equal initial "\"") "\"\""
-                    (if (equal initial "(") "()" initial)) 2)
-            ses-mode-edit-map
-            t                         ; Convert to Lisp object.
-            'ses-read-cell-history
-            (prin1-to-string (if (eq (car-safe curval) 'ses-safe-formula)
-                                (cadr curval)
-                              curval))))))
+           (if (equal initial "\"")
+               (progn
+                 (if (not (stringp curval)) (setq curval nil))
+                 (read-string (if curval
+                                  (format "String Cell %s (default %s): "
+                                          ses--curcell curval)
+                                (format "String Cell %s: " ses--curcell))
+                              nil 'ses-read-string-history curval))
+             (read-from-minibuffer
+              (format "Cell %s: " ses--curcell)
+              (cons (if (equal initial "(") "()" initial) 2)
+              ses-mode-edit-map
+              t                         ; Convert to Lisp object.
+              'ses-read-cell-history
+              (prin1-to-string (if (eq (car-safe curval) 'ses-safe-formula)
+                                   (cadr curval)
+                                 curval)))))))
   (when (ses-edit-cell row col newval)
     (ses-command-hook) ; Update cell widths before movement.
     (dolist (x ses-after-entry-functions)
@@ -2363,7 +2413,7 @@ With prefix, deletes several cells."
       (1value (ses-clear-cell-backward (- count)))
     (ses-check-curcell)
     (ses-begin-change)
-    (dotimes (x count)
+    (dotimes (_ count)
       (ses-set-curcell)
       (let ((rowcol (ses-sym-rowcol ses--curcell)))
        (or rowcol (signal 'end-of-buffer nil))
@@ -2378,7 +2428,7 @@ cells."
       (1value (ses-clear-cell-forward (- count)))
     (ses-check-curcell 'end)
     (ses-begin-change)
-    (dotimes (x count)
+    (dotimes (_ count)
       (backward-char 1) ; Will signal 'beginning-of-buffer if appropriate.
       (ses-set-curcell)
       (let ((rowcol (ses-sym-rowcol ses--curcell)))
@@ -2390,12 +2440,14 @@ cells."
 ;;----------------------------------------------------------------------------
 
 (defun ses-read-printer (prompt default)
-  "Common code for `ses-read-cell-printer', `ses-read-column-printer', and `ses-read-default-printer'.
-PROMPT should end with \": \".  Result is t if operation was canceled."
+  "Common code for functions `ses-read-cell-printer', `ses-read-column-printer',
+`ses-read-default-printer' and `ses-define-local-printer'.
+PROMPT should end with \": \".  Result is t if operation was
+canceled."
   (barf-if-buffer-read-only)
   (if (eq default t)
       (setq default "")
-    (setq prompt (format "%s [currently %S]: "
+    (setq prompt (format "%s (default %S): "
                         (substring prompt 0 -2)
                         default)))
   (let ((new (read-from-minibuffer prompt
@@ -2411,6 +2463,7 @@ PROMPT should end with \": \".  Result is t if operation was canceled."
       (or (not new)
          (stringp new)
          (stringp (car-safe new))
+         (and (symbolp new) (gethash new ses--local-printer-hashmap))
          (ses-warn-unsafe new 'unsafep-function)
          (setq new t)))
     new))
@@ -2425,21 +2478,20 @@ one argument, or a symbol that names a function of one argument.  In the
 latter two cases, the function's result should be either a string (will be
 right-justified) or a list of one string (will be left-justified)."
   (interactive
-   (let ((default t)
-        x)
+   (let ((default t))
      (ses-check-curcell 'range)
      ;;Default is none if not all cells in range have same printer
      (catch 'ses-read-cell-printer
        (ses-dorange ses--curcell
-        (setq x (ses-cell-printer row col))
-        (if (eq (car-safe x) 'ses-safe-printer)
-            (setq x (cadr x)))
-        (if (eq default t)
-            (setq default x)
-          (unless (equal default x)
-            ;;Range contains differing printer functions
-            (setq default t)
-            (throw 'ses-read-cell-printer t)))))
+        (let ((x (ses-cell-printer row col)))
+           (if (eq (car-safe x) 'ses-safe-printer)
+               (setq x (cadr x)))
+           (if (eq default t)
+               (setq default x)
+             (unless (equal default x)
+               ;;Range contains differing printer functions
+               (setq default t)
+               (throw 'ses-read-cell-printer t))))))
      (list (ses-read-printer (format "Cell %S printer: " ses--curcell)
                             default))))
   (unless (eq newval t)
@@ -2718,7 +2770,7 @@ inserts a new row if at bottom of print area.  Repeat COUNT times."
      (list col
           (if current-prefix-arg
               (prefix-numeric-value current-prefix-arg)
-            (read-from-minibuffer (format "Column %s width [currently %d]: "
+            (read-from-minibuffer (format "Column %s width (default %d): "
                                           (ses-column-letter col)
                                           (ses-col-width col))
                                   nil  ; No initial contents.
@@ -2957,9 +3009,9 @@ cons of ROW and COL).  Treat plain symbols as strings unless ARG is a list."
       ;; Invalid sexp --- leave it as a string.
       (setq val (substring text from to)))
      ((and (car val) (symbolp (car val)))
-      (if (consp arg)
-         (setq val (list 'quote (car val)))  ; Keep symbol.
-       (setq val (substring text from to)))) ; Treat symbol as text.
+      (setq val (if (consp arg)
+                   (list 'quote (car val))   ; Keep symbol.
+                 (substring text from to)))) ; Treat symbol as text.
      (t
       (setq val (car val))))
     (let ((row (car rowcol))
@@ -3305,29 +3357,31 @@ highlighted range in the spreadsheet."
        (if (equal new-rowcol rowcol)
          (put new-name 'ses-cell rowcol)
          (error "Not a valid name for this cell location"))
-      (setq ses--named-cell-hashmap (or ses--named-cell-hashmap (make-hash-table :test 'eq)))
+      (setq ses--named-cell-hashmap
+            (or ses--named-cell-hashmap (make-hash-table :test 'eq)))
       (put new-name 'ses-cell :ses-named)
       (puthash new-name rowcol ses--named-cell-hashmap))
     (push `(ses-rename-cell ,old-name ,cell) buffer-undo-list)
-    ;; replace name by new name in formula of cells refering to renamed cell
+    ;; Replace name by new name in formula of cells refering to renamed cell.
     (dolist (ref (ses-cell-references cell))
       (let* ((x (ses-sym-rowcol ref))
             (xcell  (ses-get-cell (car x) (cdr x))))
-       (ses-cell-formula-aset xcell
-                              (ses-replace-name-in-formula
-                               (ses-cell-formula xcell)
-                               sym
-                               new-name))))
-    ;; replace name by new name in reference list of cells to which renamed cell refers to
+       (setf (ses-cell-formula xcell)
+              (ses-replace-name-in-formula
+               (ses-cell-formula xcell)
+               sym
+               new-name))))
+    ;; Replace name by new name in reference list of cells to which renamed
+    ;; cell refers to.
     (dolist (ref (ses-formula-references (ses-cell-formula cell)))
       (let* ((x (ses-sym-rowcol ref))
             (xcell (ses-get-cell (car x) (cdr x))))
-       (ses-cell-references-aset xcell
-                                 (cons new-name (delq sym
-                                                      (ses-cell-references xcell))))))
+       (setf (ses-cell-references xcell)
+              (cons new-name (delq sym
+                                   (ses-cell-references xcell))))))
     (push new-name ses--renamed-cell-symb-list)
     (set new-name (symbol-value sym))
-    (aset cell 0 new-name)
+    (setf (ses-cell--symbol cell) new-name)
     (makunbound sym)
     (and curcell (setq ses--curcell new-name))
     (let* ((pos (point))
@@ -3344,6 +3398,75 @@ highlighted range in the spreadsheet."
                                  (symbol-name new-name)))
     (force-mode-line-update)))
 
+(defun ses-refresh-local-printer (name compiled-value)
+  "Refresh printout for all cells which use printer NAME.
+NAME should be the name of a locally defined printer.
+Uses the value COMPILED-VALUE for this printer."
+  (message "Refreshing cells using printer %S" name)
+  (let (new-print)
+    (dotimes (row ses--numrows)
+      (dotimes (col ses--numcols)
+       (let ((cell-printer (ses-cell-printer row col)))
+         (when (eq cell-printer name)
+           (unless new-print
+             (setq new-print t)
+             (ses-begin-change))
+           (ses-print-cell row col)))))))
+
+(defun ses-define-local-printer (name)
+  "Define a local printer with name NAME."
+  (interactive "*SEnter printer name: ")
+  (let* ((cur-printer (gethash name ses--local-printer-hashmap))
+        (default (and (vectorp cur-printer) (ses--locprn-def cur-printer)))
+        create-printer
+        (new-def
+          (ses-read-printer (format "Enter definition of printer %S: " name)
+                            default)))
+    (cond
+     ;; cancelled operation => do nothing
+     ((eq new-def t))
+     ;; no change => do nothing
+     ((and (vectorp cur-printer) (equal new-def default)))
+     ;; re-defined printer
+     ((vectorp cur-printer)
+      (setq create-printer 0)
+      (setf (ses--locprn-def cur-printer) new-def)
+      (ses-refresh-local-printer
+       name
+       (setf (ses--locprn-compiled cur-printer)
+             (ses-local-printer-compile new-def))))
+     ;; new definition
+     (t
+      (setq create-printer 1)
+      (puthash name
+              (setq cur-printer
+                    (ses-make-local-printer-info new-def))
+              ses--local-printer-hashmap)))
+    (when create-printer
+      (let ((printer-def-text
+             (concat
+              "(ses-local-printer "
+              (symbol-name name)
+              " "
+              (prin1-to-string (ses--locprn-def cur-printer))
+              ")")))
+        (save-excursion
+          (ses-goto-data ses--numrows
+                         (ses--locprn-number cur-printer))
+          (let ((inhibit-read-only t))
+            ;; Special undo since it's outside the narrowed buffer.
+            (let (buffer-undo-list)
+              (if (= create-printer 0)
+                  (delete-region (point) (line-end-position))
+                (insert ?\n)
+                (backward-char))
+              (insert printer-def-text)
+              (when (= create-printer 1)
+                (ses-file-format-extend-paramter-list 3)
+                (ses-set-parameter 'ses--numlocprn
+                                   (+ ses--numlocprn create-printer))))))))))
+
+
 ;;----------------------------------------------------------------------------
 ;; Checking formulas for safety
 ;;----------------------------------------------------------------------------
@@ -3353,6 +3476,7 @@ highlighted range in the spreadsheet."
   (if (or (stringp printer)
          (stringp (car-safe printer))
          (not printer)
+         (and (symbolp printer) (gethash printer ses--local-printer-hashmap))
          (ses-warn-unsafe printer 'unsafep-function))
       printer
     'ses-unsafe))
index 9dc9a013f8b23a77dfe7c75ad434911a449bfc91..506f944094bd86a41b4e3fd49acdfb2809e54eb0 100644 (file)
@@ -1,7 +1,6 @@
 ;;; shell.el --- specialized comint.el for running the shell -*- lexical-binding: t -*-
 
-;; Copyright (C) 1988, 1993-1997, 2000-2014 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1988, 1993-1997, 2000-2014 Free Software Foundation, Inc.
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
 ;;     Simon Marshall <simon@gnu.org>
@@ -584,6 +583,8 @@ buffer."
       (setq shell-dirstack-query
            (cond ((string-equal shell "sh") "pwd")
                  ((string-equal shell "ksh") "echo $PWD ~-")
+                 ;; Bypass any aliases.  TODO all shells could use this.
+                 ((string-equal shell "bash") "command dirs")
                  (t "dirs")))
       ;; Bypass a bug in certain versions of bash.
       (when (string-equal shell "bash")
index d7f5b41830249b7b5c23ded5d9ce9210b12cbec0..5da662c21248498de38ad065d53b67d489a0b19e 100644 (file)
@@ -806,15 +806,15 @@ If BACKWARD-ONLY is non-nil, only delete them before point."
 If N is negative, delete newlines as well, leaving -N spaces.
 See also `cycle-spacing'."
   (interactive "*p")
-  (cycle-spacing n nil t))
+  (cycle-spacing n nil 'single-shot))
 
 (defvar cycle-spacing--context nil
   "Store context used in consecutive calls to `cycle-spacing' command.
-The first time this function is run, it saves the original point
-position and original spacing around the point in this
-variable.")
+The first time `cycle-spacing' runs, it saves in this variable:
+its N argument, the original point position, and the original spacing
+around point.")
 
-(defun cycle-spacing (&optional n preserve-nl-back single-shot)
+(defun cycle-spacing (&optional n preserve-nl-back mode)
   "Manipulate whitespace around point in a smart way.
 In interactive use, this function behaves differently in successive
 consecutive calls.
@@ -825,25 +825,31 @@ It deletes all spaces and tabs around point, leaving one space
 it deletes newlines as well, leaving -N spaces.
 \(If PRESERVE-NL-BACK is non-nil, it does not delete newlines before point.)
 
-The second call in a sequence (or the first call if the above does
-not result in any changes) deletes all spaces.
+The second call in a sequence deletes all spaces.
 
 The third call in a sequence restores the original whitespace (and point).
 
-If SINGLE-SHOT is non-nil, it only performs the first step in the sequence."
+If MODE is `single-shot', it only performs the first step in the sequence.
+If MODE is `fast' and the first step would not result in any change
+\(i.e., there are exactly (abs N) spaces around point),
+the function goes straight to the second step.
+
+Repeatedly calling the function with different values of N starts a
+new sequence each time."
   (interactive "*p")
   (let ((orig-pos       (point))
        (skip-characters (if (and n (< n 0)) " \t\n\r" " \t"))
-       (n               (abs (or n 1))))
+       (num             (abs (or n 1))))
     (skip-chars-backward (if preserve-nl-back " \t" skip-characters))
     (constrain-to-field nil orig-pos)
     (cond
-     ;; Command run for the first time or single-shot is non-nil.
-     ((or single-shot
+     ;; Command run for the first time, single-shot mode or different argument
+     ((or (eq 'single-shot mode)
          (not (equal last-command this-command))
-         (not cycle-spacing--context))
+         (not cycle-spacing--context)
+         (not (eq (car cycle-spacing--context) n)))
       (let* ((start (point))
-            (n     (- n (skip-chars-forward " " (+ n (point)))))
+            (num   (- num (skip-chars-forward " " (+ num (point)))))
             (mid   (point))
             (end   (progn
                      (skip-chars-forward skip-characters)
@@ -851,12 +857,12 @@ If SINGLE-SHOT is non-nil, it only performs the first step in the sequence."
        (setq cycle-spacing--context  ;; Save for later.
              ;; Special handling for case where there was no space at all.
              (unless (= start end)
-               (cons orig-pos (buffer-substring start (point)))))
+                (cons n (cons orig-pos (buffer-substring start (point))))))
        ;; If this run causes no change in buffer content, delete all spaces,
        ;; otherwise delete all excess spaces.
-       (delete-region (if (and (not single-shot) (zerop n) (= mid end))
+       (delete-region (if (and (eq mode 'fast) (zerop num) (= mid end))
                           start mid) end)
-        (insert (make-string n ?\s))))
+        (insert (make-string num ?\s))))
 
      ;; Command run for the second time.
      ((not (equal orig-pos (point)))
@@ -864,8 +870,8 @@ If SINGLE-SHOT is non-nil, it only performs the first step in the sequence."
 
      ;; Command run for the third time.
      (t
-      (insert (cdr cycle-spacing--context))
-      (goto-char (car cycle-spacing--context))
+      (insert (cddr cycle-spacing--context))
+      (goto-char (cadr cycle-spacing--context))
       (setq cycle-spacing--context nil)))))
 \f
 (defun beginning-of-buffer (&optional arg)
@@ -875,10 +881,8 @@ If the buffer is narrowed, this command uses the beginning of the
 accessible part of the buffer.
 
 If Transient Mark mode is disabled, leave mark at previous
-position, unless a \\[universal-argument] prefix is supplied.
-
-Don't use this command in Lisp programs!
-\(goto-char (point-min)) is faster."
+position, unless a \\[universal-argument] prefix is supplied."
+  (declare (interactive-only "use `(goto-char (point-min))' instead."))
   (interactive "^P")
   (or (consp arg)
       (region-active-p)
@@ -893,8 +897,6 @@ Don't use this command in Lisp programs!
                        (/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
                 (point-min))))
   (if (and arg (not (consp arg))) (forward-line 1)))
-(put 'beginning-of-buffer 'interactive-only
-     "use `(goto-char (point-min))' instead.")
 
 (defun end-of-buffer (&optional arg)
   "Move point to the end of the buffer.
@@ -903,10 +905,8 @@ If the buffer is narrowed, this command uses the end of the
 accessible part of the buffer.
 
 If Transient Mark mode is disabled, leave mark at previous
-position, unless a \\[universal-argument] prefix is supplied.
-
-Don't use this command in Lisp programs!
-\(goto-char (point-max)) is faster."
+position, unless a \\[universal-argument] prefix is supplied."
+  (declare (interactive-only "use `(goto-char (point-max))' instead."))
   (interactive "^P")
   (or (consp arg) (region-active-p) (push-mark))
   (let ((size (- (point-max) (point-min))))
@@ -927,7 +927,6 @@ Don't use this command in Lisp programs!
         ;; then scroll specially to put it near, but not at, the bottom.
         (overlay-recenter (point))
         (recenter -3))))
-(put 'end-of-buffer 'interactive-only "use `(goto-char (point-max))' instead.")
 
 (defcustom delete-active-region t
   "Whether single-char deletion commands delete an active region.
@@ -968,6 +967,7 @@ arg, and KILLFLAG is set if N is explicitly specified.
 In Overwrite mode, single character backward deletion may replace
 tabs with spaces so as to back over columns, unless point is at
 the end of the line."
+  (declare (interactive-only delete-char))
   (interactive "p\nP")
   (unless (integerp n)
     (signal 'wrong-type-argument (list 'integerp n)))
@@ -990,7 +990,6 @@ the end of the line."
             (insert-char ?\s (- ocol (current-column)) nil))))
        ;; Otherwise, do simple deletion.
        (t (delete-char (- n) killflag))))
-(put 'delete-backward-char 'interactive-only 'delete-char)
 
 (defun delete-forward-char (n &optional killflag)
   "Delete the following N characters (previous if N is negative).
@@ -1001,6 +1000,7 @@ To disable this, set variable `delete-active-region' to nil.
 Optional second arg KILLFLAG non-nil means to kill (save in kill
 ring) instead of delete.  Interactively, N is the prefix arg, and
 KILLFLAG is set if N was explicitly specified."
+  (declare (interactive-only delete-char))
   (interactive "p\nP")
   (unless (integerp n)
     (signal 'wrong-type-argument (list 'integerp n)))
@@ -1014,7 +1014,6 @@ KILLFLAG is set if N was explicitly specified."
 
        ;; Otherwise, do simple deletion.
        (t (delete-char n killflag))))
-(put 'delete-forward-char 'interactive-only 'delete-char)
 
 (defun mark-whole-buffer ()
   "Put point at beginning and mark at end of buffer.
@@ -1022,6 +1021,7 @@ If narrowing is in effect, only uses the accessible part of the buffer.
 You probably should not use this function in Lisp programs;
 it is usually a mistake for a Lisp function to use any subroutine
 that uses or sets the mark."
+  (declare (interactive-only t))
   (interactive)
   (push-mark (point))
   (push-mark (point-max) nil t)
@@ -1050,6 +1050,7 @@ What you probably want instead is something like:
   (forward-line (1- N))
 If at all possible, an even better solution is to use char counts
 rather than line counts."
+  (declare (interactive-only forward-line))
   (interactive
    (if (and current-prefix-arg (not (consp current-prefix-arg)))
        (list (prefix-numeric-value current-prefix-arg))
@@ -1089,7 +1090,6 @@ rather than line counts."
     (if (eq selective-display t)
        (re-search-forward "[\n\C-m]" nil 'end (1- line))
       (forward-line (1- line)))))
-(put 'goto-line 'interactive-only 'forward-line)
 
 (defun count-words-region (start end &optional arg)
   "Count the number of words in the region.
@@ -1508,24 +1508,13 @@ to get different commands to edit and resubmit."
          ;; add it to the history.
          (or (equal newcmd (car command-history))
              (setq command-history (cons newcmd command-history)))
-          (unwind-protect
-              (progn
-                ;; Trick called-interactively-p into thinking that `newcmd' is
-                ;; an interactive call (bug#14136).
-                (add-hook 'called-interactively-p-functions
-                          #'repeat-complex-command--called-interactively-skip)
-                (eval newcmd))
-            (remove-hook 'called-interactively-p-functions
-                         #'repeat-complex-command--called-interactively-skip)))
+          (apply #'funcall-interactively
+                (car newcmd)
+                (mapcar (lambda (e) (eval e t)) (cdr newcmd))))
       (if command-history
          (error "Argument %d is beyond length of command history" arg)
        (error "There are no previous complex commands to repeat")))))
 
-(defun repeat-complex-command--called-interactively-skip (i _frame1 frame2)
-  (and (eq 'eval (cadr frame2))
-       (eq 'repeat-complex-command
-           (cadr (backtrace-frame i #'called-interactively-p)))
-       1))
 
 (defvar extended-command-history nil)
 
@@ -2370,91 +2359,115 @@ are ignored.  If BEG and END are nil, all undo elements are used."
            (undo-make-selective-list (min beg end) (max beg end))
          buffer-undo-list)))
 
+;; The positions given in elements of the undo list are the positions
+;; as of the time that element was recorded to undo history.  In
+;; general, subsequent buffer edits render those positions invalid in
+;; the current buffer, unless adjusted according to the intervening
+;; undo elements.
+;;
+;; Undo in region is a use case that requires adjustments to undo
+;; elements.  It must adjust positions of elements in the region based
+;; on newer elements not in the region so as they may be correctly
+;; applied in the current buffer.  undo-make-selective-list
+;; accomplishes this with its undo-deltas list of adjustments.  An
+;; example undo history from oldest to newest:
+;;
+;; buf pos:
+;; 123456789 buffer-undo-list undo-deltas
+;; --------- ---------------- -----------
+;; aaa       (1 . 4)          (1 . -3)
+;; aaba      (3 . 4)          N/A (in region)
+;; ccaaba    (1 . 3)          (1 . -2)
+;; ccaabaddd (7 . 10)         (7 . -3)
+;; ccaabdd   ("ad" . 6)       (6 . 2)
+;; ccaabaddd (6 . 8)          (6 . -2)
+;;  |   |<-- region: "caab", from 2 to 6
+;;
+;; When the user starts a run of undos in region,
+;; undo-make-selective-list is called to create the full list of in
+;; region elements.  Each element is adjusted forward chronologically
+;; through undo-deltas to determine if it is in the region.
+;;
+;; In the above example, the insertion of "b" is (3 . 4) in the
+;; buffer-undo-list.  The undo-delta (1 . -2) causes (3 . 4) to become
+;; (5 . 6).  The next three undo-deltas cause no adjustment, so (5
+;; . 6) is assessed as in the region and placed in the selective list.
+;; Notably, the end of region itself adjusts from "2 to 6" to "2 to 5"
+;; due to the selected element.  The "b" insertion is the only element
+;; fully in the region, so in this example undo-make-selective-list
+;; returns (nil (5 . 6)).
+;;
+;; The adjustment of the (7 . 10) insertion of "ddd" shows an edge
+;; case.  It is adjusted through the undo-deltas: ((6 . 2) (6 . -2)).
+;; Normally an undo-delta of (6 . 2) would cause positions after 6 to
+;; adjust by 2.  However, they shouldn't adjust to less than 6, so (7
+;; . 10) adjusts to (6 . 8) due to the first undo delta.
+;;
+;; More interesting is how to adjust the "ddd" insertion due to the
+;; next undo-delta: (6 . -2), corresponding to reinsertion of "ad".
+;; If the reinsertion was a manual retyping of "ad", then the total
+;; adjustment should be (7 . 10) -> (6 . 8) -> (8 . 10).  However, if
+;; the reinsertion was due to undo, one might expect the first "d"
+;; character would again be a part of the "ddd" text, meaning its
+;; total adjustment would be (7 . 10) -> (6 . 8) -> (7 . 10).
+;;
+;; undo-make-selective-list assumes in this situation that "ad" was a
+;; new edit, even if it was inserted because of an undo.
+;; Consequently, if the user undos in region "8 to 10" of the
+;; "ccaabaddd" buffer, they could be surprised that it becomes
+;; "ccaabad", as though the first "d" became detached from the
+;; original "ddd" insertion.  This quirk is a FIXME.
+
 (defun undo-make-selective-list (start end)
   "Return a list of undo elements for the region START to END.
-The elements come from `buffer-undo-list', but we keep only
-the elements inside this region, and discard those outside this region.
-If we find an element that crosses an edge of this region,
-we stop and ignore all further elements."
-  (let ((undo-list-copy (undo-copy-list buffer-undo-list))
-       (undo-list (list nil))
-       some-rejected
-       undo-elt temp-undo-list delta)
-    (while undo-list-copy
-      (setq undo-elt (car undo-list-copy))
-      (let ((keep-this
-            (cond ((and (consp undo-elt) (eq (car undo-elt) t))
-                   ;; This is a "was unmodified" element.
-                   ;; Keep it if we have kept everything thus far.
-                   (not some-rejected))
-                   ;; Skip over marker adjustments, instead relying on
-                   ;; finding them after (TEXT . POS) elements
-                   ((markerp (car-safe undo-elt))
-                    nil)
-                  (t
-                   (undo-elt-in-region undo-elt start end)))))
-       (if keep-this
-           (progn
-             (setq end (+ end (cdr (undo-delta undo-elt))))
-             ;; Don't put two nils together in the list
-             (when (not (and (eq (car undo-list) nil)
-                              (eq undo-elt nil)))
-                (setq undo-list (cons undo-elt undo-list))
-                ;; If (TEXT . POS), "keep" its subsequent (MARKER
-                ;; . ADJUSTMENT) whose markers haven't moved.
-                (when (and (stringp (car-safe undo-elt))
-                           (integerp (cdr-safe undo-elt)))
-                  (let ((list-i (cdr undo-list-copy)))
+The elements come from `buffer-undo-list', but we keep only the
+elements inside this region, and discard those outside this
+region.  The elements' positions are adjusted so as the returned
+list can be applied to the current buffer."
+  (let ((ulist buffer-undo-list)
+        ;; A list of position adjusted undo elements in the region.
+        (selective-list (list nil))
+        ;; A list of undo-deltas for out of region undo elements.
+        undo-deltas
+        undo-elt)
+    (while ulist
+      (when undo-no-redo
+        (while (gethash ulist undo-equiv-table)
+          (setq ulist (gethash ulist undo-equiv-table))))
+      (setq undo-elt (car ulist))
+      (cond
+       ((null undo-elt)
+        ;; Don't put two nils together in the list
+        (when (car selective-list)
+          (push nil selective-list)))
+       ((and (consp undo-elt) (eq (car undo-elt) t))
+        ;; This is a "was unmodified" element.  Keep it
+        ;; if we have kept everything thus far.
+        (when (not undo-deltas)
+          (push undo-elt selective-list)))
+       ;; Skip over marker adjustments, instead relying
+       ;; on finding them after (TEXT . POS) elements
+       ((markerp (car-safe undo-elt))
+        nil)
+       (t
+        (let ((adjusted-undo-elt (undo-adjust-elt undo-elt
+                                                  undo-deltas)))
+          (if (undo-elt-in-region adjusted-undo-elt start end)
+              (progn
+                (setq end (+ end (cdr (undo-delta adjusted-undo-elt))))
+                (push adjusted-undo-elt selective-list)
+                ;; Keep (MARKER . ADJUSTMENT) if their (TEXT . POS) was
+                ;; kept.  primitive-undo may discard them later.
+                (when (and (stringp (car-safe adjusted-undo-elt))
+                           (integerp (cdr-safe adjusted-undo-elt)))
+                  (let ((list-i (cdr ulist)))
                     (while (markerp (car-safe (car list-i)))
-                      (let* ((adj-elt (pop list-i))
-                             (m (car adj-elt)))
-                        (and (eq (marker-buffer m) (current-buffer))
-                             (= (cdr undo-elt) m)
-                             (push adj-elt undo-list))))))))
-         (if (undo-elt-crosses-region undo-elt start end)
-             (setq undo-list-copy nil)
-           (setq some-rejected t)
-           (setq temp-undo-list (cdr undo-list-copy))
-           (setq delta (undo-delta undo-elt))
-
-           (when (/= (cdr delta) 0)
-             (let ((position (car delta))
-                   (offset (cdr delta)))
-
-               ;; Loop down the earlier events adjusting their buffer
-               ;; positions to reflect the fact that a change to the buffer
-               ;; isn't being undone. We only need to process those element
-               ;; types which undo-elt-in-region will return as being in
-               ;; the region since only those types can ever get into the
-               ;; output
-
-               (while temp-undo-list
-                 (setq undo-elt (car temp-undo-list))
-                 (cond ((integerp undo-elt)
-                        (if (>= undo-elt position)
-                            (setcar temp-undo-list (- undo-elt offset))))
-                       ((atom undo-elt) nil)
-                       ((stringp (car undo-elt))
-                        ;; (TEXT . POSITION)
-                        (let ((text-pos (abs (cdr undo-elt)))
-                              (point-at-end (< (cdr undo-elt) 0 )))
-                          (if (>= text-pos position)
-                              (setcdr undo-elt (* (if point-at-end -1 1)
-                                                  (- text-pos offset))))))
-                       ((integerp (car undo-elt))
-                        ;; (BEGIN . END)
-                        (when (>= (car undo-elt) position)
-                          (setcar undo-elt (- (car undo-elt) offset))
-                          (setcdr undo-elt (- (cdr undo-elt) offset))))
-                       ((null (car undo-elt))
-                        ;; (nil PROPERTY VALUE BEG . END)
-                        (let ((tail (nthcdr 3 undo-elt)))
-                          (when (>= (car tail) position)
-                            (setcar tail (- (car tail) offset))
-                            (setcdr tail (- (cdr tail) offset))))))
-                 (setq temp-undo-list (cdr temp-undo-list))))))))
-      (setq undo-list-copy (cdr undo-list-copy)))
-    (nreverse undo-list)))
+                      (push (pop list-i) selective-list)))))
+            (let ((delta (undo-delta undo-elt)))
+              (when (/= 0 (cdr delta))
+                (push delta undo-deltas)))))))
+      (pop ulist))
+    (nreverse selective-list)))
 
 (defun undo-elt-in-region (undo-elt start end)
   "Determine whether UNDO-ELT falls inside the region START ... END.
@@ -2502,6 +2515,73 @@ is not *inside* the region START...END."
         ;; (BEGIN . END)
         (and (< (car undo-elt) end)
              (> (cdr undo-elt) start)))))
+(make-obsolete 'undo-elt-crosses-region nil "24.5")
+
+(defun undo-adjust-elt (elt deltas)
+  "Return adjustment of undo element ELT by the undo DELTAS
+list."
+  (pcase elt
+    ;; POSITION
+    ((pred integerp)
+     (undo-adjust-pos elt deltas))
+    ;; (BEG . END)
+    (`(,(and beg (pred integerp)) . ,(and end (pred integerp)))
+     (undo-adjust-beg-end beg end deltas))
+    ;; (TEXT . POSITION)
+    (`(,(and text (pred stringp)) . ,(and pos (pred integerp)))
+     (cons text (* (if (< pos 0) -1 1)
+                   (undo-adjust-pos (abs pos) deltas))))
+    ;; (nil PROPERTY VALUE BEG . END)
+    (`(nil . ,(or `(,prop ,val ,beg . ,end) pcase--dontcare))
+     `(nil ,prop ,val . ,(undo-adjust-beg-end beg end deltas)))
+    ;; (apply DELTA START END FUN . ARGS)
+    ;; FIXME
+    ;; All others return same elt
+    (_ elt)))
+
+;; (BEG . END) can adjust to the same positions, commonly when an
+;; insertion was undone and they are out of region, for example:
+;;
+;; buf pos:
+;; 123456789 buffer-undo-list undo-deltas
+;; --------- ---------------- -----------
+;; [...]
+;; abbaa     (2 . 4)          (2 . -2)
+;; aaa       ("bb" . 2)       (2 . 2)
+;; [...]
+;;
+;; "bb" insertion (2 . 4) adjusts to (2 . 2) because of the subsequent
+;; undo.  Further adjustments to such an element should be the same as
+;; for (TEXT . POSITION) elements.  The options are:
+;;
+;;   1: POSITION adjusts using <= (use-< nil), resulting in behavior
+;;      analogous to marker insertion-type t.
+;;
+;;   2: POSITION adjusts using <, resulting in behavior analogous to
+;;      marker insertion-type nil.
+;;
+;; There was no strong reason to prefer one or the other, except that
+;; the first is more consistent with prior undo in region behavior.
+(defun undo-adjust-beg-end (beg end deltas)
+  "Return cons of adjustments to BEG and END by the undo DELTAS
+list."
+  (let ((adj-beg (undo-adjust-pos beg deltas)))
+    ;; Note: option 2 above would be like (cons (min ...) adj-end)
+    (cons adj-beg
+          (max adj-beg (undo-adjust-pos end deltas t)))))
+
+(defun undo-adjust-pos (pos deltas &optional use-<)
+  "Return adjustment of POS by the undo DELTAS list, comparing
+with < or <= based on USE-<."
+  (dolist (d deltas pos)
+    (when (if use-<
+              (< (car d) pos)
+            (<= (car d) pos))
+      (setq pos
+            ;; Don't allow pos to become less than the undo-delta
+            ;; position.  This edge case is described in the overview
+            ;; comments.
+            (max (car d) (- pos (cdr d)))))))
 
 ;; Return the first affected buffer position and the delta for an undo element
 ;; delta is defined as the change in subsequent buffer positions if we *did*
@@ -3286,6 +3366,11 @@ support pty association, if PROGRAM is nil."
 
 (defvar process-menu-query-only nil)
 
+(defvar process-menu-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [?d] 'process-menu-delete-process)
+    map))
+
 (define-derived-mode process-menu-mode tabulated-list-mode "Process Menu"
   "Major mode for listing the processes called by Emacs."
   (setq tabulated-list-format [("Process" 15 t)
@@ -3298,6 +3383,12 @@ support pty association, if PROGRAM is nil."
   (add-hook 'tabulated-list-revert-hook 'list-processes--refresh nil t)
   (tabulated-list-init-header))
 
+(defun process-menu-delete-process ()
+  "Kill process at point in a `list-processes' buffer."
+  (interactive)
+  (delete-process (tabulated-list-get-id))
+  (revert-buffer))
+
 (defun list-processes--refresh ()
   "Recompute the list of processes for the Process List buffer.
 Also, delete any process that is exited or signaled."
@@ -3651,14 +3742,34 @@ argument should still be a \"useful\" string for such uses."
   (if interprogram-cut-function
       (funcall interprogram-cut-function string)))
 
+;; It has been argued that this should work similar to `self-insert-command'
+;; which merges insertions in undo-list in groups of 20 (hard-coded in cmds.c).
+(defcustom kill-append-merge-undo nil
+  "Whether appending to kill ring also makes \\[undo] restore both pieces of text simultaneously."
+  :type 'boolean
+  :group 'killing
+  :version "24.5")
+
 (defun kill-append (string before-p)
   "Append STRING to the end of the latest kill in the kill ring.
 If BEFORE-P is non-nil, prepend STRING to the kill.
+Also removes the last undo boundary in the current buffer,
+ depending on `kill-append-merge-undo'.
 If `interprogram-cut-function' is set, pass the resulting kill to it."
   (let* ((cur (car kill-ring)))
     (kill-new (if before-p (concat string cur) (concat cur string))
              (or (= (length cur) 0)
-                 (equal nil (get-text-property 0 'yank-handler cur))))))
+                 (equal nil (get-text-property 0 'yank-handler cur))))
+    (when (and kill-append-merge-undo (not buffer-read-only))
+      (let ((prev buffer-undo-list)
+            (next (cdr buffer-undo-list)))
+        ;; find the next undo boundary
+        (while (car next)
+          (pop next)
+          (pop prev))
+        ;; remove this undo boundary
+        (when prev
+          (setcdr prev (cdr next)))))))
 
 (defcustom yank-pop-change-selection nil
   "Whether rotating the kill ring changes the window system selection.
@@ -3756,7 +3867,7 @@ some text between BEG and END, but we're killing the region."
          ;; Add that string to the kill ring, one way or another.
          (if (eq last-command 'kill-region)
              (kill-append string (< end beg))
-           (kill-new string nil)))
+           (kill-new string)))
        (when (or string (eq last-command 'kill-region))
          (setq this-command 'kill-region))
        (setq deactivate-mark t)
@@ -4282,10 +4393,8 @@ If ARG is zero, move to the beginning of the current line."
 (defun insert-buffer (buffer)
   "Insert after point the contents of BUFFER.
 Puts mark after the inserted text.
-BUFFER may be a buffer or a buffer name.
-
-This function is meant for the user to run interactively.
-Don't call it from programs: use `insert-buffer-substring' instead!"
+BUFFER may be a buffer or a buffer name."
+  (declare (interactive-only insert-buffer-substring))
   (interactive
    (list
     (progn
@@ -4300,7 +4409,6 @@ Don't call it from programs: use `insert-buffer-substring' instead!"
      (insert-buffer-substring (get-buffer buffer))
      (point)))
   nil)
-(put 'insert-buffer 'interactive-only 'insert-buffer-substring)
 
 (defun append-to-buffer (buffer start end)
   "Append to specified buffer the text of the region.
@@ -4419,9 +4527,11 @@ run `deactivate-mark-hook'."
     (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382).
     (cond
      ((eq (car-safe transient-mark-mode) 'only)
-      (setq transient-mark-mode (cdr transient-mark-mode)))
+      (setq transient-mark-mode (cdr transient-mark-mode))
+      (if (eq transient-mark-mode (default-value 'transient-mark-mode))
+          (kill-local-variable 'transient-mark-mode)))
      ((eq transient-mark-mode 'lambda)
-      (setq transient-mark-mode nil)))
+      (kill-local-variable 'transient-mark-mode)))
     (setq mark-active nil)
     (run-hooks 'deactivate-mark-hook)
     (redisplay--update-region-highlight (selected-window))))
@@ -4434,7 +4544,7 @@ If NO-TMM is non-nil, leave `transient-mark-mode' alone."
       (force-mode-line-update) ;Refresh toolbar (bug#16382).
       (setq mark-active t)
       (unless (or transient-mark-mode no-tmm)
-        (setq transient-mark-mode 'lambda))
+        (setq-local transient-mark-mode 'lambda))
       (run-hooks 'activate-mark-hook))))
 
 (defun set-mark (pos)
@@ -4648,7 +4758,7 @@ Novice Emacs Lisp programmers often try to use the mark for the wrong
 purposes.  See the documentation of `set-mark' for more information."
   (interactive "P")
   (cond ((eq transient-mark-mode 'lambda)
-        (setq transient-mark-mode nil))
+        (kill-local-variable 'transient-mark-mode))
        ((eq (car-safe transient-mark-mode) 'only)
         (deactivate-mark)))
   (cond
@@ -4658,16 +4768,14 @@ purposes.  See the documentation of `set-mark' for more information."
     (if arg
        (pop-to-mark-command)
       (push-mark-command t)))
-   ((and set-mark-command-repeat-pop
-        (eq last-command 'pop-to-mark-command))
-    (setq this-command 'pop-to-mark-command)
-    (pop-to-mark-command))
    ((and set-mark-command-repeat-pop
         (eq last-command 'pop-global-mark)
         (not arg))
     (setq this-command 'pop-global-mark)
     (pop-global-mark))
-   (arg
+   ((or (and set-mark-command-repeat-pop
+             (eq last-command 'pop-to-mark-command))
+        arg)
     (setq this-command 'pop-to-mark-command)
     (pop-to-mark-command))
    ((eq last-command 'set-mark-command)
@@ -4742,7 +4850,7 @@ mode temporarily."
     (set-mark (point))
     (goto-char omark)
     (cond (temp-highlight
-          (setq transient-mark-mode (cons 'only transient-mark-mode)))
+          (setq-local transient-mark-mode (cons 'only transient-mark-mode)))
          ((or (and arg (region-active-p)) ; (xor arg (not (region-active-p)))
               (not (or arg (region-active-p))))
           (deactivate-mark))
@@ -4781,13 +4889,15 @@ its earlier value."
   (cond ((and shift-select-mode this-command-keys-shift-translated)
          (unless (and mark-active
                      (eq (car-safe transient-mark-mode) 'only))
-          (setq transient-mark-mode
-                 (cons 'only
-                       (unless (eq transient-mark-mode 'lambda)
-                         transient-mark-mode)))
+          (setq-local transient-mark-mode
+                       (cons 'only
+                             (unless (eq transient-mark-mode 'lambda)
+                               transient-mark-mode)))
            (push-mark nil nil t)))
         ((eq (car-safe transient-mark-mode) 'only)
          (setq transient-mark-mode (cdr transient-mark-mode))
+         (if (eq transient-mark-mode (default-value 'transient-mark-mode))
+             (kill-local-variable 'transient-mark-mode))
          (deactivate-mark))))
 
 (define-minor-mode transient-mark-mode
@@ -4815,7 +4925,7 @@ Transient Mark mode, invoke \\[apropos-documentation] and type \"transient\"
 or \"mark.*active\" at the prompt."
   :global t
   ;; It's defined in C/cus-start, this stops the d-m-m macro defining it again.
-  :variable transient-mark-mode)
+  :variable (default-value 'transient-mark-mode))
 
 (defvar widen-automatically t
   "Non-nil means it is ok for commands to call `widen' when they want to.
@@ -4889,11 +4999,8 @@ this command moves to the specified goal column (or as close as possible).
 The goal column is stored in the variable `goal-column', which is nil
 when there is no goal column.  Note that setting `goal-column'
 overrides `line-move-visual' and causes this command to move by buffer
-lines rather than by display lines.
-
-If you are thinking of using this in a Lisp program, consider
-using `forward-line' instead.  It is usually easier to use
-and more reliable (no dependence on goal column, etc.)."
+lines rather than by display lines."
+  (declare (interactive-only forward-line))
   (interactive "^p\np")
   (or arg (setq arg 1))
   (if (and next-line-add-newlines (= arg 1))
@@ -4910,7 +5017,6 @@ and more reliable (no dependence on goal column, etc.)."
           (signal (car err) (cdr err))))
       (line-move arg nil nil try-vscroll)))
   nil)
-(put 'next-line 'interactive-only 'forward-line)
 
 (defun previous-line (&optional arg try-vscroll)
   "Move cursor vertically up ARG lines.
@@ -4936,11 +5042,9 @@ this command moves to the specified goal column (or as close as possible).
 The goal column is stored in the variable `goal-column', which is nil
 when there is no goal column.  Note that setting `goal-column'
 overrides `line-move-visual' and causes this command to move by buffer
-lines rather than by display lines.
-
-If you are thinking of using this in a Lisp program, consider using
-`forward-line' with a negative argument instead.  It is usually easier
-to use and more reliable (no dependence on goal column, etc.)."
+lines rather than by display lines."
+  (declare (interactive-only
+            "use `forward-line' with negative argument instead."))
   (interactive "^p\np")
   (or arg (setq arg 1))
   (if (called-interactively-p 'interactive)
@@ -4950,8 +5054,6 @@ to use and more reliable (no dependence on goal column, etc.)."
         (signal (car err) (cdr err))))
     (line-move (- arg) nil nil try-vscroll))
   nil)
-(put 'previous-line 'interactive-only
-     "use `forward-line' with negative argument instead.")
 
 (defcustom track-eol nil
   "Non-nil means vertical motion starting at end of line keeps to ends of lines.
@@ -5832,7 +5934,9 @@ With prefix arg ARG, effect is to take character before point
 and drag it forward past ARG other characters (backward if ARG negative).
 If no argument and at end of line, the previous two chars are exchanged."
   (interactive "*P")
-  (and (null arg) (eolp) (forward-char -1))
+  (when (and (null arg) (eolp) (not (bobp))
+            (not (get-text-property (1- (point)) 'read-only)))
+    (forward-char -1))
   (transpose-subr 'forward-char (prefix-numeric-value arg)))
 
 (defun transpose-words (arg)
@@ -6489,6 +6593,7 @@ The function should return non-nil if the two tokens do not match.")
                             (not blink-matching-paren-dont-ignore-comments))))
                   (condition-case ()
                       (progn
+                       (syntax-propertize (point))
                         (forward-sexp -1)
                         ;; backward-sexp skips backward over prefix chars,
                         ;; so move back to the matching paren.
@@ -6603,6 +6708,8 @@ At top-level, as an editor command, this simply beeps."
     (deactivate-mark))
   (if (fboundp 'kmacro-keyboard-quit)
       (kmacro-keyboard-quit))
+  (when completion-in-region-mode
+    (completion-in-region-mode -1))
   ;; Force the next redisplay cycle to remove the "Def" indicator from
   ;; all the mode lines.
   (if defining-kbd-macro
@@ -6899,6 +7006,8 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
     (define-key map "\e\e\e" 'delete-completion-window)
     (define-key map [left] 'previous-completion)
     (define-key map [right] 'next-completion)
+    (define-key map [?\t] 'next-completion)
+    (define-key map [backtab] 'previous-completion)
     (define-key map "q" 'quit-window)
     (define-key map "z" 'kill-this-buffer)
     map)
@@ -7847,31 +7956,6 @@ contains the list of implementations currently supported for this command."
                              command-name)))))))
 
 \f
-;; This is here because files in obsolete/ are not scanned for autoloads.
-
-(defvar iswitchb-mode nil "\
-Non-nil if Iswitchb mode is enabled.
-See the command `iswitchb-mode' for a description of this minor mode.
-Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `iswitchb-mode'.")
-
-(custom-autoload 'iswitchb-mode "iswitchb" nil)
-
-(autoload 'iswitchb-mode "iswitchb" "\
-Toggle Iswitchb mode.
-With a prefix argument ARG, enable Iswitchb mode if ARG is
-positive, and disable it otherwise.  If called from Lisp, enable
-the mode if ARG is omitted or nil.
-
-Iswitchb mode is a global minor mode that enables switching
-between buffers using substrings.  See `iswitchb' for details.
-
-\(fn &optional ARG)" t nil)
-
-(make-obsolete 'iswitchb-mode
-               "use `icomplete-mode' or `ido-mode' instead." "24.4")
-\f
 
 (provide 'simple)
 
index 54dce9e43b7ad39a735a0e92ce396f4cdb950aa5..1c6128a33a5fc1a42834296bf908c5a57476d4be 100644 (file)
@@ -55,22 +55,15 @@ Typical examples might be `upcase' or `capitalize'.")
 When the region is visible (due to `transient-mark-mode' or marking a region
 with the mouse) and this is non-nil and the function was called without an
 explicit ARG, then the ARG defaults to -1, i.e. wrapping around the visible
-region.
-
-We will probably delete this variable in a future Emacs version
-unless we get a substantial number of complaints about the auto-wrap
-feature.")
+region.")
+(make-obsolete-variable 'skeleton-autowrap nil "24.5")
 
 (defvar skeleton-end-newline t
   "If non-nil, make sure that the skeleton inserted ends with a newline.
 This just influences the way the default `skeleton-end-hook' behaves.")
 
-(defvar skeleton-end-hook
-  (lambda ()
-    (or (eolp) (not skeleton-end-newline) (newline-and-indent)))
+(defvar skeleton-end-hook nil
   "Hook called at end of skeleton but before going to point of interest.
-By default this moves out anything following to next line,
-  unless `skeleton-end-newline' is set to nil.
 The variables `v1' and `v2' are still set when calling this.")
 
 
@@ -271,6 +264,7 @@ When done with skeleton, but before going back to `_'-point call
               (mapcar #'car skeleton-further-elements)
               (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements)
             (skeleton-internal-list skeleton str))
+       (or (eolp) (not skeleton-end-newline) (newline-and-indent))
        (run-hooks 'skeleton-end-hook)
        (sit-for 0)
        (or (pos-visible-in-window-p beg)
index 084767893e4aed122045e52df02b560023e4551e..55e86e7fef3de2030a2d073da5f6f1602aeaff89 100644 (file)
@@ -39,21 +39,9 @@ this version is not backward compatible to 0.14 or earlier.")
 ;;
 ;;; Notes:
 ;;
-;;    Users of really old emacsen without the need timer functions
-;; will not have speedbar updating automatically.  Use "g" to refresh
-;; the display after changing directories.  Remember, do not interrupt
-;; the stealthy updates or your display may not be completely
-;; refreshed.
-;;
 ;;    AUC-TEX users: The imenu tags for AUC-TEX mode don't work very
 ;; well.  Use the imenu keywords from tex-mode.el for better results.
 ;;
-;; This file requires the library package assoc (association lists)
-;;     assoc should be available in all modern versions of Emacs.
-;; The custom package is optional (for easy configuration of speedbar)
-;;     http://www.dina.kvl.dk/~abraham/custom/
-;;     custom is available in all versions of Emacs version 20 or better.
-;;
 ;;; Developing for speedbar
 ;;
 ;; Adding a speedbar specialized display mode:
index a229207a2c85f2096024909fd4ccf0b09d7f3de7..144d732272f82ce9004a778587cbd065cb0ea6fa 100644 (file)
@@ -293,8 +293,9 @@ see `tty-setup-hook'.")
 `tty-setup-hook' instead." "24.4")
 
 (defvar inhibit-startup-hooks nil
-  "Non-nil means don't run `term-setup-hook' and `emacs-startup-hook'.
-This is because we already did so.")
+  "Non-nil means don't run some startup hooks, because we already did.
+Currently this applies to: `emacs-startup-hook', `term-setup-hook',
+and `window-setup-hook'.")
 
 (defvar keyboard-type nil
   "The brand of keyboard you are using.
@@ -648,9 +649,7 @@ It is the default value of the variable `top-level'."
                                       (emacs-pid)
                                       (system-name))))))))
        (unless inhibit-startup-hooks
-         (run-hooks 'emacs-startup-hook)
-         (and term-setup-hook
-              (run-hooks 'term-setup-hook)))
+         (run-hooks 'emacs-startup-hook 'term-setup-hook))
 
        ;; Don't do this if we failed to create the initial frame,
        ;; for instance due to a dense colormap.
@@ -686,8 +685,8 @@ It is the default value of the variable `top-level'."
        ;; Now we know the user's default font, so add it to the menu.
        (if (fboundp 'font-menu-add-default)
            (font-menu-add-default))
-       (and window-setup-hook
-            (run-hooks 'window-setup-hook))))
+       (unless inhibit-startup-hooks
+         (run-hooks 'window-setup-hook))))
     ;; Subprocesses of Emacs do not have direct access to the terminal, so
     ;; unless told otherwise they should only assume a dumb terminal.
     ;; We are careful to do it late (after term-setup-hook), although the
@@ -720,9 +719,6 @@ It is the default value of the variable `top-level'."
 (defconst tool-bar-images-pixel-height 24
   "Height in pixels of images in the tool-bar.")
 
-(defvar tool-bar-originally-present nil
-  "Non-nil if tool-bars are present before user and site init files are read.")
-
 (defvar handle-args-function-alist '((nil . tty-handle-args))
   "Functions for processing window-system dependent command-line arguments.
 Window system startup files should add their own function to this
@@ -1043,18 +1039,6 @@ please check its value")
   (or (eq initial-window-system 'pc)
       (tty-register-default-colors))
 
-  ;; Record whether the tool-bar is present before the user and site
-  ;; init files are processed.  frame-notice-user-settings uses this
-  ;; to determine if the tool-bar has been disabled by the init files,
-  ;; and the frame needs to be resized.
-  (when (fboundp 'frame-notice-user-settings)
-    (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist)
-                              (assq 'tool-bar-lines default-frame-alist))))
-      (setq tool-bar-originally-present
-            (and tool-bar-lines
-                 (cdr tool-bar-lines)
-                 (not (eq 0 (cdr tool-bar-lines)))))))
-
   (let ((old-scalable-fonts-allowed scalable-fonts-allowed)
        (old-face-ignored-fonts face-ignored-fonts))
 
@@ -1411,8 +1395,9 @@ If this is nil, no message will be displayed."
             `("GNU/Linux"
               ,(lambda (_button) (browse-url "http://www.gnu.org/gnu/linux-and-gnu.html"))
             "Browse http://www.gnu.org/gnu/linux-and-gnu.html")
-          `("GNU" ,(lambda (_button) (describe-gnu-project))
-          "Display info on the GNU project")))
+          `("GNU" ,(lambda (_button)
+                    (browse-url "http://www.gnu.org/gnu/thegnuproject.html"))
+           "Browse http://www.gnu.org/gnu/thegnuproject.html")))
      " operating system.\n\n"
      :face variable-pitch
      :link ("Emacs Tutorial" ,(lambda (_button) (help-with-tutorial)))
@@ -2441,10 +2426,7 @@ A fancy display is used on graphic displays, normal otherwise."
       ;; If there are no switches to process, we might as well
       ;; run this hook now, and there may be some need to do it
       ;; before doing any output.
-      (run-hooks 'emacs-startup-hook)
-      (and term-setup-hook
-          (run-hooks 'term-setup-hook))
-      (setq inhibit-startup-hooks t)
+      (run-hooks 'emacs-startup-hook 'term-setup-hook)
 
       ;; It's important to notice the user settings before we
       ;; display the startup message; otherwise, the settings
@@ -2456,10 +2438,9 @@ A fancy display is used on graphic displays, normal otherwise."
       ;; If there are no switches to process, we might as well
       ;; run this hook now, and there may be some need to do it
       ;; before doing any output.
-      (when window-setup-hook
-       (run-hooks 'window-setup-hook)
-       ;; Don't let the hook be run twice.
-       (setq window-setup-hook nil))
+      (run-hooks 'window-setup-hook)
+
+      (setq inhibit-startup-hooks t)
 
       ;; ;; Do this now to avoid an annoying delay if the user
       ;; ;; clicks the menu bar during the sit-for.
index ac0e130b4e087d0e712d1cf3733f3156caf9e4fa..9accb9d36c51a57c8c124a15f9a9a801f580a523 100644 (file)
@@ -265,7 +265,9 @@ information about the function or macro; these go into effect
 during the evaluation of the `defun' or `defmacro' form.
 
 The possible values of SPECS are specified by
-`defun-declarations-alist' and `macro-declarations-alist'."
+`defun-declarations-alist' and `macro-declarations-alist'.
+
+For more information, see info node `(elisp)Declare Form'."
   ;; FIXME: edebug spec should pay attention to defun-declarations-alist.
   nil)
 
@@ -332,6 +334,7 @@ Any list whose car is `frame-configuration' is assumed to be a frame
 configuration."
   (and (consp object)
        (eq (car object) 'frame-configuration)))
+
 \f
 ;;;; List functions.
 
@@ -380,6 +383,13 @@ If N is omitted or nil, remove the last element."
           (if (> n 0) (setcdr (nthcdr (- (1- m) n) list) nil))
           list))))
 
+(defun zerop (number)
+  "Return t if NUMBER is zero."
+  ;; Used to be in C, but it's pointless since (= 0 n) is faster anyway because
+  ;; = has a byte-code.
+  (declare (compiler-macro (lambda (_) `(= 0 ,number))))
+  (= 0 number))
+
 (defun delete-dups (list)
   "Destructively remove `equal' duplicates from LIST.
 Store the result in LIST and return it.  LIST must be a proper list.
@@ -2006,7 +2016,7 @@ If optional CONFIRM is non-nil, read the password twice to make sure.
 Optional DEFAULT is a default password to use instead of empty input.
 
 This function echoes `.' for each character that the user types.
-Note that in batch mode, the input is not hidden!
+You could let-bind `read-hide-char' to another hiding character, though.
 
 Once the caller uses the password, it can erase the password
 by doing (clear-string STRING)."
@@ -2031,7 +2041,7 @@ by doing (clear-string STRING)."
                                      beg)))
              (dotimes (i (- end beg))
                (put-text-property (+ i beg) (+ 1 i beg)
-                                  'display (string ?.)))))
+                                  'display (string (or read-hide-char ?.))))))
           minibuf)
       (minibuffer-with-setup-hook
           (lambda ()
@@ -2045,12 +2055,9 @@ by doing (clear-string STRING)."
            (setq-local show-paren-mode nil)            ;bug#16091.
             (add-hook 'after-change-functions hide-chars-fun nil 'local))
         (unwind-protect
-            (let ((enable-recursive-minibuffers t))
-              (read-string
-               (if noninteractive
-                   (format "%s[INPUT WILL NOT BE HIDDEN!] " prompt) ; bug#17839
-                 prompt)
-               nil t default)) ; t = "no history"
+            (let ((enable-recursive-minibuffers t)
+                 (read-hide-char (or read-hide-char ?.)))
+              (read-string prompt nil t default)) ; t = "no history"
           (when (buffer-live-p minibuf)
             (with-current-buffer minibuf
               ;; Not sure why but it seems that there might be cases where the
@@ -2185,12 +2192,16 @@ floating point support."
                   (read-event nil t seconds))))
       (or (null read)
          (progn
-           ;; If last command was a prefix arg, e.g. C-u, push this event onto
-           ;; unread-command-events as (t . EVENT) so it will be added to
-           ;; this-command-keys by read-key-sequence.
-           (if (eq overriding-terminal-local-map universal-argument-map)
-               (setq read (cons t read)))
-           (push read unread-command-events)
+            ;; https://lists.gnu.org/archive/html/emacs-devel/2006-10/msg00394.html
+            ;; We want `read' appear in the next command's this-command-event
+            ;; but not in the current one.
+            ;; By pushing (cons t read), we indicate that `read' has not
+            ;; yet been recorded in this-command-keys, so it will be recorded
+            ;; next time it's read.
+            ;; And indeed the `seconds' argument to read-event correctly
+            ;; prevented recording this event in the current command's
+            ;; this-command-keys.
+           (push (cons t read) unread-command-events)
            nil))))))
 
 ;; Behind display-popup-menus-p test.
@@ -2697,14 +2708,6 @@ computing the hash.  If BINARY is non-nil, return a string in binary
 form."
   (secure-hash 'sha1 object start end binary))
 
-(defalias 'function-put #'put
-  ;; This is only really used in Emacs>24.4, but we add it to 24.4 already, so
-  ;; as to ease the pain when people use future autoload files that contain
-  ;; function-put.
-  "Set function F's property PROP to VALUE.
-The namespace for PROP is shared with symbols.
-So far, F can only be a symbol, not a lambda expression.")
-
 (defun function-get (f prop &optional autoload)
   "Return the value of property PROP of function F.
 If AUTOLOAD is non-nil and F is autoloaded, try to autoload it
@@ -3194,12 +3197,7 @@ not really affect the buffer's content."
     `(let* ((,modified (buffer-modified-p))
             (buffer-undo-list t)
             (inhibit-read-only t)
-            (inhibit-modification-hooks t)
-            deactivate-mark
-            ;; Avoid setting and removing file locks and checking
-            ;; buffer's uptodate-ness w.r.t the underlying file.
-            buffer-file-name
-            buffer-file-truename)
+            (inhibit-modification-hooks t))
        (unwind-protect
            (progn
              ,@body)
@@ -3317,6 +3315,19 @@ The value returned is the value of the last form in BODY."
                  ,@body)
         (with-current-buffer ,old-buffer
           (set-case-table ,old-case-table))))))
+
+(defmacro with-file-modes (modes &rest body)
+  "Execute BODY with default file permissions temporarily set to MODES.
+MODES is as for `set-default-file-modes'."
+  (declare (indent 1) (debug t))
+  (let ((umask (make-symbol "umask")))
+    `(let ((,umask (default-file-modes)))
+       (unwind-protect
+           (progn
+             (set-default-file-modes ,modes)
+             ,@body)
+         (set-default-file-modes ,umask)))))
+
 \f
 ;;; Matching and match data.
 
@@ -3668,12 +3679,14 @@ and replace a sub-expression, e.g.
       (setq matches (cons (substring string start l) matches)) ; leftover
       (apply #'concat (nreverse matches)))))
 \f
-(defun string-prefix-p (str1 str2 &optional ignore-case)
-  "Return non-nil if STR1 is a prefix of STR2.
+(defun string-prefix-p (prefix string &optional ignore-case)
+  "Return non-nil if PREFIX is a prefix of STRING.
 If IGNORE-CASE is non-nil, the comparison is done without paying attention
 to case differences."
-  (eq t (compare-strings str1 nil nil
-                         str2 0 (length str1) ignore-case)))
+  (let ((prefix-length (length prefix)))
+    (if (> prefix-length (length string)) nil
+      (eq t (compare-strings prefix 0 prefix-length string
+                            0 prefix-length ignore-case)))))
 
 (defun string-suffix-p (suffix string  &optional ignore-case)
   "Return non-nil if SUFFIX is a suffix of STRING.
@@ -3857,7 +3870,8 @@ This function is called directly from the C code."
            (byte-compile-log-warning msg))
        (run-with-timer 0 nil
                        (lambda (msg)
-                         (message "%s" msg)) msg))))
+                         (message "%s" msg))
+                        msg))))
 
   ;; Finally, run any other hook.
   (run-hook-with-args 'after-load-functions abs-file))
@@ -4174,7 +4188,8 @@ I is the index of the frame after FRAME2.  It should return nil
 if those frames don't seem special and otherwise, it should return
 the number of frames to skip (minus 1).")
 
-(defconst internal--call-interactively (symbol-function 'call-interactively))
+(defconst internal--funcall-interactively
+  (symbol-function 'funcall-interactively))
 
 (defun called-interactively-p (&optional kind)
   "Return t if the containing function was called by `call-interactively'.
@@ -4248,10 +4263,13 @@ command is called from a keyboard macro?"
       (pcase (cons frame nextframe)
         ;; No subr calls `interactive-p', so we can rule that out.
         (`((,_ ,(pred (lambda (f) (subrp (indirect-function f)))) . ,_) . ,_) nil)
-        ;; In case #<subr call-interactively> without going through the
-        ;; `call-interactively' symbol (bug#3984).
-        (`(,_ . (t ,(pred (eq internal--call-interactively)) . ,_)) t)
-        (`(,_ . (t call-interactively . ,_)) t)))))
+        ;; In case #<subr funcall-interactively> without going through the
+        ;; `funcall-interactively' symbol (bug#3984).
+        (`(,_ . (t ,(pred (lambda (f)
+                            (eq internal--funcall-interactively
+                                (indirect-function f))))
+                   . ,_))
+         t)))))
 
 (defun interactive-p ()
   "Return t if the containing function was run directly by user input.
@@ -4312,6 +4330,7 @@ lookup sequence then continues."
     ;; Don't use letrec, because equal (in add/remove-hook) would get trapped
     ;; in a cycle.
     (fset clearfun
+          (suspicious-object
           (lambda ()
             (with-demoted-errors "set-transient-map PCH: %S"
               (unless (cond
@@ -4334,7 +4353,11 @@ lookup sequence then continues."
                        (t (funcall keep-pred)))
                 (internal-pop-keymap map 'overriding-terminal-local-map)
                 (remove-hook 'pre-command-hook clearfun)
-                (when on-exit (funcall on-exit))))))
+                 (when on-exit (funcall on-exit))
+                 ;; Comment out the fset if you want to debug the GC bug.
+;;;            (fset clearfun nil)
+;;;             (set clearfun nil)
+                 )))))
     (add-hook 'pre-command-hook clearfun)
     (internal-push-keymap map 'overriding-terminal-local-map)))
 
index ce6125e27900817418170e95a4aede760f16f330..825a202c04643f955516db6a1eb372508b694e2a 100644 (file)
 ;;  full advantage of this package
 ;;
 ;;  (add-hook 'term-mode-hook
-;;               (function
-;;                (lambda ()
-;;                      (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *")
-;;                      (make-local-variable 'mouse-yank-at-point)
-;;                      (make-local-variable 'transient-mark-mode)
-;;                      (setq mouse-yank-at-point t)
-;;                      (setq transient-mark-mode nil)
-;;                      (auto-fill-mode -1)
-;;                      (setq tab-width 8 ))))
+;;           (function
+;;            (lambda ()
+;;                  (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *")
+;;                  (setq-local mouse-yank-at-point t)
+;;                  (setq-local transient-mark-mode nil)
+;;                  (auto-fill-mode -1)
+;;                  (setq tab-width 8 ))))
 ;;
 ;;
 ;;             ----------------------------------------
@@ -3632,7 +3630,7 @@ all pending output has been dealt with."))
            (if (< down 0) term-scroll-start term-scroll-end))))
     (when (or (and (< down 0) (< scroll-needed 0))
              (and (> down 0) (> scroll-needed 0)))
-      (let ((save-point (copy-marker (point))) (save-top))
+      (let ((save-point (point-marker)) (save-top))
        (goto-char term-home-marker)
        (cond (term-scroll-with-delete
               (if (< down 0)
index 9750da15c720abd2fcce8e5d8174c803ed490858..dc6899e3835fbddb84b20eba24a4cfb409903eb5 100644 (file)
@@ -22,8 +22,6 @@
 
 ;;; Commentary:
 
-;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
-
 ;;; Code:
 
 (defun terminal-init-AT386 ()
index b8756c3873d8f1204f78381cfbeb58b5ecd2111a..b523063c0fd4bcc372076fc22968082c3d7f1c74 100644 (file)
@@ -5,9 +5,11 @@ See the end of the file for license conditions.
    This directory contains files of elisp that customize Emacs for certain
 terminal types.
 
-   When Emacs opens a new terminal, it checks the TERM environment variable to
-see what type of terminal the user is running on, searches for an elisp file
-named "term/${TERM}.el", and if one exists, loads it.  If Emacs finds no
+   When Emacs opens a new terminal, it checks the TERM environment variable
+to see what type of terminal the user is running on.  (If there is an entry
+for TERM in the `term-file-aliases' variable, Emacs uses the associated value
+in place of TERM in the following.)  Emacs searches for an elisp file named
+"term/${TERM}.el", and if one exists, loads it.  If Emacs finds no
 suitable file, then it strips the last hyphen and what follows it from TERM,
 and tries again.  If that still doesn't yield a file, then the previous hyphen
 is stripped, and so on until all hyphens are gone.  For example, if the
diff --git a/lisp/term/apollo.el b/lisp/term/apollo.el
deleted file mode 100644 (file)
index e4cabac..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-(defun terminal-init-apollo ()
-  "Terminal initialization function for apollo."
-  (tty-run-terminal-initialization (selected-frame) "vt100"))
-
-;;; apollo.el ends here
index a58ff76aefee9785b8b658115cca786c96aff726..a1e459a1261ed21ccbe38d72a5c801103343e6e7 100644 (file)
@@ -22,8 +22,6 @@
 
 ;;; Commentary:
 
-;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
-
 ;;; Code:
 
 (defun terminal-init-news ()
index d37a695086ad1d717d2b3112dfb119a689abde34..69ddda80983c93969a1510e505b7d68750880d08 100644 (file)
@@ -1,12 +1,9 @@
-;; Treat a screen terminal similar to an xterm.
-(load "term/xterm")
-
-(declare-function xterm-register-default-colors "xterm" ())
+;;; screen.el --- terminal initialization for screen and tmux  -*- lexical-binding: t -*-
+;; Copyright (C) 1995, 2001-2014 Free Software Foundation, Inc.
 
 (defun terminal-init-screen ()
   "Terminal initialization function for screen."
-  ;; Use the xterm color initialization code.
-  (xterm-register-default-colors)
-  (tty-set-up-initial-frame-faces))
+  ;; Treat a screen terminal similar to an xterm.
+  (tty-run-terminal-initialization (selected-frame) "xterm"))
 
 ;; screen.el ends here
index 841d88d4e19da8e2083b77600fba6283fc07b1d9..3b77ab4640048ca5fbecb39a8f45c2a305542d59 100644 (file)
@@ -23,8 +23,6 @@
 
 ;;; Commentary:
 
-;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
-
 ;;; Code:
 
 (defvar tvi970-terminal-map
index 19e64d2bd90a1c52ece13fbe729064324b402124..6761e83891e17462ac41074ce2bd5e5e480954db 100644 (file)
@@ -22,8 +22,6 @@
 
 ;;; Commentary:
 
-;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
-
 ;; Handles all VT100 clones, including the Apollo terminal.  Also handles
 ;; the VT200 --- its PF- and arrow- keys are different, but all those
 ;; are really set up by the terminal initialization code, which mines them
diff --git a/lisp/term/vt102.el b/lisp/term/vt102.el
deleted file mode 100644 (file)
index 261b0bb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-(defun terminal-init-vt102 ()
-  "Terminal initialization function for vt102."
-  (tty-run-terminal-initialization (selected-frame) "vt100"))
-
-;;; vt102.el ends here
diff --git a/lisp/term/vt125.el b/lisp/term/vt125.el
deleted file mode 100644 (file)
index 2b2098d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-(defun terminal-init-vt125 ()
-  "Terminal initialization function for vt125."
-  (tty-run-terminal-initialization (selected-frame) "vt100"))
-
-;;; vt125.el ends here
diff --git a/lisp/term/vt201.el b/lisp/term/vt201.el
deleted file mode 100644 (file)
index a65b473..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-;; For our purposes we can treat the vt200 and vt100 almost alike.
-;; Most differences are handled by the termcap entry.
-(defun terminal-init-vt201 ()
-  "Terminal initialization function for vt201."
-  (tty-run-terminal-initialization (selected-frame) "vt100")
-  ;; Make F11 an escape key.
-  (define-key input-decode-map "\e[23~" [f11]) ;Probably redundant.
-  (define-key local-function-key-map [f11] [?\e]))
-
-;;; vt201.el ends here
diff --git a/lisp/term/vt220.el b/lisp/term/vt220.el
deleted file mode 100644 (file)
index 0dd4335..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-;; For our purposes we can treat the vt200 and vt100 almost alike.
-;; Most differences are handled by the termcap entry.
-(defun terminal-init-vt220 ()
-  "Terminal initialization function for vt220."
-  (tty-run-terminal-initialization (selected-frame) "vt100")
-  ;; Make F11 an escape key.
-  (define-key input-decode-map "\e[23~" [f11]) ;Probably redundant.
-  (define-key local-function-key-map [f11] [?\e]))
-
-;;; vt220.el ends here
diff --git a/lisp/term/vt240.el b/lisp/term/vt240.el
deleted file mode 100644 (file)
index b58d421..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-;; For our purposes we can treat the vt200 and vt100 almost alike.
-;; Most differences are handled by the termcap entry.
-(defun terminal-init-vt240 ()
-  "Terminal initialization function for vt240."
-  (tty-run-terminal-initialization (selected-frame) "vt100")
-  ;; Make F11 an escape key.
-  (define-key input-decode-map "\e[23~" [f11]) ;Probably redundant.
-  (define-key local-function-key-map [f11] [?\e]))
-
-;;; vt240.el ends here
diff --git a/lisp/term/vt300.el b/lisp/term/vt300.el
deleted file mode 100644 (file)
index a266455..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-(defun terminal-init-vt300 ()
-  "Terminal initialization function for vt300."
-  (tty-run-terminal-initialization (selected-frame) "vt100")
-  ;; Make F11 an escape key.
-  (define-key input-decode-map "\e[23~" [f11]) ;Probably redundant.
-  (define-key local-function-key-map [f11] [?\e]))
-
-;;; vt300.el ends here
diff --git a/lisp/term/vt320.el b/lisp/term/vt320.el
deleted file mode 100644 (file)
index 08ed9a8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-(defun terminal-init-vt320 ()
-  "Terminal initialization function for vt320."
-  (tty-run-terminal-initialization (selected-frame) "vt100")
-  ;; Make F11 an escape key.
-  (define-key input-decode-map "\e[23~" [f11]) ;Probably redundant.
-  (define-key local-function-key-map [f11] [?\e]))
-
-;;; vt320.el ends here
diff --git a/lisp/term/vt400.el b/lisp/term/vt400.el
deleted file mode 100644 (file)
index ad4a5fd..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-(defun terminal-init-vt400 ()
-  "Terminal initialization function for vt400."
-  (tty-run-terminal-initialization (selected-frame) "vt100")
-  ;; Make F11 an escape key.
-  (define-key input-decode-map "\e[23~" [f11]) ;Probably redundant.
-  (define-key local-function-key-map [f11] [?\e]))
-
-;;; vt400.el ends here
diff --git a/lisp/term/vt420.el b/lisp/term/vt420.el
deleted file mode 100644 (file)
index f6745a3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-(defun terminal-init-vt420 ()
-  "Terminal initialization function for vt420."
-  (tty-run-terminal-initialization (selected-frame) "vt100")
-  ;; Make F11 an escape key.
-  (define-key input-decode-map "\e[23~" [f11]) ;Probably redundant.
-  (define-key local-function-key-map [f11] [?\e]))
-
-;;; vt420.el ends here
index aa9ba43d3d79a859623030529670db55e374c09b..77c1655dfd1a526ed169e3aab9ffa119062b2cc3 100644 (file)
@@ -23,7 +23,6 @@
 
 ;;; Commentary:
 
-;; Uses the Emacs 19 terminal initialization features --- won't work with 18.
 ;; Rewritten for Emacs 19 by jimb,  January 1992
 ;; Cleaned up for new terminal package conventions by esr, March 1993
 ;; Should work well for Televideo TVI 925 although it's overkill.
index ba017e9938f75d08d8c1121b37be70e7648ab20e..1d085017214e6cbb2d4fe2cdd323fae7b80d98de 100644 (file)
@@ -43,10 +43,40 @@ The relevant features are:
   :type '(choice (const :tag "No" nil)
                  (const :tag "Check" check)
                  ;; NOTE: If you add entries here, make sure to update
-                 ;; `tocheck-capabilities' in `terminal-init-xterm' as well.
+                 ;; `terminal-init-xterm' as well.
                  (set (const :tag "modifyOtherKeys support" modifyOtherKeys)
                       (const :tag "report background" reportBackground))))
 
+(defconst xterm-paste-ending-sequence "\e[201~"
+  "Characters send by the terminal to end a bracketed paste.")
+
+(defun xterm-paste ()
+  "Handle the start of a terminal paste operation."
+  (interactive)
+  (let* ((end-marker-length (length xterm-paste-ending-sequence))
+         (pasted-text (with-temp-buffer
+                        (set-buffer-multibyte nil)
+                        (while (not (search-backward
+                                     xterm-paste-ending-sequence
+                                     (- (point) end-marker-length) t))
+                          (let ((event (read-event
+                                        nil nil
+                                        ;; Use finite timeout to avoid
+                                        ;; glomming the event onto
+                                        ;; this-command-keys.
+                                        most-positive-fixnum)))
+                            (when (eql event ?\r)
+                              (setf event ?\n))
+                            (insert event)))
+                        (let ((last-coding-system-used))
+                          (decode-coding-region
+                           (point-min) (point)
+                           (keyboard-coding-system) t))))
+         (interprogram-paste-function (lambda () pasted-text)))
+    (yank)))
+
+(define-key global-map [xterm-paste] #'xterm-paste)
+
 (defvar xterm-function-map
   (let ((map (make-sparse-keymap)))
 
@@ -248,6 +278,70 @@ The relevant features are:
     (define-key map "\eOx" [kp-8])
     (define-key map "\eOy" [kp-9])
 
+    (define-key map "\eO2j" [S-kp-multiply])
+    (define-key map "\eO2k" [S-kp-add])
+    (define-key map "\eO2l" [S-kp-separator])
+    (define-key map "\eO2m" [S-kp-subtract])
+    (define-key map "\eO2o" [S-kp-divide])
+    (define-key map "\eO2p" [S-kp-0])
+    (define-key map "\eO2q" [S-kp-1])
+    (define-key map "\eO2r" [S-kp-2])
+    (define-key map "\eO2s" [S-kp-3])
+    (define-key map "\eO2t" [S-kp-4])
+    (define-key map "\eO2u" [S-kp-5])
+    (define-key map "\eO2v" [S-kp-6])
+    (define-key map "\eO2w" [S-kp-7])
+    (define-key map "\eO2x" [S-kp-8])
+    (define-key map "\eO2y" [S-kp-9])
+
+    (define-key map "\eO4j" [M-S-kp-multiply])
+    (define-key map "\eO4k" [M-S-kp-add])
+    (define-key map "\eO4l" [M-S-kp-separator])
+    (define-key map "\eO4m" [M-S-kp-subtract])
+    (define-key map "\eO4o" [M-S-kp-divide])
+    (define-key map "\eO4p" [M-S-kp-0])
+    (define-key map "\eO4q" [M-S-kp-1])
+    (define-key map "\eO4r" [M-S-kp-2])
+    (define-key map "\eO4s" [M-S-kp-3])
+    (define-key map "\eO4t" [M-S-kp-4])
+    (define-key map "\eO4u" [M-S-kp-5])
+    (define-key map "\eO4v" [M-S-kp-6])
+    (define-key map "\eO4w" [M-S-kp-7])
+    (define-key map "\eO4x" [M-S-kp-8])
+    (define-key map "\eO4y" [M-S-kp-9])
+
+    (define-key map "\eO6j" [C-S-kp-multiply])
+    (define-key map "\eO6k" [C-S-kp-add])
+    (define-key map "\eO6l" [C-S-kp-separator])
+    (define-key map "\eO6m" [C-S-kp-subtract])
+    (define-key map "\eO6o" [C-S-kp-divide])
+    (define-key map "\eO6p" [C-S-kp-0])
+    (define-key map "\eO6q" [C-S-kp-1])
+    (define-key map "\eO6r" [C-S-kp-2])
+    (define-key map "\eO6s" [C-S-kp-3])
+    (define-key map "\eO6t" [C-S-kp-4])
+    (define-key map "\eO6u" [C-S-kp-5])
+    (define-key map "\eO6v" [C-S-kp-6])
+    (define-key map "\eO6w" [C-S-kp-7])
+    (define-key map "\eO6x" [C-S-kp-8])
+    (define-key map "\eO6y" [C-S-kp-9])
+
+    (define-key map "\eO8j" [C-M-S-kp-multiply])
+    (define-key map "\eO8k" [C-M-S-kp-add])
+    (define-key map "\eO8l" [C-M-S-kp-separator])
+    (define-key map "\eO8m" [C-M-S-kp-subtract])
+    (define-key map "\eO8o" [C-M-S-kp-divide])
+    (define-key map "\eO8p" [C-M-S-kp-0])
+    (define-key map "\eO8q" [C-M-S-kp-1])
+    (define-key map "\eO8r" [C-M-S-kp-2])
+    (define-key map "\eO8s" [C-M-S-kp-3])
+    (define-key map "\eO8t" [C-M-S-kp-4])
+    (define-key map "\eO8u" [C-M-S-kp-5])
+    (define-key map "\eO8v" [C-M-S-kp-6])
+    (define-key map "\eO8w" [C-M-S-kp-7])
+    (define-key map "\eO8x" [C-M-S-kp-8])
+    (define-key map "\eO8y" [C-M-S-kp-9])
+
     ;; These keys are available in xterm starting from version 216
     ;; if the modifyOtherKeys resource is set to 1.
     (dolist (bind '((5 9   [C-tab])
@@ -394,6 +488,11 @@ The relevant features are:
     (define-key map "\e[12~" [f2])
     (define-key map "\e[13~" [f3])
     (define-key map "\e[14~" [f4])
+
+    ;; Recognize the start of a bracketed paste sequence.  The handler
+    ;; internally recognizes the end.
+    (define-key map "\e[200~" [xterm-paste])
+    
     map)
   "Function key map overrides for xterm.")
 
@@ -463,9 +562,6 @@ The relevant features are:
     map)
   "Keymap of possible alternative meanings for some keys.")
 
-;; List of terminals for which modify-other-keys has been turned on.
-(defvar xterm-modify-other-keys-terminal-list nil)
-
 (defun xterm--report-background-handler ()
   (let ((str "")
         chr)
@@ -605,21 +701,23 @@ We run the first FUNCTION whose STRING matches the input events."
     (when (memq 'modifyOtherKeys xterm-extra-capabilities)
       (terminal-init-xterm-modify-other-keys)))
 
+  ;; Unconditionally enable bracketed paste mode: terminals that don't
+  ;; support it just ignore the sequence.
+  (terminal-init-xterm-bracketed-paste-mode)
+
   (run-hooks 'terminal-init-xterm-hook))
 
 (defun terminal-init-xterm-modify-other-keys ()
   "Terminal initialization for xterm's modifyOtherKeys support."
-  ;; Make sure that the modifyOtherKeys state is restored when
-  ;; suspending, resuming and exiting.
-  (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys)
-  (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys)
-  (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys)
-  (add-hook 'delete-terminal-functions 'xterm-remove-modify-other-keys)
-  ;; Add the selected frame to the list of frames that
-  ;; need to deal with modify-other-keys.
-  (push (frame-terminal)
-      xterm-modify-other-keys-terminal-list)
-  (xterm-turn-on-modify-other-keys))
+  (send-string-to-terminal "\e[>4;1m")
+  (push "\e[>4m" (terminal-parameter nil 'tty-mode-reset-strings))
+  (push "\e[>4;1m" (terminal-parameter nil 'tty-mode-set-strings)))
+
+(defun terminal-init-xterm-bracketed-paste-mode ()
+  "Terminal initialization for bracketed paste mode."
+  (send-string-to-terminal "\e[?2004h")
+  (push "\e[?2004l" (terminal-parameter nil 'tty-mode-reset-strings))
+  (push "\e[?2004h" (terminal-parameter nil 'tty-mode-set-strings)))
 
 ;; Set up colors, for those versions of xterm that support it.
 (defvar xterm-standard-colors
@@ -737,29 +835,6 @@ versions of xterm."
     ;; right colors, so clear them.
     (clear-face-cache)))
 
-(defun xterm-turn-on-modify-other-keys ()
-  "Turn the modifyOtherKeys feature of xterm back on."
-  (let ((terminal (frame-terminal)))
-    (when (and (terminal-live-p terminal)
-              (memq terminal xterm-modify-other-keys-terminal-list))
-      (send-string-to-terminal "\e[>4;1m" terminal))))
-
-(defun xterm-turn-off-modify-other-keys (&optional frame)
-  "Temporarily turn off the modifyOtherKeys feature of xterm."
-  (let ((terminal (when frame (frame-terminal frame))))
-    (when (and (terminal-live-p terminal)
-               (memq terminal xterm-modify-other-keys-terminal-list))
-      (send-string-to-terminal "\e[>4m" terminal))))
-
-(defun xterm-remove-modify-other-keys (&optional terminal)
-  "Turn off the modifyOtherKeys feature of xterm for good."
-  (setq terminal (or terminal (frame-terminal)))
-  (when (and (terminal-live-p terminal)
-            (memq terminal xterm-modify-other-keys-terminal-list))
-    (setq xterm-modify-other-keys-terminal-list
-         (delq terminal xterm-modify-other-keys-terminal-list))
-    (send-string-to-terminal "\e[>4m" terminal)))
-
 (defun xterm-maybe-set-dark-background-mode (redc greenc bluec)
   ;; Use the heuristic in `frame-set-background-mode' to decide if a
   ;; frame is dark.
index 8a99ff2926dda2b20e1dcaaffe1385c59b78bf54..3209980c015f31466e18deb7a9d1358c617500f1 100644 (file)
@@ -4840,7 +4840,7 @@ If optional arg MOVE is non-nil move point to end of field."
 If optional prefix JUSTIFY is non-nil justify as well.
 In BibTeX mode this function is bound to `fill-paragraph-function'."
   (interactive "*P")
-  (let ((pnt (copy-marker (point)))
+  (let ((pnt (point-marker))
         (bounds (bibtex-enclosing-field t)))
     (bibtex-fill-field-bounds bounds justify)
     (goto-char pnt)))
@@ -4852,7 +4852,7 @@ names appear in column `bibtex-field-indentation', field text starts in
 column `bibtex-text-indentation' and continuation lines start here, too.
 If `bibtex-align-at-equal-sign' is non-nil, align equal signs, too."
   (interactive "*")
-  (let ((pnt (copy-marker (point)))
+  (let ((pnt (point-marker))
         (beg (bibtex-beginning-of-entry)) ; move point
         bounds)
     (bibtex-delete-whitespace)
index 7a5bc8afeea4c95420a1c91d728cd1b38ab4c127..05e593ea70fe731c846c9591313e66e1c466b2a2 100644 (file)
@@ -311,8 +311,7 @@ unbalanced, but hey...)"
     (when (or (not arg) (= (prefix-numeric-value arg) 2))
       (modify-syntax-entry ?\" "." table))
     (set-syntax-table table)
-    (when font-lock-mode
-      (font-lock-fontify-buffer))))
+    (font-lock-flush)))
 
 
 (defun conf-outline-level ()
index 5cdae22cc0fc8070108bb2c158f48ce49c50517e..0fc6b4a9995a1daca9886e869540c0690da53536 100644 (file)
@@ -931,16 +931,14 @@ Otherwise returns the library directory name, if that is defined."
 (defun ispell-call-process (&rest args)
   "Like `call-process' but defend against bad `default-directory'."
   (let ((default-directory default-directory))
-    (unless (and (file-directory-p default-directory)
-                (file-readable-p default-directory))
+    (unless (file-accessible-directory-p default-directory)
       (setq default-directory (expand-file-name "~/")))
     (apply 'call-process args)))
 
 (defun ispell-call-process-region (&rest args)
   "Like `call-process-region' but defend against bad `default-directory'."
   (let ((default-directory default-directory))
-    (unless (and (file-directory-p default-directory)
-                (file-readable-p default-directory))
+    (unless (file-accessible-directory-p default-directory)
       (setq default-directory (expand-file-name "~/")))
     (apply 'call-process-region args)))
 
@@ -2939,8 +2937,7 @@ Keeps argument list for future Ispell invocations for no async support."
          (ispell-hunspell-fill-dictionary-entry ispell-current-dictionary)))
 
   (let* ((default-directory
-           (if (and (file-directory-p default-directory)
-                    (file-readable-p default-directory))
+           (if (file-accessible-directory-p default-directory)
                default-directory
              ;; Defend against bad `default-directory'.
              (expand-file-name "~/")))
@@ -2998,8 +2995,7 @@ Keeps argument list for future Ispell invocations for no async support."
           (if (or ispell-really-aspell
                   ispell-really-hunspell
                   ;; Protect against bad default-directory
-                  (not (and (file-directory-p default-directory)
-                            (file-readable-p default-directory)))
+                  (not (file-accessible-directory-p default-directory))
                   ;; Ispell and per-dir personal dicts available
                   (not (or (file-readable-p (concat default-directory
                                                     ".ispell_words"))
index ce69a64f4c0b5a8e183238b86415684aebe88704..2d7093ce81d9e60cfb02f7ee75e838c6fcc8aff7 100644 (file)
@@ -47,6 +47,7 @@
       (and (listp reftex-plug-into-AUCTeX)
            (nth which reftex-plug-into-AUCTeX))))
 
+;;;###autoload
 (defun reftex-arg-label (optional &optional prompt definition)
   "Use `reftex-label', `reftex-reference' or AUCTeX's code to insert label arg.
 What is being used depends upon `reftex-plug-into-AUCTeX'."
@@ -68,6 +69,7 @@ What is being used depends upon `reftex-plug-into-AUCTeX'."
         (LaTeX-add-labels label))
     (TeX-argument-insert label optional)))
 
+;;;###autoload
 (defun reftex-arg-cite (optional &optional prompt definition)
   "Use `reftex-citation' or AUCTeX's code to insert a cite-key macro argument.
 What is being used depends upon `reftex-plug-into-AUCTeX'."
@@ -85,6 +87,7 @@ What is being used depends upon `reftex-plug-into-AUCTeX'."
                         optional)))
 
 
+;;;###autoload
 (defun reftex-arg-index-tag (optional &optional prompt &rest args)
   "Prompt for an index tag with completion.
 This is the name of an index, not the entry."
@@ -104,6 +107,7 @@ This is the name of an index, not the entry."
       (setq tag (read-string prompt)))
     (TeX-argument-insert tag optional)))
 
+;;;###autoload
 (defun reftex-arg-index (optional &optional prompt &rest args)
   "Prompt for an index entry completing with known entries.
 Completion is specific for just one index, if the macro or a tag
@@ -138,6 +142,7 @@ argument identify one of multiple indices."
        (t "idx")))))
 
 (defvar LaTeX-label-function)
+;;;###autoload
 (defun reftex-plug-into-AUCTeX ()
   ;; Replace AUCTeX functions with RefTeX functions.
   ;; Which functions are replaced is controlled by the variable
@@ -162,6 +167,7 @@ argument identify one of multiple indices."
        (fboundp 'TeX-arg-index)
        (fset 'TeX-arg-index 'reftex-arg-index)))
 
+;;;###autoload
 (defun reftex-toggle-plug-into-AUCTeX ()
   "Toggle Interface between AUCTeX and RefTeX on and off."
   (interactive)
@@ -173,6 +179,7 @@ argument identify one of multiple indices."
       (message "RefTeX has been plugged into AUCTeX.")
     (message "RefTeX no longer interacts with AUCTeX.")))
 
+;;;###autoload
 (defun reftex-add-label-environments (entry-list)
   "Add label environment descriptions to `reftex-label-alist-style'.
 The format of ENTRY-LIST is exactly like `reftex-label-alist'.  See there
@@ -197,8 +204,10 @@ the label information is recompiled on next use."
           (push entry list)))
       (when changed
         (put reftex-docstruct-symbol 'reftex-label-alist-style list)))))
+;;;###autoload
 (defalias 'reftex-add-to-label-alist 'reftex-add-label-environments)
 
+;;;###autoload
 (defun reftex-add-section-levels (entry-list)
   "Add entries to the value of `reftex-section-levels'.
 The added values are kept local to the current document.  The format
@@ -219,9 +228,14 @@ of ENTRY-LIST is a list of cons cells (\"MACRONAME\" . LEVEL).  See
       (when changed
         (put reftex-docstruct-symbol 'reftex-section-levels list)))))
 
+;;;###autoload
 (defun reftex-notice-new-section ()
   (reftex-notice-new 1 'force))
 
 (provide 'reftex-auc)
 
 ;;; reftex-auc.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index a36fa17fca5ae3407b198c57022338ea02335b73..8ac0b0b360636d77d58074d6fab9266f7171f38c 100644 (file)
@@ -58,6 +58,7 @@
            ,@body)
        (set-syntax-table saved-syntax))))
 
+;;;###autoload
 (defun reftex-default-bibliography ()
   "Return the expanded value of variable `reftex-default-bibliography'.
 The expanded value is cached."
@@ -70,6 +71,7 @@ The expanded value is cached."
          reftex-default-bibliography))
   (get 'reftex-default-bibliography :reftex-expanded))
 
+;;;###autoload
 (defun reftex-bib-or-thebib ()
   "Test if BibTeX or \begin{thebibliography} should be used for the citation.
 Find the bof of the current file"
@@ -89,6 +91,7 @@ Find the bof of the current file"
         (if bib 'bib nil)
       (if thebib 'thebib nil))))
 
+;;;###autoload
 (defun reftex-get-bibfile-list ()
   "Return list of bibfiles for current document.
 When using the chapterbib or bibunits package you should either
@@ -112,6 +115,7 @@ Then this function will return the applicable database files."
    (error "\\bibliography statement missing or .bib files not found")))
 
 ;;; Find a certain reference in any of the BibTeX files.
+;;;###autoload
 (defun reftex-pop-to-bibtex-entry (key file-list &optional mark-to-kill
                                        highlight item return)
   "Find BibTeX KEY in any file in FILE-LIST in another window.
@@ -161,6 +165,7 @@ If RETURN is non-nil, just return the entry and restore point."
           (error "No \\bibitem with citation key %s" key)
         (error "No BibTeX entry with citation key %s" key)))))
 
+;;;###autoload
 (defun reftex-end-of-bib-entry (item)
   (save-excursion
     (condition-case nil
@@ -452,6 +457,7 @@ If FIELD is empty try \"editor\" field."
       (setq names (replace-match " " nil t names)))
     (split-string names "\n")))
 
+;;;###autoload
 (defun reftex-parse-bibtex-entry (entry &optional from to raw)
   "Parse BibTeX ENTRY.
 If ENTRY is nil then parse the entry in current buffer between FROM and TO.
@@ -604,6 +610,7 @@ If FORMAT is non-nil `format' entry accordingly."
 
 ;;; Make a citation
 
+;; NB this is a global autoload - see reftex.el.
 ;;;###autoload
 (defun reftex-citation (&optional no-insert format-key)
   "Make a citation using BibTeX database files.
@@ -787,11 +794,13 @@ in order to only add another reference in the same cite command."
           (error "No citation format associated with key `%c'" key)))))
     format))
 
+;;;###autoload
 (defun reftex-citep ()
   "Call `reftex-citation' with a format selector `?p'."
   (interactive)
   (reftex-citation nil ?p))
 
+;;;###autoload
 (defun reftex-citet ()
   "Call `reftex-citation' with a format selector `?t'."
   (interactive)
@@ -1058,6 +1067,7 @@ in order to only add another reference in the same cite command."
     (setq format (replace-match "" t t format)))
   format)
 
+;;;###autoload
 (defun reftex-make-cite-echo-string (entry docstruct-symbol)
   "Format a bibtex ENTRY for the echo area and cache the result."
   (let* ((key (reftex-get-bib-field "&key" entry))
@@ -1151,6 +1161,7 @@ recommended for follow mode.  It works OK for individual lookups."
                                                (string-match "^&" (car pair)))
                                              alist))))
 
+;;;###autoload
 (defun reftex-create-bibtex-file (bibfile)
   "Create a new BibTeX database BIBFILE with all entries referenced in document.
 The command prompts for a filename and writes the collected
@@ -1244,3 +1255,7 @@ created files in the variables `reftex-create-bibtex-header' or
 
 (provide 'reftex-cite)
 ;;; reftex-cite.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index dc7448cc993b3df3a427d91574d5eabab25dbf1a..a06492e475905cc21ba124c6267249586bac6dda 100644 (file)
@@ -30,6 +30,7 @@
 
 (require 'reftex)
 
+;;;###autoload
 (defun reftex-view-crossref (&optional arg auto-how fail-quietly)
   "View cross reference of macro at point.  Point must be on the KEY
 argument.  When at a `\\ref' macro, show corresponding `\\label'
@@ -220,6 +221,7 @@ to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'."
       (when (equal arg 2)
         (select-window pop-win)))))
 
+;;;###autoload
 (defun reftex-mouse-view-crossref (ev)
   "View cross reference of \\ref or \\cite macro where you click.
 If the macro at point is a \\ref, show the corresponding label definition.
@@ -318,6 +320,7 @@ With argument, actually select the window showing the cross reference."
   "Non-nil means use the idle timers in XEmacs for crossref display.
 Currently, idle timer restart is broken and we use the post-command-hook.")
 
+;;;###autoload
 (defun reftex-toggle-auto-view-crossref ()
   "Toggle the automatic display of crossref information in the echo area.
 When active, leaving point idle in the argument of a \\ref or \\cite macro
@@ -355,6 +358,7 @@ will display info in the echo area."
                             'reftex-view-crossref-when-idle
                             reftex-idle-time nil t))))
 
+;;;###autoload
 (defun reftex-view-crossref-from-bibtex (&optional arg)
   "View location in a LaTeX document which cites the BibTeX entry at point.
 Since BibTeX files can be used by many LaTeX documents, this function
@@ -482,3 +486,7 @@ Calling this function several times find successive citation locations."
 (provide 'reftex-dcr)
 
 ;;; reftex-dcr.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index 4311c99923eb47a553f92752f74f7928068be916..e16792ee703162fbf2f4e3a7100e026ca503517d 100644 (file)
@@ -29,6 +29,7 @@
 (require 'reftex)
 ;;;
 
+;;;###autoload
 (defun reftex-create-tags-file ()
   "Create TAGS file by running `etags' on the current document.
 The TAGS file is also immediately visited with `visit-tags-table'."
@@ -48,6 +49,7 @@ The TAGS file is also immediately visited with `visit-tags-table'."
 (defvar reftex-grep-command "grep -n "
   "Last grep command used in \\[reftex-grep-document]; default for next grep.")
 
+;;;###autoload
 (defun reftex-grep-document (grep-cmd)
   "Run grep query through all files related to this document.
 With prefix arg, force to rescan document.
@@ -64,6 +66,7 @@ No active TAGS table is required."
                   (mapconcat 'identity files " "))))
     (grep cmd)))
 
+;;;###autoload
 (defun reftex-search-document (&optional regexp)
   "Regexp search through all files of the current document.
 Starts always in the master file.  Stops when a match is found.
@@ -79,6 +82,7 @@ No active TAGS table is required."
     (reftex-access-scan-info current-prefix-arg)
     (tags-search regexp (list 'reftex-all-document-files))))
 
+;;;###autoload
 (defun reftex-query-replace-document (&optional from to delimited)
   "Do `query-replace-regexp' of FROM with TO over the entire document.
 Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
@@ -100,6 +104,7 @@ No active TAGS table is required."
 (defvar TeX-master)
 (defvar isearch-next-buffer-function)
 
+;;;###autoload
 (defun reftex-find-duplicate-labels ()
   "Produce a list of all duplicate labels in the document."
 
@@ -158,6 +163,7 @@ No active TAGS table is required."
       (delete-window)
       (message "Document does not contain duplicate labels."))))
 
+;;;###autoload
 (defun reftex-change-label (&optional from to)
   "Run `query-replace-regexp' of FROM with TO in all macro arguments.
 Works on the entire multifile document.
@@ -177,6 +183,7 @@ No active TAGS table is required."
      (concat "{" (regexp-quote from) "}")
      (format "{%s}" to))))
 
+;;;###autoload
 (defun reftex-renumber-simple-labels ()
   "Renumber all simple labels in the document to make them sequentially.
 Simple labels are the ones created by RefTeX, consisting only of the
@@ -304,6 +311,7 @@ one with the `xr' package."
                  (t nil))))))))
     n))
 
+;;;###autoload
 (defun reftex-save-all-document-buffers ()
   "Save all documents associated with the current document.
 The function is useful after a global action like replacing or renumbering
@@ -414,6 +422,7 @@ Also checks if buffers visiting the files are in read-only mode."
       (when flist
        (find-file-noselect (car flist))))))
 
+;; NB this is a global autoload - see reftex.el.
 ;;;###autoload
 (defun reftex-isearch-minor-mode (&optional arg)
   "When on, isearch searches the whole document, not only the current file.
@@ -466,3 +475,7 @@ With no argument, this command toggles
                'reftex-isearch-minor-mode)
 
 ;;; reftex-global.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index 4a329b9999e59a98ebc4b9aef9f0fc579a42ba65..f6aa5239dea11b1a5968827a3d11cf4b27c9ad96 100644 (file)
@@ -35,6 +35,7 @@
 (defvar TeX-master)
 ;; END remove for XEmacs release
 
+;;;###autoload
 (defun reftex-index-selection-or-word (&optional arg phrase)
   "Put selection or the word near point into the default index macro.
 This uses the information in `reftex-index-default-macro' to make an index
@@ -87,6 +88,7 @@ which is part of AUCTeX, the string is first processed with the
         (delete-region beg end)
         (reftex-index def-char full-entry def-tag sel)))))
 
+;;;###autoload
 (defun reftex-index (&optional char key tag sel no-insert)
   "Query for an index macro and insert it along with its arguments.
 The index macros available are those defined in `reftex-index-macro' or
@@ -156,6 +158,7 @@ will prompt for other arguments."
                (member tag tag-list)))
       (put reftex-docstruct-symbol 'default-index-tag tag)))
 
+;;;###autoload
 (defun reftex-index-complete-tag (&optional itag opt-args)
   ;; Ask the user for a tag, completing on known tags.
   ;; ITAG is the argument number which contains the tag.
@@ -180,6 +183,7 @@ will prompt for other arguments."
     (reftex-update-default-index tag)
     tag))
 
+;;;###autoload
 (defun reftex-index-select-tag ()
   ;; Have the user select an index tag.
   ;; FIXME: should we cache tag-alist, prompt and help?
@@ -249,6 +253,7 @@ will prompt for other arguments."
             (error "No index tag associated with %c" rpl)))))
      (t (error "This should not happen (reftex-index-select-tag)")))))
 
+;;;###autoload
 (defun reftex-index-complete-key (&optional tag optional initial)
   ;; Read an index key, with completion.
   ;; Restrict completion table on index tag TAG.
@@ -434,6 +439,7 @@ _ ^        Add/Remove parent key (to make this item a subitem).
 } / {      Restrict Index to a single document section / Widen.
 < / >      When restricted, move restriction to previous/next section.")
 
+;;;###autoload
 (defun reftex-index-show-entry (data &optional no-revisit)
   ;; Find an index entry associated with DATA and display it highlighted
   ;; in another window.  NO-REVISIT means we are not allowed to visit
@@ -462,6 +468,7 @@ _ ^        Add/Remove parent key (to make this item a subitem).
       (reftex-highlight 0 (match-beginning 0) (match-end 0) (current-buffer)))
     match))
 
+;;;###autoload
 (defun reftex-display-index (&optional tag overriding-restriction redo
                                        &rest locations)
   "Display a buffer with an index compiled from the current document.
@@ -1244,6 +1251,7 @@ This gets refreshed in every phrases command.")
     table)
   "Syntax table for RefTeX Index Phrases mode.")
 
+;;;###autoload
 (defun reftex-index-phrase-selection-or-word (arg)
   "Add current selection or word at point to the phrases buffer.
 When you are in transient-mark-mode and the region is active, the
@@ -1258,6 +1266,7 @@ You get a chance to edit the entry in the phrases buffer - finish with
        (substitute-command-keys
         "Return to LaTeX with \\[reftex-index-phrases-save-and-return]"))))
 
+;;;###autoload
 (defun reftex-index-visit-phrases-buffer ()
   "Switch to the phrases buffer, initialize if empty."
   (interactive)
@@ -1345,6 +1354,7 @@ If the buffer is non-empty, delete the old header first."
 (defvar reftex-index-phrases-menu)
 (defvar reftex-index-phrases-marker)
 (defvar reftex-index-phrases-restrict-file nil)
+;; NB this is a global autoload - see reftex.el.
 ;;;###autoload
 (define-derived-mode reftex-index-phrases-mode fundamental-mode "Phrases"
   "Major mode for managing the Index phrases of a LaTeX document.
@@ -2096,3 +2106,7 @@ Does not do a save-excursion."
 (provide 'reftex-index)
 
 ;;; reftex-index.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index 71bec89a51dd2a77900539c3e2dad0d83c8f19c7..ce73939ac32bf6127f8861d39cbe06de372b7441 100644 (file)
              ,@body))
        (set-syntax-table saved-syntax))))
 
+;;;###autoload
 (defun reftex-parse-one ()
   "Re-parse this file."
   (interactive)
   (let ((reftex-enable-partial-scans t))
     (reftex-access-scan-info '(4))))
 
+;;;###autoload
 (defun reftex-parse-all ()
   "Re-parse entire document."
   (interactive)
   (reftex-access-scan-info '(16)))
 
+(defvar reftex--index-tags)
+
+;;;###autoload
 (defun reftex-do-parse (rescan &optional file)
   "Do a document rescan.
 When allowed, do only a partial scan from FILE."
@@ -72,7 +77,7 @@ When allowed, do only a partial scan from FILE."
          (file (or file (buffer-file-name)))
          (true-file (file-truename file))
          (bibview-cache (assq 'bibview-cache old-list))
-         (index-tags (cdr (assq 'index-tags old-list)))
+         (reftex--index-tags (cdr (assq 'index-tags old-list)))
          from-file appendix docstruct tmp)
 
     ;; Make sure replacement is really an option here
@@ -92,7 +97,7 @@ When allowed, do only a partial scan from FILE."
                 (t (error "This should not happen (reftex-do-parse)"))))
 
     ;; Reset index-tags if we scan everything
-    (if (equal rescan 1) (setq index-tags nil))
+    (if (equal rescan 1) (setq reftex--index-tags nil))
 
     ;; Find active toc entry and initialize section-numbers
     (setq reftex-active-toc (reftex-last-assoc-before-elt
@@ -137,11 +142,12 @@ When allowed, do only a partial scan from FILE."
            (entry (or (assq 'is-multi docstruct)
                       (car (push (list 'is-multi is-multi) docstruct)))))
       (setcdr entry (cons is-multi nil)))
-    (and index-tags (setq index-tags (sort index-tags 'string<)))
+    (and reftex--index-tags
+         (setq reftex--index-tags (sort reftex--index-tags 'string<)))
     (let ((index-tag-cell (assq 'index-tags docstruct)))
       (if index-tag-cell
-          (setcdr index-tag-cell index-tags)
-        (push (cons 'index-tags index-tags) docstruct)))
+          (setcdr index-tag-cell reftex--index-tags)
+        (push (cons 'index-tags reftex--index-tags) docstruct)))
     (unless (assq 'xr docstruct)
       (let* ((allxr (reftex-all-assq 'xr-doc docstruct))
              (alist (mapcar
@@ -165,11 +171,13 @@ When allowed, do only a partial scan from FILE."
     (set reftex-docstruct-symbol docstruct)
     (put reftex-docstruct-symbol 'modified t)))
 
+;;;###autoload
 (defun reftex-everything-regexp ()
   (if reftex-support-index
       reftex-everything-regexp
     reftex-everything-regexp-no-index))
 
+;; NB this is a global autoload - see reftex.el.
 ;;;###autoload
 (defun reftex-all-document-files (&optional relative)
   "Return a list of all files belonging to the current document.
@@ -189,8 +197,6 @@ of master file."
     (nreverse file-list)))
 
 ;; Bound in the caller, reftex-do-parse.
-(defvar index-tags)
-
 (defun reftex-parse-from-file (file docstruct master-dir)
   "Scan the buffer for labels and save them in a list."
   (let ((regexp (reftex-everything-regexp))
@@ -300,7 +306,7 @@ of master file."
                  (when reftex-support-index
                    (setq index-entry (reftex-index-info file))
                    (when index-entry
-                     (add-to-list 'index-tags (nth 1 index-entry))
+                     (add-to-list 'reftex--index-tags (nth 1 index-entry))
                      (push index-entry docstruct))))
 
                 ((match-end 11)
@@ -357,8 +363,9 @@ of master file."
       (member "biblatex" TeX-active-styles)
     ;; poor-man's check...
     (save-excursion
-      (re-search-forward "^[^%]*\\\\usepackage.*{biblatex}" nil t))))
+      (re-search-forward "^[^%\n]*?\\\\usepackage.*{biblatex}" nil t))))
 
+;;;###autoload
 (defun reftex-locate-bibliography-files (master-dir &optional files)
   "Scan buffer for bibliography macros and return file list."
   (unless files
@@ -421,6 +428,7 @@ This function also makes sure the old toc markers do not point anywhere."
           (setcdr (nthcdr (1- (length new)) new) (cdr eof-list)))
         new))))
 
+;;;###autoload
 (defun reftex-section-info (file)
   "Return a section entry for the current match.
 Careful: This function expects the match-data to be still in place!"
@@ -457,6 +465,7 @@ Careful: This function expects the match-data to be still in place!"
     (list 'toc "toc" text file marker level section-number
           literal (marker-position marker))))
 
+;;;###autoload
 (defun reftex-ensure-index-support (&optional abort)
   "When index support is turned off, ask to turn it on and
 set the current prefix argument so that `reftex-access-scan-info'
@@ -472,11 +481,13 @@ will rescan the entire document."
         (ding)
         (sit-for 1)))))
 
+;;;###autoload
 (defun reftex-index-info-safe (file)
   (reftex-with-special-syntax
    (reftex-index-info file)))
 
 (defvar test-dummy)
+;;;###autoload
 (defun reftex-index-info (file)
   "Return an index entry for the current match.
 Careful: This function expects the match-data to be still in place!"
@@ -525,6 +536,7 @@ Careful: This function expects the match-data to be still in place!"
       ;;       0        1       2      3   4   5  6      7       8      9
       (list 'index index-tag context file bom arg key showkey sortkey key-end))))
 
+;;;###autoload
 (defun reftex-short-context (env parse &optional bound derive)
   "Get about one line of useful context for the label definition at point."
 
@@ -585,6 +597,7 @@ Careful: This function expects the match-data to be still in place!"
     (t
      "INVALID VALUE OF PARSE"))))
 
+;;;###autoload
 (defun reftex-where-am-I ()
   "Return the docstruct entry above point.
 Actually returns a cons cell in which the cdr is a flag indicating
@@ -683,6 +696,7 @@ if the information is exact (t) or approximate (nil)."
             cnt 2))
     (cons rtn (eq cnt 1))))
 
+;;;###autoload
 (defun reftex-notice-new (&optional n force)
   "Hook to handshake with RefTeX after something new has been inserted."
   ;; Add a new entry to the docstruct list.  If it is a section, renumber
@@ -759,7 +773,7 @@ if the information is exact (t) or approximate (nil)."
              ;; Index entry
              (and reftex-support-index
                   (setq entry (reftex-index-info-safe buffer-file-name))
-                  ;; FIXME: (add-to-list 'index-tags (nth 1 index-entry))
+                  ;; FIXME: (add-to-list 'reftex--index-tags (nth 1 index-entry))
                   (push entry (cdr tail))))))))))
 
     (error nil))
@@ -781,11 +795,13 @@ in TeX."
     t)
    (t nil)))
 
+;;;###autoload
 (defun reftex-what-macro-safe (which &optional bound)
   "Call `reftex-what-macro' with special syntax table."
   (reftex-with-special-syntax
    (reftex-what-macro which bound)))
 
+;;;###autoload
 (defun reftex-what-macro (which &optional bound)
   "Find out if point is within the arguments of any TeX-macro.
 The return value is either (\"\\macro\" . (point)) or a list of them.
@@ -848,6 +864,7 @@ considered an argument of macro \\macro."
             (goto-char pos)))
         (nreverse cmd-list)))))
 
+;;;###autoload
 (defun reftex-what-environment (which &optional bound)
   "Find out if point is inside a LaTeX environment.
 The return value is (e.g.) either (\"equation\" . (point)) or a list of
@@ -885,6 +902,7 @@ this point.  If it is nil, limit to nearest \\section - like statement."
             (throw 'exit (cons env (point))))))
         (nreverse env-list)))))
 
+;;;###autoload
 (defun reftex-what-special-env (which &optional bound)
   "Run the special environment parsers and return the matches.
 
@@ -925,7 +943,7 @@ If WHICH is a list of environments, look only for those environments and
             specials
           (car specials))))))
 
-(defsubst reftex-move-to-next-arg (&optional ignore)
+(defsubst reftex-move-to-next-arg (&optional _ignore)
   "Assuming that we are at the end of a macro name or a macro argument,
 move forward to the opening parenthesis of the next argument.
 This function understands the splitting of macros over several lines
@@ -944,6 +962,7 @@ in TeX."
   (let ((entry (assoc key reftex-env-or-mac-alist)))
     (reftex-nth-arg (nth 5 entry) (nth 6 entry))))
 
+;;;###autoload
 (defun reftex-nth-arg (n &optional opt-args)
   "Return the Nth following {} or [] parentheses content.
 OPT-ARGS is a list of argument numbers which are optional."
@@ -982,6 +1001,7 @@ OPT-ARGS is a list of argument numbers which are optional."
           (reftex-context-substring)
         nil))))
 
+;;;###autoload
 (defun reftex-move-over-touching-args ()
   (condition-case nil
       (while (memq (following-char) '(?\[ ?\{))
@@ -1021,6 +1041,7 @@ When point is just after a { or [, limit string to matching parenthesis"
 ;; Variable holding the vector with section numbers
 (defvar reftex-section-numbers (make-vector reftex-max-section-depth 0))
 
+;;;###autoload
 (defun reftex-init-section-numbers (&optional toc-entry appendix)
   "Initialize the section numbers with zeros or with what is found in the TOC-ENTRY."
   (let* ((level  (or (nth 5 toc-entry) -1))
@@ -1039,6 +1060,7 @@ When point is just after a { or [, limit string to matching parenthesis"
       (decf i)))
   (put 'reftex-section-numbers 'appendix appendix))
 
+;;;###autoload
 (defun reftex-section-number (&optional level star)
   "Return a string with the current section number.
 When LEVEL is non-nil, increase section numbers on that level."
@@ -1107,3 +1129,7 @@ When LEVEL is non-nil, increase section numbers on that level."
 (provide 'reftex-parse)
 
 ;;; reftex-parse.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index f2fa815f47977fd0fa88a2c9988d2dc8c78ee531..ac01b6852ec5d8ca235ebd1d379963fb1a1a9932 100644 (file)
@@ -29,6 +29,7 @@
 (require 'reftex)
 (require 'reftex-parse)
 
+;;;###autoload
 (defun reftex-label-location (&optional bound)
   "Return the environment or macro which determines the label type at point.
 If optional BOUND is an integer, limit backward searches to that point."
@@ -62,6 +63,7 @@ If optional BOUND is an integer, limit backward searches to that point."
      (t ;; This should not happen, I think?
       "section"))))
 
+;;;###autoload
 (defun reftex-label-info-update (cell)
   ;; Update information about just one label in a different file.
   ;; CELL contains the old info list
@@ -92,6 +94,7 @@ If optional BOUND is an integer, limit backward searches to that point."
                 (append (reftex-label-info label file) (list note)))
             (list label typekey "" file "LOST LABEL.  RESCAN TO FIX.")))))))
 
+;;;###autoload
 (defun reftex-label-info (label &optional file bound derive env-or-mac)
   ;; Return info list on LABEL at point.
   (let* ((prefix (if (string-match "^[a-zA-Z0-9]+:" label)
@@ -118,6 +121,7 @@ If optional BOUND is an integer, limit backward searches to that point."
 
 ;;; Creating labels ---------------------------------------------------------
 
+;;;###autoload
 (defun reftex-label (&optional environment no-insert)
   "Insert a unique label.  Return the label.
 If ENVIRONMENT is given, don't bother to find out yourself.
@@ -398,6 +402,7 @@ also applies `reftex-translate-to-ascii-function' to the string."
  a / A      Put all marked entries into one/many \\ref commands.
  q / RET    Quit without referencing / Accept current label (also on mouse-2).")
 
+;;;###autoload
 (defun reftex-reference (&optional type no-insert cut)
   "Make a LaTeX reference.  Look only for labels of a certain TYPE.
 With prefix arg, force to rescan buffer for labels.  This should only be
@@ -705,6 +710,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
             (file (nth 3 data)))
         (reftex-access-scan-info arg file)))))
 
+;;;###autoload
 (defun reftex-query-label-type ()
   ;; Ask for label type
   (let ((key (reftex-select-with-char
@@ -713,6 +719,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
       (error "No such label type: %s" (char-to-string key)))
     (char-to-string key)))
 
+;;;###autoload
 (defun reftex-show-label-location (data forward no-revisit
                                         &optional stay error)
   ;; View the definition site of a label in another window.
@@ -833,10 +840,14 @@ package.\n\nThis is a generated function."
 Replace any occurrences of \"\\ref\" with REFSTYLE."
   ;; Replace instances of \ref in `fmt' with the special reference
   ;; style selected by the user.
-  (while (string-match "\\(\\\\ref\\)[ \t]*{" fmt)
-    (setq fmt (replace-match refstyle t t fmt 1)))
+  (cond
+   ((while (string-match "\\(\\\\ref\\)[ \t]*{" fmt)
+      (setq fmt (replace-match refstyle t t fmt 1))))
+   ((string-match "\\(\\\\[[:alpha:]]+\\)[ \t]*{" fmt)
+    (setq fmt (replace-match refstyle t t fmt 1))))
   (format fmt label))
 
+;;;###autoload
 (defun reftex-goto-label (&optional other-window)
   "Prompt for a label (with completion) and jump to the location of this label.
 Optional prefix argument OTHER-WINDOW goes to the label in another window."
@@ -867,3 +878,7 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window."
 (provide 'reftex-ref)
 
 ;;; reftex-ref.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index f589abbc77875d51990e328075671189fe67e0b4..a993a883b0fc7aeb738992b030135e1a33fe2ac7 100644 (file)
 This keymap can be used to configure the label selection process which is
 started with the command \\[reftex-reference].")
 
+;;;###autoload
 (define-derived-mode reftex-select-label-mode fundamental-mode "LSelect"
   "Major mode for selecting a label in a LaTeX document.
 This buffer was created with RefTeX.
@@ -147,6 +148,7 @@ During a selection process, these are the local bindings.
 This keymap can be used to configure the BibTeX selection process which is
 started with the command \\[reftex-citation].")
 
+;;;###autoload
 (define-derived-mode reftex-select-bib-mode fundamental-mode "BSelect"
   "Major mode for selecting a citation key in a LaTeX document.
 This buffer was created with RefTeX.
@@ -188,6 +190,7 @@ During a selection process, these are the local bindings.
 ;;           (throw 'exit entry)))
 ;;     nil))))
 
+;;;###autoload
 (defun reftex-get-offset (buf here-am-I &optional typekey toc index file)
   ;; Find the correct offset data, like insert-docstruct would, but faster.
   ;; Buffer BUF knows the correct docstruct to use.
@@ -212,6 +215,7 @@ During a selection process, these are the local bindings.
               (throw 'exit (or lastentry entry))))
         nil))))
 
+;;;###autoload
 (defun reftex-insert-docstruct
   (buf toc labels index-entries files context counter show-commented
             here-I-am xr-prefix toc-buffer)
@@ -412,6 +416,7 @@ During a selection process, these are the local bindings.
     (run-hooks 'reftex-display-copied-context-hook)
     offset))
 
+;;;###autoload
 (defun reftex-find-start-point (fallback &rest locations)
   ;; Set point to the first available LOCATION.  When a LOCATION is a list,
   ;; search for such a :data text property.  When it is an integer,
@@ -440,6 +445,7 @@ During a selection process, these are the local bindings.
 (defvar reftex-last-line nil)
 (defvar reftex-select-marked nil)
 
+;;;###autoload
 (defun reftex-select-item (reftex-select-prompt help-string keymap
                                   &optional offset
                                   call-back cb-flag)
@@ -737,3 +743,7 @@ Cycle in reverse order if optional argument REVERSE is non-nil."
 (provide 'reftex-sel)
 
 ;;; reftex-sel.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index 59f9de8811127b3b23a21ddd53db6347d4a4ff85..e164770fa0c1ce0cdaaf99af725a46caae2a9a4e 100644 (file)
@@ -190,6 +190,7 @@ M-%        Global search and replace to rename label at point.
 x          Switch to TOC of external document (with LaTeX package `xr').
 z          Jump to a specific section (e.g. '3 z' goes to section 3).")
 
+;;;###autoload
 (defun reftex-toc (&optional rebuild reuse)
   "Show the table of contents for the current document.
 When called with a raw C-u prefix, rescan the document first."
@@ -240,13 +241,13 @@ When called with a raw C-u prefix, rescan the document first."
                 (< (window-height) (* 2 window-min-height)))
         (delete-other-windows))
 
-      (setq reftex-last-window-width (window-width)
+      (setq reftex-last-window-width (window-total-width)
             reftex-last-window-height (window-height))  ; remember
 
       (unless unsplittable
         (if reftex-toc-split-windows-horizontally
             (split-window-right
-             (floor (* (window-width)
+             (floor (* (window-total-width)
                        reftex-toc-split-windows-fraction)))
           (split-window-below
            (floor (* (window-height)
@@ -319,6 +320,7 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
     (reftex-find-start-point (point) offset (get 'reftex-toc :reftex-line))
     (setq reftex-last-follow-point (point))))
 
+;;;###autoload
 (defun reftex-toc-recenter (&optional arg)
   "Display the TOC window and highlight line corresponding to current position."
   (interactive "P")
@@ -372,8 +374,8 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help
 (defun reftex-re-enlarge ()
   "Enlarge window to a remembered size."
   (let ((count (if reftex-toc-split-windows-horizontally
-                  (- (or reftex-last-window-width (window-width))
-                     (window-width))
+                  (- (or reftex-last-window-width (window-total-width))
+                     (window-total-width))
                 (- (or reftex-last-window-height (window-height))
                    (window-height)))))
     (when (> count 0)
@@ -1009,6 +1011,7 @@ label prefix determines the wording of a reference."
        (let (current-prefix-arg)
          (reftex-toc-recenter))))
 
+;;;###autoload
 (defun reftex-toggle-auto-toc-recenter ()
   "Toggle the automatic recentering of the TOC window.
 When active, leaving point idle will make the TOC window jump to the correct
@@ -1088,3 +1091,7 @@ always show the current section in connection with the option
       (reftex-toggle-auto-toc-recenter))))
 
 ;;; reftex-toc.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "reftex.el"
+;; End:
index ec3ab712ce4f29a2f412dd956cb52ca86f61b9ca..ccbdc9595c438197621e9813ad46daab10b47983 100644 (file)
 (require 'reftex-vars)
 
 
-;;; Autoloads
-
-;; Parser functions
-(autoload 'reftex-parse-one "reftex-parse"
-  "Re-parse this file." t)
-(autoload 'reftex-parse-all "reftex-parse"
-  "Re-parse entire document." t)
-(autoload 'reftex-do-parse "reftex-parse")
-(autoload 'reftex-where-am-I "reftex-parse")
-(autoload 'reftex-init-section-numbers "reftex-parse")
-(autoload 'reftex-section-info "reftex-parse")
-(autoload 'reftex-section-number "reftex-parse")
-(autoload 'reftex-what-macro "reftex-parse")
-(autoload 'reftex-what-macro-safe "reftex-parse")
-(autoload 'reftex-index-info "reftex-parse")
-(autoload 'reftex-index-info-safe "reftex-parse")
-(autoload 'reftex-short-context "reftex-parse")
-(autoload 'reftex-what-environment "reftex-parse")
-(autoload 'reftex-what-special-env "reftex-parse")
-(autoload 'reftex-move-over-touching-args "reftex-parse")
-(autoload 'reftex-notice-new "reftex-parse")
-(autoload 'reftex-nth-arg "reftex-parse")
-(autoload 'reftex-locate-bibliography-files "reftex-parse")
-(autoload 'reftex-ensure-index-support "reftex-parse")
-(autoload 'reftex-everything-regexp "reftex-parse")
-
-;; Labels and References
-(autoload 'reftex-label-location "reftex-ref")
-(autoload 'reftex-label-info-update "reftex-ref")
-(autoload 'reftex-label-info "reftex-ref")
-(autoload 'reftex-label "reftex-ref"
- "Insert a unique label." t)
-(autoload 'reftex-reference "reftex-ref"
- "Make a LaTeX reference." t)
+;;; Autoloads - see end for automatic autoloads
+
+;; We autoload tons of functions from these files, but some have
+;; a single function that needs to be globally autoloaded.
+;; The alternative is to use a Makefile rule + distinct autoload
+;; cookie (eg ;;;###reftex-autoload) for internal autoloads,
+;; as eg calendar/ does.  But that seemed like overkill for 4 functions.
+
+;;;###autoload(autoload 'reftex-citation "reftex-cite" nil t)
+;;;###autoload(autoload 'reftex-all-document-files "reftex-parse")
+;;;###autoload(autoload 'reftex-isearch-minor-mode "reftex-global" nil t)
+;;;###autoload(autoload 'reftex-index-phrases-mode "reftex-index" nil t)
+
+;; Generated functions.
 (autoload 'reftex-varioref-vref "reftex-ref"
   "Make a varioref reference." t)
 (autoload 'reftex-fancyref-fref "reftex-ref"
   "Make a fancyref \\fref reference." t)
 (autoload 'reftex-fancyref-Fref "reftex-ref"
   "Make a fancyref \\Fref reference." t)
-(autoload 'reftex-show-label-location "reftex-ref")
-(autoload 'reftex-query-label-type "reftex-ref")
-(autoload 'reftex-goto-label "reftex-ref"
-  "Prompt for label name and go to that location." t)
-
-;; Table of contents
-(autoload 'reftex-toc "reftex-toc"
-  "Show the table of contents for the current document." t)
-(autoload 'reftex-toc-recenter "reftex-toc"
-  "Display the TOC window and highlight line corresponding to current position." t)
-(autoload 'reftex-toggle-auto-toc-recenter "reftex-toc"
-  "Toggle automatic recentering of TOC window." t)
-
-;; BibTeX citations.
-(autoload 'reftex-citep "reftex-cite")
-(autoload 'reftex-citet "reftex-cite")
-(autoload 'reftex-make-cite-echo-string "reftex-cite")
-(autoload 'reftex-get-bibfile-list "reftex-cite")
-(autoload 'reftex-pop-to-bibtex-entry "reftex-cite")
-(autoload 'reftex-end-of-bib-entry "reftex-cite")
-(autoload 'reftex-parse-bibtex-entry "reftex-cite")
-(autoload 'reftex-citation "reftex-cite"
- "Make a citation using BibTeX database files." t)
-(autoload 'reftex-default-bibliography "reftex-cite")
-(autoload 'reftex-bib-or-thebib "reftex-cite")
-(autoload 'reftex-create-bibtex-file "reftex-cite"
-  "Create a new BibTeX database BIBFILE with all entries referenced in document."
-  t)
-
-;; Selection
-(autoload 'reftex-select-label-mode "reftex-sel")
-(autoload 'reftex-select-bib-mode "reftex-sel")
-(autoload 'reftex-find-start-point "reftex-sel")
-(autoload 'reftex-insert-docstruct "reftex-sel")
-(autoload 'reftex-get-offset "reftex-sel")
-(autoload 'reftex-select-item "reftex-sel")
-
-;; Index support
-(autoload 'reftex-index "reftex-index"
- "Query for an index macro and insert it along with its arguments." t)
-(autoload 'reftex-index-selection-or-word "reftex-index"
- "Put selection or the word near point into the default index macro." t)
-(autoload 'reftex-index-phrase-selection-or-word "reftex-index"
- "Put selection or the word near point into Index Phrases File." t)
-(autoload 'reftex-display-index "reftex-index"
- "Display a buffer with an index compiled from the current document." t)
-(autoload 'reftex-index-visit-phrases-buffer "reftex-index"
- "Visit the Index Phrases File." t)
-(autoload 'reftex-index-phrases-mode "reftex-index"
- "Major mode for managing the Index phrases of a LaTeX document." t)
-(autoload 'reftex-index-complete-tag "reftex-index")
-(autoload 'reftex-index-complete-key "reftex-index")
-(autoload 'reftex-index-show-entry "reftex-index")
-(autoload 'reftex-index-select-tag "reftex-index")
-
-;; View cross references
-(autoload 'reftex-view-crossref "reftex-dcr"
- "View cross reference of \\ref or \\cite macro at point." t)
-(autoload 'reftex-mouse-view-crossref "reftex-dcr"
- "View cross reference of \\ref or \\cite macro where you click." t)
-(autoload 'reftex-toggle-auto-view-crossref "reftex-dcr")
-(autoload 'reftex-view-crossref-from-bibtex "reftex-dcr"
- "View location in a LaTeX document which cites the BibTeX entry at point." t)
-
-;; Operations on entire Multifile documents
-(autoload 'reftex-create-tags-file "reftex-global"
- "Create TAGS file by running `etags' on the current document." t)
-(autoload 'reftex-grep-document "reftex-global"
- "Run grep query through all files related to this document." t)
-(autoload 'reftex-search-document "reftex-global"
- "Regexp search through all files of the current TeX document." t)
-(autoload 'reftex-query-replace-document "reftex-global"
- "Run a query-replace-regexp of FROM with TO over the entire TeX document." t)
-(autoload 'reftex-find-duplicate-labels "reftex-global"
- "Produce a list of all duplicate labels in the document." t)
-(autoload 'reftex-change-label "reftex-global"
- "Query replace FROM with TO in all \\label and \\ref commands." t)
-(autoload 'reftex-renumber-simple-labels "reftex-global"
- "Renumber all simple labels in the document to make them sequentially." t)
-(autoload 'reftex-save-all-document-buffers "reftex-global"
- "Save all documents associated with the current document." t)
-
-;; AUCTeX Interface
-(autoload 'reftex-arg-label "reftex-auc")
-(autoload 'reftex-arg-cite "reftex-auc")
-(autoload 'reftex-arg-index-tag "reftex-auc")
-(autoload 'reftex-arg-index "reftex-auc")
-(autoload 'reftex-plug-into-AUCTeX "reftex-auc")
-(autoload 'reftex-toggle-plug-into-AUCTeX "reftex-auc"
- "Toggle Interface between AUCTeX and RefTeX on and off." t)
-(autoload 'reftex-add-label-environments "reftex-auc")
-(autoload 'reftex-add-to-label-alist "reftex-auc")
-(autoload 'reftex-add-section-levels "reftex-auc")
-(autoload 'reftex-notice-new-section "reftex-auc")
-
 
 ;;; =========================================================================
 ;;;
@@ -2493,6 +2378,703 @@ Your bug report will be posted to the AUCTeX bug reporting list.
 ;;; That's it! ----------------------------------------------------------------
 
 (setq reftex-tables-dirty t)  ; in case this file is evaluated by hand
+
+\f
+;;; Start of automatically extracted autoloads.
+\f
+;;;### (autoloads nil "reftex-auc" "reftex-auc.el" "16f7e4bde671b5faee975a9ff10838e7")
+;;; Generated autoloads from reftex-auc.el
+
+(autoload 'reftex-arg-label "reftex-auc" "\
+Use `reftex-label', `reftex-reference' or AUCTeX's code to insert label arg.
+What is being used depends upon `reftex-plug-into-AUCTeX'.
+
+\(fn OPTIONAL &optional PROMPT DEFINITION)" nil nil)
+
+(autoload 'reftex-arg-cite "reftex-auc" "\
+Use `reftex-citation' or AUCTeX's code to insert a cite-key macro argument.
+What is being used depends upon `reftex-plug-into-AUCTeX'.
+
+\(fn OPTIONAL &optional PROMPT DEFINITION)" nil nil)
+
+(autoload 'reftex-arg-index-tag "reftex-auc" "\
+Prompt for an index tag with completion.
+This is the name of an index, not the entry.
+
+\(fn OPTIONAL &optional PROMPT &rest ARGS)" nil nil)
+
+(autoload 'reftex-arg-index "reftex-auc" "\
+Prompt for an index entry completing with known entries.
+Completion is specific for just one index, if the macro or a tag
+argument identify one of multiple indices.
+
+\(fn OPTIONAL &optional PROMPT &rest ARGS)" nil nil)
+
+(autoload 'reftex-plug-into-AUCTeX "reftex-auc" "\
+
+
+\(fn)" nil nil)
+
+(autoload 'reftex-toggle-plug-into-AUCTeX "reftex-auc" "\
+Toggle Interface between AUCTeX and RefTeX on and off.
+
+\(fn)" t nil)
+
+(autoload 'reftex-add-label-environments "reftex-auc" "\
+Add label environment descriptions to `reftex-label-alist-style'.
+The format of ENTRY-LIST is exactly like `reftex-label-alist'.  See there
+for details.
+This function makes it possible to support RefTeX from AUCTeX style files.
+The entries in ENTRY-LIST will be processed after the user settings in
+`reftex-label-alist', and before the defaults (specified in
+`reftex-default-label-alist-entries').  Any changes made to
+`reftex-label-alist-style' will raise a flag to the effect that
+the label information is recompiled on next use.
+
+\(fn ENTRY-LIST)" nil nil)
+
+(defalias 'reftex-add-to-label-alist 'reftex-add-label-environments)
+
+(autoload 'reftex-add-section-levels "reftex-auc" "\
+Add entries to the value of `reftex-section-levels'.
+The added values are kept local to the current document.  The format
+of ENTRY-LIST is a list of cons cells (\"MACRONAME\" . LEVEL).  See
+`reftex-section-levels' for an example.
+
+\(fn ENTRY-LIST)" nil nil)
+
+(autoload 'reftex-notice-new-section "reftex-auc" "\
+
+
+\(fn)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-cite" "reftex-cite.el" "43a70b713b3cd8a225f03431400e54e6")
+;;; Generated autoloads from reftex-cite.el
+
+(autoload 'reftex-default-bibliography "reftex-cite" "\
+Return the expanded value of variable `reftex-default-bibliography'.
+The expanded value is cached.
+
+\(fn)" nil nil)
+
+(autoload 'reftex-bib-or-thebib "reftex-cite" "\
+Test if BibTeX or \begin{thebibliography} should be used for the citation.
+Find the bof of the current file
+
+\(fn)" nil nil)
+
+(autoload 'reftex-get-bibfile-list "reftex-cite" "\
+Return list of bibfiles for current document.
+When using the chapterbib or bibunits package you should either
+use the same database files everywhere, or separate parts using
+different databases into different files (included into the mater file).
+Then this function will return the applicable database files.
+
+\(fn)" nil nil)
+
+(autoload 'reftex-pop-to-bibtex-entry "reftex-cite" "\
+Find BibTeX KEY in any file in FILE-LIST in another window.
+If MARK-TO-KILL is non-nil, mark new buffer to kill.
+If HIGHLIGHT is non-nil, highlight the match.
+If ITEM in non-nil, search for bibitem instead of database entry.
+If RETURN is non-nil, just return the entry and restore point.
+
+\(fn KEY FILE-LIST &optional MARK-TO-KILL HIGHLIGHT ITEM RETURN)" nil nil)
+
+(autoload 'reftex-end-of-bib-entry "reftex-cite" "\
+
+
+\(fn ITEM)" nil nil)
+
+(autoload 'reftex-parse-bibtex-entry "reftex-cite" "\
+Parse BibTeX ENTRY.
+If ENTRY is nil then parse the entry in current buffer between FROM and TO.
+If RAW is non-nil, keep double quotes/curly braces delimiting fields.
+
+\(fn ENTRY &optional FROM TO RAW)" nil nil)
+
+(autoload 'reftex-citation "reftex-cite" "\
+Make a citation using BibTeX database files.
+After prompting for a regular expression, scans the buffers with
+bibtex entries (taken from the \\bibliography command) and offers the
+matching entries for selection.  The selected entry is formatted according
+to `reftex-cite-format' and inserted into the buffer.
+
+If NO-INSERT is non-nil, nothing is inserted, only the selected key returned.
+
+FORMAT-KEY can be used to pre-select a citation format.
+
+When called with a `C-u' prefix, prompt for optional arguments in
+cite macros.  When called with a numeric prefix, make that many
+citations.  When called with point inside the braces of a `\\cite'
+command, it will add another key, ignoring the value of
+`reftex-cite-format'.
+
+The regular expression uses an expanded syntax: && is interpreted as `and'.
+Thus, `aaaa&&bbb' matches entries which contain both `aaaa' and `bbb'.
+While entering the regexp, completion on knows citation keys is possible.
+`=' is a good regular expression to match all entries in all files.
+
+\(fn &optional NO-INSERT FORMAT-KEY)" t nil)
+
+(autoload 'reftex-citep "reftex-cite" "\
+Call `reftex-citation' with a format selector `?p'.
+
+\(fn)" t nil)
+
+(autoload 'reftex-citet "reftex-cite" "\
+Call `reftex-citation' with a format selector `?t'.
+
+\(fn)" t nil)
+
+(autoload 'reftex-make-cite-echo-string "reftex-cite" "\
+Format a bibtex ENTRY for the echo area and cache the result.
+
+\(fn ENTRY DOCSTRUCT-SYMBOL)" nil nil)
+
+(autoload 'reftex-create-bibtex-file "reftex-cite" "\
+Create a new BibTeX database BIBFILE with all entries referenced in document.
+The command prompts for a filename and writes the collected
+entries to that file.  Only entries referenced in the current
+document with any \\cite-like macros are used.  The sequence in
+the new file is the same as it was in the old database.
+
+Entries referenced from other entries must appear after all
+referencing entries.
+
+You can define strings to be used as header or footer for the
+created files in the variables `reftex-create-bibtex-header' or
+`reftex-create-bibtex-footer' respectively.
+
+\(fn BIBFILE)" t nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-dcr" "reftex-dcr.el" "e90640fdd78f4404b29729bf7a5fce30")
+;;; Generated autoloads from reftex-dcr.el
+
+(autoload 'reftex-view-crossref "reftex-dcr" "\
+View cross reference of macro at point.  Point must be on the KEY
+argument.  When at a `\\ref' macro, show corresponding `\\label'
+definition, also in external documents (`xr').  When on a label, show
+a locations where KEY is referenced.  Subsequent calls find additional
+locations.  When on a `\\cite', show the associated `\\bibitem' macro or
+the BibTeX database entry.  When on a `\\bibitem', show a `\\cite' macro
+which uses this KEY. When on an `\\index', show other locations marked
+by the same index entry.
+To define additional cross referencing items, use the option
+`reftex-view-crossref-extra'.  See also `reftex-view-crossref-from-bibtex'.
+With one or two C-u prefixes, enforce rescanning of the document.
+With argument 2, select the window showing the cross reference.
+AUTO-HOW is only for the automatic crossref display and is handed through
+to the functions `reftex-view-cr-cite' and `reftex-view-cr-ref'.
+
+\(fn &optional ARG AUTO-HOW FAIL-QUIETLY)" t nil)
+
+(autoload 'reftex-mouse-view-crossref "reftex-dcr" "\
+View cross reference of \\ref or \\cite macro where you click.
+If the macro at point is a \\ref, show the corresponding label definition.
+If it is a \\cite, show the BibTeX database entry.
+If there is no such macro at point, search forward to find one.
+With argument, actually select the window showing the cross reference.
+
+\(fn EV)" t nil)
+
+(autoload 'reftex-toggle-auto-view-crossref "reftex-dcr" "\
+Toggle the automatic display of crossref information in the echo area.
+When active, leaving point idle in the argument of a \\ref or \\cite macro
+will display info in the echo area.
+
+\(fn)" t nil)
+
+(autoload 'reftex-view-crossref-from-bibtex "reftex-dcr" "\
+View location in a LaTeX document which cites the BibTeX entry at point.
+Since BibTeX files can be used by many LaTeX documents, this function
+prompts upon first use for a buffer in RefTeX mode.  To reset this
+link to a document, call the function with a prefix arg.
+Calling this function several times find successive citation locations.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-global" "reftex-global.el" "a773b46e8b751bca3a82c991f81b5fdd")
+;;; Generated autoloads from reftex-global.el
+
+(autoload 'reftex-create-tags-file "reftex-global" "\
+Create TAGS file by running `etags' on the current document.
+The TAGS file is also immediately visited with `visit-tags-table'.
+
+\(fn)" t nil)
+
+(autoload 'reftex-grep-document "reftex-global" "\
+Run grep query through all files related to this document.
+With prefix arg, force to rescan document.
+No active TAGS table is required.
+
+\(fn GREP-CMD)" t nil)
+
+(autoload 'reftex-search-document "reftex-global" "\
+Regexp search through all files of the current document.
+Starts always in the master file.  Stops when a match is found.
+To continue searching for next match, use command \\[tags-loop-continue].
+No active TAGS table is required.
+
+\(fn &optional REGEXP)" t nil)
+
+(autoload 'reftex-query-replace-document "reftex-global" "\
+Do `query-replace-regexp' of FROM with TO over the entire document.
+Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
+If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
+with the command \\[tags-loop-continue].
+No active TAGS table is required.
+
+\(fn &optional FROM TO DELIMITED)" t nil)
+
+(autoload 'reftex-find-duplicate-labels "reftex-global" "\
+Produce a list of all duplicate labels in the document.
+
+\(fn)" t nil)
+
+(autoload 'reftex-change-label "reftex-global" "\
+Run `query-replace-regexp' of FROM with TO in all macro arguments.
+Works on the entire multifile document.
+If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
+with the command \\[tags-loop-continue].
+No active TAGS table is required.
+
+\(fn &optional FROM TO)" t nil)
+
+(autoload 'reftex-renumber-simple-labels "reftex-global" "\
+Renumber all simple labels in the document to make them sequentially.
+Simple labels are the ones created by RefTeX, consisting only of the
+prefix and a number.  After the command completes, all these labels will
+have sequential numbers throughout the document.  Any references to
+the labels will be changed as well.  For this, RefTeX looks at the
+arguments of any macros which either start or end in the string `ref'.
+This command should be used with care, in particular in multifile
+documents.  You should not use it if another document refers to this
+one with the `xr' package.
+
+\(fn)" t nil)
+
+(autoload 'reftex-save-all-document-buffers "reftex-global" "\
+Save all documents associated with the current document.
+The function is useful after a global action like replacing or renumbering
+labels.
+
+\(fn)" t nil)
+
+(autoload 'reftex-isearch-minor-mode "reftex-global" "\
+When on, isearch searches the whole document, not only the current file.
+This minor mode allows isearch to search through all the files of
+the current TeX document.
+
+With no argument, this command toggles
+`reftex-isearch-minor-mode'.  With a prefix argument ARG, turn
+`reftex-isearch-minor-mode' on if ARG is positive, otherwise turn it off.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-index" "reftex-index.el" "ccf53e4cdf1d7280e4cdb54d23e81854")
+;;; Generated autoloads from reftex-index.el
+
+(autoload 'reftex-index-selection-or-word "reftex-index" "\
+Put selection or the word near point into the default index macro.
+This uses the information in `reftex-index-default-macro' to make an index
+entry.  The phrase indexed is the current selection or the word near point.
+When called with one `C-u' prefix, let the user have a chance to edit the
+index entry.  When called with 2 `C-u' as prefix, also ask for the index
+macro and other stuff.
+When called inside TeX math mode as determined by the `texmathp.el' library
+which is part of AUCTeX, the string is first processed with the
+`reftex-index-math-format', which see.
+
+\(fn &optional ARG PHRASE)" t nil)
+
+(autoload 'reftex-index "reftex-index" "\
+Query for an index macro and insert it along with its arguments.
+The index macros available are those defined in `reftex-index-macro' or
+by a call to `reftex-add-index-macros', typically from an AUCTeX style file.
+RefteX provides completion for the index tag and the index key, and
+will prompt for other arguments.
+
+\(fn &optional CHAR KEY TAG SEL NO-INSERT)" t nil)
+
+(autoload 'reftex-index-complete-tag "reftex-index" "\
+
+
+\(fn &optional ITAG OPT-ARGS)" nil nil)
+
+(autoload 'reftex-index-select-tag "reftex-index" "\
+
+
+\(fn)" nil nil)
+
+(autoload 'reftex-index-complete-key "reftex-index" "\
+
+
+\(fn &optional TAG OPTIONAL INITIAL)" nil nil)
+
+(autoload 'reftex-index-show-entry "reftex-index" "\
+
+
+\(fn DATA &optional NO-REVISIT)" nil nil)
+
+(autoload 'reftex-display-index "reftex-index" "\
+Display a buffer with an index compiled from the current document.
+When the document has multiple indices, first prompts for the correct one.
+When index support is turned off, offer to turn it on.
+With one or two `C-u' prefixes, rescan document first.
+With prefix 2, restrict index to current document section.
+With prefix 3, restrict index to region.
+
+\(fn &optional TAG OVERRIDING-RESTRICTION REDO &rest LOCATIONS)" t nil)
+
+(autoload 'reftex-index-phrase-selection-or-word "reftex-index" "\
+Add current selection or word at point to the phrases buffer.
+When you are in transient-mark-mode and the region is active, the
+selection will be used - otherwise the word at point.
+You get a chance to edit the entry in the phrases buffer - finish with
+`C-c C-c'.
+
+\(fn ARG)" t nil)
+
+(autoload 'reftex-index-visit-phrases-buffer "reftex-index" "\
+Switch to the phrases buffer, initialize if empty.
+
+\(fn)" t nil)
+
+(autoload 'reftex-index-phrases-mode "reftex-index" "\
+Major mode for managing the Index phrases of a LaTeX document.
+This buffer was created with RefTeX.
+
+To insert new phrases, use
+ - `C-c \\' in the LaTeX document to copy selection or word
+ - `\\[reftex-index-new-phrase]' in the phrases buffer.
+
+To index phrases use one of:
+
+\\[reftex-index-this-phrase]     index current phrase
+\\[reftex-index-next-phrase]     index next phrase (or N with prefix arg)
+\\[reftex-index-all-phrases]     index all phrases
+\\[reftex-index-remaining-phrases]     index current and following phrases
+\\[reftex-index-region-phrases]     index the phrases in the region
+
+You can sort the phrases in this buffer with \\[reftex-index-sort-phrases].
+To display information about the phrase at point, use \\[reftex-index-phrases-info].
+
+For more information see the RefTeX User Manual.
+
+Here are all local bindings.
+
+\\{reftex-index-phrases-mode-map}
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-parse" "reftex-parse.el" "69a531bd0ac3f97f076b7dda4ec2304d")
+;;; Generated autoloads from reftex-parse.el
+
+(autoload 'reftex-parse-one "reftex-parse" "\
+Re-parse this file.
+
+\(fn)" t nil)
+
+(autoload 'reftex-parse-all "reftex-parse" "\
+Re-parse entire document.
+
+\(fn)" t nil)
+
+(autoload 'reftex-do-parse "reftex-parse" "\
+Do a document rescan.
+When allowed, do only a partial scan from FILE.
+
+\(fn RESCAN &optional FILE)" nil nil)
+
+(autoload 'reftex-everything-regexp "reftex-parse" "\
+
+
+\(fn)" nil nil)
+
+(autoload 'reftex-all-document-files "reftex-parse" "\
+Return a list of all files belonging to the current document.
+When RELATIVE is non-nil, give file names relative to directory
+of master file.
+
+\(fn &optional RELATIVE)" nil nil)
+
+(autoload 'reftex-locate-bibliography-files "reftex-parse" "\
+Scan buffer for bibliography macros and return file list.
+
+\(fn MASTER-DIR &optional FILES)" nil nil)
+
+(autoload 'reftex-section-info "reftex-parse" "\
+Return a section entry for the current match.
+Careful: This function expects the match-data to be still in place!
+
+\(fn FILE)" nil nil)
+
+(autoload 'reftex-ensure-index-support "reftex-parse" "\
+When index support is turned off, ask to turn it on and
+set the current prefix argument so that `reftex-access-scan-info'
+will rescan the entire document.
+
+\(fn &optional ABORT)" nil nil)
+
+(autoload 'reftex-index-info-safe "reftex-parse" "\
+
+
+\(fn FILE)" nil nil)
+
+(autoload 'reftex-index-info "reftex-parse" "\
+Return an index entry for the current match.
+Careful: This function expects the match-data to be still in place!
+
+\(fn FILE)" nil nil)
+
+(autoload 'reftex-short-context "reftex-parse" "\
+Get about one line of useful context for the label definition at point.
+
+\(fn ENV PARSE &optional BOUND DERIVE)" nil nil)
+
+(autoload 'reftex-where-am-I "reftex-parse" "\
+Return the docstruct entry above point.
+Actually returns a cons cell in which the cdr is a flag indicating
+if the information is exact (t) or approximate (nil).
+
+\(fn)" nil nil)
+
+(autoload 'reftex-notice-new "reftex-parse" "\
+Hook to handshake with RefTeX after something new has been inserted.
+
+\(fn &optional N FORCE)" nil nil)
+
+(autoload 'reftex-what-macro-safe "reftex-parse" "\
+Call `reftex-what-macro' with special syntax table.
+
+\(fn WHICH &optional BOUND)" nil nil)
+
+(autoload 'reftex-what-macro "reftex-parse" "\
+Find out if point is within the arguments of any TeX-macro.
+The return value is either (\"\\macro\" . (point)) or a list of them.
+
+If WHICH is nil, immediately return nil.
+If WHICH is 1, return innermost enclosing macro.
+If WHICH is t, return list of all macros enclosing point.
+If WHICH is a list of macros, look only for those macros and return the
+  name of the first macro in this list found to enclose point.
+If the optional BOUND is an integer, bound backwards directed
+  searches to this point.  If it is nil, limit to nearest \\section -
+  like statement.
+
+This function is pretty stable, but can be fooled if the text contains
+things like \\macro{aa}{bb} where \\macro is defined to take only one
+argument.  As RefTeX cannot know this, the string \"bb\" would still be
+considered an argument of macro \\macro.
+
+\(fn WHICH &optional BOUND)" nil nil)
+
+(autoload 'reftex-what-environment "reftex-parse" "\
+Find out if point is inside a LaTeX environment.
+The return value is (e.g.) either (\"equation\" . (point)) or a list of
+them.
+
+If WHICH is nil, immediately return nil.
+If WHICH is 1, return innermost enclosing environment.
+If WHICH is t, return list of all environments enclosing point.
+If WHICH is a list of environments, look only for those environments and
+  return the name of the first environment in this list found to enclose
+  point.
+
+If the optional BOUND is an integer, bound backwards directed searches to
+this point.  If it is nil, limit to nearest \\section - like statement.
+
+\(fn WHICH &optional BOUND)" nil nil)
+
+(autoload 'reftex-what-special-env "reftex-parse" "\
+Run the special environment parsers and return the matches.
+
+The return value is (e.g.) either (\"my-parser-function\" . (point))
+or a list of them.
+
+If WHICH is nil, immediately return nil.
+If WHICH is 1, return innermost enclosing environment.
+If WHICH is t, return list of all environments enclosing point.
+If WHICH is a list of environments, look only for those environments and
+  return the name of the first environment in this list found to enclose
+  point.
+
+\(fn WHICH &optional BOUND)" nil nil)
+
+(autoload 'reftex-nth-arg "reftex-parse" "\
+Return the Nth following {} or [] parentheses content.
+OPT-ARGS is a list of argument numbers which are optional.
+
+\(fn N &optional OPT-ARGS)" nil nil)
+
+(autoload 'reftex-move-over-touching-args "reftex-parse" "\
+
+
+\(fn)" nil nil)
+
+(autoload 'reftex-init-section-numbers "reftex-parse" "\
+Initialize the section numbers with zeros or with what is found in the TOC-ENTRY.
+
+\(fn &optional TOC-ENTRY APPENDIX)" nil nil)
+
+(autoload 'reftex-section-number "reftex-parse" "\
+Return a string with the current section number.
+When LEVEL is non-nil, increase section numbers on that level.
+
+\(fn &optional LEVEL STAR)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-ref" "reftex-ref.el" "3ad5bfbb747c7f8c5cd5b30e3b6fc342")
+;;; Generated autoloads from reftex-ref.el
+
+(autoload 'reftex-label-location "reftex-ref" "\
+Return the environment or macro which determines the label type at point.
+If optional BOUND is an integer, limit backward searches to that point.
+
+\(fn &optional BOUND)" nil nil)
+
+(autoload 'reftex-label-info-update "reftex-ref" "\
+
+
+\(fn CELL)" nil nil)
+
+(autoload 'reftex-label-info "reftex-ref" "\
+
+
+\(fn LABEL &optional FILE BOUND DERIVE ENV-OR-MAC)" nil nil)
+
+(autoload 'reftex-label "reftex-ref" "\
+Insert a unique label.  Return the label.
+If ENVIRONMENT is given, don't bother to find out yourself.
+If NO-INSERT is non-nil, do not insert label into buffer.
+With prefix arg, force to rescan document first.
+When you are prompted to enter or confirm a label, and you reply with
+just the prefix or an empty string, no label at all will be inserted.
+A new label is also recorded into the label list.
+This function is controlled by the settings of reftex-insert-label-flags.
+
+\(fn &optional ENVIRONMENT NO-INSERT)" t nil)
+
+(autoload 'reftex-reference "reftex-ref" "\
+Make a LaTeX reference.  Look only for labels of a certain TYPE.
+With prefix arg, force to rescan buffer for labels.  This should only be
+necessary if you have recently entered labels yourself without using
+reftex-label.  Rescanning of the buffer can also be requested from the
+label selection menu.
+The function returns the selected label or nil.
+If NO-INSERT is non-nil, do not insert \\ref command, just return label.
+When called with 2 C-u prefix args, disable magic word recognition.
+
+\(fn &optional TYPE NO-INSERT CUT)" t nil)
+
+(autoload 'reftex-query-label-type "reftex-ref" "\
+
+
+\(fn)" nil nil)
+
+(autoload 'reftex-show-label-location "reftex-ref" "\
+
+
+\(fn DATA FORWARD NO-REVISIT &optional STAY ERROR)" nil nil)
+
+(autoload 'reftex-goto-label "reftex-ref" "\
+Prompt for a label (with completion) and jump to the location of this label.
+Optional prefix argument OTHER-WINDOW goes to the label in another window.
+
+\(fn &optional OTHER-WINDOW)" t nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-sel" "reftex-sel.el" "086c2dd94aedc95620c5e972ad4c741a")
+;;; Generated autoloads from reftex-sel.el
+
+(autoload 'reftex-select-label-mode "reftex-sel" "\
+Major mode for selecting a label in a LaTeX document.
+This buffer was created with RefTeX.
+It only has a meaningful keymap when you are in the middle of a
+selection process.
+To select a label, move the cursor to it and press RET.
+Press `?' for a summary of important key bindings.
+
+During a selection process, these are the local bindings.
+
+\\{reftex-select-label-mode-map}
+
+\(fn)" t nil)
+
+(autoload 'reftex-select-bib-mode "reftex-sel" "\
+Major mode for selecting a citation key in a LaTeX document.
+This buffer was created with RefTeX.
+It only has a meaningful keymap when you are in the middle of a
+selection process.
+In order to select a citation, move the cursor to it and press RET.
+Press `?' for a summary of important key bindings.
+
+During a selection process, these are the local bindings.
+
+\\{reftex-select-label-mode-map}
+
+\(fn)" t nil)
+
+(autoload 'reftex-get-offset "reftex-sel" "\
+
+
+\(fn BUF HERE-AM-I &optional TYPEKEY TOC INDEX FILE)" nil nil)
+
+(autoload 'reftex-insert-docstruct "reftex-sel" "\
+
+
+\(fn BUF TOC LABELS INDEX-ENTRIES FILES CONTEXT COUNTER SHOW-COMMENTED HERE-I-AM XR-PREFIX TOC-BUFFER)" nil nil)
+
+(autoload 'reftex-find-start-point "reftex-sel" "\
+
+
+\(fn FALLBACK &rest LOCATIONS)" nil nil)
+
+(autoload 'reftex-select-item "reftex-sel" "\
+
+
+\(fn REFTEX-SELECT-PROMPT HELP-STRING KEYMAP &optional OFFSET CALL-BACK CB-FLAG)" nil nil)
+
+;;;***
+\f
+;;;### (autoloads nil "reftex-toc" "reftex-toc.el" "0364fac43b02eee087ee4cbe37f7f76c")
+;;; Generated autoloads from reftex-toc.el
+
+(autoload 'reftex-toc "reftex-toc" "\
+Show the table of contents for the current document.
+When called with a raw C-u prefix, rescan the document first.
+
+\(fn &optional REBUILD REUSE)" t nil)
+
+(autoload 'reftex-toc-recenter "reftex-toc" "\
+Display the TOC window and highlight line corresponding to current position.
+
+\(fn &optional ARG)" t nil)
+
+(autoload 'reftex-toggle-auto-toc-recenter "reftex-toc" "\
+Toggle the automatic recentering of the TOC window.
+When active, leaving point idle will make the TOC window jump to the correct
+section.
+
+\(fn)" t nil)
+
+;;;***
+\f
+;;; End of automatically extracted autoloads.
+
 (provide 'reftex)
 
 ;;; reftex.el ends here
index b05a5e5a7e3bef847e84599733dce276231463f4..5ea0b419d2298ecb9c7fd103d8cba373df3f51f6 100644 (file)
@@ -3121,7 +3121,7 @@ newlines as mandated by `comment-line-break-function'."
 
 (defun rst-comment-region (beg end &optional arg)
   "Comment or uncomment the current region.
-Region is from from BEG to END.  Uncomment if ARG."
+Region is from BEG to END.  Uncomment if ARG."
   (save-excursion
     (if (consp arg)
        (rst-uncomment-region beg end arg)
index 9732e7fa6496d85a87b1e19df986f39220e7e40b..50fee2f4b849d1cdb985de107d895f754785ca4e 100644 (file)
@@ -3,7 +3,8 @@
 ;; Copyright (C) 1997-2014 Free Software Foundation, Inc.
 
 ;; Author:     Milan Zamazal <pdm@zamazal.org>
-;; Version:    4.5
+;;             Michal Nazarewicz <mina86@mina86.com>
+;; Version:    4.5.3
 ;; Keywords:   text, TeX, SGML, wp
 
 ;; This file is part of GNU Emacs.
@@ -77,15 +78,22 @@ by the hard space character.
 The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE.  For this
 mode, the item for the mode SYMBOL is looked up in the alist instead."
   :group 'tildify
-  :type '(repeat (choice (list symbol regexp integer) (cons symbol symbol))))
+  :type '(repeat (cons :tag "Entry for major mode"
+                       (choice (const  :tag "Default" t)
+                               (symbol :tag "Major mode"))
+                       (choice (list   :tag "Regexp"
+                                       regexp
+                                       (integer :tag "Group "))
+                               (symbol :tag "Like other")))))
 
 (defcustom tildify-string-alist
   '((latex-mode . "~")
     (tex-mode . latex-mode)
     (plain-tex-mode . latex-mode)
     (sgml-mode . "&nbsp;")
-    (xml-mode . sgml-mode)
     (html-mode . sgml-mode)
+    (xml-mode . "&#160;") ; XML does not define &nbsp; use numeric reference
+    (nxml-mode . xml-mode)
     (t . " "))
   "Alist specifying what is a hard space in the current major mode.
 
@@ -104,41 +112,43 @@ for SGML.
 The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE.  For this
 mode, the item for the mode SYMBOL is looked up in the alist instead."
   :group 'tildify
-  :type '(repeat (cons symbol (choice string symbol))))
+  :type '(repeat (cons :tag "Entry for major mode"
+                       (choice (const  :tag "Default" t)
+                               (symbol :tag "Major mode"))
+                       (choice (const  :tag "No-break space (U+00A0)" "\u00A0")
+                               (string :tag "String    ")
+                               (symbol :tag "Like other")))))
 
 (defcustom tildify-ignored-environments-alist
-  '((latex-mode
+  `((latex-mode
      ("\\\\\\\\" . "")         ; do not remove this
-     ("\\\\begin{verbatim}" . "\\\\end{verbatim}")
+     (,(eval-when-compile (concat
+                           "\\\\begin{\\("
+                           (regexp-opt '("verbatim" "math" "displaymath"
+                                         "equation" "eqnarray" "eqnarray*"))
+                           "\\)}"))
+      . ("\\\\end{" 1 "}"))
      ("\\\\verb\\*?\\(.\\)" . (1))
-     ("\\$\\$" . "\\$\\$")
-     ("\\$" . "\\$")
+     ("\\$\\$?" . (0))
      ("\\\\(" . "\\\\)")
      ("\\\\[[]" . "\\\\[]]")
-     ("\\\\begin{math}" . "\\\\end{math}")
-     ("\\\\begin{displaymath}" . "\\\\end{displaymath}")
-     ("\\\\begin{equation}" . "\\\\end{equation}")
-     ("\\\\begin{eqnarray\\*?}" . "\\\\end{eqnarray\\*?}")
      ("\\\\[a-zA-Z]+\\( +\\|{}\\)[a-zA-Z]*" . "")
      ("%" . "$"))
     (plain-tex-mode . latex-mode)
     (html-mode
-     ("<pre[^>]*>" . "</pre>")
-     ("<dfn>" . "</dfn>")
-     ("<code>" . "</code>")
-     ("<samp>" . "</samp>")
-     ("<kbd>" . "</kbd>")
-     ("<var>" . "</var>")
-     ("<PRE[^>]*>" . "</PRE>")
-     ("<DFN>" . "</DFN>")
-     ("<CODE>" . "</CODE>")
-     ("<SAMP>" . "</SAMP>")
-     ("<KBD>" . "</KBD>")
-     ("<VAR>" . "</VAR>")
+     (,(eval-when-compile (concat
+                           "<\\("
+                           (regexp-opt '("pre" "dfn" "code" "samp" "kbd" "var"
+                                         "PRE" "DFN" "CODE" "SAMP" "KBD" "VAR"))
+                           "\\)\\>[^>]*>"))
+      . ("</" 1 ">"))
      ("<! *--" . "-- *>")
      ("<" . ">"))
     (sgml-mode . html-mode)
-    (t nil))
+    (xml-mode
+     ("<! *--" . "-- *>")
+     ("<" . ">"))
+    (nxml-mode . xml-mode))
   "Alist specifying ignored structured text environments.
 Parts of text defined in this alist are skipped without performing hard space
 insertion on them.  These setting allow skipping text parts like verbatim or
@@ -160,133 +170,123 @@ END-REGEX defines end of the corresponding text part and can be either:
   subexpressions of BEG-REGEX (this is used to solve cases like
   \\\\verb<character> in TeX)."
   :group 'tildify
-  :type '(repeat (cons symbol (choice symbol (repeat sexp)))))
-
-
-;;; *** Internal variables ***
-
-(defvar tildify-count nil
-  "Counter for replacements.")
+  :type '(repeat
+          (cons :tag "Entry for major mode"
+                (choice (const  :tag "Default" t)
+                        (symbol :tag "Major mode"))
+                (choice
+                 (const  :tag "None")
+                 (repeat
+                  :tag "Environments"
+                  (cons :tag "Regexp pair"
+                        (regexp :tag "Open ")
+                        (choice :tag "Close"
+                                (regexp :tag "Regexp")
+                                (list :tag "Regexp and groups (concatenated)"
+                                      (choice (regexp  :tag "Regexp")
+                                              (integer :tag "Group "))))))
+                 (symbol :tag "Like other")))))
 
 
 ;;; *** Interactive functions ***
 
 ;;;###autoload
-(defun tildify-region (beg end)
+(defun tildify-region (beg end &optional dont-ask)
   "Add hard spaces in the region between BEG and END.
 See variables `tildify-pattern-alist', `tildify-string-alist', and
 `tildify-ignored-environments-alist' for information about configuration
 parameters.
-This function performs no refilling of the changed text."
-  (interactive "*r")
-  (setq tildify-count 0)
-  (let (a
-       z
-       (marker-end (copy-marker end))
-       end-env
-       finish
-       (ask t)
-       (case-fold-search nil)
-       (regexp (tildify-build-regexp)) ; beginnings of environments
-       aux)
-    (if regexp
-       ;; Yes, ignored environments exist for the current major mode,
-       ;; tildify just texts outside them
-       (save-excursion
-         (save-restriction
-           (widen)
-           (goto-char (point-min))
-           (while (not finish)
-             (setq a (point))
-             (setq end-env (tildify-find-env regexp))
-             (setq z (copy-marker (if end-env (1- (point)) (point-max))))
-             (if (>= (marker-position z) beg)
-                 (progn
-                   (or (>= a beg) (setq a beg))
-                   (or (<= (marker-position z) (marker-position marker-end))
-                       (setq z marker-end))
-                   (setq aux (tildify-tildify a (marker-position z) ask))
-                   (if (eq aux 'force)
-                       (setq ask nil)
-                     (if (eq aux nil)
-                         (setq finish t)))))
-             (if (>= (marker-position z) (marker-position marker-end))
-                 (setq finish t))
-             (or (>= (point) (marker-position z))
-                 (goto-char (marker-position z)))
-             (if (not finish)
-                 (if (re-search-forward end-env nil t)
-                     (if (> (point) (marker-position marker-end))
-                         (setq finish t))
-                   (message
-                    "End of environment not found: %s" end-env)
-                   (setq finish t))))))
-      ;; No ignored environments, tildify directly
-      (tildify-tildify beg end ask)))
-  (message "%d spaces replaced." tildify-count))
+This function performs no refilling of the changed text.
+If DONT-ASK is set, or called interactively with prefix argument, user
+won't be prompted for confirmation of each substitution."
+  (interactive "*rP")
+  (let (case-fold-search (count 0) (ask (not dont-ask)))
+    (tildify-foreach-region-outside-env beg end
+      (lambda (beg end)
+        (let ((aux (tildify-tildify beg end ask)))
+          (setq count (+ count (car aux)))
+          (if (not (eq (cdr aux) 'force))
+              (cdr aux)
+            (setq ask nil)
+            t))))
+    (message "%d spaces replaced." count)))
 
 ;;;###autoload
-(defun tildify-buffer ()
+(defun tildify-buffer (&optional dont-ask)
   "Add hard spaces in the current buffer.
 See variables `tildify-pattern-alist', `tildify-string-alist', and
 `tildify-ignored-environments-alist' for information about configuration
 parameters.
-This function performs no refilling of the changed text."
-  (interactive  "*")
-  (tildify-region (point-min) (point-max)))
+This function performs no refilling of the changed text.
+If DONT-ASK is set, or called interactively with prefix argument, user
+won't be prompted for confirmation of each substitution."
+  (interactive  "*P")
+  (tildify-region (point-min) (point-max) dont-ask))
 
 
 ;;; *** Auxiliary functions ***
 
-(defun tildify-build-regexp ()
-  "Build start of environment regexp."
-  (let ((alist (tildify-mode-alist tildify-ignored-environments-alist))
-       regexp)
-    (when alist
-      (setq regexp (caar alist))
-      (setq alist (cdr alist))
-      (while alist
-       (setq regexp (concat regexp "\\|" (caar alist)))
-       (setq alist (cdr alist)))
-      regexp)))
-
 (defun tildify-mode-alist (mode-alist &optional mode)
   "Return alist item for the MODE-ALIST in the current major MODE."
-  (if (null mode)
-      (setq mode major-mode))
-  (let ((alist (cdr (or (assoc mode mode-alist)
+  (let ((alist (cdr (or (assoc (or mode major-mode) mode-alist)
                        (assoc t mode-alist)))))
     (if (and alist
             (symbolp alist))
        (tildify-mode-alist mode-alist alist)
       alist)))
 
-(defun tildify-find-env (regexp)
+(defun tildify-foreach-region-outside-env (beg end callback)
+  "Scan region from BEG to END calling CALLBACK on portions out of environments.
+Call CALLBACK on each region outside of environment to ignore.
+CALLBACK will only be called for regions which have intersection
+with [BEG END].  It must be a function that takes two point
+arguments specifying the region to operate on.  Stop scanning the
+region as soon as CALLBACK returns nil.  Environments to ignore
+are determined from `tildify-ignored-environments-alist'."
+  (declare (indent 2))
+  (let ((pairs (tildify-mode-alist tildify-ignored-environments-alist)))
+    (if (not pairs)
+        (funcall callback beg end)
+      (let ((func (lambda (b e)
+                    (let ((b (max b beg)) (e (min e end)))
+                    (if (< b e) (funcall callback b e) t))))
+            (beg-re (concat "\\(?:"
+                            (mapconcat 'car pairs "\\)\\|\\(?:")
+                            "\\)"))
+            p end-re)
+        (save-excursion
+          (save-restriction
+            (widen)
+            (goto-char (point-min))
+            (while (and (< (setq p (point)) end)
+                        (if (not (setq end-re
+                                       (tildify-find-env beg-re pairs)))
+                            (progn (funcall func p end) nil)
+                          (funcall func p (match-beginning 0))
+                          (when (< (point) end)
+                            (setq p (point))
+                            (re-search-forward end-re nil t)))))))))))
+
+(defun tildify-find-env (regexp pairs)
   "Find environment using REGEXP.
-Return regexp for the end of the environment or nil if no environment was
-found."
+Return regexp for the end of the environment found in PAIRS or nil if
+no environment was found."
   ;; Find environment
-  (if (re-search-forward regexp nil t)
-      ;; Build end-env regexp
-      (let ((match (match-string 0))
-           (alist (tildify-mode-alist tildify-ignored-environments-alist))
-           expression)
-       (save-match-data
-         (while (not (eq (string-match (caar alist) match) 0))
-           (setq alist (cdr alist))))
-       (if (stringp (setq expression (cdar alist)))
-           expression
-         (let ((result "")
-               aux)
-           (while expression
-             (setq result (concat result
-                                  (if (stringp (setq aux (car expression)))
-                                      expression
-                                    (regexp-quote (match-string aux)))))
-             (setq expression (cdr expression)))
-           result)))
-    ;; Return nil if not found
-    nil))
+  (when (re-search-forward regexp nil t)
+    (save-match-data
+      (let ((match (match-string 0)))
+        (while (not (eq (string-match (caar pairs) match) 0))
+          (setq pairs (cdr pairs)))
+        (let ((expression (cdar pairs)))
+          (if (stringp expression)
+              expression
+            (mapconcat
+             (lambda (expr)
+               (if (stringp expr)
+                   expr
+                 (regexp-quote (match-string expr match))))
+             expression
+             "")))))))
 
 (defun tildify-tildify (beg end ask)
   "Add tilde characters in the region between BEG and END.
@@ -295,8 +295,9 @@ macros.
 
 If ASK is nil, perform replace without asking user for confirmation.
 
-Returns one of symbols: t (all right), nil (quit), force (replace without
-further questions)."
+Returns (count . response) cons where count is number of string
+replacements done and response is one of symbols: t (all right), nil
+(quit), force (replace without further questions)."
   (save-excursion
     (goto-char beg)
     (let* ((alist (tildify-mode-alist tildify-pattern-alist))
@@ -308,7 +309,8 @@ further questions)."
           bad-answer
           replace
           quit
-          (message-log-max nil))
+          (message-log-max nil)
+          (count 0))
       (while (and (not quit)
                  (re-search-forward regexp (marker-position end-marker) t))
        (when (or (not ask)
@@ -335,12 +337,11 @@ further questions)."
                      (setq bad-answer t)))
                    replace))
          (replace-match tilde t t nil match-number)
-         (setq tildify-count (1+ tildify-count))))
+         (setq count (1+ count))))
       ;; Return value
-      (cond
-       (quit nil)
-       ((not ask) 'force)
-       (t t)))))
+      (cons count (cond (quit nil)
+                        ((not ask) 'force)
+                        (t t))))))
 
 
 ;;; *** Announce ***
index 4880bfea30b808b1fe4c0872d20f7e8c43ba1100..b8e34ea65c4e52e6a38868c4e195e00bfd4a0460 100644 (file)
@@ -6,15 +6,34 @@
        (url-insert-file-contents): Condition on url-http-response-status
        for the HTTP/S specific part.  (Bug#17549)
 
-2014-05-09  Michael Albinus  <michael.albinus@gmx.de>
+2014-05-14  Glenn Morris  <rgm@gnu.org>
+
+       * url-util.el (url-make-private-file): Use with-file-modes.
+
+2014-05-12  Michael Albinus  <michael.albinus@gmx.de>
 
        * url-handlers.el (url-file-handler-load-in-progress): New defvar.
        (url-file-handler): Use it, in order to avoid recursive load.
 
-2014-05-01  Glenn Morris  <rgm@gnu.org>
+2014-05-04  Glenn Morris  <rgm@gnu.org>
 
        * url-parse.el (url-generic-parse-url): Doc fix (replace `iff').
 
+2014-04-01  Michael Albinus  <michael.albinus@gmx.de>
+
+       * url-tramp.el: New file.
+
+       * url-handlers.el (url-handler-regexp): Add ssh, scp, rsync and telnet.
+       Add :version.
+       (url-file-handler): Call `url-tramp-file-handler' if appropriate.
+
+2014-03-28  Glenn Morris  <rgm@gnu.org>
+
+       * url-vars.el (url-bug-address): Make into an obsolete alias.
+       * url-http.el (url-http-handle-authentication):
+       * url-news.el (url-news-fetch-message-id):
+       Use M-x report-emacs-bug in help messages.
+
 2014-03-26  Juanma Barranquero  <lekktu@gmail.com>
 
        * url-handlers.el (url-http-parse-response): Add autoload.
index fcb6e70f4d7c836b802116225dc622d2dd12f63c..6adb2d978af18cf398c3fc2078ddcf58f50b0f5b 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2001, 2004-2014 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
-;; Maintainer: Bill Perry <wmperry@gnu.org>
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: url, vc
 
 ;; This file is part of GNU Emacs.
index 2a9c6ead029dd5eb0727d0005e38ce191f27f3e1..b1cc8a29e3befaa6d9f53f9e431170cec1c7c46a 100644 (file)
@@ -3,6 +3,7 @@
 ;; Copyright (C) 1997-1998, 2004-2014 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: comm, data, processes
 
 ;; This file is part of GNU Emacs.
index 0572e6eec8b8bc527c74ba7f875670aafd026db8..704c743bfcdf5ddf3a2719a3d4822573651f636a 100644 (file)
@@ -111,7 +111,7 @@ the mode if ARG is omitted or nil."
       (push (cons url-handler-regexp 'url-file-handler)
            file-name-handler-alist)))
 
-(defcustom url-handler-regexp "\\`\\(https?\\|ftp\\|file\\|nfs\\)://"
+(defcustom url-handler-regexp "\\`\\(https?\\|ftp\\|file\\|nfs\\|ssh\\|scp\\|rsync\\|telnet\\)://"
   "Regular expression for URLs handled by `url-handler-mode'.
 When URL Handler mode is enabled, this regular expression is
 added to `file-name-handler-alist'.
@@ -122,6 +122,7 @@ regular expression avoids conflicts with local files that look
 like URLs \(Gnus is particularly bad at this\)."
   :group 'url
   :type 'regexp
+  :version "24.5"
   :set (lambda (symbol value)
         (let ((enable url-handler-mode))
           (url-handler-mode 0)
@@ -147,21 +148,30 @@ the arguments that would have been passed to OPERATION."
   ;; Avoid recursive load.
   (if (and load-in-progress url-file-handler-load-in-progress)
       (url-run-real-handler operation args)
-    (let ((url-file-handler-load-in-progress load-in-progress)
-         (fn (get operation 'url-file-handlers))
-         (val nil)
-         (hooked nil))
-      (if (and (not fn) (intern-soft (format "url-%s" operation))
-              (fboundp (intern-soft (format "url-%s" operation))))
-         (error "Missing URL handler mapping for %s" operation))
-      (if fn
-         (setq hooked t
-               val (save-match-data (apply fn args)))
-       (setq hooked nil
-             val (url-run-real-handler operation args)))
-      (url-debug 'handlers "%s %S%S => %S" (if hooked "Hooked" "Real")
-                operation args val)
-      val)))
+    (let ((url-file-handler-load-in-progress load-in-progress))
+      ;; Check, whether there are arguments we want pass to Tramp.
+      (if (catch :do
+            (dolist (url (cons default-directory args))
+              (and (member
+                    (url-type (url-generic-parse-url (and (stringp url) url)))
+                    url-tramp-protocols)
+                   (throw :do t))))
+          (apply 'url-tramp-file-handler operation args)
+        ;; Otherwise, let's do the job.
+        (let ((fn (get operation 'url-file-handlers))
+              (val nil)
+              (hooked nil))
+          (if (and (not fn) (intern-soft (format "url-%s" operation))
+                   (fboundp (intern-soft (format "url-%s" operation))))
+              (error "Missing URL handler mapping for %s" operation))
+          (if fn
+              (setq hooked t
+                    val (save-match-data (apply fn args)))
+            (setq hooked nil
+                  val (url-run-real-handler operation args)))
+          (url-debug 'handlers "%s %S%S => %S" (if hooked "Hooked" "Real")
+                     operation args val)
+          val)))))
 
 (defun url-file-handler-identity (&rest args)
   ;; Identity function
index dcb86689ca9efdcde8aa6640520c4f2eef6797aa..608a865be7b70d8f959c5b02b8afdb7269e13c76 100644 (file)
@@ -3,6 +3,7 @@
 ;; Copyright (C) 1999, 2001, 2004-2014 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: comm, data, processes
 
 ;; This file is part of GNU Emacs.
@@ -413,7 +414,7 @@ Return the number of characters removed."
          (goto-char (point-max))
          (insert "<hr>Sorry, but I do not know how to handle " type
                  " authentication.  If you'd like to write it,"
-                 " send it to " url-bug-address ".<hr>")
+                 " please use M-x report-emacs-bug RET.<hr>")
           ;; We used to set a `status' var (declared "special") but I can't
           ;; find the corresponding let-binding, so it's probably an error.
           ;; FIXME: Maybe it was supposed to set `success', i.e. to return t?
index 105fb67737463438a4fdcf23f989506f7a593069..0ce6d2e6cd1c356537428b6190f728c8e1b255f4 100644 (file)
@@ -70,8 +70,7 @@
                "    </xmp>\n"
                "   </p>\n"
                "   <p>\n"
-               "    If you If you feel this is an error, <a href=\""
-               "mailto:" url-bug-address "\">send mail</a>\n"
+               "    If you feel this is an error, M-x report-emacs-bug RET.\n"
                "   </p>\n"
                "  </div>\n"
                " </body>\n"
diff --git a/lisp/url/url-tramp.el b/lisp/url/url-tramp.el
new file mode 100644 (file)
index 0000000..83cedd1
--- /dev/null
@@ -0,0 +1,79 @@
+;;; url-tramp.el --- file-name-handler magic invoking Tramp for some protocols
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Michael Albinus <michael.albinus@gmx.de>
+;; Keywords: comm, data, processes, hypermedia
+
+;; This file is part of GNU Emacs.
+;;
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'url-parse)
+(require 'tramp)
+(require 'password-cache)
+
+;;;###autoload
+(defcustom url-tramp-protocols '("ftp" "ssh" "scp" "rsync" "telnet")
+  "List of URL protocols the work is handled by Tramp.
+They must also be covered by `url-handler-regexp'."
+  :group 'url
+  :version "24.5"
+  :type '(list string))
+
+(defun url-tramp-convert-url-to-tramp (url)
+  "Convert URL to a Tramp file name."
+  (let ((obj (url-generic-parse-url (and (stringp url) url))))
+    (if (member (url-type obj) url-tramp-protocols)
+       (progn
+         (if (url-password obj)
+             (password-cache-add
+              (tramp-make-tramp-file-name
+               (url-type obj) (url-user obj) (url-host obj) "")
+              (url-password obj))
+           (tramp-make-tramp-file-name
+            (url-type obj) (url-user obj) (url-host obj) (url-filename obj))))
+      url)))
+
+(defun url-tramp-convert-tramp-to-url (file)
+  "Convert FILE, a Tramp file name, to a URL."
+  (let ((obj (ignore-errors (tramp-dissect-file-name file))))
+    (if (member (tramp-file-name-method obj) url-tramp-protocols)
+       (url-recreate-url
+        (url-parse-make-urlobj
+         (tramp-file-name-method obj)
+         (tramp-file-name-user obj)
+         nil ; password.
+         (tramp-file-name-host obj)
+         nil ; port.
+         (tramp-file-name-localname obj)
+         nil nil t)) ; target attributes fullness.
+      file)))
+
+;;;###autoload
+(defun url-tramp-file-handler (operation &rest args)
+  "Function called from the `file-name-handler-alist' routines.
+OPERATION is what needs to be done.  ARGS are the arguments that
+would have been passed to OPERATION."
+  (let ((default-directory (url-tramp-convert-url-to-tramp default-directory))
+       (args (mapcar 'url-tramp-convert-url-to-tramp args)))
+    (url-tramp-convert-tramp-to-url (apply operation args))))
+
+(provide 'url-tramp)
+
+;;; url-tramp.el ends here
index a7d7e3e0fedd2939c262f836b770996de16c7894..b796e769c60c1874c331220c3538e431c7e14e24 100644 (file)
@@ -1,9 +1,9 @@
 ;;; url-util.el --- Miscellaneous helper routines for URL library
 
-;; Copyright (C) 1996-1999, 2001, 2004-2014 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1996-1999, 2001, 2004-2014 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: comm, data, processes
 
 ;; This file is part of GNU Emacs.
@@ -628,14 +628,9 @@ Creates FILE and its parent directories if they do not exist."
       (make-directory dir t)))
   ;; Based on doc-view-make-safe-dir.
   (condition-case nil
-      (let ((umask (default-file-modes)))
-        (unwind-protect
-            (progn
-              (set-default-file-modes #o0600)
-              (with-temp-buffer
-                (write-region (point-min) (point-max)
-                              file nil 'silent nil 'excl)))
-          (set-default-file-modes umask)))
+      (with-file-modes #o0600
+        (with-temp-buffer
+          (write-region (point-min) (point-max) file nil 'silent nil 'excl)))
     (file-already-exists
      (if (file-symlink-p file)
          (error "Danger: `%s' is a symbolic link" file))
index 4cdb59deb27808055097c54879680e9415fd6b8c..62b7b855533cfe5d1af36e4118639e6b72b5ba0d 100644 (file)
@@ -1,7 +1,6 @@
 ;;; url-vars.el --- Variables for Uniform Resource Locator tool
 
-;; Copyright (C) 1996-1999, 2001, 2004-2014 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1996-1999, 2001, 2004-2014 Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
@@ -82,8 +81,8 @@ If non-nil and not t, the user will be asked for each refresh request."
   :type 'boolean
   :group 'url-cache)
 
-(defconst url-bug-address "bug-gnu-emacs@gnu.org"
-  "Where to send bug reports.")
+(define-obsolete-variable-alias 'url-bug-address
+  'report-emacs-bug-address "24.5")
 
 (defcustom url-personal-mail-address nil
   "Your full email address.
index cbbcfd4f18b60595acff8220dff3e5a19a5b67cd..620593a9a811a0336f87afe9b4a19e31b6956ac8 100644 (file)
@@ -1,9 +1,9 @@
 ;;; url.el --- Uniform Resource Locator retrieval tool  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1996-1999, 2001, 2004-2014 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 1996-1999, 2001, 2004-2014 Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: comm, data, processes, hypermedia
 
 ;; This file is part of GNU Emacs.
index 923de9a0ca6261cd6f2e38c61ac50f158343e334..4908c5f496148aa55b60821c975a6277b4cd2a3f 100644 (file)
@@ -302,14 +302,9 @@ well."
 (defvar diff-added-face 'diff-added)
 
 (defface diff-changed
-  ;; We normally apply a `shadow'-based face on the `diff-context'
-  ;; face, and keep `diff-changed' the default.
-  '((((class color grayscale) (min-colors 88)))
-    ;; If the terminal lacks sufficient colors for shadowing,
-    ;; highlight changed lines explicitly.
-    (((class color))
-     :foreground "yellow"))
+  '((t nil))
   "`diff-mode' face used to highlight changed lines."
+  :version "24.5"
   :group 'diff-mode)
 (define-obsolete-face-alias 'diff-changed-face 'diff-changed "22.1")
 (defvar diff-changed-face 'diff-changed)
@@ -343,8 +338,12 @@ well."
 (defvar diff-function-face 'diff-function)
 
 (defface diff-context
-  '((((class color grayscale) (min-colors 88)) :inherit shadow))
+  '((((class color grayscale) (min-colors 88) (background light))
+     :foreground "#333333")
+    (((class color grayscale) (min-colors 88) (background dark))
+     :foreground "#dddddd"))
   "`diff-mode' face used to highlight context and other side-information."
+  :version "24.5"
   :group 'diff-mode)
 (define-obsolete-face-alias 'diff-context-face 'diff-context "22.1")
 (defvar diff-context-face 'diff-context)
@@ -1916,7 +1915,7 @@ For use in `add-log-current-defun-function'."
 
 ;;; Fine change highlighting.
 
-(defface diff-refine-change
+(defface diff-refine-changed
   '((((class color) (min-colors 88) (background light))
      :background "#ffff55")
     (((class color) (min-colors 88) (background dark))
@@ -1924,6 +1923,7 @@ For use in `add-log-current-defun-function'."
     (t :inverse-video t))
   "Face used for char-based changes shown by `diff-refine-hunk'."
   :group 'diff-mode)
+(define-obsolete-face-alias 'diff-refine-change 'diff-refine-changed "24.5")
 
 (defface diff-refine-removed
   '((default
index dd0d76485bf75e7d97fd8a9d4e358962e2a349d9..589ea454965ff2efc105e61f13d398e20661f3d4 100644 (file)
@@ -949,7 +949,9 @@ this variable represents.")
 
 (defface ediff-current-diff-Ancestor
   (if (featurep 'emacs)
-      '((((class color) (min-colors 16))
+      '((((class color) (min-colors 88))
+        (:background "VioletRed"))
+       (((class color) (min-colors 16))
         (:foreground "Black" :background "VioletRed"))
        (((class color))
         (:foreground "black" :background "magenta3"))
@@ -1057,7 +1059,9 @@ this variable represents.")
 
 (defface ediff-fine-diff-Ancestor
   (if (featurep 'emacs)
-      '((((class color) (min-colors 16))
+      '((((class color) (min-colors 88))
+        (:background "Green"))
+       (((class color) (min-colors 16))
         (:foreground "Black" :background "Green"))
        (((class color))
         (:foreground "red3" :background "green"))
@@ -1091,6 +1095,8 @@ this variable represents.")
   (if (featurep 'emacs)
       `((((type pc))
         (:foreground "green3" :background "light grey"))
+       (((class color) (min-colors 88))
+        (:background "light grey"))
        (((class color) (min-colors 16))
         (:foreground "Black" :background "light grey"))
        (((class color))
@@ -1115,7 +1121,9 @@ this variable represents.")
 
 (defface ediff-even-diff-B
   (if (featurep 'emacs)
-      `((((class color) (min-colors 16))
+      `((((class color) (min-colors 88))
+        (:background "Grey"))
+       (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
         (:foreground "blue3" :background "Grey" :weight bold))
@@ -1138,6 +1146,8 @@ this variable represents.")
   (if (featurep 'emacs)
       `((((type pc))
         (:foreground "yellow3" :background "light grey"))
+       (((class color) (min-colors 88))
+        (:background "light grey"))
        (((class color) (min-colors 16))
         (:foreground "Black" :background "light grey"))
        (((class color))
@@ -1164,6 +1174,8 @@ this variable represents.")
   (if (featurep 'emacs)
       `((((type pc))
         (:foreground "cyan3" :background "light grey"))
+       (((class color) (min-colors 88))
+        (:background "Grey"))
        (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
@@ -1197,6 +1209,8 @@ this variable represents.")
   (if (featurep 'emacs)
       '((((type pc))
         (:foreground "green3" :background "gray40"))
+       (((class color) (min-colors 88))
+        (:background "Grey"))
        (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
@@ -1222,6 +1236,8 @@ this variable represents.")
   (if (featurep 'emacs)
       '((((type pc))
         (:foreground "White" :background "gray40"))
+       (((class color) (min-colors 88))
+        (:background "light grey"))
        (((class color) (min-colors 16))
         (:foreground "Black" :background "light grey"))
        (((class color))
@@ -1246,6 +1262,8 @@ this variable represents.")
   (if (featurep 'emacs)
       '((((type pc))
         (:foreground "yellow3" :background "gray40"))
+       (((class color) (min-colors 88))
+        (:background "Grey"))
        (((class color) (min-colors 16))
         (:foreground "White" :background "Grey"))
        (((class color))
@@ -1268,7 +1286,9 @@ this variable represents.")
 
 (defface ediff-odd-diff-Ancestor
   (if (featurep 'emacs)
-      '((((class color) (min-colors 16))
+      '((((class color) (min-colors 88))
+        (:background "gray40"))
+       (((class color) (min-colors 16))
         (:foreground "cyan3" :background "gray40"))
        (((class color))
         (:foreground "green3" :background "black" :weight bold))
@@ -1326,7 +1346,7 @@ this variable represents.")
 (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
   "Overlay for the current difference region in the ancestor buffer.")
 
-(defvar ediff-toggle-read-only-function 'toggle-read-only
+(defvar ediff-toggle-read-only-function 'read-only-mode
   "Function to be used to toggle read-only status of the buffer.
 If nil, Ediff tries using the command bound to C-x C-q.")
 
index dbf5247952727f80aa0da5adec929e32c8043882..9ca9effbfd4297647f4cf953f08c77ffb752f076 100644 (file)
@@ -1027,8 +1027,8 @@ of the current buffer."
                                 (file-writable-p file)))
             (toggle-ro-cmd (cond (ediff-toggle-read-only-function)
                                  ((ediff-file-checked-out-p file)
-                                  'toggle-read-only)
-                                 (file-writable 'toggle-read-only)
+                                  'read-only-mode)
+                                 (file-writable 'read-only-mode)
                                  (t (key-binding "\C-x\C-q")))))
        ;; If the file is checked in, make sure we don't make buffer modifiable
        ;; without warning the user.  The user can fool our checks by making the
@@ -1039,7 +1039,7 @@ of the current buffer."
                 ;; non-interactively, in which case don't ask questions
                 ctl-buf)
            (cond ((not buffer-read-only)
-                  (setq toggle-ro-cmd 'toggle-read-only))
+                  (setq toggle-ro-cmd 'read-only-mode))
                  ((and (or (beep 1) t) ; always beep
                        (y-or-n-p
                         (format
@@ -1054,13 +1054,13 @@ of the current buffer."
                     (ediff-change-saved-variable
                      'buffer-read-only nil buf-type)))
                  (t
-                  (setq toggle-ro-cmd 'toggle-read-only)
+                  (setq toggle-ro-cmd 'read-only-mode)
                   (beep 1) (beep 1)
                   (message
                    "Boy, this is risky! Don't modify this file...")
                   (sit-for 3)))) ; let the user see the warning
        (if (and toggle-ro-cmd
-                (string-match "toggle-read-only" (symbol-name toggle-ro-cmd)))
+                (string-match "read-only-mode" (symbol-name toggle-ro-cmd)))
            (save-excursion
              (save-window-excursion
                (select-window (ediff-get-visible-buffer-window buf))
index d4638616dd746580576c936206e9438cdf53885f..b17d11d34a43fd2f589a32fc48c8ebd595c4a3c1 100644 (file)
@@ -2883,17 +2883,11 @@ keymap.  Leaves merge in fast mode."
     (setq vars (cdr vars))
     (setq values (cdr values))))
 
-;; Make a temporary file that only we have access to.
-;; PREFIX is appended to emerge-temp-file-prefix to make the filename prefix.
+;; When the pointless option emerge-temp-file-prefix goes,
+;; make this function obsolete too, and just use make-temp-file.
 (defun emerge-make-temp-file (prefix)
-  (let (f (old-modes (default-file-modes)))
-    (unwind-protect
-       (progn
-         ;; This has no effect, since make-temp-file sets umask = 700.
-         (set-default-file-modes emerge-temp-file-mode)
-         (setq f (make-temp-file (concat emerge-temp-file-prefix prefix))))
-      (set-default-file-modes old-modes))
-    f))
+  "Make a private temporary file based on `emerge-temp-file-prefix'."
+  (make-temp-file (concat emerge-temp-file-prefix prefix)))
 
 ;;; Functions that query the user before he can write out the current buffer.
 
index cc9c4673345a4778ee90581812766b817476f31d..771281555ab054b81bbc12c4d70597a03467b8ba 100644 (file)
@@ -116,9 +116,10 @@ Used in `smerge-diff-base-mine' and related functions."
 (define-obsolete-face-alias 'smerge-markers-face 'smerge-markers "22.1")
 (defvar smerge-markers-face 'smerge-markers)
 
-(defface smerge-refined-change
+(defface smerge-refined-changed
   '((t nil))
   "Face used for char-based changes shown by `smerge-refine'.")
+(define-obsolete-face-alias 'smerge-refined-change 'smerge-refined-changed "24.5")
 
 (defface smerge-refined-removed
   '((default
index 424b48a4ffaadf0b7b07f730a2a2309c53fe4a27..d3e10a63f56b369ffbc234b82669eb851175c771 100644 (file)
                         :value "20.5"))
   :group 'vc)
 
+(defcustom vc-annotate-background-mode
+  (not (or (eq (or frame-background-mode
+                  (frame-parameter nil 'background-mode))
+              'dark)
+          (and (tty-display-color-p) (<= (display-color-cells) 8))))
+  "Non-nil means `vc-annotate-color-map' is applied to the background.
+
+When non-nil, the color range from `vc-annotate-color-map' is applied
+to the background, while the foreground remains default.
+
+When nil, the color range from `vc-annotate-color-map' is applied
+to the foreground, and the color from the option `vc-annotate-background'
+is applied to the background."
+  :type 'boolean
+  :version "24.5"
+  :group 'vc)
+
 (defcustom vc-annotate-color-map
   (if (and (tty-display-color-p) (<= (display-color-cells) 8))
       ;; A custom sorted TTY colormap
                  (prog1
                      (cons date x)
                    (setq date (+ date delta)))) colors))
-    ;; Normal colormap: hue stepped from 0-240deg, value=1., saturation=0.75
-    '(( 20. . "#FF3F3F")
-      ( 40. . "#FF6C3F")
-      ( 60. . "#FF993F")
-      ( 80. . "#FFC63F")
-      (100. . "#FFF33F")
-      (120. . "#DDFF3F")
-      (140. . "#B0FF3F")
-      (160. . "#83FF3F")
-      (180. . "#56FF3F")
-      (200. . "#3FFF56")
-      (220. . "#3FFF83")
-      (240. . "#3FFFB0")
-      (260. . "#3FFFDD")
-      (280. . "#3FF3FF")
-      (300. . "#3FC6FF")
-      (320. . "#3F99FF")
-      (340. . "#3F6CFF")
-      (360. . "#3F3FFF")))
+    (cond
+     ;; Normal colormap for background colors with dark foreground:
+     ;; hue stepped from 0-240deg, value=1., saturation=0.20
+     (vc-annotate-background-mode
+      '(( 20. . "#FFCCCC")
+       ( 40. . "#FFD8CC")
+       ( 60. . "#FFE4CC")
+       ( 80. . "#FFF0CC")
+       (100. . "#FFFCCC")
+       (120. . "#F6FFCC")
+       (140. . "#EAFFCC")
+       (160. . "#DEFFCC")
+       (180. . "#D2FFCC")
+       (200. . "#CCFFD2")
+       (220. . "#CCFFDE")
+       (240. . "#CCFFEA")
+       (260. . "#CCFFF6")
+       (280. . "#CCFCFF")
+       (300. . "#CCF0FF")
+       (320. . "#CCE4FF")
+       (340. . "#CCD8FF")
+       (360. . "#CCCCFF")))
+     ;; Normal colormap for foreground colors on dark background:
+     ;; hue stepped from 0-240deg, value=1., saturation=0.75
+     (t
+      '(( 20. . "#FF3F3F")
+       ( 40. . "#FF6C3F")
+       ( 60. . "#FF993F")
+       ( 80. . "#FFC63F")
+       (100. . "#FFF33F")
+       (120. . "#DDFF3F")
+       (140. . "#B0FF3F")
+       (160. . "#83FF3F")
+       (180. . "#56FF3F")
+       (200. . "#3FFF56")
+       (220. . "#3FFF83")
+       (240. . "#3FFFB0")
+       (260. . "#3FFFDD")
+       (280. . "#3FF3FF")
+       (300. . "#3FC6FF")
+       (320. . "#3F99FF")
+       (340. . "#3F6CFF")
+       (360. . "#3F3FFF")))))
   "Association list of age versus color, for \\[vc-annotate].
 Ages are given in units of fractional days.  Default is eighteen
 steps using a twenty day increment, from red to blue.  For TTY
@@ -98,12 +139,12 @@ all other colors between (excluding black and white)."
   :type 'alist
   :group 'vc)
 
-(defcustom vc-annotate-very-old-color "#3F3FFF"
+(defcustom vc-annotate-very-old-color (if vc-annotate-background-mode "#CCCCFF" "#3F3FFF")
   "Color for lines older than the current color range in \\[vc-annotate]."
   :type 'string
   :group 'vc)
 
-(defcustom vc-annotate-background "black"
+(defcustom vc-annotate-background nil
   "Background color for \\[vc-annotate].
 Default color is used if nil."
   :type '(choice (const :tag "Default background" nil) (color))
@@ -347,7 +388,9 @@ Customization variables:
 `vc-annotate-menu-elements' customizes the menu elements of the
 mode-specific menu.  `vc-annotate-color-map' and
 `vc-annotate-very-old-color' define the mapping of time to colors.
-`vc-annotate-background' specifies the background color."
+`vc-annotate-background' specifies the background color.
+`vc-annotate-background-mode' specifies whether the color map
+should be applied to the background or to the foreground."
   (interactive
    (save-current-buffer
      (vc-ensure-vc-buffer)
@@ -666,10 +709,13 @@ The annotations are relative to the current time, unless overridden by OFFSET."
                ;; Make the face if not done.
                (face (or (intern-soft face-name)
                          (let ((tmp-face (make-face (intern face-name))))
-                           (set-face-foreground tmp-face (cdr color))
-                           (when vc-annotate-background
-                            (set-face-background tmp-face
-                                                 vc-annotate-background))
+                           (cond
+                            (vc-annotate-background-mode
+                             (set-face-background tmp-face (cdr color)))
+                            (t
+                             (set-face-foreground tmp-face (cdr color))
+                             (when vc-annotate-background
+                              (set-face-background tmp-face vc-annotate-background))))
                            tmp-face))))        ; Return the face
           (put-text-property start end 'face face)))))
   ;; Pretend to font-lock there were no matches.
index 0730a9c72ce3be97a176d3b9f3a166033a51027a..4693998dfaf04260b708a8f71612b315caa05604 100644 (file)
@@ -1132,11 +1132,12 @@ stream.  Standard error output is discarded."
                   (file &optional keep noquery reset-vc-info))
 
 (defun vc-bzr-shelve (name)
-  "Create a shelve."
+  "Shelve the changes of the selected files."
   (interactive "sShelf name: ")
-  (let ((root (vc-bzr-root default-directory)))
+  (let ((root (vc-bzr-root default-directory))
+        (fileset (vc-deduce-fileset)))
     (when root
-      (vc-bzr-command "shelve" nil 0 nil "--all" "-m" name)
+      (vc-bzr-command "shelve" nil 0 (nth 1 fileset) "--all" "-m" name)
       (vc-resynch-buffer root t t))))
 
 (defun vc-bzr-shelve-show (name)
index b800c64c8697a92a42f12dc765b9fbb53a5bb6c3..df61006ad51c132c487aaa09eabd75210ef984f5 100644 (file)
@@ -82,8 +82,8 @@
 ;; - annotate-current-time ()                  NOT NEEDED
 ;; - annotate-extract-revision-at-line ()      OK
 ;; TAG SYSTEM
-;; - create-tag (dir name branchp)             NEEDED
-;; - retrieve-tag (dir name update)            NEEDED
+;; - create-tag (dir name branchp)             OK
+;; - retrieve-tag (dir name update)            OK FIXME UPDATE BUFFERS
 ;; MISCELLANEOUS
 ;; - make-version-backups-p (file)             ??
 ;; - repository-hostname (dirname)             ??
@@ -146,12 +146,19 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   :group 'vc-hg)
 
 (defcustom vc-hg-root-log-format
-  '("{rev}:{tags}: {author|person} {date|shortdate} {desc|firstline}\\n"
-    "^\\([0-9]+\\):\\([^:]*\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)"
+  `(,(concat "{rev}:{ifeq(branch, 'default','', '{branch}')}"
+             ":{bookmarks}:{tags}:{author|person}"
+             " {date|shortdate} {desc|firstline}\\n")
+    ,(concat "^\\(?:[+@o x|-]*\\)"      ;Graph data.
+             "\\([0-9]+\\):\\([^:]*\\)"
+             ":\\([^:]*\\):\\([^:]*\\):\\(.*?\\)"
+             "[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)")
     ((1 'log-view-message-face)
-     (2 'change-log-list)
-     (3 'change-log-name)
-     (4 'change-log-date)))
+     (2 'change-log-file)
+     (3 'change-log-list)
+     (4 'change-log-conditionals)
+     (5 'change-log-name)
+     (6 'change-log-date)))
   "Mercurial log template for `vc-hg-print-log' short format.
 This should be a list (TEMPLATE REGEXP KEYWORDS), where TEMPLATE
 is the \"--template\" argument string to pass to Mercurial,
@@ -160,7 +167,7 @@ output, and KEYWORDS is a list of `font-lock-keywords' for
 highlighting the Log View buffer."
   :type '(list string string (repeat sexp))
   :group 'vc-hg
-  :version "24.1")
+  :version "24.5")
 
 \f
 ;;; Properties of the backend
@@ -244,6 +251,9 @@ highlighting the Log View buffer."
 
 (autoload 'vc-setup-buffer "vc-dispatcher")
 
+(defvar vc-hg-log-graph nil
+  "If non-nil, use `--graph' in the short log output.")
+
 (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit)
   "Print commit log associated with FILES into specified BUFFER.
 If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'.
@@ -261,7 +271,9 @@ If LIMIT is non-nil, show no more than this many entries."
             (nconc
              (when start-revision (list (format "-r%s:0" start-revision)))
              (when limit (list "-l" (format "%s" limit)))
-             (when shortlog (list "--template" (car vc-hg-root-log-format)))
+             (when shortlog `(,@(if vc-hg-log-graph '("--graph"))
+                               "--template"
+                               ,(car vc-hg-root-log-format)))
              vc-hg-log-switches)))))
 
 (defvar log-view-message-re)
@@ -376,8 +388,26 @@ Optional arg REVISION is a revision to annotate from."
       (if (match-beginning 3)
          (match-string-no-properties 1)
        (cons (match-string-no-properties 1)
-             (expand-file-name (match-string-no-properties 4)
-                               (vc-hg-root default-directory)))))))
+      (expand-file-name (match-string-no-properties 4)
+ (vc-hg-root default-directory)))))))
+
+;;; Tag system
+
+(defun vc-hg-create-tag (dir name branchp)
+  "Attach the tag NAME to the state of the working copy."
+  (let ((default-directory dir))
+    (and (vc-hg-command nil 0 nil "status")
+         (vc-hg-command nil 0 nil (if branchp "bookmark" "tag") name))))
+
+(defun vc-hg-retrieve-tag (dir name update)
+  "Retrieve the version tagged by NAME of all registered files at or below DIR."
+  (let ((default-directory dir))
+    (vc-hg-command nil 0 nil "update" name)
+    ;; FIXME: update buffers if `update' is true
+    ;; TODO: update *vc-change-log* buffer so can see @ if --graph
+    ))
+
+;;; Miscellaneous
 
 (defun vc-hg-previous-revision (_file rev)
   (let ((newrev (1- (string-to-number rev))))
index fb10edca06dd0096d0f41ae8941892c790b05dff..df660d193e281540b2735a6a9c3e247da38dfa19 100644 (file)
@@ -190,6 +190,11 @@ individually should stay local."
 (make-variable-buffer-local 'vc-mode)
 (put 'vc-mode 'permanent-local t)
 
+;;; We signal this error when we try to do something a VC backend
+;;; doesn't support.  Two arguments: the method that's not supported
+;;; and the backend
+(define-error 'vc-not-supported "VC method not implemented for backend")
+
 (defun vc-mode (&optional _arg)
   ;; Dummy function for C-h m
   "Version Control minor mode.
@@ -268,10 +273,10 @@ It is usually called via the `vc-call' macro."
       (setq f (vc-find-backend-function backend function-name))
       (push (cons function-name f) (get backend 'vc-functions)))
     (cond
-     ((null f)
-      (error "Sorry, %s is not implemented for %s" function-name backend))
-     ((consp f)        (apply (car f) (cdr f) args))
-     (t                (apply f args)))))
+      ((null f)
+       (signal 'vc-not-supported (list function-name backend)))
+      ((consp f)       (apply (car f) (cdr f) args))
+      (t               (apply f args)))))
 
 (defmacro vc-call (fun file &rest args)
   "A convenience macro for calling VC backend functions.
index 4a536900eb3967e9a5cb03ca645fb853da7c3047..5491d67e700fb9db61fdf174e3a1dfbff06d5747 100644 (file)
@@ -1878,6 +1878,19 @@ saving the buffer."
         t (list backend (list rootdir) working-revision) nil nil
         (called-interactively-p 'interactive))))))
 
+;;;###autoload
+(defun vc-root-dir ()
+  "Return the root directory for the current VC tree.
+Return nil if the root directory cannot be identified."
+  (let ((backend (vc-deduce-backend)))
+    (if backend
+        (condition-case err
+            (vc-call-backend backend 'root default-directory)
+          (vc-not-supported
+           (unless (eq (cadr err) 'root)
+             (signal (car err) (cdr err)))
+           nil)))))
+
 ;;;###autoload
 (defun vc-revision-other-window (rev)
   "Visit revision REV of the current file in another window.
@@ -2450,7 +2463,7 @@ depending on the underlying version-control system."
        (error "Please revert all modified workfiles before rollback")))
     ;; Accumulate changes associated with the fileset
     (vc-setup-buffer "*vc-diff*")
-    (not-modified)
+    (set-buffer-modified-p nil)
     (message "Finding changes...")
     (let* ((tip (vc-working-revision (car files)))
            ;; FIXME: `previous-revision' should take the fileset.
index 83bd4e0607476953a0784e01ef9faac59885023b..917f0432ef2b11475c9b99affc54d67916392461 100644 (file)
@@ -1204,6 +1204,8 @@ SYMBOL    is a valid symbol associated with CHAR.
 (defvar whitespace-point (point)
   "Used to save locally current point value.
 Used by function `whitespace-trailing-regexp' (which see).")
+(defvar-local whitespace-point--used nil
+  "Region whose highlighting depends on `whitespace-point'.")
 
 (defvar whitespace-font-lock-refontify nil
   "Used to save locally the font-lock refontify state.
@@ -1717,43 +1719,7 @@ It is a cons of strings, where the car part is used when
 (defun whitespace-report (&optional force report-if-bogus)
   "Report some whitespace problems in buffer.
 
-Return nil if there is no whitespace problem; otherwise, return
-non-nil.
-
-If FORCE is non-nil or \\[universal-argument] was pressed just
-before calling `whitespace-report' interactively, it forces
-`whitespace-style' to have:
-
-   empty
-   trailing
-   indentation
-   space-before-tab
-   space-after-tab
-
-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
-
-Report if some of the following whitespace problems exist:
-
-* If `indent-tabs-mode' is non-nil:
-   empty               1. empty lines at beginning of buffer.
-   empty               2. empty lines at end of buffer.
-   trailing            3. SPACEs or TABs at end of line.
-   indentation         4. 8 or more SPACEs at beginning of line.
-   space-before-tab    5. SPACEs before TAB.
-   space-after-tab     6. 8 or more SPACEs after TAB.
-
-* If `indent-tabs-mode' is nil:
-   empty               1. empty lines at beginning of buffer.
-   empty               2. empty lines at end of buffer.
-   trailing            3. SPACEs or TABs at end of line.
-   indentation         4. TABS at beginning of line.
-   space-before-tab    5. SPACEs before TAB.
-   space-after-tab     6. 8 or more SPACEs after TAB.
-
-See `whitespace-style' for documentation.
-See also `whitespace-cleanup' and `whitespace-cleanup-region' for
-cleaning up these problems."
+Perform `whitespace-report-region' on the current buffer."
   (interactive (list current-prefix-arg))
   (whitespace-report-region (point-min) (point-max)
                            force report-if-bogus))
@@ -1771,13 +1737,14 @@ before calling `whitespace-report-region' interactively, it
 forces `whitespace-style' to have:
 
    empty
+   trailing
    indentation
    space-before-tab
-   trailing
    space-after-tab
 
-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
+If REPORT-IF-BOGUS is t, it reports only when there are any
+whitespace problems in buffer; if it is `never', it does not
+report problems.
 
 Report if some of the following whitespace problems exist:
 
@@ -1832,7 +1799,7 @@ cleaning up these problems."
                     (and (re-search-forward regexp rend t)
                          (setq has-bogus t))))
               whitespace-report-list)))
-       (when (if report-if-bogus has-bogus t)
+       (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus))
          (whitespace-kill-buffer whitespace-report-buffer-name)
          ;; `whitespace-indent-tabs-mode' is local to current buffer
          ;; `whitespace-tab-width' is local to current buffer
@@ -2155,7 +2122,10 @@ resultant list will be returned."
   (when (whitespace-style-face-p)
     ;; save current point and refontify when necessary
     (set (make-local-variable 'whitespace-point)
-        (point))
+         (point))
+    (setq whitespace-point--used
+          (let ((ol (make-overlay (point) (point) nil nil t)))
+            (delete-overlay ol) ol))
     (set (make-local-variable 'whitespace-font-lock-refontify)
         0)
     (set (make-local-variable 'whitespace-bob-marker)
@@ -2170,6 +2140,7 @@ resultant list will be returned."
     (setq
      whitespace-font-lock-keywords
      `(
+       (whitespace-point--flush-used)
        ,@(when (memq 'spaces whitespace-active-style)
            ;; Show SPACEs.
            `((,whitespace-space-regexp 1 whitespace-space t)
@@ -2247,26 +2218,47 @@ resultant list will be returned."
                  (whitespace-space-after-tab-regexp 'space)))
               1 whitespace-space-after-tab t)))))
     (font-lock-add-keywords nil whitespace-font-lock-keywords t)
-    (when font-lock-mode
-      (font-lock-fontify-buffer))))
+    (font-lock-flush)))
 
 
 (defun whitespace-color-off ()
   "Turn off color visualization."
   ;; turn off font lock
+  (kill-local-variable 'whitespace-point--used)
   (when (whitespace-style-face-p)
     (remove-hook 'post-command-hook #'whitespace-post-command-hook t)
     (remove-hook 'before-change-functions #'whitespace-buffer-changed t)
     (font-lock-remove-keywords nil whitespace-font-lock-keywords)
-    (when font-lock-mode
-      (font-lock-fontify-buffer))))
-
+    (font-lock-flush)))
+
+(defun whitespace-point--used (start end)
+  (let ((ostart (overlay-start whitespace-point--used)))
+    (if ostart
+        (move-overlay whitespace-point--used
+                      (min start ostart)
+                      (max end (overlay-end whitespace-point--used)))
+      (move-overlay whitespace-point--used start end))))
+
+(defun whitespace-point--flush-used (limit)
+  (let ((ostart (overlay-start whitespace-point--used)))
+    ;; Strip parts of whitespace-point--used we're about to refresh.
+    (when ostart
+      (let ((oend (overlay-end whitespace-point--used)))
+        (if (<= (point) ostart)
+            (if (<= oend limit)
+                (delete-overlay whitespace-point--used)
+              (move-overlay whitespace-point--used limit oend)))
+        (if (<= oend limit)
+            (move-overlay whitespace-point--used ostart (point))))))
+  nil)
 
 (defun whitespace-trailing-regexp (limit)
   "Match trailing spaces which do not contain the point at end of line."
   (let ((status t))
     (while (if (re-search-forward whitespace-trailing-regexp limit t)
-              (= whitespace-point (match-end 1)) ;; loop if point at eol
+              (when (= whitespace-point (match-end 1)) ; Loop if point at eol.
+                 (whitespace-point--used (match-beginning 0) (match-end 0))
+                 t)
             (setq status nil)))                  ;; end of buffer
     status))
 
@@ -2279,8 +2271,11 @@ beginning of buffer."
     (cond
      ;; at bob
      ((= b 1)
-      (setq r (and (/= whitespace-point 1)
-                  (looking-at whitespace-empty-at-bob-regexp)))
+      (setq r (and (looking-at whitespace-empty-at-bob-regexp)
+                   (or (/= whitespace-point 1)
+                       (progn (whitespace-point--used (match-beginning 0)
+                                                      (match-end 0))
+                              nil))))
       (set-marker whitespace-bob-marker (if r (match-end 1) b)))
      ;; inside bob empty region
      ((<= limit whitespace-bob-marker)
@@ -2318,9 +2313,11 @@ buffer."
     (cond
      ;; at eob
      ((= limit e)
-      (when (/= whitespace-point e)
-       (goto-char limit)
-       (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b)))
+      (goto-char limit)
+      (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
+      (when (and r (= whitespace-point e))
+        (setq r nil)
+        (whitespace-point--used (match-beginning 0) (match-end 0)))
       (if r
          (set-marker whitespace-eob-marker (match-beginning 1))
        (set-marker whitespace-eob-marker limit)
@@ -2356,43 +2353,57 @@ buffer."
 (defun whitespace-post-command-hook ()
   "Save current point into `whitespace-point' variable.
 Also refontify when necessary."
-  (setq whitespace-point (point))      ; current point position
-  (let ((refontify
-        (or
-         ;; it is at end of line ...
-         (and (eolp)
-              ;; ... with trailing SPACE or TAB
-              (or (= (preceding-char) ?\ )
-                  (= (preceding-char) ?\t)))
-         ;; it is at beginning of buffer (bob)
-         (= whitespace-point 1)
-         ;; the buffer was modified and ...
-         (and whitespace-buffer-changed
-              (or
-               ;; ... or inside bob whitespace region
-               (<= whitespace-point whitespace-bob-marker)
-               ;; ... or at bob whitespace region border
-               (and (= whitespace-point (1+ whitespace-bob-marker))
-                    (= (preceding-char) ?\n))))
-         ;; it is at end of buffer (eob)
-         (= whitespace-point (1+ (buffer-size)))
-         ;; the buffer was modified and ...
-         (and whitespace-buffer-changed
-              (or
-               ;; ... or inside eob whitespace region
-               (>= whitespace-point whitespace-eob-marker)
-               ;; ... or at eob whitespace region border
-               (and (= whitespace-point (1- whitespace-eob-marker))
-                    (= (following-char) ?\n)))))))
-    (when (or refontify (> whitespace-font-lock-refontify 0))
-      (setq whitespace-buffer-changed nil)
-      ;; adjust refontify counter
-      (setq whitespace-font-lock-refontify
-           (if refontify
-               1
-             (1- whitespace-font-lock-refontify)))
-      ;; refontify
-      (jit-lock-refontify))))
+  (unless (and (eq whitespace-point (point))
+               (not whitespace-buffer-changed))
+    (setq whitespace-point (point))    ; current point position
+    (let ((refontify
+           (cond
+            ;; It is at end of buffer (eob).
+            ((= whitespace-point (1+ (buffer-size)))
+             (when (whitespace-looking-back whitespace-empty-at-eob-regexp
+                                            nil)
+               (match-beginning 0)))
+            ;; It is at end of line ...
+            ((and (eolp)
+                  ;; ... with trailing SPACE or TAB
+                  (or (memq (preceding-char) '(?\s ?\t))))
+             (line-beginning-position))
+            ;; It is at beginning of buffer (bob).
+            ((and (= whitespace-point 1)
+                  (looking-at whitespace-empty-at-bob-regexp))
+             (match-end 0))))
+          (ostart (overlay-start whitespace-point--used)))
+      (cond
+       ((not refontify)
+        ;; New point does not affect highlighting: just refresh the
+        ;; highlighting of old point, if needed.
+        (when ostart
+          (font-lock-flush ostart
+                           (overlay-end whitespace-point--used))
+          (delete-overlay whitespace-point--used)))
+       ((not ostart)
+        ;; Old point did not affect highlighting, but new one does: refresh the
+        ;; highlighting of new point.
+        (font-lock-flush (min refontify (point)) (max refontify (point))))
+       ((save-excursion
+          (goto-char ostart)
+          (setq ostart (line-beginning-position))
+          (and (<= ostart (max refontify (point)))
+               (progn
+                 (goto-char (overlay-end whitespace-point--used))
+                 (let ((oend (line-beginning-position 2)))
+                   (<= (min refontify (point)) oend)))))
+        ;; The old point highlighting and the new point highlighting
+        ;; cover a contiguous region: do a single refresh.
+        (font-lock-flush (min refontify (point) ostart)
+                         (max refontify (point)
+                              (overlay-end whitespace-point--used)))
+        (delete-overlay whitespace-point--used))
+       (t
+        (font-lock-flush (min refontify (point))
+                         (max refontify (point)))
+        (font-lock-flush ostart (overlay-end whitespace-point--used))
+        (delete-overlay whitespace-point--used))))))
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
index a857407820c41a7bf44128e4541c433b7a23f36b..92e52bff55e970c7a21127c85ef79ba6e8eae7f9 100644 (file)
@@ -2626,7 +2626,7 @@ Return an alist of (TYPE MATCH)."
   (let* ((value (widget-get widget :value))
         (type (nth 0 (widget-get widget :args)))
         children)
-    (widget-put widget :value-pos (copy-marker (point)))
+    (widget-put widget :value-pos (point-marker))
     (set-marker-insertion-type (widget-get widget :value-pos) t)
     (while value
       (let ((answer (widget-match-inline type value)))
index c771f01707ea17a5791e8037160eca984a7973e8..28a2be00af92442cfadc454221a1ed747f51e584 100644 (file)
@@ -185,16 +185,19 @@ argument replaces this)."
   (let ((buffer (make-symbol "buffer"))
        (window (make-symbol "window"))
        (value (make-symbol "value")))
-    `(let* ((,buffer (temp-buffer-window-setup ,buffer-or-name))
-           (standard-output ,buffer)
-           ,window ,value)
-       (setq ,value (progn ,@body))
-       (with-current-buffer ,buffer
-        (setq ,window (temp-buffer-window-show ,buffer ,action)))
-
-       (if (functionp ,quit-function)
-          (funcall ,quit-function ,window ,value)
-        ,value))))
+    (macroexp-let2 nil vbuffer-or-name buffer-or-name
+      (macroexp-let2 nil vaction action
+       (macroexp-let2 nil vquit-function quit-function
+         `(let* ((,buffer (temp-buffer-window-setup ,vbuffer-or-name))
+                 (standard-output ,buffer)
+                 ,window ,value)
+            (setq ,value (progn ,@body))
+            (with-current-buffer ,buffer
+              (setq ,window (temp-buffer-window-show ,buffer ,vaction)))
+
+            (if (functionp ,vquit-function)
+                (funcall ,vquit-function ,window ,value)
+              ,value)))))))
 
 (defmacro with-current-buffer-window (buffer-or-name action quit-function &rest body)
   "Evaluate BODY with a buffer BUFFER-OR-NAME current and show that buffer.
@@ -205,16 +208,50 @@ BODY."
   (let ((buffer (make-symbol "buffer"))
        (window (make-symbol "window"))
        (value (make-symbol "value")))
-    `(let* ((,buffer (temp-buffer-window-setup ,buffer-or-name))
-           (standard-output ,buffer)
-           ,window ,value)
-       (with-current-buffer ,buffer
-        (setq ,value (progn ,@body))
-        (setq ,window (temp-buffer-window-show ,buffer ,action)))
+    (macroexp-let2 nil vbuffer-or-name buffer-or-name
+      (macroexp-let2 nil vaction action
+       (macroexp-let2 nil vquit-function quit-function
+         `(let* ((,buffer (temp-buffer-window-setup ,vbuffer-or-name))
+                 (standard-output ,buffer)
+                 ,window ,value)
+            (with-current-buffer ,buffer
+              (setq ,value (progn ,@body))
+              (setq ,window (temp-buffer-window-show ,buffer ,vaction)))
+
+            (if (functionp ,vquit-function)
+                (funcall ,vquit-function ,window ,value)
+              ,value)))))))
+
+(defmacro with-displayed-buffer-window (buffer-or-name action quit-function &rest body)
+  "Show a buffer BUFFER-OR-NAME and evaluate BODY in that buffer.
+This construct is like `with-current-buffer-window' but unlike that
+displays the buffer specified by BUFFER-OR-NAME before running BODY."
+  (declare (debug t))
+  (let ((buffer (make-symbol "buffer"))
+       (window (make-symbol "window"))
+       (value (make-symbol "value")))
+    (macroexp-let2 nil vbuffer-or-name buffer-or-name
+      (macroexp-let2 nil vaction action
+       (macroexp-let2 nil vquit-function quit-function
+         `(let* ((,buffer (temp-buffer-window-setup ,vbuffer-or-name))
+                 (standard-output ,buffer)
+                 ,window ,value)
+            (with-current-buffer ,buffer
+              (setq ,window (temp-buffer-window-show ,buffer ,vaction)))
 
-       (if (functionp ,quit-function)
-          (funcall ,quit-function ,window ,value)
-        ,value))))
+            (let ((inhibit-read-only t)
+                  (inhibit-modification-hooks t))
+              (setq ,value (progn ,@body)))
+
+            (set-window-point ,window (point-min))
+
+            (when (functionp (cdr (assq 'window-height (cdr ,vaction))))
+              (ignore-errors
+                (funcall (cdr (assq 'window-height (cdr ,vaction))) ,window)))
+
+            (if (functionp ,vquit-function)
+                (funcall ,vquit-function ,window ,value)
+              ,value)))))))
 
 ;; The following two functions are like `window-next-sibling' and
 ;; `window-prev-sibling' but the WINDOW argument is _not_ optional (so
@@ -341,9 +378,9 @@ Anything less might crash Emacs.")
 (defcustom window-min-height 4
   "The minimum total height, in lines, of any window.
 The value has to accommodate one text line, a mode and header
-line, and a bottom divider, if present.  A value less than
-`window-safe-min-height' is ignored.  The value of this variable
-is honored when windows are resized or split.
+line, a horizontal scroll bar and a bottom divider, if present.
+A value less than `window-safe-min-height' is ignored.  The value
+of this variable is honored when windows are resized or split.
 
 Applications should never rebind this variable.  To resize a
 window to a height less than the one specified here, an
@@ -1100,11 +1137,12 @@ dumping to it."
        (format "frame text pixel: %s x %s   cols/lines: %s x %s\n"
               (frame-text-width frame) (frame-text-height frame)
               (frame-text-cols frame) (frame-text-lines frame))
-       (format "tool: %s  scroll: %s  fringe: %s  border: %s  right: %s  bottom: %s\n\n"
+       (format "tool: %s  scroll: %s/%s  fringe: %s  border: %s  right: %s  bottom: %s\n\n"
               (if (fboundp 'tool-bar-height)
                   (tool-bar-height frame t)
                 "0")
               (frame-scroll-bar-width frame)
+              (frame-scroll-bar-height frame)
               (frame-fringe-width frame)
               (frame-border-width frame)
               (frame-right-divider-width frame)
@@ -1225,12 +1263,14 @@ of WINDOW."
          value)
       (with-current-buffer (window-buffer window)
        (cond
+        ((window-minibuffer-p window)
+         (if pixelwise (frame-char-height (window-frame window)) 1))
         ((and (not (window--size-ignore-p window ignore))
               (window-size-fixed-p window horizontal))
          ;; The minimum size of a fixed size window is its size.
          (window-size window horizontal pixelwise))
-        ((or (eq ignore 'safe) (eq ignore window))
-         ;; If IGNORE equals `safe' or WINDOW return the safe values.
+        ((eq ignore 'safe)
+         ;; If IGNORE equals `safe' return the safe value.
          (window-safe-min-size window horizontal pixelwise))
         (horizontal
          ;; For the minimum width of a window take fringes and
@@ -1241,8 +1281,11 @@ of WINDOW."
          ;; `window-min-width'.
          (let* ((char-size (frame-char-size window t))
                 (fringes (window-fringes window))
+                (margins (window-margins window))
                 (pixel-width
                  (+ (window-safe-min-size window t t)
+                    (* (or (car margins) 0) char-size)
+                    (* (or (cdr margins) 0) char-size)
                     (car fringes) (cadr fringes)
                     (window-scroll-bar-width window)
                     (window-right-divider-width window))))
@@ -1264,6 +1307,7 @@ of WINDOW."
                (pixel-height
                 (+ (window-safe-min-size window nil t)
                    (window-header-line-height window)
+                   (window-scroll-bar-height window)
                    (window-mode-line-height window)
                    (window-bottom-divider-width window))))
            (if pixelwise
@@ -1471,6 +1515,18 @@ by which WINDOW can be shrunk."
       (window--min-delta-1
        window (- size minimum) horizontal ignore trail noup pixelwise)))))
 
+(defun frame-windows-min-size (&optional frame horizontal pixelwise)
+  "Return minimum number of lines of FRAME's windows.
+HORIZONTAL non-nil means return number of columns of FRAME's
+windows.  PIXELWISE non-nil means return sizes in pixels."
+  (setq frame (window-normalize-frame frame))
+  (let* ((root (frame-root-window frame))
+        (mini (window-next-sibling root)))
+    (+ (window-min-size root horizontal nil pixelwise)
+       (if (and mini (not horizontal))
+          (window-min-size mini horizontal nil pixelwise)
+        0))))
+
 (defun window--max-delta-1 (window delta &optional horizontal ignore trail noup pixelwise)
   "Internal function of `window-max-delta'."
   (if (not (window-parent window))
@@ -2947,6 +3003,28 @@ routines."
         pixel-delta
        (/ pixel-delta (frame-char-height frame)))))
 
+(defun window--sanitize-window-sizes (frame horizontal)
+  "Assert that all windows on FRAME are large enough.
+If necessary and possible, make sure that every window on frame
+FRAME has its minimum height.  Optional argument HORIZONTAL
+non-nil means to make sure that every window on frame FRAME has
+its minimum width.  The minimumm height/width of a window is the
+respective value returned by `window-min-size' for that window.
+
+Return t if all windows were resized appropriately.  Return nil
+if at least one window could not be resized as requested, which
+may happen when the FRAME is not large enough to accomodate it."
+  (let ((value t))
+    (walk-window-tree
+     (lambda (window)
+       (let  ((delta (- (window-min-size window horizontal nil t)
+                       (window-size window horizontal t))))
+        (when (> delta 0)
+          (if (window-resizable-p window delta horizontal nil t)
+              (window-resize window delta horizontal nil t)
+            (setq value nil))))))
+    value))
+
 (defun adjust-window-trailing-edge (window delta &optional horizontal pixelwise)
   "Move WINDOW's bottom edge by DELTA lines.
 Optional argument HORIZONTAL non-nil means move WINDOW's right
@@ -4204,20 +4282,6 @@ showing BUFFER-OR-NAME."
        ;; If a window doesn't show BUFFER, unrecord BUFFER in it.
        (unrecord-window-buffer window buffer)))))
 \f
-;;; Splitting windows.
-(defun window-split-min-size (&optional horizontal pixelwise)
-  "Return minimum height of any window when splitting windows.
-Optional argument HORIZONTAL non-nil means return minimum width."
-  (cond
-   (pixelwise
-    (if horizontal
-       (window-min-pixel-width)
-      (window-min-pixel-height)))
-   (horizontal
-    (max window-min-width window-safe-min-width))
-   (t
-    (max window-min-height window-safe-min-height))))
-
 (defun split-window (&optional window size side pixelwise)
   "Make a new window adjacent to WINDOW.
 WINDOW must be a valid window and defaults to the selected one.
@@ -4281,6 +4345,9 @@ frame.  The selected window is not changed by this function."
         (pixel-size
          (when (numberp size)
            (window--size-to-pixel window size horizontal pixelwise t)))
+        (divider-width (if horizontal
+                           (frame-right-divider-width frame)
+                         (frame-bottom-divider-width frame)))
         atom-root)
     (window--check frame)
     (catch 'done
@@ -4382,19 +4449,14 @@ frame.  The selected window is not changed by this function."
          (cond
           (resize
            ;; SIZE unspecified, resizing.
-           (when (and (not (window-sizable-p
-                            parent (- new-pixel-size) horizontal nil t))
-                      ;; Try again with minimum split size.
-                      (setq new-pixel-size
-                            (max new-pixel-size
-                                 (window-split-min-size horizontal t)))
-                      (not (window-sizable-p
-                            parent (- new-pixel-size) horizontal nil t)))
-             (error "Window %s too small for splitting 1" parent)))
-          ((> (+ new-pixel-size (window-min-size window horizontal nil t))
+           (unless (window-sizable-p
+                    parent (- new-pixel-size divider-width) horizontal nil t)
+             (error "Window %s too small for splitting (1)" parent)))
+          ((> (+ new-pixel-size divider-width
+                 (window-min-size window horizontal nil t))
               old-pixel-size)
            ;; SIZE unspecified, no resizing.
-           (error "Window %s too small for splitting 2" window))))
+           (error "Window %s too small for splitting (2)" window))))
         ((and (>= pixel-size 0)
               (or (>= pixel-size old-pixel-size)
                   (< new-pixel-size
@@ -4402,19 +4464,19 @@ frame.  The selected window is not changed by this function."
          ;; SIZE specified as new size of old window.  If the new size
          ;; is larger than the old size or the size of the new window
          ;; would be less than the safe minimum, signal an error.
-         (error "Window %s too small for splitting 3" window))
+         (error "Window %s too small for splitting (3)" window))
         (resize
          ;; SIZE specified, resizing.
          (unless (window-sizable-p
-                  parent (- new-pixel-size) horizontal nil t)
+                  parent (- new-pixel-size divider-width) horizontal nil t)
            ;; If we cannot resize the parent give up.
-           (error "Window %s too small for splitting 4" parent)))
+           (error "Window %s too small for splitting (4)" parent)))
         ((or (< new-pixel-size
                 (window-safe-min-pixel-size window horizontal))
              (< (- old-pixel-size new-pixel-size)
                 (window-safe-min-pixel-size window horizontal)))
          ;; SIZE specification violates minimum size restrictions.
-         (error "Window %s too small for splitting 5" window)))
+         (error "Window %s too small for splitting (5)" window)))
 
        (window--resize-reset frame horizontal)
 
@@ -4485,6 +4547,9 @@ frame.  The selected window is not changed by this function."
              (set-window-parameter (window-parent new) 'window-atom t))
            (set-window-parameter new 'window-atom t)))
 
+         ;; Sanitize sizes.
+         (window--sanitize-window-sizes frame horizontal)
+
          (run-window-configuration-change-hook frame)
          (run-window-scroll-functions new)
          (window--check frame)
@@ -5056,7 +5121,7 @@ value can be also stored on disk and read back in a new session."
                (let ((scroll-bars (cdr (assq 'scroll-bars state))))
                  (set-window-scroll-bars
                   window (car scroll-bars) (nth 2 scroll-bars)
-                  (nth 3 scroll-bars)))
+                  (or (nth 3 scroll-bars) 0) (nth 5 scroll-bars)))
                (set-window-vscroll window (cdr (assq 'vscroll state)))
                ;; Adjust vertically.
                (if (memq window-size-fixed '(t height))
@@ -5980,6 +6045,8 @@ The actual non-nil value of this variable will be copied to the
           (const display-buffer-pop-up-window)
           (const display-buffer-same-window)
           (const display-buffer-pop-up-frame)
+          (const display-buffer-below-selected)
+          (const display-buffer-at-bottom)
           (const display-buffer-in-previous-window)
           (const display-buffer-use-some-window)
           (function :tag "Other function"))
@@ -7077,7 +7144,10 @@ FRAME."
             (value (window-text-pixel-size
                     nil t t workarea-width workarea-height t))
             (width (+ (car value) (window-right-divider-width)))
-            (height (+ (cdr value) (window-bottom-divider-width))))
+            (height
+             (+ (cdr value)
+                (window-bottom-divider-width)
+                (nth 3 (window-scroll-bars)))))
        ;; Don't change height or width when the window's size is fixed
        ;; in either direction or ONLY forbids it.
        (cond
@@ -7236,6 +7306,7 @@ accessible position."
          ;; height.  Its width remains fixed.
          (setq height (+ (cdr (window-text-pixel-size
                                nil nil t nil (frame-pixel-height) t))
+                         (nth 3 (window-scroll-bars window))
                          (window-bottom-divider-width)))
          ;; Round height.
          (unless pixelwise
index 88510517b25fb511d6d4d8db1a4d63af49182bf4..2dda211200d14e62440bd4eba4edc67a690738c8 100644 (file)
               (substring arg 0 (match-end 1))
             arg))))
 
+(require 'cl-lib)
+
 (eval-when-compile                     ; to avoid compiler warnings
   (require 'dired)
-  (require 'cl-lib)
   (require 'apropos))
 
-(defun woman-mapcan (fn x)
-  "Return concatenated list of FN applied to successive `car' elements of X.
-FN must return a list, cons or nil.  Useful for splicing into a list."
-  ;; Based on the Standard Lisp function MAPCAN but with args swapped!
-  ;; More concise implementation than the recursive one.  -- dak
-  (apply #'nconc (mapcar fn x)))
-
 (defun woman-parse-colon-path (paths)
   "Explode search path string PATHS into a list of directory names.
 Allow Cygwin colon-separated search paths on Microsoft platforms.
@@ -440,7 +434,7 @@ As a special case, if PATHS is nil then replace it by calling
             (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf)))
            ((string-match-p ";" paths)
             ;; Assume DOS-style path-list...
-            (woman-mapcan              ; splice list into list
+            (cl-mapcan                 ; splice list into list
              (lambda (x)
                (if x
                    (list x)
@@ -451,14 +445,14 @@ As a special case, if PATHS is nil then replace it by calling
             (list paths))
            (t
             ;; Assume UNIX/Cygwin-style path-list...
-            (woman-mapcan              ; splice list into list
+            (cl-mapcan                 ; splice list into list
              (lambda (x)
                (mapcar 'woman-Cyg-to-Win
                        (if x (list x) (woman-parse-man.conf))))
              (let ((path-separator ":"))
                (parse-colon-path paths)))))
     ;; Assume host-default-style path-list...
-    (woman-mapcan                      ; splice list into list
+    (cl-mapcan                         ; splice list into list
      (lambda (x) (if x (list x) (woman-parse-man.conf)))
      (parse-colon-path (or paths "")))))
 
index 59ed68a60c738ff36f3b8b48f46297263844c61b..cad3151b244c73bfd4c9dc5b6b2e1b8d1089f619 100644 (file)
 
 (defvar xterm-mouse-debug-buffer nil)
 
-(defvar xterm-mouse-last)
-
 ;; Mouse events symbols must have an 'event-kind property with
 ;; the value 'mouse-click.
-(dolist (event-type '(mouse-1 mouse-2 mouse-3
-                     M-down-mouse-1 M-down-mouse-2 M-down-mouse-3))
-  (put event-type 'event-kind 'mouse-click))
+(dolist (event '(mouse-1 mouse-2 mouse-3 mouse-4 mouse-5))
+  (let ((M-event (intern (concat "M-" (symbol-name event)))))
+    (put event 'event-kind 'mouse-click)
+    (put M-event 'event-kind 'mouse-click)))
 
 (defun xterm-mouse-translate (_event)
   "Read a click and release event from XTerm."
@@ -63,61 +62,44 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
 
 (defun xterm-mouse-translate-1 (&optional extension)
   (save-excursion
-    (save-window-excursion              ;FIXME: Why?
-      (deactivate-mark)                 ;FIXME: Why?
-      (let* ((xterm-mouse-last nil)
-            (down (xterm-mouse-event extension))
-            (down-command (nth 0 down))
-            (down-data    (nth 1 down))
-            (down-where   (nth 1 down-data))
-            (down-binding (key-binding (if (symbolp down-where)
-                                           (vector down-where down-command)
-                                         (vector down-command))))
-            (is-down (string-match "down" (symbol-name (car down)))))
-
-       ;; Retrieve the expected preface for the up-event.
-       (when is-down
-         (unless (cond ((null extension)
-                        (and (eq (read-event) ?\e)
-                             (eq (read-event) ?\[)
-                             (eq (read-event) ?M)))
-                       ((eq extension 1006)
-                        (and (eq (read-event) ?\e)
-                             (eq (read-event) ?\[)
-                             (eq (read-event) ?<))))
-           (error "Unexpected escape sequence from XTerm")))
-
-       ;; Process the up-event.
-       (let* ((click (if is-down (xterm-mouse-event extension) down))
-              (click-data  (nth 1 click))
-              (click-where (nth 1 click-data)))
-          (cond
-           ((null down) nil)
-           ((memq down-binding '(nil ignore))
-            (if (and (symbolp click-where)
-                     (consp click-where))
-                (vector (list click-where click-data) click)
-              (vector click)))
+    (let* ((event (xterm-mouse-event extension))
+          (ev-command (nth 0 event))
+          (ev-data    (nth 1 event))
+          (ev-where   (nth 1 ev-data))
+          (vec (vector event))
+          (is-down (string-match "down-" (symbol-name ev-command))))
+
+      (cond
+       ((null event) nil)              ;Unknown/bogus byte sequence!
+       (is-down
+       (setf (terminal-parameter nil 'xterm-mouse-last-down) event)
+       vec)
+       (t
+       (let* ((down (terminal-parameter nil 'xterm-mouse-last-down))
+              (down-data (nth 1 down))
+              (down-where (nth 1 down-data)))
+         (setf (terminal-parameter nil 'xterm-mouse-last-down) nil)
+         (cond
+          ((null down)
+           ;; This is an "up-only" event.  Pretend there was an up-event
+           ;; right before and keep the up-event for later.
+           (push event unread-command-events)
+           (vector (cons (intern (replace-regexp-in-string
+                                  "\\`\\([ACMHSs]-\\)*" "\\&down-"
+                                  (symbol-name ev-command) t))
+                         (cdr event))))
+          ((equal ev-where down-where) vec)
            (t
-           (setq unread-command-events
-                 (append (if (eq down-where click-where)
-                             (list click)
-                           (list
-                            ;; Cheat `mouse-drag-region' with move event.
-                            (list 'mouse-movement click-data)
-                            ;; Generate a drag event.
-                            (if (symbolp down-where)
-                                0
-                              (list (intern (format "drag-mouse-%d"
-                                                    (1+ xterm-mouse-last)))
-                                    down-data click-data))))
-                         unread-command-events))
-           (if xterm-mouse-debug-buffer
-               (print unread-command-events xterm-mouse-debug-buffer))
-           (if (and (symbolp down-where)
-                    (consp down-where))
-               (vector (list down-where down-data) down)
-             (vector down)))))))))
+           (let ((drag (if (symbolp ev-where)
+                           0           ;FIXME: Why?!?
+                         (list (intern (replace-regexp-in-string
+                                        "\\`\\([ACMHSs]-\\)*" "\\&drag-"
+                                        (symbol-name ev-command) t))
+                               down-data ev-data))))
+             (if (null track-mouse)
+                 (vector drag)
+               (push drag unread-command-events)
+               (vector (list 'mouse-movement ev-data))))))))))))
 
 ;; These two variables have been converted to terminal parameters.
 ;;
@@ -158,23 +140,21 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
 (defun xterm-mouse--read-event-sequence-1000 ()
   (let* ((code (- (read-event) 32))
          (type
-          ;; For buttons > 3, the release-event looks differently
-          ;; (see xc/programs/xterm/button.c, function EditorButton),
-          ;; and come in a release-event only, no down-event.
-          (cond ((>= code 64)
-                 (format "mouse-%d" (- code 60)))
-                ((memq code '(8 9 10))
-                 (setq xterm-mouse-last (- code 8))
-                 (format "M-down-mouse-%d" (- code 7)))
-                ((and (= code 11) xterm-mouse-last)
-                 (format "M-mouse-%d" (1+ xterm-mouse-last)))
-                ((and (= code 3) xterm-mouse-last)
-                 ;; For buttons > 5 xterm only reports a button-release event.
-                 ;; Drop them since they're not usable and can be spurious.
-                 (format "mouse-%d" (1+ xterm-mouse-last)))
-                ((memq code '(0 1 2))
-                 (setq xterm-mouse-last code)
-                 (format "down-mouse-%d" (+ 1 code)))))
+         ;; For buttons > 3, the release-event looks differently
+         ;; (see xc/programs/xterm/button.c, function EditorButton),
+         ;; and come in a release-event only, no down-event.
+         (cond ((>= code 64)
+                (format "mouse-%d" (- code 60)))
+               ((memq code '(8 9 10))
+                (format "M-down-mouse-%d" (- code 7)))
+               ((memq code '(3 11))
+                 (let ((down (car (terminal-parameter
+                                   nil 'xterm-mouse-last-down))))
+                   (when (and down (string-match "[0-9]" (symbol-name down)))
+                     (format (if (eq code 3) "mouse-%s" "M-mouse-%s")
+                             (match-string 0 (symbol-name down))))))
+               ((memq code '(0 1 2))
+                (format "down-mouse-%d" (+ 1 code)))))
          (x (- (read-event) 33))
          (y (- (read-event) 33)))
     (and type (wholenump x) (wholenump y)
@@ -211,10 +191,20 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
                            (if down "down-" "")
                            (if wheel
                                (- code 60)
-                             (1+ (setq xterm-mouse-last (mod code 4)))))))
+                             (1+ (mod code 4))))))
          (1- (string-to-number (apply 'string (nreverse x-bytes))))
          (1- (string-to-number (apply 'string (nreverse y-bytes)))))))
 
+(defun xterm-mouse--set-click-count (event click-count)
+  (setcdr (cdr event) (list click-count))
+  (let ((name (symbol-name (car event))))
+    (when (string-match "\\(.*?\\)\\(\\(?:down-\\)?mouse-.*\\)" name)
+      (setcar event
+              (intern (concat (match-string 1 name)
+                              (if (= click-count 2)
+                                  "double-" "triple-")
+                              (match-string 2 name)))))))
+
 (defun xterm-mouse-event (&optional extension)
   "Convert XTerm mouse event to Emacs mouse event.
 EXTENSION, if non-nil, means to use an extension to the usual
@@ -240,18 +230,42 @@ which is the \"1006\" extension implemented in Xterm >= 277."
              (w (window-at x y))
              (ltrb (window-edges w))
              (left (nth 0 ltrb))
-             (top (nth 1 ltrb)))
-        (set-terminal-parameter nil 'xterm-mouse-x x)
-        (set-terminal-parameter nil 'xterm-mouse-y y)
-        (setq
-         last-input-event
-         (list type
-               (let ((event (if w
+             (top (nth 1 ltrb))
+             (posn (if w
                                 (posn-at-x-y (- x left) (- y top) w t)
                               (append (list nil 'menu-bar)
-                                      (nthcdr 2 (posn-at-x-y x y))))))
-                 (setcar (nthcdr 3 event) timestamp)
-                 event)))))))
+                             (nthcdr 2 (posn-at-x-y x y)))))
+             (event (list type posn)))
+        (setcar (nthcdr 3 posn) timestamp)
+
+        ;; Try to handle double/triple clicks.
+        (let* ((last-click (terminal-parameter nil 'xterm-mouse-last-click))
+               (last-type (nth 0 last-click))
+               (last-name (symbol-name last-type))
+               (last-time (nth 1 last-click))
+               (click-count (nth 2 last-click))
+               (this-time (float-time))
+               (name (symbol-name type)))
+          (cond
+           ((not (string-match "down-" name))
+            ;; For up events, make the up side match the down side.
+            (setq this-time last-time)
+            (when (and click-count (> click-count 1)
+                       (string-match "down-" last-name)
+                       (equal name (replace-match "" t t last-name)))
+              (xterm-mouse--set-click-count event click-count)))
+           ((not last-time) nil)
+           ((and (> double-click-time (* 1000 (- this-time last-time)))
+                 (equal last-name (replace-match "" t t name)))
+            (setq click-count (1+ click-count))
+            (xterm-mouse--set-click-count event click-count))
+           (t (setq click-count 1)))
+          (set-terminal-parameter nil 'xterm-mouse-last-click
+                                  (list type this-time click-count)))
+
+        (set-terminal-parameter nil 'xterm-mouse-x x)
+        (set-terminal-parameter nil 'xterm-mouse-y y)
+        (setq last-input-event event)))))
 
 ;;;###autoload
 (define-minor-mode xterm-mouse-mode
@@ -267,69 +281,79 @@ single clicks are supported.  When turned on, the normal xterm
 mouse functionality for such clicks is still available by holding
 down the SHIFT key while pressing the mouse button."
   :global t :group 'mouse
-  (let ((do-hook (if xterm-mouse-mode 'add-hook 'remove-hook)))
-    (funcall do-hook 'terminal-init-xterm-hook
-             'turn-on-xterm-mouse-tracking-on-terminal)
-    (funcall do-hook 'delete-terminal-functions
-             'turn-off-xterm-mouse-tracking-on-terminal)
-    (funcall do-hook 'suspend-tty-functions
-             'turn-off-xterm-mouse-tracking-on-terminal)
-    (funcall do-hook 'resume-tty-functions
-             'turn-on-xterm-mouse-tracking-on-terminal)
-    (funcall do-hook 'suspend-hook 'turn-off-xterm-mouse-tracking)
-    (funcall do-hook 'suspend-resume-hook 'turn-on-xterm-mouse-tracking)
-    (funcall do-hook 'kill-emacs-hook 'turn-off-xterm-mouse-tracking))
+  (funcall (if xterm-mouse-mode 'add-hook 'remove-hook)
+           'terminal-init-xterm-hook
+           'turn-on-xterm-mouse-tracking-on-terminal)
   (if xterm-mouse-mode
       ;; Turn it on
       (progn
        (setq mouse-position-function #'xterm-mouse-position-function)
-       (turn-on-xterm-mouse-tracking))
+        (mapc #'turn-on-xterm-mouse-tracking-on-terminal (terminal-list)))
     ;; Turn it off
-    (turn-off-xterm-mouse-tracking 'force)
+    (mapc #'turn-off-xterm-mouse-tracking-on-terminal (terminal-list))
     (setq mouse-position-function nil)))
 
-(defun turn-on-xterm-mouse-tracking ()
-  "Enable Emacs mouse tracking in xterm."
-  (dolist (terminal (terminal-list))
-    (turn-on-xterm-mouse-tracking-on-terminal terminal)))
+(defconst xterm-mouse-tracking-enable-sequence
+  "\e[?1000h\e[?1006h"
+  "Control sequence to enable xterm mouse tracking.
+Enables basic tracking, then extended tracking on
+terminals that support it.")
 
-(defun turn-off-xterm-mouse-tracking (&optional _force)
-  "Disable Emacs mouse tracking in xterm."
-  (dolist (terminal (terminal-list))
-    (turn-off-xterm-mouse-tracking-on-terminal terminal)))
+(defconst xterm-mouse-tracking-disable-sequence
+  "\e[?1006l\e[?1000l"
+  "Reset the modes set by `xterm-mouse-tracking-enable-sequence'.")
 
 (defun turn-on-xterm-mouse-tracking-on-terminal (&optional terminal)
   "Enable xterm mouse tracking on TERMINAL."
   (when (and xterm-mouse-mode (eq t (terminal-live-p terminal))
             ;; Avoid the initial terminal which is not a termcap device.
-            ;; FIXME: is there more elegant way to detect the initial terminal?
+            ;; FIXME: is there more elegant way to detect the initial
+             ;; terminal?
             (not (string= (terminal-name terminal) "initial_terminal")))
     (unless (terminal-parameter terminal 'xterm-mouse-mode)
       ;; Simulate selecting a terminal by selecting one of its frames
+      ;; so that we can set the terminal-local `input-decode-map'.
       (with-selected-frame (car (frames-on-display-list terminal))
         (define-key input-decode-map "\e[M" 'xterm-mouse-translate)
         (define-key input-decode-map "\e[<" 'xterm-mouse-translate-extended))
-      (set-terminal-parameter terminal 'xterm-mouse-mode t))
-    (send-string-to-terminal "\e[?1000h" terminal)
-    ;; Request extended mouse support, if available (xterm >= 277).
-    (send-string-to-terminal "\e[?1006h" terminal)))
+      (condition-case err
+          (send-string-to-terminal xterm-mouse-tracking-enable-sequence
+                                   terminal)
+        ;; FIXME: This should use a dedicated error signal.
+        (error (if (equal (cadr err) "Terminal is currently suspended")
+                   nil                  ;The sequence will be sent upon resume.
+                 (signal (car err) (cdr err)))))
+      (push xterm-mouse-tracking-enable-sequence
+            (terminal-parameter nil 'tty-mode-set-strings))
+      (push xterm-mouse-tracking-disable-sequence
+            (terminal-parameter nil 'tty-mode-reset-strings))
+      (set-terminal-parameter terminal 'xterm-mouse-mode t))))
 
 (defun turn-off-xterm-mouse-tracking-on-terminal (terminal)
   "Disable xterm mouse tracking on TERMINAL."
   ;; Only send the disable command to those terminals to which we've already
   ;; sent the enable command.
   (when (and (terminal-parameter terminal 'xterm-mouse-mode)
-             (eq t (terminal-live-p terminal))
-            ;; Avoid the initial terminal which is not a termcap device.
-            ;; FIXME: is there more elegant way to detect the initial terminal?
-            (not (string= (terminal-name terminal) "initial_terminal")))
+             (eq t (terminal-live-p terminal)))
     ;; We could remove the key-binding and unset the `xterm-mouse-mode'
     ;; terminal parameter, but it seems less harmful to send this escape
     ;; command too many times (or to catch an unintended key sequence), than
     ;; to send it too few times (or to fail to let xterm-mouse events
     ;; pass by untranslated).
-    (send-string-to-terminal "\e[?1000l" terminal)
-    (send-string-to-terminal "\e[?1006l" terminal)))
+    (condition-case err
+        (send-string-to-terminal xterm-mouse-tracking-disable-sequence
+                                 terminal)
+      ;; FIXME: This should use a dedicated error signal.
+      (error (if (equal (cadr err) "Terminal is currently suspended")
+                 nil
+               (signal (car err) (cdr err)))))
+    (setf (terminal-parameter nil 'tty-mode-set-strings)
+          (remq xterm-mouse-tracking-enable-sequence
+                (terminal-parameter nil 'tty-mode-set-strings)))
+    (setf (terminal-parameter nil 'tty-mode-reset-strings)
+          (remq xterm-mouse-tracking-disable-sequence
+                (terminal-parameter nil 'tty-mode-reset-strings)))
+    (set-terminal-parameter terminal 'xterm-mouse-mode nil)))
 
 (provide 'xt-mouse)
 
index 2a865f7165c4179c16cc3ce972ada41ee6b7f349..11ee10edac2d43385372c4b1ea8a33735e0053cf 100644 (file)
@@ -1,3 +1,78 @@
+2014-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lwlib.h (toplevel): Use unsigned int for LWLIB_ID.
+
+2014-06-28  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in: Use gcc auto-dependency information.
+       Move old dependency information to new file deps.mk.
+       (MKDIR_P, DEPFLAGS, MKDEPDIR, lwlib_deps_frag):
+       New, set by configure.
+       (DEPDIR): New variable.
+       (ALL_CFLAGS): Add DEPFLAGS.
+       (.c.o): Add MKDEPDIR.
+       (clean, mostlyclean): Delete DEPDIR.
+       * deps.mk, autodeps.mk: New files.
+
+2014-06-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Omit redundant extern decls.
+       From Dmitry Antipov.
+       * lwlib-Xm.c (lw_motif_widget_p, xm_update_one_value)
+       (xm_create_dialog, xm_destroy_instance, xm_popup_menu)
+       (xm_set_keyboard_focus, xm_set_main_areas): Remove decls.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in ($(globals_h)): Use `make -C' rather than `cd && make'.
+
+       * Makefile.in (mostlyclean, clean, distclean, maintainer-clean):
+       Declare as PHONY.
+       (bootstrap-clean): New.
+
+2014-06-13  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in ($(globals_h)):
+       GNU make automatically passes command-line arguments to sub-makes.
+
+2014-06-04  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lwlib-widget.h (widget_value) [USE_X_TOOLKIT]: Use X toolkit
+       fields conditionally.
+
+2014-06-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Do not require libXt-devel when building with gtk.
+       * lwlib-widget.h: New file, with contents taken from lwlib.h.
+       (widget_value) [HAVE_NTGUI]: New member 'title'.
+       * lwlib.h: Include lwlib-widget.h.
+       (change_type, enum button_type, widget_value):
+       Move to lwlib-widget.h.
+
+2014-06-03  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xlwmenu.c (openXftFont): Do not load regular X font here.
+       (XlwMenuInitialize): Remove ancient #if 0 code.
+       (XlwMenuDestroy): Likewise.  Free regular X font here.
+
+2014-06-02  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Use common memory management functions for widgets.
+       * lwlib.h (widget_value): Do not maintain a free list any more.
+       (malloc_widget_value, free_widget_value): Remove prototypes.
+       * lwlib.c (malloc_widget_value, free_widget_value):
+       (widget_value_free_list, malloc_cpt): Remove.
+       (free_widget_value_tree, copy_widget_value_tree): Adjust users.
+
+2014-05-30  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Use common string allocation and freeing functions where applicable.
+       * lwlib.h (safe_strdup): Remove prototype.
+       * lwlib.c (safe_strdup, safe_free_str): Remove.
+       (copy_widget_value_tree, allocate_widget_info, free_widget_info):
+       (merge_widget_value): Prefer xstrdup, xfree and dupstring.
+       * lwlib-Xm.c (make_destroyed_instance, xm_update_one_value): Ditto.
+
 2013-12-14  Paul Eggert  <eggert@cs.ucla.edu>
 
        Use bool for boolean, focusing on headers.
index 8bdd2bbbf3d8a127e881e6ab719c7cbe3cc734b4..516b3286951a043f0ad8e02a1c7f24ee8ba159d8 100644 (file)
@@ -41,6 +41,7 @@ RANLIB=@RANLIB@
 
 AR = @AR@
 ARFLAGS = @ARFLAGS@
+MKDIR_P = @MKDIR_P@
 
 LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
 MOTIF_OBJS = lwlib-Xm.o
@@ -50,13 +51,19 @@ TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
 
 OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
 
+DEPDIR = deps
+## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
+DEPFLAGS = @DEPFLAGS@
+## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
+MKDEPDIR = @MKDEPDIR@
+
 ## ../src is where the generated file (config.h, globals.h) are.
 ## $(srcdir)/../src is where the non-generated files (lisp.h) are.
 ## (In an out-of-tree build, these two are not the same.)
 ## $(srcdir) is where the lwlib sources are.
 ## There are no generated lwlib files, hence no need for -I.
 ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
-  $(C_SWITCH_MACHINE) \
+  $(C_SWITCH_MACHINE) $(DEPFLAGS) \
   $(WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \
   -Demacs -I../src \
   -I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib
@@ -65,6 +72,7 @@ all: liblw.a
 .PHONY: all
 
 .c.o:
+       @$(MKDEPDIR)
        $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
 
 liblw.a: $(OBJS)
@@ -72,32 +80,23 @@ liblw.a: $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
        $(RANLIB) $@
 
-## Generated files in ../src, non-generated in $(srcdir)/../src.
-config_h = ../src/config.h $(srcdir)/../src/conf_post.h
-lisp_h = $(srcdir)/../src/lisp.h
-## lisp.h includes this.
 globals_h = ../src/globals.h
-src_h = $(config_h) $(lisp_h) $(globals_h)
-
 $(globals_h):
-       cd ../src && $(MAKE) $(MFLAGS) globals.h
-
-lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h
-lwlib.o:       $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \
-  lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h
-lwlib-Xlw.o:   $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h
-lwlib-Xaw.o:   $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
-lwlib-Xm.o:    $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
-xlwmenu.o:     $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \
-  $(srcdir)/../src/xterm.h
-
-mostlyclean:
+       $(MAKE) -C ../src globals.h
+
+## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
+@lwlib_deps_frag@
+
+.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
+
+clean mostlyclean:
        rm -f *.o liblw.a \#*
+       -rm -rf ${DEPDIR}
 
-clean: mostlyclean
 distclean: clean
        rm -f Makefile
-maintainer-clean: distclean
+
+bootstrap-clean maintainer-clean: distclean
        rm -f TAGS
 
 
diff --git a/lwlib/autodeps.mk b/lwlib/autodeps.mk
new file mode 100644 (file)
index 0000000..f710929
--- /dev/null
@@ -0,0 +1,5 @@
+### autodeps.mk --- lwlib/Makefile fragment for GNU Emacs
+
+## This is inserted in lwlib/Makefile if AUTO_DEPEND=yes.
+
+-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
diff --git a/lwlib/deps.mk b/lwlib/deps.mk
new file mode 100644 (file)
index 0000000..6355ec6
--- /dev/null
@@ -0,0 +1,43 @@
+### deps.mk --- lwlib/Makefile fragment for GNU Emacs
+
+# Copyright (C) 1992, 1993 Lucid, Inc.
+# Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc.
+#
+# This file is part of the Lucid Widget Library.
+#
+# The Lucid Widget Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 1, or (at your option)
+# any later version.
+#
+# The Lucid Widget Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+### Commentary:
+
+## This file is inserted in lwlib/Makefile if AUTO_DEPEND=no.
+## It defines static dependencies between the various source files.
+
+### Code:
+
+## Generated files in ../src, non-generated in $(srcdir)/../src.
+config_h = ../src/config.h $(srcdir)/../src/conf_post.h
+lisp_h = $(srcdir)/../src/lisp.h
+## lisp.h includes this.
+src_h = $(config_h) $(lisp_h) $(globals_h)
+
+lwlib-utils.o: $(src_h) lwlib-utils.c lwlib-utils.h lwlib.h
+lwlib.o:       $(src_h) lwlib.c lwlib.h lwlib-int.h lwlib-utils.h \
+  lwlib-Xlw.h lwlib-Xm.h lwlib-Xaw.h
+lwlib-Xlw.o:   $(src_h) lwlib-Xlw.c lwlib.h lwlib-int.h lwlib-Xlw.h xlwmenu.h
+lwlib-Xaw.o:   $(src_h) lwlib-Xaw.c lwlib-Xaw.h lwlib.h lwlib-int.h
+lwlib-Xm.o:    $(src_h) lwlib-Xm.c lwlib-Xm.h lwlib.h lwlib-int.h lwlib-utils.h
+xlwmenu.o:     $(src_h) xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h \
+  $(srcdir)/../src/xterm.h
+
+### deps.mk ends here
index bbb9657d7a19e5df009b3e2e349d982b0fdcf252..4d48e64cb1411e3cfc1a7dd77f379bd5ee1b95af 100644 (file)
@@ -79,7 +79,6 @@ static destroyed_instance *make_destroyed_instance (char *, char *,
                                                     Boolean);
 static void free_destroyed_instance (destroyed_instance*);
 Widget first_child (Widget);
-Boolean lw_motif_widget_p (Widget);
 static XmString resource_motif_string (Widget, char *);
 static void destroy_all_children (Widget, int);
 static void xm_update_label (widget_instance *, Widget, widget_value *);
@@ -99,7 +98,6 @@ static void xm_update_menu (widget_instance *, Widget, widget_value *,
 static void xm_update_text (widget_instance *, Widget, widget_value *);
 static void xm_update_text_field (widget_instance *, Widget,
                                   widget_value *);
-void xm_update_one_value (widget_instance *, Widget, widget_value *);
 static void activate_button (Widget, XtPointer, XtPointer);
 static Widget make_dialog (char *, Widget, Boolean, char *, char *,
                            Boolean, Boolean, Boolean, int, int);
@@ -107,21 +105,16 @@ static destroyed_instance* find_matching_instance (widget_instance*);
 static void mark_dead_instance_destroyed (Widget, XtPointer, XtPointer);
 static void recenter_widget (Widget);
 static Widget recycle_instance (destroyed_instance*);
-Widget xm_create_dialog (widget_instance*);
 static Widget make_menubar (widget_instance*);
 static void remove_grabs (Widget, XtPointer, XtPointer);
 static Widget make_popup_menu (widget_instance*);
 static Widget make_main (widget_instance*);
-void xm_destroy_instance (widget_instance*);
-void xm_popup_menu (Widget, XEvent *);
 static void set_min_dialog_size (Widget);
 static void do_call (Widget, XtPointer, enum do_call_type);
 static void xm_generic_callback (Widget, XtPointer, XtPointer);
 static void xm_nosel_callback (Widget, XtPointer, XtPointer);
 static void xm_pull_down_callback (Widget, XtPointer, XtPointer);
 static void xm_pop_down_callback (Widget, XtPointer, XtPointer);
-void xm_set_keyboard_focus (Widget, Widget);
-void xm_set_main_areas (Widget, Widget, Widget);
 static void xm_internal_update_other_instances (Widget, XtPointer,
                                                 XtPointer);
 static void xm_arm_callback (Widget, XtPointer, XtPointer);
@@ -170,8 +163,8 @@ make_destroyed_instance (char* name,
 {
   destroyed_instance* instance =
     (destroyed_instance*) xmalloc (sizeof (destroyed_instance));
-  instance->name = safe_strdup (name);
-  instance->type = safe_strdup (type);
+  instance->name = xstrdup (name);
+  instance->type = xstrdup (type);
   instance->widget = widget;
   instance->parent = parent;
   instance->pop_up_p = pop_up_p;
@@ -953,10 +946,7 @@ xm_update_one_value (widget_instance* instance,
 
              XtVaGetValues (toggle, XmNset, &set, NULL);
              if (set)
-               {
-                 xfree (val->value);
-                 val->value = safe_strdup (XtName (toggle));
-               }
+               dupstring (&val->value, XtName (toggle));
            }
          val->edited = True;
        }
@@ -979,7 +969,7 @@ xm_update_one_value (widget_instance* instance,
                  if (pos_list [j] == i)
                    {
                      cur->selected = True;
-                     val->value = safe_strdup (cur->name);
+                     val->value = xstrdup (cur->name);
                    }
              }
          val->edited = 1;
index 570dcf5f11b14c722db725104e19e5510ad025b3..f2def4cdd0eb4f28cc9fca1253cadf6d5239bc83 100644 (file)
@@ -23,8 +23,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lwlib.h"
 
-extern char *safe_strdup (const char *);
-
 struct widget_xft_data;
 
 typedef struct _widget_instance
diff --git a/lwlib/lwlib-widget.h b/lwlib/lwlib-widget.h
new file mode 100644 (file)
index 0000000..8901964
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+Copyright (C) 1992, 1993 Lucid, Inc.
+Copyright (C) 1994, 1999-2014 Free Software Foundation, Inc.
+
+This file is part of the Lucid Widget Library.
+
+The Lucid Widget Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+The Lucid Widget Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* This part is separate from lwlib.h because it does not need X,
+   and thus can be used by non-X code in Emacs proper.  */
+
+#ifndef LWLIB_WIDGET_H
+#define LWLIB_WIDGET_H
+
+typedef enum
+{
+  NO_CHANGE = 0,
+  INVISIBLE_CHANGE = 1,
+  VISIBLE_CHANGE = 2,
+  STRUCTURAL_CHANGE = 3
+} change_type;
+
+enum button_type
+{
+  BUTTON_TYPE_NONE,
+  BUTTON_TYPE_TOGGLE,
+  BUTTON_TYPE_RADIO
+};
+
+typedef struct _widget_value
+{
+  /* Name of widget.  */
+  Lisp_Object lname;
+  char *name;
+
+  /* Value (meaning depend on widget type).  */
+  char *value;
+
+  /* Keyboard equivalent. no implications for XtTranslations.  */
+  Lisp_Object lkey;
+  char *key;
+
+  /* Help string or nil if none.
+     GC finds this string through the frame's menu_bar_vector
+     or through menu_items.  */
+  Lisp_Object help;
+
+  /* True if enabled.  */
+  bool enabled;
+
+  /* True if selected.  */
+  bool selected;
+
+  /* True if was edited (maintained by get_value).  */
+  bool edited;
+
+#ifdef HAVE_NTGUI
+  /* True if menu title.  */
+  bool title;
+#endif
+
+  /* The type of a button.  */
+  enum button_type button_type;
+
+  /* Contents of the sub-widgets, also selected slot for checkbox.  */
+  struct _widget_value *contents;
+
+  /* Data passed to callback.  */
+  void *call_data;
+
+  /* Next one in the list.  */
+  struct _widget_value *next;
+
+#ifdef USE_X_TOOLKIT
+  /* Type of change (maintained by lw library).  */
+  change_type change;
+
+  /* Type of this widget's change, but not counting the other widgets
+     found in the `next' field.  */
+  change_type this_one_change;
+
+  /* Slot for the toolkit dependent part.  Always initialize to NULL.  */
+  void *toolkit_data;
+
+  /* Whether we should free the toolkit data slot when freeing the
+     widget_value itself.  */
+  bool free_toolkit_data;
+#endif  
+
+} widget_value;
+
+#endif
index f3e80160ebf5e7ffc720774f02c2755860aa7bb9..7f2f753c1d4b36feeda1d6e8fc3592295469b371 100644 (file)
@@ -71,7 +71,6 @@ static widget_value *merge_widget_value (widget_value *,
                                          widget_value *,
                                          int, int *);
 static void instantiate_widget_instance (widget_instance *);
-static void safe_free_str (char *);
 static void free_widget_value_tree (widget_value *);
 static widget_value *copy_widget_value_tree (widget_value *,
                                              change_type);
@@ -99,63 +98,6 @@ static void destroy_one_instance (widget_instance *);
 static void lw_pop_all_widgets (LWLIB_ID, Boolean);
 static Boolean get_one_value (widget_instance *, widget_value *);
 static void show_one_widget_busy (Widget, Boolean);
-\f/* utility functions for widget_instance and widget_info */
-char *
-safe_strdup (const char *s)
-{
-  return s ? xstrdup (s) : 0;
-}
-
-static void
-safe_free_str (char *s)
-{
-  xfree (s);
-}
-
-static widget_value *widget_value_free_list = 0;
-static int malloc_cpt = 0;
-
-widget_value *
-malloc_widget_value (void)
-{
-  widget_value *wv;
-  if (widget_value_free_list)
-    {
-      wv = widget_value_free_list;
-      widget_value_free_list = wv->free_list;
-      wv->free_list = 0;
-    }
-  else
-    {
-      wv = (widget_value *) xmalloc (sizeof (widget_value));
-      malloc_cpt++;
-    }
-  memset ((void*) wv, 0, sizeof (widget_value));
-  return wv;
-}
-
-/* this is analogous to free().  It frees only what was allocated
-   by malloc_widget_value(), and no substructures.
- */
-void
-free_widget_value (widget_value *wv)
-{
-  if (wv->free_list)
-    abort ();
-
-  if (malloc_cpt > 25)
-    {
-      /* When the number of already allocated cells is too big,
-        We free it.  */
-      xfree (wv);
-      malloc_cpt--;
-    }
-  else
-    {
-      wv->free_list = widget_value_free_list;
-      widget_value_free_list = wv;
-    }
-}
 
 static void
 free_widget_value_tree (widget_value *wv)
@@ -185,7 +127,7 @@ free_widget_value_tree (widget_value *wv)
       free_widget_value_tree (wv->next);
       wv->next = (widget_value *) 0xDEADBEEF;
     }
-  free_widget_value (wv);
+  xfree (wv);
 }
 
 static widget_value *
@@ -198,10 +140,11 @@ copy_widget_value_tree (widget_value *val, change_type change)
   if (val == (widget_value *) 1)
     return val;
 
-  copy = malloc_widget_value ();
-  copy->name = safe_strdup (val->name);
-  copy->value = safe_strdup (val->value);
-  copy->key = safe_strdup (val->key);
+  copy = xmalloc (sizeof (widget_value));
+  copy->lname = copy->lkey = Qnil;
+  copy->name = xstrdup (val->name);
+  copy->value = val->value ? xstrdup (val->value) : NULL;
+  copy->key = val->key ? xstrdup (val->key) : NULL;
   copy->help = val->help;
   copy->enabled = val->enabled;
   copy->button_type = val->button_type;
@@ -228,8 +171,8 @@ allocate_widget_info (const char* type,
                       lw_callback highlight_cb)
 {
   widget_info* info = (widget_info*) xmalloc (sizeof (widget_info));
-  info->type = safe_strdup (type);
-  info->name = safe_strdup (name);
+  info->type = xstrdup (type);
+  info->name = xstrdup (name);
   info->id = id;
   info->val = copy_widget_value_tree (val, STRUCTURAL_CHANGE);
   info->busy = False;
@@ -248,8 +191,8 @@ allocate_widget_info (const char* type,
 static void
 free_widget_info (widget_info *info)
 {
-  safe_free_str (info->type);
-  safe_free_str (info->name);
+  xfree (info->type);
+  xfree (info->name);
   free_widget_value_tree (info->val);
   memset ((void*)info, 0xDEADBEEF, sizeof (widget_info));
   xfree (info);
@@ -431,24 +374,21 @@ merge_widget_value (widget_value *val1,
       EXPLAIN (val1->name, change, STRUCTURAL_CHANGE, "name change",
               val1->name, val2->name);
       change = max (change, STRUCTURAL_CHANGE);
-      safe_free_str (val1->name);
-      val1->name = safe_strdup (val2->name);
+      dupstring (&val1->name, val2->name);
     }
   if (safe_strcmp (val1->value, val2->value))
     {
       EXPLAIN (val1->name, change, VISIBLE_CHANGE, "value change",
               val1->value, val2->value);
       change = max (change, VISIBLE_CHANGE);
-      safe_free_str (val1->value);
-      val1->value = safe_strdup (val2->value);
+      dupstring (&val1->value, val2->value);
     }
   if (safe_strcmp (val1->key, val2->key))
     {
       EXPLAIN (val1->name, change, VISIBLE_CHANGE, "key change",
               val1->key, val2->key);
       change = max (change, VISIBLE_CHANGE);
-      safe_free_str (val1->key);
-      val1->key = safe_strdup (val2->key);
+      dupstring (&val1->key, val2->key);
     }
   if (! EQ (val1->help, val2->help))
     {
index 0e646a26b99a3a3db837722abb39cfd234840dbb..7d87facb90354feb8b404f37a5557035da216a43 100644 (file)
@@ -42,22 +42,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 ** main:     ("name")
 */
 
-typedef unsigned long LWLIB_ID;
+#include "lwlib-widget.h"
 
-typedef enum _change_type
-{
-  NO_CHANGE = 0,
-  INVISIBLE_CHANGE = 1,
-  VISIBLE_CHANGE = 2,
-  STRUCTURAL_CHANGE = 3
-} change_type;
-
-enum button_type
-{
-  BUTTON_TYPE_NONE,
-  BUTTON_TYPE_TOGGLE,
-  BUTTON_TYPE_RADIO
-};
+typedef unsigned int LWLIB_ID;
 
 /* Menu separator types.  */
 
@@ -81,51 +68,6 @@ enum menu_separator
   SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH
 };
 
-typedef struct _widget_value
-{
-  /* name of widget */
-  Lisp_Object   lname;
-  char*                name;
-  /* value (meaning depend on widget type) */
-  char*                value;
-  /* keyboard equivalent. no implications for XtTranslations */
-  Lisp_Object   lkey;
-  char*                key;
-  /* Help string or nil if none.
-     GC finds this string through the frame's menu_bar_vector
-     or through menu_items.  */
-  Lisp_Object  help;
-  /* true if enabled */
-  Boolean      enabled;
-  /* true if selected */
-  Boolean      selected;
-  /* true if was edited (maintained by get_value) */
-  Boolean      edited;
-  /* The type of a button.  */
-  enum button_type button_type;
-  /* true if has changed (maintained by lw library) */
-  change_type  change;
-  /* true if this widget itself has changed,
-     but not counting the other widgets found in the `next' field.  */
-  change_type   this_one_change;
-  /* Contents of the sub-widgets, also selected slot for checkbox */
-  struct _widget_value*        contents;
-  /* data passed to callback */
-  XtPointer    call_data;
-  /* next one in the list */
-  struct _widget_value*        next;
-  /* slot for the toolkit dependent part.  Always initialize to NULL. */
-  void* toolkit_data;
-  /* tell us if we should free the toolkit data slot when freeing the
-     widget_value itself. */
-  Boolean free_toolkit_data;
-
-  /* we resource the widget_value structures; this points to the next
-     one on the free list if this one has been deallocated.
-   */
-  struct _widget_value *free_list;
-} widget_value;
-
 
 typedef void (*lw_callback) (Widget w, LWLIB_ID id, void* data);
 
@@ -153,8 +95,6 @@ widget_value* lw_get_all_values (LWLIB_ID id);
 Boolean lw_get_some_values (LWLIB_ID id, widget_value* val);
 void lw_pop_up_all_widgets (LWLIB_ID id);
 void lw_pop_down_all_widgets (LWLIB_ID id);
-widget_value *malloc_widget_value (void);
-void free_widget_value (widget_value *);
 void lw_popup_menu (Widget, XEvent *);
 
 /* Toolkit independent way of focusing on a Widget at the Xt level. */
index a4a18f0ba456a4e1d451cc256b3590f91e4dddbe..6f4db562e0ba6833737b81a557b97574844c3ae7 100644 (file)
@@ -1863,16 +1863,9 @@ openXftFont (XlwMenuWidget mw)
           fname[i] = '-';
         }
 
-      mw->menu.font = XLoadQueryFont (XtDisplay (mw), fname);
-      if (!mw->menu.font)
-        {
-          mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, fname);
-          if (!mw->menu.xft_font)
-            {
-              fprintf (stderr, "Can't find font '%s'\n", fname);
-              mw->menu.xft_font = getDefaultXftFont (mw);
-            }
-        }
+      mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, fname);
+      if (!mw->menu.xft_font)
+       mw->menu.xft_font = getDefaultXftFont (mw);
     }
 
   if (fname != mw->menu.fontName) xfree (fname);
@@ -1889,15 +1882,6 @@ XlwMenuInitialize (Widget request, Widget w, ArgList args, Cardinal *num_args)
   Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw)));
   Display* display = XtDisplay (mw);
 
-#if 0
-  widget_value *tem = (widget_value *) XtMalloc (sizeof (widget_value));
-
-  /* _XtCreate is freeing the object that was passed to us,
-     so make a copy that we will actually keep.  */
-  memcpy (tem, mw->menu.contents, sizeof (widget_value));
-  mw->menu.contents = tem;
-#endif
-
   /*  mw->menu.cursor = XCreateFontCursor (display, mw->menu.cursor_shape); */
   mw->menu.cursor = mw->menu.cursor_shape;
 
@@ -2074,19 +2058,15 @@ XlwMenuDestroy (Widget w)
   XFreePixmap (XtDisplay (mw), mw->menu.gray_pixmap);
   mw->menu.gray_pixmap = (Pixmap) -1;
 
-#if 0
-  /* Do free mw->menu.contents because nowadays we copy it
-     during initialization.  */
-  XtFree (mw->menu.contents);
-#endif
-
   /* Don't free mw->menu.contents because that comes from our creator.
      The `*_stack' elements are just pointers into `contents' so leave
      that alone too.  But free the stacks themselves. */
   if (mw->menu.old_stack) XtFree ((char *) mw->menu.old_stack);
   if (mw->menu.new_stack) XtFree ((char *) mw->menu.new_stack);
 
-  /* Remember, you can't free anything that came from the resource
+  /* Original comment was:
+
+     Remember, you can't free anything that came from the resource
      database.  This includes:
          mw->menu.cursor
          mw->menu.top_shadow_pixmap
@@ -2095,7 +2075,11 @@ XlwMenuDestroy (Widget w)
      Also the color cells of top_shadow_color, bottom_shadow_color,
      foreground, and button_foreground will never be freed until this
      client exits.  Nice, eh?
-   */
+
+     But now I can free font without any visible glitches.  */
+
+  if (mw->menu.font)
+    XFreeFont (XtDisplay (mw), mw->menu.font);
 
 #ifdef HAVE_XFT
   if (mw->menu.windows [0].xft_draw)
index 20ce40e7441dcab0c3ccb5ca902e1f04b37d4e39..35f6195204e8986361e9b35499b924dc8deaea78 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 34
+# gnulib-common.m4 serial 35
 dnl Copyright (C) 2007-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -49,6 +49,16 @@ AC_DEFUN([gl_COMMON_BODY], [
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 
+/* gcc supports the "unused" attribute on possibly unused labels, and
+   g++ has since version 4.5.  Note to support C++ as well as C,
+   _GL_UNUSED_LABEL should be used with a trailing ;  */
+#if !defined __cplusplus || __GNUC__ > 4 \
+    || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define _GL_UNUSED_LABEL _GL_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
 /* The __pure__ attribute was added in gcc 2.96.  */
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
index 0ba2d7950af45c0ddf5f3cb8a2073719db2b8c06..98acc069c92ad96b45596798b6477938e72482cd 100644 (file)
@@ -119,13 +119,6 @@ AC_DEFUN([gl_EARLY],
   # Code from module stat:
   # Code from module stat-time:
   # Code from module stdalign:
-  # Code from module stdarg:
-  dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
-  dnl for the builtin va_copy to work.  With Autoconf 2.60 or later,
-  dnl gl_PROG_CC_C99 arranges for this.  With older Autoconf gl_PROG_CC_C99
-  dnl shouldn't hurt, though installers are on their own to set c99 mode.
-  gl_PROG_CC_C99
-  # Code from module stdbool:
   # Code from module stddef:
   # Code from module stdint:
   # Code from module stdio:
@@ -342,8 +335,6 @@ AC_DEFUN([gl_INIT],
   gl_STAT_TIME
   gl_STAT_BIRTHTIME
   gl_STDALIGN_H
-  gl_STDARG_H
-  AM_STDBOOL_H
   gl_STDDEF_H
   gl_STDINT_H
   gl_STDIO_H
@@ -891,8 +882,6 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/stat-time.h
   lib/stat.c
   lib/stdalign.in.h
-  lib/stdarg.in.h
-  lib/stdbool.in.h
   lib/stddef.in.h
   lib/stdint.in.h
   lib/stdio.in.h
@@ -998,8 +987,6 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/stat-time.m4
   m4/stat.m4
   m4/stdalign.m4
-  m4/stdarg.m4
-  m4/stdbool.m4
   m4/stddef_h.m4
   m4/stdint.m4
   m4/stdio_h.m4
diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644 (file)
index 0000000..c5b26b5
--- /dev/null
+++ b/m4/pkg.m4
@@ -0,0 +1,214 @@
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+       AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
index 4ba073231f9af5648b1fa0107a63a4f280249bcc..2b3347f992dc557c4bf2fb254f75bc2136f88145 100644 (file)
@@ -1,4 +1,4 @@
-# pthread_sigmask.m4 serial 13
+# pthread_sigmask.m4 serial 14
 dnl Copyright (C) 2011-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -97,39 +97,43 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
     dnl with -lpthread, the pthread_sigmask() function always returns 0 and has
     dnl no effect.
     if test -z "$LIB_PTHREAD_SIGMASK"; then
-      AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
-        [gl_cv_func_pthread_sigmask_in_libc_works],
-        [
-          AC_RUN_IFELSE(
-            [AC_LANG_SOURCE([[
-#include <pthread.h>
-#include <signal.h>
-#include <stddef.h>
-int main ()
-{
-  sigset_t set;
-  sigemptyset (&set);
-  return pthread_sigmask (1729, &set, NULL) != 0;
-}]])],
-            [gl_cv_func_pthread_sigmask_in_libc_works=no],
-            [gl_cv_func_pthread_sigmask_in_libc_works=yes],
-            [
-changequote(,)dnl
-             case "$host_os" in
-               freebsd* | hpux* | solaris | solaris2.[2-9]*)
-                 gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
-               *)
-                 gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
-             esac
-changequote([,])dnl
-            ])
-        ])
-      case "$gl_cv_func_pthread_sigmask_in_libc_works" in
-        *no)
-          REPLACE_PTHREAD_SIGMASK=1
-          AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
-            [Define to 1 if pthread_sigmask() may returns 0 and have no effect.])
-          ;;
+      case " $LIBS " in
+        *' -lpthread '*) ;;
+       *)
+         AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
+           [gl_cv_func_pthread_sigmask_in_libc_works],
+           [
+             AC_RUN_IFELSE(
+               [AC_LANG_SOURCE([[
+                  #include <pthread.h>
+                  #include <signal.h>
+                  #include <stddef.h>
+                  int main ()
+                  {
+                    sigset_t set;
+                    sigemptyset (&set);
+                    return pthread_sigmask (1729, &set, NULL) != 0;
+                  }]])],
+               [gl_cv_func_pthread_sigmask_in_libc_works=no],
+               [gl_cv_func_pthread_sigmask_in_libc_works=yes],
+               [
+                changequote(,)dnl
+                case "$host_os" in
+                  freebsd* | hpux* | solaris | solaris2.[2-9]*)
+                    gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+                  *)
+                    gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+                esac
+                changequote([,])dnl
+               ])
+           ])
+         case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+           *no)
+             REPLACE_PTHREAD_SIGMASK=1
+             AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
+               [Define to 1 if pthread_sigmask may return 0 and have no effect.])
+             ;;
+         esac;;
       esac
     fi
 
@@ -184,11 +188,12 @@ int main ()
           *)
             gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
         esac
-        dnl Here we link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK,
-        dnl otherwise we get a false positive on those platforms where
-        dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
-        gl_save_LIBS="$LIBS"
-        LIBS="$LIBS $LIBMULTITHREAD"
+        m4_ifdef([gl_][THREADLIB],
+          [dnl Link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK.
+           dnl Otherwise we get a false positive on those platforms where
+           dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
+           gl_save_LIBS=$LIBS
+           LIBS="$LIBS $LIBMULTITHREAD"])
         AC_RUN_IFELSE(
           [AC_LANG_SOURCE([[
 #include <pthread.h>
@@ -227,7 +232,7 @@ int main ()
           [:],
           [gl_cv_func_pthread_sigmask_unblock_works=no],
           [:])
-        LIBS="$gl_save_LIBS"
+        m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS])
       ])
     case "$gl_cv_func_pthread_sigmask_unblock_works" in
       *no)
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
deleted file mode 100644 (file)
index 732aa31..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-# stdarg.m4 serial 6
-dnl Copyright (C) 2006, 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Provide a working va_copy in combination with <stdarg.h>.
-
-AC_DEFUN([gl_STDARG_H],
-[
-  STDARG_H=''
-  NEXT_STDARG_H='<stdarg.h>'
-  AC_MSG_CHECKING([for va_copy])
-  AC_CACHE_VAL([gl_cv_func_va_copy], [
-    AC_COMPILE_IFELSE(
-      [AC_LANG_PROGRAM(
-         [[#include <stdarg.h>]],
-         [[
-#ifndef va_copy
-void (*func) (va_list, va_list) = va_copy;
-#endif
-         ]])],
-      [gl_cv_func_va_copy=yes],
-      [gl_cv_func_va_copy=no])])
-  AC_MSG_RESULT([$gl_cv_func_va_copy])
-  if test $gl_cv_func_va_copy = no; then
-    dnl Provide a substitute.
-    dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
-    dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h>
-    dnl which does '#undef va_copy', leading to a missing va_copy symbol. For
-    dnl this platform, we use an <stdarg.h> substitute. But we cannot use this
-    dnl approach on other platforms, because <stdarg.h> often defines only
-    dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do
-    dnl not work in this situation.
-    AC_EGREP_CPP([vaccine],
-      [#if defined _AIX && !defined __GNUC__
-        AIX vaccine
-       #endif
-      ], [gl_aixcc=yes], [gl_aixcc=no])
-    if test $gl_aixcc = yes; then
-      dnl Provide a substitute <stdarg.h> file.
-      STDARG_H=stdarg.h
-      gl_NEXT_HEADERS([stdarg.h])
-      dnl Fallback for the case when <stdarg.h> contains only macro definitions.
-      if test "$gl_cv_next_stdarg_h" = '""'; then
-        gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
-        NEXT_STDARG_H="$gl_cv_next_stdarg_h"
-      fi
-    else
-      dnl Provide a substitute in <config.h>, either __va_copy or as a simple
-      dnl assignment.
-      gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
-        AC_COMPILE_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[#include <stdarg.h>]],
-             [[
-#ifndef __va_copy
-error, bail out
-#endif
-             ]])],
-          [gl_cv_func___va_copy=yes],
-          [gl_cv_func___va_copy=no])])
-      if test $gl_cv_func___va_copy = yes; then
-        AC_DEFINE([va_copy], [__va_copy],
-          [Define as a macro for copying va_list variables.])
-      else
-        AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed.  */
-#define gl_va_copy(a,b) ((a) = (b))])
-        AC_DEFINE([va_copy], [gl_va_copy],
-          [Define as a macro for copying va_list variables.])
-      fi
-    fi
-  fi
-  AC_SUBST([STDARG_H])
-  AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"])
-  AC_SUBST([NEXT_STDARG_H])
-])
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
deleted file mode 100644 (file)
index 006ed52..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-# Check for stdbool.h that conforms to C99.
-
-dnl Copyright (C) 2002-2006, 2009-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# Prepare for substituting <stdbool.h> if it is not supported.
-
-AC_DEFUN([AM_STDBOOL_H],
-[
-  AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
-
-  # Define two additional variables used in the Makefile substitution.
-
-  if test "$ac_cv_header_stdbool_h" = yes; then
-    STDBOOL_H=''
-  else
-    STDBOOL_H='stdbool.h'
-  fi
-  AC_SUBST([STDBOOL_H])
-  AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
-
-  if test "$ac_cv_type__Bool" = yes; then
-    HAVE__BOOL=1
-  else
-    HAVE__BOOL=0
-  fi
-  AC_SUBST([HAVE__BOOL])
-])
-
-# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
-AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-
-# This version of the macro is needed in autoconf <= 2.68.
-
-AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
-  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
-     [ac_cv_header_stdbool_h],
-     [AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM(
-           [[
-             #include <stdbool.h>
-             #ifndef bool
-              "error: bool is not defined"
-             #endif
-             #ifndef false
-              "error: false is not defined"
-             #endif
-             #if false
-              "error: false is not 0"
-             #endif
-             #ifndef true
-              "error: true is not defined"
-             #endif
-             #if true != 1
-              "error: true is not 1"
-             #endif
-             #ifndef __bool_true_false_are_defined
-              "error: __bool_true_false_are_defined is not defined"
-             #endif
-
-             struct s { _Bool s: 1; _Bool t; } s;
-
-             char a[true == 1 ? 1 : -1];
-             char b[false == 0 ? 1 : -1];
-             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-             char d[(bool) 0.5 == true ? 1 : -1];
-             /* See body of main program for 'e'.  */
-             char f[(_Bool) 0.0 == false ? 1 : -1];
-             char g[true];
-             char h[sizeof (_Bool)];
-             char i[sizeof s.t];
-             enum { j = false, k = true, l = false * true, m = true * 256 };
-             /* The following fails for
-                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-             _Bool n[m];
-             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-             /* Catch a bug in an HP-UX C compiler.  See
-                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-              */
-             _Bool q = true;
-             _Bool *pq = &q;
-           ]],
-           [[
-             bool e = &s;
-             *pq |= q;
-             *pq |= ! q;
-             /* Refer to every declared value, to avoid compiler optimizations.  */
-             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                     + !m + !n + !o + !p + !q + !pq);
-           ]])],
-        [ac_cv_header_stdbool_h=yes],
-        [ac_cv_header_stdbool_h=no])])
-   AC_CHECK_TYPES([_Bool])
-])
index 8e2c921cbef74aceab5626d3f33bd166e25485c1..578ebe0809a1032eca1318cb67c7e411dc4fd12e 100644 (file)
@@ -1,4 +1,4 @@
-# timer_time.m4 serial 2
+# timer_time.m4 serial 3
 dnl Copyright (C) 2011-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,12 @@ AC_DEFUN([gl_TIMER_TIME],
   dnl Based on clock_time.m4. See details there.
 
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_REQUIRE([gl_THREADLIB])
+
+  dnl Test whether the gnulib module 'threadlib' is in use.
+  dnl Some packages like Emacs use --avoid=threadlib.
+  dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
+  dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
+  m4_ifdef([gl_][THREADLIB], [AC_REQUIRE([gl_][THREADLIB])])
 
   LIB_TIMER_TIME=
   AC_SUBST([LIB_TIMER_TIME])
@@ -19,21 +24,21 @@ AC_DEFUN([gl_TIMER_TIME],
     AC_SEARCH_LIBS([timer_settime], [rt posix4],
                    [test "$ac_cv_search_timer_settime" = "none required" ||
                     LIB_TIMER_TIME=$ac_cv_search_timer_settime])
-    dnl GLIBC uses threads to emulate posix timers when kernel support
-    dnl is not available (like Linux < 2.6 or when used with kFreeBSD)
-    dnl Now the pthread lib is linked automatically in the normal case,
-    dnl but when linking statically, it needs to be explicitly specified.
-    AC_EGREP_CPP([Thread],
-      [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
-     && !(__UCLIBC__ && __HAS_NO_THREADS__)
-  Thread emulation available
- #endif
-#endif
-      ],
-      [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])
+    m4_ifdef([gl_][THREADLIB],
+      [dnl GLIBC uses threads to emulate posix timers when kernel support
+       dnl is not available (like Linux < 2.6 or when used with kFreeBSD)
+       dnl Now the pthread lib is linked automatically in the normal case,
+       dnl but when linking statically, it needs to be explicitly specified.
+       AC_EGREP_CPP([Thread],
+         [#include <features.h>
+          #ifdef __GNU_LIBRARY__
          #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
+               && !(__UCLIBC__ && __HAS_NO_THREADS__)
+            Thread emulation available
          #endif
+          #endif
+         ],
+         [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])])
     AC_CHECK_FUNCS([timer_settime])
   LIBS=$gl_saved_libs
 ])
index aed5b17c0e2b3af99da41e57010a086eb5d675c0..fba490547eed53d882915c1c2dc74a718631839b 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -1,8 +1,7 @@
 #!/bin/sh
 ### make-dist: create an Emacs distribution tar file from current srcdir
 
-## Copyright (C) 1995, 1997-1998, 2000-2014 Free Software Foundation,
-## Inc.
+## Copyright (C) 1995, 1997-1998, 2000-2014 Free Software Foundation, Inc.
 
 ## This file is part of GNU Emacs.
 
@@ -160,7 +159,7 @@ fi
 
 ### Find out which version of Emacs this is.
 version=`
-  sed -n 's/^AC_INIT(emacs,[    ]*\([^  )]*\).*/\1/p' <configure.ac
+  sed -n 's/^AC_INIT(GNU Emacs,[        ]*\([^  ,)]*\).*/\1/p' <configure.ac
 ` || version=
 if [ ! "${version}" ]; then
   echo "${progname}: can't find current Emacs version in \`./src/emacs.c'" >&2
@@ -383,7 +382,7 @@ echo "Making links to \`lib'"
 echo "Making links to \`lib-src'"
 (cd lib-src
  ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src
- ln ChangeLog Makefile.in README testfile ../${tempdir}/lib-src
+ ln ChangeLog Makefile.in README ../${tempdir}/lib-src
  ln grep-changelog rcs2log ../${tempdir}/lib-src
  ln makefile.w32-in ../${tempdir}/lib-src
  ln update-game-score.exe.manifest ../${tempdir}/lib-src)
@@ -439,12 +438,12 @@ echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'"
 
 echo "Making links to \`oldXMenu'"
 (cd oldXMenu
- ln *.[ch] *.in ../${tempdir}/oldXMenu
+ ln *.[ch] *.in *.mk ../${tempdir}/oldXMenu
  ln README ChangeLog ../${tempdir}/oldXMenu)
 
 echo "Making links to \`lwlib'"
 (cd lwlib
- ln *.[ch] *.in ../${tempdir}/lwlib
+ ln *.[ch] *.in *.mk ../${tempdir}/lwlib
  ln README ChangeLog ../${tempdir}/lwlib)
 
 ## It is important to distribute admin/ because it contains sources
@@ -461,6 +460,7 @@ if [ "$with_tests" = "yes" ]; then
   echo "Making links to \`test' and its subdirectories"
   for f in `find test -type f`; do
     case $f in
+      test/automated/*.log) continue ;;
       test/automated/flymake/warnpred/a.out) continue ;;
       test/automated/Makefile) continue ;;
     esac
index 0ba3ead17a7ba2c75398616f65d7194b18211ab3..97276d63abacc27c214c03f3e10b90b25bb63507 100644 (file)
@@ -70,7 +70,7 @@
 /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/
 /^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION ""/
 /^#undef PENDING_OUTPUT_COUNT/s/^.*$/#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)/
-/^#undef VERSION/s/^.*$/#define VERSION "24.3.92"/
+/^#undef VERSION/s/^.*$/#define VERSION "24.4.50"/
 /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/
 /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/
 /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/
index ad869f1a19aa1b0cc58ede610b633201543f8c8d..45a2dbf427c3bbd6bb9dcdf9c29c8ffd473be690 100644 (file)
@@ -1,3 +1,12 @@
+2014-06-25  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (${ns_appbindir}): New.
+       (${ns_appbindir}/Emacs): Use order-only prereq to create output dir.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (bootstrap-clean): New.
+
 2014-03-13  Glenn Morris  <rgm@gnu.org>
 
        * templates/Info.plist.in: Make it strictly valid xml.  (Bug#17002)
index fe570d13ee894d81a1c930456baacd7e6954e1b9..52f321109b77cb5dbbd13f7e635ff34a0ef0b433 100644 (file)
@@ -43,16 +43,19 @@ ${ns_check_file} ${ns_appdir}: ${srcdir}/${ns_appsrc} ${ns_appsrc}
            ( cd ${ns_appdir} ; umask 022; tar xf - )
        touch ${ns_appdir}
 
-${ns_appbindir}/Emacs: ${ns_appdir} ${ns_check_file} ../src/emacs${EXEEXT}
-       ${MKDIR_P} ${ns_appbindir}
-       cp -f ../src/emacs${EXEEXT} ${ns_appbindir}/Emacs
+${ns_appbindir}:
+       ${MKDIR_P} $@
+
+${ns_appbindir}/Emacs: ${ns_appdir} ${ns_check_file} ../src/emacs${EXEEXT} | \
+  ${ns_appbindir}
+       cp -f ../src/emacs${EXEEXT} $@
 
 .PHONY: all
 
 all: ${ns_appdir} ${ns_appbindir}/Emacs
 
 
-.PHONY: clean distclean maintainer-clean
+.PHONY: clean distclean bootstrap-clean maintainer-clean
 
 clean:
        rm -rf ${ns_appdir}
@@ -64,6 +67,6 @@ distclean: clean
          Cocoa/Emacs.base/Contents/Info.plist \
          Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings
 
-maintainer-clean: distclean
+bootstrap-clean maintainer-clean: distclean
 
 ### Makefile.in ends here
index 299879ccba87bd77702101d290824d6d171985a3..9c7328e917563d258be49cf5e30fcb99028dcd98 100644 (file)
@@ -1,18 +1,65 @@
-2014-04-26  Eli Zaretskii  <eliz@gnu.org>
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (LDFLAGS): Explicitly set via configure.
+
+2014-06-15  Eli Zaretskii  <eliz@gnu.org>
+
+       * Makefile.in (CPPFLAGS): Define.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (bootstrap-clean): New.
+
+2014-06-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * inc/ms-w32.h (POLL_FOR_INPUT): Define with HAVE_WINDOW_SYSTEM.
+
+2014-05-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * Makefile.in (DONT_INSTALL): Now empty.
+       (addsection${EXEEXT}): Remove target.
+
+       * addsection.c: File removed.
+
+2014-05-27  Fabrice Popineau  <fabrice.popineau@gmail.com>
+
+       * inc/ms-w32.h: Switch to the system heap allocation scheme
+       instead of GNU malloc and ralloc.
+
+       * inc/sys/mman.h: New file.
+
+       * INSTALL: Update for the new build requirements.
+
+2014-05-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Assume C99 or later (Bug#17487).
+       * gnulib.mk: Remove stdarg and stdbool modules.
+
+2014-05-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't require pkg-config when building from repository.
+       * INSTALL: Remove no-longer-needed notes about pkg-config.
+
+2014-05-05  Eli Zaretskii  <eliz@gnu.org>
+
+       * INSTALL: Update to the effect that pkg-config is now required
+       for building from the repository.
+
+2014-04-30  Eli Zaretskii  <eliz@gnu.org>
 
        * cmdproxy.c (make_absolute): Don't copy more characters from PATH
        than a single directory name can hold.  (Bug#17334)
 
-2014-04-21  Eli Zaretskii  <eliz@gnu.org>
+2014-04-22  Eli Zaretskii  <eliz@gnu.org>
 
        * inc/ms-w32.h (lseek): Define only if not already a macro.
        Suggested by Fabrice Popineau <fabrice.popineau@gmail.com>.
 
-2014-04-09  Ken Brown  <kbrown@cornell.edu>
+2014-04-11  Ken Brown  <kbrown@cornell.edu>
 
        * emacs.rc: Revert last change.
 
-2014-04-03  Ken Brown  <kbrown@cornell.edu>
+2014-04-07  Ken Brown  <kbrown@cornell.edu>
 
        * emacs.rc: Don't use manifest on Cygwin.  (Bug#17176)
 
index f43912f6a1fc0413d99b5748abf7770ff4c02fdc..8b764f7ba2a85da5f42c82793ace8cdc8f5c3a49 100644 (file)
@@ -5,9 +5,9 @@
   See the end of the file for license conditions.
 
 The MSYS/MinGW build described here is supported on versions of
-Windows starting with Windows 2000 and newer.  Windows 9X are not
-supported (but the Emacs binary produced by this build will run on
-Windows 9X as well).
+Windows starting with Windows XP and newer.  Building on Windows 2000
+and Windows 9X is not supported (but the Emacs binary produced by this
+build will run on Windows 9X and newer systems).
 
   Do not use this recipe with Cygwin.  For building on Cygwin, use the
   normal installation instructions, ../INSTALL.
@@ -173,14 +173,14 @@ Windows 9X as well).
 
      Available from http://sourceforge.net/projects/ezwinports/files/.
 
-   . gzip (needed to compress files during "make install")
+   . pkg-config (invoked by the configure script to look for optional
+     packages)
 
-     Available from http://gnuwin32.sourceforge.net/packages/gzip.htm.
+     Available from http://www.gtk.org/download/win32.php
 
-   . pkg-config (needed for building with some optional libraries,
-     such as GnuTLS and libxml2)
+   . gzip (needed to compress files during "make install")
 
-     Available from http://www.gtk.org/download/win32.php
+     Available from http://gnuwin32.sourceforge.net/packages/gzip.htm.
 
   Each package might list other packages as prerequisites on its
   download page (under "Runtime requirements"); download those as
@@ -235,6 +235,12 @@ Windows 9X as well).
   For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
   from which you unpack all of the MSYS packages.
 
+  After installing Automake and Autoconf, make sure any of the *.m4
+  files you might have in your MinGW installation also exist in the
+  MSYS installation tree, in the share/aclocal directory.  Those *.m4
+  files which exist in the MinGW tree, but not in the MSYS tree should
+  be copied there.
+
   If/when you are confident in your MinGW/MSYS installation, and want
   to speed up the builds, we recommend installing a pre-release
   version of Make from here:
@@ -396,9 +402,10 @@ Windows 9X as well).
 
        Where should the build process find the source code?    /path/to/emacs/sources
        What compiler should emacs be built with?               gcc  -std=gnu99 -O0 -g3
-       Should Emacs use the GNU version of malloc?             yes
-       Should Emacs use a relocating allocator for buffers?    yes
-       Should Emacs use mmap(2) for buffer allocation?         no
+       Should Emacs use the GNU version of malloc?             no
+        (The GNU allocators don't work with this system configuration.)
+       Should Emacs use a relocating allocator for buffers?    no
+       Should Emacs use mmap(2) for buffer allocation?         yes
        What window system should Emacs use?                    w32
        What toolkit should Emacs use?                          none
        Where do we find X Windows header files?                NONE
@@ -408,13 +415,16 @@ Windows 9X as well).
        Does Emacs use -ljpeg?                                  yes
        Does Emacs use -ltiff?                                  yes
        Does Emacs use a gif library?                           yes
-       Does Emacs use -lpng?                                   yes
-       Does Emacs use -lrsvg-2?                                no
+       Does Emacs use a png library?                           yes
+       Does Emacs use -lrsvg-2?                                yes
        Does Emacs use imagemagick?                             no
+       Does Emacs support sound?                               no
        Does Emacs use -lgpm?                                   no
        Does Emacs use -ldbus?                                  no
        Does Emacs use -lgconf?                                 no
        Does Emacs use GSettings?                               no
+       Does Emacs use a file notification library?             yes (w32)
+       Does Emacs use access control lists?                    yes
        Does Emacs use -lselinux?                               no
        Does Emacs use -lgnutls?                                yes
        Does Emacs use -lxml2?                                  yes
@@ -422,6 +432,7 @@ Windows 9X as well).
        Does Emacs use -lm17n-flt?                              no
        Does Emacs use -lotf?                                   no
        Does Emacs use -lxft?                                   no
+       Does Emacs directly use zlib?                           yes
        Does Emacs use toolkit scroll bars?                     yes
 
   You are almost there, hang on.
index f498928bfcece508616ba7a7ccccced8dd300ef7..be5bae536f14667820717421e11153da1cbf3a15 100644 (file)
@@ -25,6 +25,9 @@ SHELL = /bin/sh
 
 CC=@CC@
 CFLAGS=@CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+
 version=@version@
 ## Used in $archlibdir.
 configuration=@configuration@
@@ -120,7 +123,7 @@ INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT}
 UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT}
 
 # Things that Emacs runs during the build process.
-DONT_INSTALL = addsection${EXEEXT}
+DONT_INSTALL =
 
 # All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
 EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
@@ -141,7 +144,9 @@ BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
              -I. -I${srcdir}
 
 ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
+## Unused.
 LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
+## Unused.
 CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
 
 all: ${EXE_FILES}
@@ -162,7 +167,7 @@ $(DESTDIR)${archlibdir}: all
         fi
 
 .PHONY: install uninstall mostlyclean clean distclean maintainer-clean
-.PHONY: extraclean check tags
+.PHONY: bootstrap-clean extraclean check tags
 
 install: $(DESTDIR)${archlibdir}
        @echo
@@ -193,7 +198,7 @@ distclean: clean
        -rm -f TAGS
        -rm -f Makefile
 
-maintainer-clean: distclean
+bootstrap-clean maintainer-clean: distclean
        true
 
 extraclean: maintainer-clean
@@ -208,9 +213,6 @@ TAGS: ${EXE_FILES:${EXEEXT}=.c}
        ../lib-src/etags *.[ch]
 
 ## Build the programs
-addsection${EXEEXT}: ${srcdir}/addsection.c
-       $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT}
-
 addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
        $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT}
 
diff --git a/nt/addsection.c b/nt/addsection.c
deleted file mode 100644 (file)
index a897573..0000000
+++ /dev/null
@@ -1,544 +0,0 @@
-/* Add an uninitialized data section to an executable.
-   Copyright (C) 1999, 2001-2014 Free Software Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-
-   Andrew Innes <andrewi@harlequin.co.uk>       04-Jan-1999
-     based on code from unexw32.c
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <time.h>
-#if defined(__GNUC__) && !defined(_W64)
-#define _ANONYMOUS_UNION
-#define _ANONYMOUS_STRUCT
-#endif
-#include <windows.h>
-
-/* Include relevant definitions from IMAGEHLP.H, which can be found
-   in \\win32sdk\mstools\samples\image\include\imagehlp.h. */
-
-PIMAGE_NT_HEADERS
-(__stdcall * pfnCheckSumMappedFile) (PVOID BaseAddress,
-                                    DWORD_PTR FileLength,
-                                    PDWORD_PTR HeaderSum,
-                                    PDWORD_PTR CheckSum);
-
-#undef min
-#undef max
-#define min(x, y) (((x) < (y)) ? (x) : (y))
-#define max(x, y) (((x) > (y)) ? (x) : (y))
-
-
-/* File handling.  */
-
-typedef struct file_data {
-  const char    *name;
-  unsigned long  size;
-  HANDLE         file;
-  HANDLE         file_mapping;
-  unsigned char *file_base;
-} file_data;
-
-int
-open_input_file (file_data *p_file, const char *filename)
-{
-  HANDLE file;
-  HANDLE file_mapping;
-  void  *file_base;
-  unsigned long size, upper_size;
-
-  file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
-                    OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
-  if (file == INVALID_HANDLE_VALUE)
-    return FALSE;
-
-  size = GetFileSize (file, &upper_size);
-  file_mapping = CreateFileMapping (file, NULL, PAGE_READONLY,
-                                   0, size, NULL);
-  if (!file_mapping)
-    return FALSE;
-
-  file_base = MapViewOfFile (file_mapping, FILE_MAP_READ, 0, 0, size);
-  if (file_base == 0)
-    return FALSE;
-
-  p_file->name = filename;
-  p_file->size = size;
-  p_file->file = file;
-  p_file->file_mapping = file_mapping;
-  p_file->file_base = file_base;
-
-  return TRUE;
-}
-
-int
-open_output_file (file_data *p_file, const char *filename, unsigned long size)
-{
-  HANDLE file;
-  HANDLE file_mapping;
-  void  *file_base;
-
-  file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
-                    CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
-  if (file == INVALID_HANDLE_VALUE)
-    return FALSE;
-
-  file_mapping = CreateFileMapping (file, NULL, PAGE_READWRITE,
-                                   0, size, NULL);
-  if (!file_mapping)
-    return FALSE;
-
-  file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size);
-  if (file_base == 0)
-    return FALSE;
-
-  p_file->name = filename;
-  p_file->size = size;
-  p_file->file = file;
-  p_file->file_mapping = file_mapping;
-  p_file->file_base = file_base;
-
-  return TRUE;
-}
-
-/* Close the system structures associated with the given file.  */
-void
-close_file_data (file_data *p_file)
-{
-  UnmapViewOfFile (p_file->file_base);
-  CloseHandle (p_file->file_mapping);
-  /* For the case of output files, set final size.  */
-  SetFilePointer (p_file->file, p_file->size, NULL, FILE_BEGIN);
-  SetEndOfFile (p_file->file);
-  CloseHandle (p_file->file);
-}
-
-
-/* Routines to manipulate NT executable file sections.  */
-
-unsigned long
-get_unrounded_section_size (PIMAGE_SECTION_HEADER p_section)
-{
-  /* The true section size, before rounding, for an initialized data or
-     code section.  (Supposedly some linkers swap the meaning of these
-     two values.)  */
-  return min (p_section->SizeOfRawData,
-             p_section->Misc.VirtualSize);
-}
-
-/* Return pointer to section header for named section. */
-IMAGE_SECTION_HEADER *
-find_section (const char *name, IMAGE_NT_HEADERS *nt_header)
-{
-  PIMAGE_SECTION_HEADER section;
-  int i;
-
-  section = IMAGE_FIRST_SECTION (nt_header);
-
-  for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++)
-    {
-      if (strcmp (section->Name, name) == 0)
-       return section;
-      section++;
-    }
-  return NULL;
-}
-
-/* Return pointer to section header for section containing the given
-   relative virtual address. */
-IMAGE_SECTION_HEADER *
-rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header)
-{
-  PIMAGE_SECTION_HEADER section;
-  int i;
-
-  section = IMAGE_FIRST_SECTION (nt_header);
-
-  for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++)
-    {
-      /* Some linkers (eg. the NT SDK linker I believe) swapped the
-        meaning of these two values - or rather, they ignored
-        VirtualSize entirely and always set it to zero.  This affects
-        some very old exes (eg. gzip dated Dec 1993).  Since
-        w32_executable_type relies on this function to work reliably,
-        we need to cope with this.  */
-      DWORD_PTR real_size = max (section->SizeOfRawData,
-                            section->Misc.VirtualSize);
-      if (rva >= section->VirtualAddress
-         && rva < section->VirtualAddress + real_size)
-       return section;
-      section++;
-    }
-  return NULL;
-}
-
-/* Return pointer to section header for section containing the given
-   offset in its raw data area. */
-IMAGE_SECTION_HEADER *
-offset_to_section (DWORD_PTR offset, IMAGE_NT_HEADERS * nt_header)
-{
-  PIMAGE_SECTION_HEADER section;
-  int i;
-
-  section = IMAGE_FIRST_SECTION (nt_header);
-
-  for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++)
-    {
-      if (offset >= section->PointerToRawData
-         && offset < section->PointerToRawData + section->SizeOfRawData)
-       return section;
-      section++;
-    }
-  return NULL;
-}
-
-/* Return offset to an object in dst, given offset in src.  We assume
-   there is at least one section in both src and dst images, and that
-   the some sections may have been added to dst (after sections in src).  */
-static DWORD_PTR
-relocate_offset (DWORD_PTR offset,
-                IMAGE_NT_HEADERS * src_nt_header,
-                IMAGE_NT_HEADERS * dst_nt_header)
-{
-  PIMAGE_SECTION_HEADER src_section = IMAGE_FIRST_SECTION (src_nt_header);
-  PIMAGE_SECTION_HEADER dst_section = IMAGE_FIRST_SECTION (dst_nt_header);
-  int i = 0;
-
-  while (offset >= src_section->PointerToRawData)
-    {
-      if (offset < src_section->PointerToRawData + src_section->SizeOfRawData)
-       break;
-      i++;
-      if (i == src_nt_header->FileHeader.NumberOfSections)
-       {
-         /* Handle offsets after the last section.  */
-         dst_section = IMAGE_FIRST_SECTION (dst_nt_header);
-         dst_section += dst_nt_header->FileHeader.NumberOfSections - 1;
-         while (dst_section->PointerToRawData == 0)
-           dst_section--;
-         while (src_section->PointerToRawData == 0)
-           src_section--;
-         return offset
-           + (dst_section->PointerToRawData + dst_section->SizeOfRawData)
-           - (src_section->PointerToRawData + src_section->SizeOfRawData);
-       }
-      src_section++;
-      dst_section++;
-    }
-  return offset +
-    (dst_section->PointerToRawData - src_section->PointerToRawData);
-}
-
-#define OFFSET_TO_RVA(offset, section) \
-         (section->VirtualAddress + ((DWORD_PTR)(offset) - section->PointerToRawData))
-
-#define RVA_TO_OFFSET(rva, section) \
-         (section->PointerToRawData + ((DWORD_PTR)(rva) - section->VirtualAddress))
-
-#define RVA_TO_SECTION_OFFSET(rva, section) \
-         ((DWORD_PTR)(rva) - section->VirtualAddress)
-
-/* Convert address in executing image to RVA.  */
-#define PTR_TO_RVA(ptr) ((DWORD_PTR)(ptr) - (DWORD_PTR) GetModuleHandle (NULL))
-
-#define PTR_TO_OFFSET(ptr, pfile_data) \
-          ((unsigned const char *)(ptr) - (pfile_data)->file_base)
-
-#define OFFSET_TO_PTR(offset, pfile_data) \
-          ((pfile_data)->file_base + (DWORD_PTR)(offset))
-
-#define ROUND_UP(p, align) \
-         (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1))
-#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1))
-
-
-static void
-copy_executable_and_add_section (file_data *p_infile,
-                                file_data *p_outfile,
-                                const char *new_section_name,
-                                DWORD_PTR new_section_size)
-{
-  unsigned char *dst;
-  PIMAGE_DOS_HEADER dos_header;
-  PIMAGE_NT_HEADERS nt_header;
-  PIMAGE_NT_HEADERS dst_nt_header;
-  PIMAGE_SECTION_HEADER section;
-  PIMAGE_SECTION_HEADER dst_section;
-  DWORD_PTR offset;
-  int i;
-  int be_verbose = GetEnvironmentVariable ("DEBUG_DUMP", NULL, 0) > 0;
-
-#define COPY_CHUNK(message, src, size, verbose)                                        \
-  do {                                                                         \
-    unsigned const char *s = (void *)(src);                                            \
-    unsigned long count = (size);                                              \
-    if (verbose)                                                               \
-      {                                                                                \
-       printf ("%s\n", (message));                                             \
-       printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base);   \
-       printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \
-       printf ("\t0x%08x Size in bytes.\n", count);                            \
-      }                                                                                \
-    memcpy (dst, s, count);                                                    \
-    dst += count;                                                              \
-  } while (0)
-
-#define DST_TO_OFFSET()  PTR_TO_OFFSET (dst, p_outfile)
-#define ROUND_UP_DST_AND_ZERO(align)                                           \
-  do {                                                                         \
-    unsigned char *newdst = p_outfile->file_base                               \
-      + ROUND_UP (DST_TO_OFFSET (), (align));                                  \
-    /* Zero the alignment slop; it may actually initialize real data.  */      \
-    memset (dst, 0, newdst - dst);                                             \
-    dst = newdst;                                                              \
-  } while (0)
-
-  /* Copy the source image sequentially, ie. section by section after
-     copying the headers and section table, to simplify the process of
-     adding an extra section table entry (which might force the raw
-     section data to be relocated).
-
-     Note that dst is updated implicitly by each COPY_CHUNK.  */
-
-  dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base;
-  nt_header = (PIMAGE_NT_HEADERS) (((unsigned char *) dos_header) +
-                                  dos_header->e_lfanew);
-  section = IMAGE_FIRST_SECTION (nt_header);
-
-  dst = (unsigned char *) p_outfile->file_base;
-
-  COPY_CHUNK ("Copying DOS header...", dos_header,
-             (DWORD_PTR) nt_header - (DWORD_PTR) dos_header, be_verbose);
-  dst_nt_header = (PIMAGE_NT_HEADERS) dst;
-  COPY_CHUNK ("Copying NT header...", nt_header,
-             (DWORD_PTR) section - (DWORD_PTR) nt_header, be_verbose);
-  dst_section = (PIMAGE_SECTION_HEADER) dst;
-  COPY_CHUNK ("Copying section table...", section,
-             nt_header->FileHeader.NumberOfSections * sizeof (*section),
-             be_verbose);
-
-  /* To improve the efficiency of demand loading, make the file
-     alignment match the section alignment (VC++ 6.0 does this by
-     default anyway).  */
-  dst_nt_header->OptionalHeader.FileAlignment =
-    dst_nt_header->OptionalHeader.SectionAlignment;
-
-  /* Add an uninitialized data section at the end, of the specified name
-     and virtual size.  */
-  if (find_section (new_section_name, nt_header) == NULL)
-    /* Leave room for extra section table entry; filled in below.  */
-    dst += sizeof (*section);
-  else
-    new_section_name = NULL;
-
-  /* Align the first section's raw data area, and set the header size
-     field accordingly.  */
-  ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment);
-  dst_nt_header->OptionalHeader.SizeOfHeaders = DST_TO_OFFSET ();
-
-  for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++)
-    {
-      char msg[100];
-      /* Windows section names are fixed 8-char strings, only
-        zero-terminated if the name is shorter than 8 characters.  */
-      sprintf (msg, "Copying raw data for %.8s...", section->Name);
-
-      /* Update the file-relative offset for this section's raw data (if
-         it has any) in case things have been relocated; we will update
-         the other offsets below once we know where everything is.  */
-      if (dst_section->PointerToRawData)
-       dst_section->PointerToRawData = DST_TO_OFFSET ();
-
-      /* Can always copy the original raw data.  */
-      COPY_CHUNK
-       (msg, OFFSET_TO_PTR (section->PointerToRawData, p_infile),
-        section->SizeOfRawData, be_verbose);
-
-      /* Round up the raw data size to the new alignment.  */
-      dst_section->SizeOfRawData =
-       ROUND_UP (dst_section->SizeOfRawData,
-                 dst_nt_header->OptionalHeader.FileAlignment);
-
-      /* Align the next section's raw data area.  */
-      ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment);
-
-      section++;
-      dst_section++;
-    }
-
-  /* Add the extra section entry (which adds no raw data).  */
-  if (new_section_name != NULL)
-    {
-      dst_nt_header->FileHeader.NumberOfSections++;
-      dst_nt_header->OptionalHeader.SizeOfImage += new_section_size;
-      strncpy (dst_section->Name, new_section_name, sizeof (dst_section->Name));
-      dst_section->VirtualAddress =
-       section[-1].VirtualAddress
-       + ROUND_UP (section[-1].Misc.VirtualSize,
-                   dst_nt_header->OptionalHeader.SectionAlignment);
-      dst_section->Misc.VirtualSize = new_section_size;
-      dst_section->PointerToRawData = 0;
-      dst_section->SizeOfRawData = 0;
-      dst_section->Characteristics =
-       IMAGE_SCN_CNT_UNINITIALIZED_DATA
-       | IMAGE_SCN_MEM_READ
-       | IMAGE_SCN_MEM_WRITE;
-    }
-
-  /* Copy remainder of source image.  */
-  section--;
-  offset = ROUND_UP (section->PointerToRawData + section->SizeOfRawData,
-                    nt_header->OptionalHeader.FileAlignment);
-  COPY_CHUNK
-    ("Copying remainder of executable...",
-     OFFSET_TO_PTR (offset, p_infile),
-     p_infile->size - offset, be_verbose);
-
-  /* Final size for new image.  */
-  p_outfile->size = DST_TO_OFFSET ();
-
-  /* Now patch up remaining file-relative offsets.  */
-  section = IMAGE_FIRST_SECTION (nt_header);
-  dst_section = IMAGE_FIRST_SECTION (dst_nt_header);
-
-#define ADJUST_OFFSET(var)                                             \
-  do {                                                                 \
-    if ((var) != 0)                                                    \
-      (var) = relocate_offset ((var), nt_header, dst_nt_header);       \
-  } while (0)
-
-  dst_nt_header->OptionalHeader.SizeOfInitializedData = 0;
-  dst_nt_header->OptionalHeader.SizeOfUninitializedData = 0;
-  for (i = 0; i < dst_nt_header->FileHeader.NumberOfSections; i++)
-    {
-      /* Recompute data sizes for completeness.  */
-      if (dst_section[i].Characteristics & IMAGE_SCN_CNT_INITIALIZED_DATA)
-       dst_nt_header->OptionalHeader.SizeOfInitializedData +=
-         ROUND_UP (dst_section[i].Misc.VirtualSize, dst_nt_header->OptionalHeader.FileAlignment);
-      else if (dst_section[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
-       dst_nt_header->OptionalHeader.SizeOfUninitializedData +=
-         ROUND_UP (dst_section[i].Misc.VirtualSize, dst_nt_header->OptionalHeader.FileAlignment);
-
-      ADJUST_OFFSET (dst_section[i].PointerToLinenumbers);
-    }
-
-  ADJUST_OFFSET (dst_nt_header->FileHeader.PointerToSymbolTable);
-
-  /* Update offsets in debug directory entries. */
-  {
-    IMAGE_DATA_DIRECTORY debug_dir =
-      dst_nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG];
-    PIMAGE_DEBUG_DIRECTORY debug_entry;
-
-    section = rva_to_section (debug_dir.VirtualAddress, dst_nt_header);
-    if (section)
-      {
-       debug_entry = (PIMAGE_DEBUG_DIRECTORY)
-         (RVA_TO_OFFSET (debug_dir.VirtualAddress, section) + p_outfile->file_base);
-       debug_dir.Size /= sizeof (IMAGE_DEBUG_DIRECTORY);
-
-       for (i = 0; i < debug_dir.Size; i++, debug_entry++)
-         ADJUST_OFFSET (debug_entry->PointerToRawData);
-      }
-  }
-}
-
-
-int
-main (int argc, char **argv)
-{
-  file_data in_file, out_file;
-  char out_filename[MAX_PATH], in_filename[MAX_PATH];
-  unsigned long size;
-  PIMAGE_DOS_HEADER dos_header;
-  PIMAGE_NT_HEADERS nt_header;
-
-#define OLD_NAME        argv[1]
-#define NEW_NAME        argv[2]
-#define SECTION_NAME    argv[3]
-#define SECTION_SIZE    argv[4]
-
-  strcpy (in_filename, OLD_NAME);
-  strcpy (out_filename, NEW_NAME);
-
-  printf ("Dumping from %s\n", in_filename);
-  printf ("          to %s\n", out_filename);
-
-  /* Open the undumped executable file.  */
-  if (!open_input_file (&in_file, in_filename))
-    {
-      printf ("Failed to open %s (%d)...bailing.\n",
-             in_filename, GetLastError ());
-      exit (1);
-    }
-  dos_header = (PIMAGE_DOS_HEADER) in_file.file_base;
-  nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew);
-  /* Allow for expansion due to increasing file align to section align.
-     We can overestimate here, since close_file_data will update the
-     size exactly.  */
-  size = in_file.size
-    + nt_header->OptionalHeader.SectionAlignment
-    * nt_header->FileHeader.NumberOfSections;
-  if (!open_output_file (&out_file, out_filename, size))
-    {
-      printf ("Failed to open %s (%d)...bailing.\n",
-             out_filename, GetLastError ());
-      exit (1);
-    }
-
-  copy_executable_and_add_section (&in_file, &out_file,
-                                  SECTION_NAME,
-                                  atoi (SECTION_SIZE) * 1024 * 1024);
-
-  /* Patch up header fields; profiler is picky about this. */
-  {
-    HANDLE hImagehelp = LoadLibrary ("imagehlp.dll");
-    DWORD_PTR  headersum;
-    DWORD_PTR  checksum;
-
-    dos_header = (PIMAGE_DOS_HEADER) out_file.file_base;
-    nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew);
-
-    nt_header->OptionalHeader.CheckSum = 0;
-//    nt_header->FileHeader.TimeDateStamp = time (NULL);
-//    dos_header->e_cp = size / 512;
-//    nt_header->OptionalHeader.SizeOfImage = size;
-
-    pfnCheckSumMappedFile = (void *) GetProcAddress (hImagehelp, "CheckSumMappedFile");
-    if (pfnCheckSumMappedFile)
-      {
-//     nt_header->FileHeader.TimeDateStamp = time (NULL);
-       pfnCheckSumMappedFile (out_file.file_base,
-                              out_file.size,
-                              &headersum,
-                              &checksum);
-       nt_header->OptionalHeader.CheckSum = checksum;
-      }
-    FreeLibrary (hImagehelp);
-  }
-
-  close_file_data (&in_file);
-  close_file_data (&out_file);
-
-  return 0;
-}
-
-/* eof */
-
index a04ee7c306a9cf64b4aad52423961efe7cd10b6b..004a7381fb5931c04b5554fe0f7256d51e9d540b 100644 (file)
@@ -1576,7 +1576,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #undef USG_SUBTTY_WORKS
 
 /* Version number of package */
-#define VERSION "24.3.92"
+#define VERSION "24.4.50"
 
 /* Define to 1 if unsetenv returns void instead of int. */
 #undef VOID_UNSETENV
index 96bc59ad8e49d4c235126aac446138bffb7c9f64..2d007ba9043a76121f52127b778e1a141a130738 100644 (file)
@@ -11,8 +11,8 @@ Emacs ICON   icons/emacs.ico
 #endif
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 24,3,92,0
- PRODUCTVERSION 24,3,92,0
+ FILEVERSION 24,4,50,0
+ PRODUCTVERSION 24,4,50,0
  FILEFLAGSMASK 0x3FL
 #ifdef EMACSDEBUG
  FILEFLAGS 0x1L
@@ -29,12 +29,12 @@ BEGIN
        BEGIN
            VALUE "CompanyName", "Free Software Foundation\0"
            VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0"
-           VALUE "FileVersion", "24, 3, 92, 0\0"
+           VALUE "FileVersion", "24, 4, 50, 0\0"
            VALUE "InternalName", "Emacs\0"
            VALUE "LegalCopyright", "Copyright (C) 2001-2014\0"
            VALUE "OriginalFilename", "emacs.exe"
            VALUE "ProductName", "Emacs\0"
-           VALUE "ProductVersion", "24, 3, 92, 0\0"
+           VALUE "ProductVersion", "24, 4, 50, 0\0"
            VALUE "OLESelfRegister", "\0"
         END
      END
index d7c56e1f2a59225701a1604bbe6f486065f9d047..7e5d2e4c0f19706b0004c521797744b51d4042b6 100644 (file)
@@ -5,8 +5,8 @@ Emacs ICON   icons\emacs.ico
 #endif
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 24,3,92,0
- PRODUCTVERSION 24,3,92,0
+ FILEVERSION 24,4,50,0
+ PRODUCTVERSION 24,4,50,0
  FILEFLAGSMASK 0x3FL
 #ifdef EMACSDEBUG
  FILEFLAGS 0x1L
@@ -23,12 +23,12 @@ BEGIN
        BEGIN
            VALUE "CompanyName", "Free Software Foundation\0"
            VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0"
-           VALUE "FileVersion", "24, 3, 92, 0\0"
+           VALUE "FileVersion", "24, 4, 50, 0\0"
            VALUE "InternalName", "EmacsClient\0"
            VALUE "LegalCopyright", "Copyright (C) 2001-2014\0"
            VALUE "OriginalFilename", "emacsclientw.exe"
            VALUE "ProductName", "EmacsClient\0"
-           VALUE "ProductVersion", "24, 3, 92, 0\0"
+           VALUE "ProductVersion", "24, 4, 50, 0\0"
            VALUE "OLESelfRegister", "\0"
         END
      END
index 7877c154b96f205e08688b66dea04742fc39e464..7c2cceb959f72d2e20bcd5f40fb250c7e4c24008 100644 (file)
@@ -671,57 +671,6 @@ EXTRA_DIST += stdalign.in.h
 
 ## end   gnulib module stdalign
 
-## begin gnulib module stdarg
-
-BUILT_SOURCES += $(STDARG_H)
-
-# We need the following in order to create <stdarg.h> when the system
-# doesn't have one that works with the given compiler.
-if GL_GENERATE_STDARG_H
-stdarg.h: stdarg.in.h $(top_builddir)/config.status
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
-             < $(srcdir)/stdarg.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-else
-stdarg.h: $(top_builddir)/config.status
-       rm -f $@
-endif
-MOSTLYCLEANFILES += stdarg.h stdarg.h-t
-
-EXTRA_DIST += stdarg.in.h
-
-## end   gnulib module stdarg
-
-## begin gnulib module stdbool
-
-BUILT_SOURCES += $(STDBOOL_H)
-
-# We need the following in order to create <stdbool.h> when the system
-# doesn't have one that works.
-if GL_GENERATE_STDBOOL_H
-stdbool.h: stdbool.in.h $(top_builddir)/config.status
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-else
-stdbool.h: $(top_builddir)/config.status
-       rm -f $@
-endif
-MOSTLYCLEANFILES += stdbool.h stdbool.h-t
-
-EXTRA_DIST += stdbool.in.h
-
-## end   gnulib module stdbool
-
 ## begin gnulib module stddef
 
 BUILT_SOURCES += $(STDDEF_H)
index 8f7c36ab1eef70daeae05cfae00bf8cc59bb152d..edb143c68d4c74aad97e5cb80cc42559c661f5b1 100644 (file)
@@ -140,6 +140,7 @@ extern char *getenv ();
    in its system headers, and is not really compatible with values
    lower than 0x0500, so leave it alone.  */
 #ifndef _W64
+# undef _WIN32_WINNT
 # define _WIN32_WINNT 0x0400
 #endif
 
@@ -158,6 +159,7 @@ extern char *getenv ();
 #ifdef HAVE_NTGUI
 # ifndef HAVE_WINDOW_SYSTEM
 #  define HAVE_WINDOW_SYSTEM 1
+#  define POLL_FOR_INPUT 1
 # endif
 #endif
 
@@ -427,20 +429,36 @@ extern char *get_emacs_configuration_options (void);
 #define _WINSOCK_H
 
 /* Defines size_t and alloca ().  */
-#ifdef emacs
-#define malloc e_malloc
-#define free   e_free
-#define realloc e_realloc
-#define calloc e_calloc
-#endif
+#include <stdlib.h>
+#include <sys/stat.h>
 #ifdef _MSC_VER
 #define alloca _alloca
 #else
 #include <malloc.h>
 #endif
 
-#include <stdlib.h>
-#include <sys/stat.h>
+#ifdef emacs
+
+typedef void * (* malloc_fn)(size_t);
+typedef void * (* realloc_fn)(void *, size_t);
+typedef void (* free_fn)(void *);
+
+extern void *malloc_before_dump(size_t);
+extern void *realloc_before_dump(void *, size_t);
+extern void free_before_dump(void *);
+extern void *malloc_after_dump(size_t);
+extern void *realloc_after_dump(void *, size_t);
+extern void free_after_dump(void *);
+
+extern malloc_fn the_malloc_fn;
+extern realloc_fn the_realloc_fn;
+extern free_fn the_free_fn;
+
+#define malloc(size) (*the_malloc_fn)(size)
+#define free(ptr)   (*the_free_fn)(ptr)
+#define realloc(ptr, size) (*the_realloc_fn)(ptr, size)
+
+#endif
 
 /* Define for those source files that do not include enough NT system files.  */
 #ifndef NULL
diff --git a/nt/inc/sys/mman.h b/nt/inc/sys/mman.h
new file mode 100644 (file)
index 0000000..6990edc
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * sys/mman.h
+ * mman-win32
+ */
+
+#ifndef _SYS_MMAN_H_
+#define _SYS_MMAN_H_
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* We need MAP_ANON in src/buffer.c */
+
+#define MAP_FILE        0
+#define MAP_SHARED      1
+#define MAP_PRIVATE     2
+#define MAP_TYPE        0xf
+#define MAP_FIXED       0x10
+#define MAP_ANONYMOUS   0x20
+#define MAP_ANON        MAP_ANONYMOUS
+
+#define MAP_FAILED      ((void *)-1)
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /*  _SYS_MMAN_H_ */
index fba62a4f1c9bbeca835b99bbc024c8f1b507a46a..59da03434e9adb0c476353ff0dab93ca2de653b6 100644 (file)
@@ -22,7 +22,7 @@
 # FIXME: This file uses DOS EOLs.  Convert to Unix after 22.1 is out
 #        (and remove or replace this comment).
 
-VERSION                = 24.3.92
+VERSION                = 24.4.50
 
 TMP_DIST_DIR   = emacs-$(VERSION)
 
index 906fe229a00a96e741eb0d7fdef5567858d8583c..1d98a544d25195c1981fcb4d51c45938b9c487c2 100644 (file)
@@ -1,3 +1,30 @@
+2014-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * XMenuInt.h (XDeleteAssoc): Remove duplicated prototype to
+       pacify -Wredundant-decls.
+
+2014-06-28  Glenn Morris  <rgm@gnu.org>
+
+       * deps.mk (${OBJS}): Depend on ../src/config.h.
+
+       * Makefile.in: Use gcc auto-dependency information.
+       Move old dependency information to new file deps.mk.
+       (MKDIR_P, DEPFLAGS, MKDEPDIR, oldxmenu_deps_frag):
+       New, set by configure.
+       (DEPDIR): New variable.
+       (ALL_CFLAGS): Add DEPFLAGS.
+       (.c.o): Add MKDEPDIR.
+       (clean, mostlyclean): Delete DEPDIR.
+       * deps.mk, autodeps.mk: New files.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (CPPFLAGS): Explicitly set via configure.
+
+       * Makefile.in (mostlyclean, clean, distclean, maintainer-clean, tags):
+       Declare as PHONY.
+       (boostrap-clean): New.
+
 2013-10-24  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in (abs_top_srcdir): New, set by configure.
index c1fdd8244ed5acab0d1208f83e010e158ae2f32c..bfa7d97912a9dba2ea37e489194626fcf487d486 100644 (file)
@@ -56,11 +56,14 @@ WERROR_CFLAGS = @WERROR_CFLAGS@
 EXTRA=insque.o
 CC=@CC@
 CFLAGS=@CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+
 TAGS = etags
 RM = rm -f
 RANLIB = @RANLIB@
 AR = @AR@
 ARFLAGS = @ARFLAGS@
+MKDIR_P = @MKDIR_P@
 
 OBJS =  Activate.o \
        AddPane.o \
@@ -90,13 +93,20 @@ OBJS =  Activate.o \
 all: libXMenu11.a
 .PHONY: all
 
+DEPDIR = deps
+## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
+DEPFLAGS = @DEPFLAGS@
+## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
+MKDEPDIR = @MKDEPDIR@
+
 ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
-  $(C_SWITCH_X_SITE) \
+  $(C_SWITCH_X_SITE) $(DEPFLAGS) \
   $(WARN_CFLAGS) $(WERROR_CFLAGS) ${PROFILING_CFLAGS} \
   $(CPPFLAGS) $(CFLAGS) -DEMACS_BITMAP_FILES \
   -I../src -I../lib -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
 
 .c.o:
+       @$(MKDEPDIR)
        $(CC) -c ${ALL_CFLAGS} $<
 
 libXMenu11.a: $(OBJS) $(EXTRA)
@@ -104,44 +114,20 @@ libXMenu11.a: $(OBJS) $(EXTRA)
        $(AR) $(ARFLAGS) $@ $(OBJS) $(EXTRA)
        $(RANLIB) $@
 
-Activate.o: Activate.c XMenuInt.h XMenu.h X10.h
-AddPane.o: AddPane.c XMenuInt.h XMenu.h X10.h
-AddSel.o: AddSel.c XMenuInt.h XMenu.h X10.h
-ChgPane.o: ChgPane.c XMenuInt.h XMenu.h X10.h
-ChgSel.o: ChgSel.c XMenuInt.h XMenu.h X10.h
-Create.o: Create.c XMenuInt.h XMenu.h X10.h
-DelPane.o: DelPane.c XMenuInt.h XMenu.h X10.h
-DelSel.o: DelSel.c XMenuInt.h XMenu.h X10.h
-Destroy.o: Destroy.c XMenuInt.h XMenu.h X10.h
-Error.o: Error.c XMenuInt.h XMenu.h X10.h
-EvHand.o: EvHand.c XMenuInt.h XMenu.h X10.h
-FindPane.o: FindPane.c XMenuInt.h XMenu.h X10.h
-FindSel.o: FindSel.c XMenuInt.h XMenu.h X10.h
-InsPane.o: InsPane.c XMenuInt.h XMenu.h X10.h
-InsSel.o: InsSel.c XMenuInt.h XMenu.h X10.h
-Internal.o: Internal.c XMenuInt.h XMenu.h X10.h
-Locate.o: Locate.c XMenuInt.h XMenu.h X10.h
-Post.o: Post.c XMenuInt.h XMenu.h X10.h
-Recomp.o: Recomp.c XMenuInt.h XMenu.h X10.h
-SetAEQ.o: SetAEQ.c XMenuInt.h XMenu.h X10.h
-SetFrz.o: SetFrz.c XMenuInt.h XMenu.h X10.h
-SetPane.o: SetPane.c XMenuInt.h XMenu.h X10.h
-SetSel.o: SetSel.c XMenuInt.h XMenu.h X10.h
-XDelAssoc.o: XDelAssoc.c X10.h
-XLookAssoc.o: XLookAssoc.c X10.h
-XCrAssoc.o: XCrAssoc.c X10.h
-XDestAssoc.o: XDestAssoc.c X10.h
-XMakeAssoc.o: XMakeAssoc.c X10.h
-insque.o: insque.c
-
-FRC.mostlyclean:
-mostlyclean: FRC.mostlyclean
+## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
+@oldxmenu_deps_frag@
+
+.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
+
+clean mostlyclean:
        rm -f libXMenu11.a ${OBJS} ${EXTRA}
-clean: mostlyclean
-distclean: clean
+       -rm -rf ${DEPDIR}
+
+bootstrap-clean maintainer-clean distclean: clean
        rm -f Makefile
-maintainer-clean: distclean
 
+.PHONY: tags
 tags:
        $(TAGS) -t *.[ch]
-.PHONY: tags
+
+### Makefile.in ends here
index 1edef30bc5f8dc4eeeca510d627a997c2bba635c..369b8c1a4a956f2262299417036ce04dcb1be8e2 100644 (file)
@@ -62,7 +62,6 @@ void _XMRefreshPane(Display *display, XMenu *menu, XMPane *pane);
 void _XMRefreshSelection(Display *display, XMenu *menu, XMSelect *select);
 void emacs_insque (void *elem, void *prev);
 void emacs_remque (void *elem);
-void XDeleteAssoc(Display *dpy, XAssocTable *table, XID x_id);
 void XDestroyAssocTable(XAssocTable *table);
 void XMakeAssoc(Display *dpy, XAssocTable *table, XID x_id, void *data);
 void XDeleteAssoc(Display *dpy, XAssocTable *table, XID x_id);
diff --git a/oldXMenu/autodeps.mk b/oldXMenu/autodeps.mk
new file mode 100644 (file)
index 0000000..f710929
--- /dev/null
@@ -0,0 +1,5 @@
+### autodeps.mk --- lwlib/Makefile fragment for GNU Emacs
+
+## This is inserted in lwlib/Makefile if AUTO_DEPEND=yes.
+
+-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
diff --git a/oldXMenu/deps.mk b/oldXMenu/deps.mk
new file mode 100644 (file)
index 0000000..81088c5
--- /dev/null
@@ -0,0 +1,72 @@
+### deps.mk --- oldXMenu/Makefile fragment for GNU Emacs
+
+## Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology
+
+## Permission to use, copy, modify, and distribute this
+## software and its documentation for any purpose and without
+## fee is hereby granted, provided that the above copyright
+## notice appear in all copies and that both that copyright
+## notice and this permission notice appear in supporting
+## documentation, and that the name of M.I.T. not be used in
+## advertising or publicity pertaining to distribution of the
+## software without specific, written prior permission.
+## M.I.T. makes no representations about the suitability of
+## this software for any purpose.  It is provided "as is"
+## without express or implied warranty.
+
+
+## Copyright (C) 2001-2014 Free Software Foundation, Inc.
+
+## This program is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+### Commentary:
+
+## This file is inserted in oldXMenu/Makefile if AUTO_DEPEND=no.
+## It defines static dependencies between the various source files.
+
+### Code:
+
+Activate.o: Activate.c XMenuInt.h XMenu.h X10.h
+AddPane.o: AddPane.c XMenuInt.h XMenu.h X10.h
+AddSel.o: AddSel.c XMenuInt.h XMenu.h X10.h
+ChgPane.o: ChgPane.c XMenuInt.h XMenu.h X10.h
+ChgSel.o: ChgSel.c XMenuInt.h XMenu.h X10.h
+Create.o: Create.c XMenuInt.h XMenu.h X10.h
+DelPane.o: DelPane.c XMenuInt.h XMenu.h X10.h
+DelSel.o: DelSel.c XMenuInt.h XMenu.h X10.h
+Destroy.o: Destroy.c XMenuInt.h XMenu.h X10.h
+Error.o: Error.c XMenuInt.h XMenu.h X10.h
+EvHand.o: EvHand.c XMenuInt.h XMenu.h X10.h
+FindPane.o: FindPane.c XMenuInt.h XMenu.h X10.h
+FindSel.o: FindSel.c XMenuInt.h XMenu.h X10.h
+InsPane.o: InsPane.c XMenuInt.h XMenu.h X10.h
+InsSel.o: InsSel.c XMenuInt.h XMenu.h X10.h
+Internal.o: Internal.c XMenuInt.h XMenu.h X10.h
+Locate.o: Locate.c XMenuInt.h XMenu.h X10.h
+Post.o: Post.c XMenuInt.h XMenu.h X10.h
+Recomp.o: Recomp.c XMenuInt.h XMenu.h X10.h
+SetAEQ.o: SetAEQ.c XMenuInt.h XMenu.h X10.h
+SetFrz.o: SetFrz.c XMenuInt.h XMenu.h X10.h
+SetPane.o: SetPane.c XMenuInt.h XMenu.h X10.h
+SetSel.o: SetSel.c XMenuInt.h XMenu.h X10.h
+XDelAssoc.o: XDelAssoc.c X10.h
+XLookAssoc.o: XLookAssoc.c X10.h
+XCrAssoc.o: XCrAssoc.c X10.h
+XDestAssoc.o: XDestAssoc.c X10.h
+XMakeAssoc.o: XMakeAssoc.c X10.h
+insque.o: insque.c
+
+${OBJS}: ../src/config.h
+
+### deps.mk ends here
index a74fe3db7a1d1e67f1217ef912dfe3f5213a816f..c10fe3dddedece16bca66d2b6c99d75493e9709e 100644 (file)
@@ -49,7 +49,7 @@ define xgetptr
   else
     set $bugfix = $arg0
   end
-  set $ptr = ($bugfix & VALMASK) | DATA_SEG_BITS
+  set $ptr = $bugfix & VALMASK
 end
 
 define xgetint
@@ -862,10 +862,8 @@ end
 define xsubchartable
   xgetptr $
   print (struct Lisp_Sub_Char_Table *) $ptr
-  xgetint $->depth
-  set $depth = $int
-  xgetint $->min_char
-  printf "Depth: %d, Min char: %d (0x%x)\n", $depth, $int, $int
+  set $subchartab = (struct Lisp_Sub_Char_Table *) $ptr
+  printf "Depth: %d, Min char: %d (0x%x)\n", $subchartab->depth, $subchartab->min_char, $subchartab->min_char
 end
 document xsubchartable
 Print the address of the sub-char-table $, its depth and min-char.
@@ -1085,8 +1083,8 @@ document xprintsym
 end
 
 define xcoding
-  set $tmp = (struct Lisp_Hash_Table *) ((Vcoding_system_hash_table & VALMASK) | DATA_SEG_BITS)
-  set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & VALMASK) | DATA_SEG_BITS)
+  set $tmp = (struct Lisp_Hash_Table *) (Vcoding_system_hash_table & VALMASK)
+  set $tmp = (struct Lisp_Vector *) ($tmp->key_and_value & VALMASK)
   set $name = $tmp->contents[$arg0 * 2]
   print $name
   pr
@@ -1098,8 +1096,8 @@ document xcoding
 end
 
 define xcharset
-  set $tmp = (struct Lisp_Hash_Table *) ((Vcharset_hash_table & VALMASK) | DATA_SEG_BITS)
-  set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & VALMASK) | DATA_SEG_BITS)
+  set $tmp = (struct Lisp_Hash_Table *) (Vcharset_hash_table & VALMASK)
+  set $tmp = (struct Lisp_Vector *) ($tmp->key_and_value & VALMASK)
   p $tmp->contents[charset_table[$arg0].hash_index * 2]
   pr
 end
index 13415734c798530372edbd181b5ad5417cac3a8f..c28f8a607aac7a9e5f3ef28201856d34b1229871 100644 (file)
        line.  When the last glyph fits only partially, give the row a
        negative x offset.
 
-2014-07-29  Eli Zaretskii  <eliz@gnu.org>
-
        Fix hscroll of R2L lines that begin with a TAB or another wide glyph.
        * xdisp.c (append_stretch_glyph): In a R2L glyph row, decrease the
        pixel width of the first glyph that is hscrolled from display.
        (display_line): In R2L glyph rows, don't give a negative offset to
        row->x when the first glyph begins before first_visible_x.
 
-2014-07-29  Andreas Schwab  <schwab@suse.de>
+       * xdisp.c (display_line): If called with iterator set up to write
+       to a marginal area, delay the call to handle_line_prefix until we
+       switch back to the text area.  (Bug#18035)
+
+       * .gdbinit (xwindow): The members total_cols, total_lines,
+       left_col, and top_line are C integers (and has been so for the
+       last 1.5 years).
+
+2014-08-01  Andreas Schwab  <schwab@suse.de>
 
        * macros.c (Fstart_kbd_macro): Initialize kbd_macro_ptr and
        kbd_macro_end together with kbd_macro_buffer.  (Bug#18140)
 
-2014-07-28  Eli Zaretskii  <eliz@gnu.org>
+2014-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
 
-       * xdisp.c (display_line): If called with iterator set up to write
-       to a marginal area, delay the call to handle_line_prefix until we
-       switch back to the text area.  (Bug#18035)
+       * atimer.c (toplevel) [HAVE_TIMERFD]: Include errno.h.
+       (timerfd_callback): Ignore weird events with no data.  Add tight
+       assertions and comments.
+       (init_atimer) [HAVE_TIMERFD]: Add environment variable to optionally
+       disable timerfd-based timer.  Use TFD_NONBLOCK for timer descriptor.
+
+2014-08-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * frame.c (x_set_frame_parameters): Fix typo in previous patch.
+       I had confused && with ||.
+
+2014-07-31  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Simplify timerfd configuration and fix some minor glitches.
+       * atimer.c (TIMERFD_CREATE_FLAGS): Remove; we now assume TFD_CLOEXEC.
+       (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
+       Fall back on timer_create if timerfd_create fails at runtime.
+       (resolution) [HAVE_CLOCK_GETRES]: Remove; we now rely on the
+       kernel primitives to do resolution.  All uses removed.
+       (timerfd) [!HAVE_TIMERFD]: Define to be -1, for convenience.
+       (turn_on_atimers): Clear timer_create-based timers too,
+       for consistency.
+
+       * frame.c (x_set_frame_parameters): Don't use uninitialized locals.
+       Without this change, the code can access the local variable 'width'
+       even when it has not been initialized, and likewise for 'height';
+       in either case this leads to undefined behavior.
+
+2014-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xrdb.c (x_load_resources) [USE_MOTIF]: Although not strictly
+       necessary, put horizontal scroll bar resources as well.  See
+       <http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00430.html>.
+       * xterm.c (x_sync_with_move): Really wait 0.5s, not 0.0005s.
+
+2014-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xrdb.c (x_load_resources) [!USE_MOTIF]: Put horizontal scroll bar
+       background value to match the resource of its vertical counterpart.
+
+2014-07-29  Martin Rudalics  <rudalics@gmx.at>
+
+       * frame.c (adjust_frame_size): Use FRAME_WINDOW_P instead of
+       FRAME_X_WINDOW when calling x_set_window_size (Bug#18138).
+
+2014-07-28  Martin Rudalics  <rudalics@gmx.at>
+
+       * frame.c (x_set_frame_parameters): Revert part of 2014-07-24
+       change that added the top margin height to the requested height
+       and revert (undocumented) part of 2014-07-28 change that changed
+       the logic of whether a size change occurred.
+
+2014-07-28  Eli Zaretskii  <eliz@gnu.org>
 
        * .gdbinit (xwindow): The members total_cols, total_lines,
        left_col, and top_line are C integers (and has been so for the
        last 1.5 years).
 
-2014-07-20  Jan Djärv  <jan.h.d@swipnet.se>
+       * .gdbinit (xsubchartable): The members 'depth' and 'min_char' are
+       now C integers.
+
+2014-07-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       On GNU/Linux, use timerfd for asynchronous timers.
+       * atimer.c (toplevel) [HAVE_TIMERFD]: Include sys/timerfd.h.
+       (toplevel): Rename alarm_timer_ok to special_timer_available.
+       [HAVE_TIMERFD]: Declare timerfd.
+       [HAVE_CLOCK_GETRES]: Declare resolution.
+       (start_atimer) [HAVE_CLOCK_GETRES]: Round up timestamp to
+       system timer resolution.
+       (set_alarm) [HAVE_TIMERFD]: Use timerfd_settime.
+       (timerfd_callback) [HAVE_TIMERFD]: New function.
+       (atimer_result, debug_timer_callback, Fdebug_timer_check)
+       [ENABLE_CHECKING]: New function for the sake of automated tests.
+       (init_atimer) [HAVE_TIMERFD]: Setup timerfd.
+       [HAVE_CLOCK_GETRES]: Likewise for system timer resolution.
+       [ENABLE_CHECKING]: Defsubr test function.
+       * atimer.h (timerfd_callback) [HAVE_TIMERFD]: Add prototype.
+       * lisp.h (add_timer_wait_descriptor) [HAVE_TIMERFD]: Likewise.
+       * process.c (add_timer_wait_descriptor) [HAVE_TIMERFD]: New function.
+
+       Fix --without-x build and pacify --enable-gcc-warnings.
+       Problems reported in Bug#18122 and Bug#18124.
+       * frame.c (get_frame_param): Define even if !HAVE_WINDOW_SYSTEM.
+       (frame_windows_min_size): Now static.
+       * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS) [!HAVE_WINDOW_SYSTEM]:
+       Define as no-op.
+       (adjust_frame_size): Always declare prototype.
+
+       Fix Gnus-related issues reported by David Kastrup <dak@gnu.org> in
+       <http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00370.html>.
+       * atimer.c (timerfd_callback): Always read expiration data.
+       Add comment.
+       (turn_on_atimers) [HAVE_TIMERFD]: Disarm timerfd timer.
+       * process.c (add_timer_wait_descriptor): Add timer descriptor
+       to input_wait_mask and non_process_wait_mask as well.
+
+2014-07-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * frame.c (x_set_frame_parameters): Don't use uninitialized locals.
+
+2014-07-27  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (applicationDidFinishLaunching antialiasThresholdDidChange):
+       Reinstate code removed by the prevoius commit to this file.
+
+2014-07-27  Martin Rudalics  <rudalics@gmx.at>
+
+       * buffer.h (struct buffer): New fields scroll_bar_height and
+       horizontal_scroll_bar_type.
+       * buffer.c (bset_scroll_bar_height)
+       (bset_horizontal_scroll_bar_type): New functions.
+       (Fbuffer_swap_text): Handle old_pointm field.
+       (init_buffer_once): Set defaults for scroll_bar_height and
+       horizontal_scroll_bar_type.
+       (syms_of_buffer): New variables scroll_bar_height and
+       horizontal_scroll_bar_type.
+       * dispextern.h (window_part): Rename ON_SCROLL_BAR to
+       ON_VERTICAL_SCROLL_BAR.  Add ON_HORIZONTAL_SCROLL_BAR.
+       (set_vertical_scroll_bar): Remove prototype.
+       (x_change_tool_bar_height): Add prototype.
+       * dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
+       (window_to_frame_vpos, update_frame_1, scrolling, init_display):
+       Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
+       and FRAME_LINES.
+       (adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
+       (update_window): Start mode_line_row->y after horizontal scroll
+       bar.
+       (change_frame_size_1): Call adjust_frame_size.
+       (init_display): When changing the size of a tty frame do not
+       pass height of menu bar.
+       (Qframe_windows_min_size): New symbol.
+       * frame.h (struct frame): List tool bar fields after menu bar
+       fields.  Add official, total_lines, horizontal_scroll_bars,
+       config_scroll_bar_height and config_scroll_bar_lines fields.
+       (FRAME_HAS_HORIZONTAL_SCROLL_BARS)
+       (FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
+       (FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
+       (FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
+       (FRAME_WINDOWS_HEIGHT): New macros.
+       (SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
+       (FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
+       (FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
+       horizontal scroll bar.
+       (frame_inhibit_resize, adjust_frame_size)
+       (frame_windows_min_size): Add declarations.
+       (Qscroll_bar_height, Qhorizontal_scroll_bars)
+       (x_set_scroll_bar_default_height, x_set_left_fringe)
+       (x_set_right_fringe, x_set_vertical_scroll_bars)
+       (x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
+       (x_set_scroll_bar_height): Add external declarations.
+       * frame.c: (frame_inhibit_resize, frame_windows_min_size)
+       (adjust_frame_size): New functions.
+       (make_frame): Initial horizontal_scroll_bars field.  Use
+       SET_FRAME_LINES.  Don't allow horizontal scroll bar in
+       minibuffer window.
+       (make_initial_frame, make_terminal_frame): No horizontal scroll
+       bar in initial and terminal frames.  Use adjust_frame_size.
+       (Fframe_total_cols): Fix doc-string.
+       (Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
+       (Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
+       using adjust_frame_size.
+       (Qscroll_bar_height, Qhorizontal_scroll_bars)
+       (Qframe_windows_min_size): New symbols.
+       (x_set_frame_parameters): Remove call of check_frame_size.
+       (x_report_frame_params): Return scroll_bar_height value.
+       (x_set_left_fringe, x_set_right_fringe): New functions.
+       (adjust_frame_height, x_set_internal_border_width)
+       (x_set_fringe_width): Remove.
+       (x_set_internal_border_width, x_set_vertical_scroll_bars)
+       (x_set_scroll_bar_width, x_set_right_divider_width)
+       (x_set_bottom_divider_width): Rewrite using adjust_frame_size.
+       (x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
+       functions.
+       (x_figure_window_size): Rewrite to make frame display the
+       expected number of lines.
+       (Vdefault_frame_scroll_bars): Rewrite doc-string.
+       (Vdefault_frame_horizontal_scroll_bars)
+       (Vframe_initial_frame_tool_bar_height)
+       (frame_inhibit_implied_resize): New variables.
+       * fringe.c (compute_fringe_widths): Remove.
+       * gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
+       (xg_create_horizontal_scroll_bar)
+       (xg_update_horizontal_scrollbar_pos)
+       (xg_set_toolkit_horizontal_scroll_bar_thumb)
+       (xg_get_default_scrollbar_height)
+       (xg_clear_under_internal_border): Extern.
+       * gtkutil.c (xg_frame_resized): Don't call
+       do_pending_window_change.
+       (xg_frame_set_char_size): Use adjust_frame_size.
+       (style_changed_cb): Call update_theme_scrollbar_height and
+       x_set_scroll_bar_default_height.
+       (x_wm_set_size_hint): Don't call check_frame_size.
+       (update_theme_scrollbar_height)
+       (xg_get_default_scrollbar_height)
+       (xg_create_horizontal_scroll_bar)
+       (xg_update_horizontal_scrollbar_pos)
+       (xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
+       (xg_create_scroll_bar): Set horizontal slot of bar.
+       (xg_initialize): Call update_theme_scrollbar_height.
+       (xg_clear_under_internal_border): No more static.
+       * insdel.c (adjust_suspend_auto_hscroll): New function.
+       (adjust_markers_for_delete, adjust_markers_for_insert)
+       (adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
+       * keyboard.c (readable_events, discard_mouse_events)
+       (make_lispy_event): Handle horizontal scroll bar click events.
+       (Fsuspend_emacs): When changing the size of a tty frame do not
+       pass height of menu bar.
+       (Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
+       (Qright, Qleftmost, Qrightmost): New symbols.
+       * menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
+       FRAME_LINES.
+       * minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
+       * nsfns.m (x_set_internal_border_width): New function.
+       * nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
+       Remove extended fringe code.
+       (x_set_window_size, x_new_font): Don't call
+       compute_fringe_widths.
+       * term.c (Fresume_tty): When changing the size of a tty frame do
+       not pass height of menu bar.
+       (clear_tty_hooks, set_tty_hooks): Clear
+       horizontal_scroll_bar_hook.
+       (init_tty): Frame has no horizontal scroll bars.
+       * termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
+       scroll_bar_before_handle, scroll_bar_horizontal_handle,
+       scroll_bar_after_handle, scroll_bar_left_arrow,
+       scroll_bar_right_arrow, scroll_bar_to_leftmost and
+       scroll_bar_to_rightmost entries.
+       (enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
+       (struct terminal): Add set_horizontal_scroll_bar_hook.
+       * w32console.c (initialize_w32_display): Clear
+       horizontal_scroll_bar_hook.
+       * w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
+       FRAME_X_DISPLAY.
+       (x_clear_under_internal_border, x_set_internal_border_width):
+       New functions.
+       (x_set_menu_bar_lines): Rewrite using frame_inhibit_resize.  Set
+       windows_or_buffers_changed when adding the menu bar.
+       (x_set_tool_bar_lines): Rewrite using adjust_frame_size.
+       (x_change_tool_bar_height, x_set_scroll_bar_default_height)
+       (w32_createhscrollbar): New functions.
+       (w32_createscrollbar): Rename to w32_createvscrollbar.
+       (w32_createwindow): Init WND_HSCROLLBAR_INDEX.
+       (w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
+       WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR.  Add
+       WM_EMACS_SHOWCURSOR.
+       (w32_wnd_proc): Handle WM_HSCROLL case.  In WM_WINDOWPOSCHANGING
+       case do not artificially impose WM size hints.  Handle
+       WM_EMACS_SHOWCURSOR case.  Replace WM_EMACS_CREATESCROLLBAR case
+       by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
+       cases.
+       (my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
+       WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
+       (unwind_create_frame_1): Remove.
+       (Fx_create_frame): Make both scrollbars the system standard
+       width and height.  Use official field of frame structure to
+       inhibit running window-configuration-change-hook.
+       (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
+       pixelwise.  Handle frame's official field.
+       (w32_frame_parm_handlers): Remove x_set_fringe_width
+       entries. Add x_set_scroll_bar_height,
+       x_set_horizontal_scroll_bars, x_set_left_fringe and
+       x_set_right_fringe.
+       * w32inevt.c (resize_event, maybe_generate_resize_event): Do not
+       pass height of menu bar to change_frame_size.
+       * w32menu.c (set_frame_menubar): Rewrite using
+       frame_inhibit_resize.
+       * w32term.h (struct w32_display_info): Add
+       horizontal_scroll_bar_cursor and cursor_display_counter.
+       (struct scroll_bar): Add horizontal.
+       (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
+       (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
+       (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
+       (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
+       (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
+       (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
+       (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
+       (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
+       (WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
+       instead of WM_EMACS_CREATESCROLLBAR.
+       (WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
+       WND_SCROLLBAR_INDEX.
+       * w32term.c (horizontal_scroll_bar_min_handle)
+       (horizontal_scroll_bar_left_border)
+       (horizontal_scroll_bar_right_border): New integers.
+       (x_set_frame_alpha): Replace x_highlight_frame by
+       w32_focus_frame.
+       (x_window_to_scroll_bar): New argument "type".  Update callers
+       accordingly.
+       (w32_set_horizontal_scroll_bar_thumb)
+       (x_horizontal_scroll_bar_report_motion)
+       (w32_set_horizontal_scroll_bar)
+       (w32_horizontal_scroll_bar_handle_click)
+       (x_horizontal_scroll_bar_report_motion): New functions.
+       (w32_mouse_position): Discriminate horizontal and vertical
+       scrollbar cases.
+       (my_create_scrollbar): Replace with two new functions
+       my_create_vscrollbar and my_create_hscrollbar.
+       (x_scroll_bar_create): New argument "horizontal".  Update
+       callers accordingly.
+       (x_scroll_bar_remove, w32_condemn_scroll_bars)
+       (w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
+       scroll bar case.
+       (w32_read_socket): Handle WM_HSCROLL cae.
+       (x_new_font): Don't recompute fringe widths.  Use
+       frame_inhibit_resize.  Calculate new menu bar height iff we
+       build without toolkit.  Always clear under internal border.
+       (x_set_window_size): Don't check frame size or recompute
+       fringes.  Reset fullscreen status before applying sizes.  Always
+       resize as requested by pixelwise argument.  Don't call
+       do_pending_window_change.
+       (x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
+       (w32_initialize_display_info): Initialize dpyinfo's
+       horizontal_scroll_bar_cursor entry.
+       (w32_create_terminal): Add set_horizontal_scroll_bar_hook.
+       (w32_initialize): Init horizontal_scroll_bar_min_handle and
+       horizontal_scroll_bar_left_border.
+       (w32fullscreen_hook): Intermittently resize window to normal
+       when switching from fullscreen to maximized state.
+       (run_window_configuration_change_hook): Don't run it if frame is
+       not official yet.
+       (unwind_change_frame): Remove.
+       (Fset_window_configuration): Rewrite using frame's official field.
+       * widget.c (set_frame_size): Don't call compute_fringe_widths.
+       (EmacsFrameSetCharSize): Obey frame_inhibit_resize.
+       * window.h (struct window): New fields old_pointm,
+       horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
+       scroll_bar_height and suspend_auto_hscroll.
+       (wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
+       New functions.
+       (sanitize_window_sizes): Extern.
+       (MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
+       (WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
+       (WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
+       (WINDOW_CONFIG_SCROLL_BAR_LINES)
+       (WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
+       macros.
+       (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
+       (WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
+       (WINDOW_VERTICAL_SCROLL_BAR_TYPE)
+       (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
+       (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
+       (WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
+       (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
+       (WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
+       * window.c (wset_old_pointm, Fwindow_scroll_bar_height)
+       (Fwindow_old_point, sanitize_window_sizes): New functions.
+       (Qwindow_sanitize_window_sizes): New symbol.
+       (window_body_height): Count in horizontal scroll bar.
+       (set_window_hscroll, Fscroll_left, Fscroll_right): Set
+       suspend_auto_hscroll slot.
+       (Fwindow_inside_edges): Count fringes pixelwise.
+       (coordinates_in_window, Fcoordinates_in_window_p): Consider
+       horizontal scroll bar.
+       (check_frame_size, adjust_window_margins): Remove functions and
+       corresponding calls.
+       (set_window_buffer): Initialize old_pointm and horizontal scroll
+       bars.
+       (temp_output_buffer_show): Reset hscroll related fields.
+       Initialize old_pointm.
+       (make_parent_window): Initialize old_pointm.
+       (make_window): Initialize old_pointm, horizontal scroll bar type,
+       and scroll bar height.
+       (resize_frame_windows): Don't count top margin in new sizes.
+       Don't use safe sizes when shrinking a frame; let the window
+       manager do the clipping.
+       (Fsplit_window_internal): Inherit horizontal scroll bar type and
+       height.
+       (Fdelete_window_internal): Unchain old_pointm marker.
+       (window_scroll_pixel_based, Fscroll_other_window): Adjust
+       old_pointm.
+       (Fwindow_text_width, Fwindow_text_height): New argument
+       "pixelwise".
+       (struct saved_window): New fields, old_pointm, hscroll_whole,
+       suspend_auto_hscroll, scroll_bar_height and
+       horizontal_scroll_bar_type.
+       (Fset_window_configuration, save_window_save): Set new fields of
+       saved_window.
+       (apply_window_adjustment): Don't call adjust_window_margins.
+       (set_window_margins): Don't change margins if new sizes don't
+       fit into window.
+       (set_window_scroll_bars): New argument "horizontal_type".
+       Handle horizontal scroll bars.  Don't change scroll bars if they
+       don't fit into window.
+       (Fset_window_scroll_bars): New argument "horizontal_type".
+       (Fwindow_scroll_bars): Return values for horizontal scroll bars.
+       (compare_window_configurations): Compare horizontal scroll bar
+       settings.
+       * xdisp.c (window_text_bottom_y, window_box_height): Count in
+       horizontal scroll bar height.
+       (pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
+       instead of FRAME_LINES.
+       (remember_mouse_glyph): Case ON_SCROLL_BAR changed to
+       ON_VERTICAL_SCROLL_BAR.
+       (with_echo_area_buffer): Initialize old_pointm.
+       (with_echo_area_buffer_unwind_data): Store old_pointm values in
+       vector.
+       (unwind_with_echo_area_buffer): Handle old_pointm.
+       (update_tool_bar): Set do_update when the tool bar window has at
+       least one line (since this is what the user sets).
+       (MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
+       (redisplay_tool_bar): Return early when toolbar has zero lines.
+       Call x_change_tool_bar_height.  Don't use max_tool_bar_height.
+       (hscroll_window_tree): Handle suspension of auto_hscroll and
+       old_pointm.
+       (set_horizontal_scroll_bar): New function.
+       (redisplay_window): Set ignore_mouse_drag_p when tool bar has
+       more than one line.  Handle horizontal scroll bars.
+       (note_mouse_highlight): Handle horizontal scrol bars.
+       (expose_frame): Set dimensions of XRectangle from frame's text
+       sizes.
+       (Vvoid_text_area_pointer): Update doc-string.
+       * xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
+       (x_change_tool_bar_height, x_set_scroll_bar_default_height)
+       (x_set_internal_border_width): New functions.
+       (x_set_tool_bar_lines): Call x_change_tool_bar_height.
+       (unwind_create_frame_1): Remove.
+       (Fx_create_frame): Handle horizontal scroll bars.  Use official
+       field of frame structure to inhibit running
+       window-configuration-change-hook.
+       (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
+       pixelwise.  Handle frame's official field.
+       (x_frame_parm_handlers): Add x_set_scroll_bar_height,
+       x_set_horizontal_scroll_bars, x_set_left_fringe,
+       x_set_right_fringe.
+       * xmenu.c (update_frame_menubar, free_frame_menubar): Use
+       adjust_frame_size.
+       * xterm.h (struct x_display_info): Add
+       horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
+       slots.
+       (struct scroll_bar): Add horizontal slot.
+       (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
+       (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
+       (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
+       (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
+       (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
+       (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
+       (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
+       (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
+       (x_clear_under_internal_border): Remove.
+       * xterm.c (XTmouse_position): Handle horizontal scroll bars.
+       (x_window_to_scroll_bar): New argument TYPE.  Update callers.
+       (x_send_scroll_bar_event, x_scroll_bar_create): New arguments
+       HORIZONTAL.  Update callers.
+       (horizontal_action_hook_id): New action hook id.
+       (x_horizontal_scroll_bar_to_input_event)
+       (x_create_horizontal_toolkit_scroll_bar)
+       (xt_horizontal_action_hook)
+       (x_set_toolkit_horizontal_scroll_bar_thumb)
+       (XTset_horizontal_scroll_bar, x_net_wm_state)
+       (x_horizontal_scroll_bar_report_motion): New functions.
+       (xg_scroll_callback, x_scroll_bar_handle_click): Handle
+       horizontal scroll bars.
+       (SCROLL_BAR_HORIZONTAL_NAME): Define.
+       (XTset_vertical_scroll_bar): Attempt to clear areas not covered
+       by scroll bar.
+       (XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite.  Handle
+       horizontal scroll bars.
+       (handle_one_xevent): Handle horizontal scroll bar events.  Call
+       x_net_wm_state.
+       (x_set_window_size_1, x_wm_set_size_hint): Don't call
+       check_frame_size.
+       (x_set_window_size): Don't call check_frame_size and
+       do_pending_window_change.
+       (x_term_init): Init horizontal_scroll_bar_cursor display info.
+       (x_create_terminal): Add set_horizontal_scroll_bar_hook.
+       (x_scroll_bar_set_handle): Add some checks when calling
+       x_clear_area.
+
+2014-07-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Revert previous change.
+       There is certainly nothing wrong with writing code like 'lo <= i
+       && i <= hi', even if LO happens to a constant.  There isn't even
+       anything wrong in general with writing 'a <= b' if A happens to
+       be a constant.  At any rate stylistic changes shouldn't
+       be done like this without discussion.
+
+2014-07-26  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * alloc.c (xnmalloc, xnrealloc, xpalloc, make_save_value)
+       (Fgarbage_collect): Reorder conditions that are written backwards.
+       * data.c (cons_to_unsigned): Likewise.
+       * dispnew.c (update_frame_1, sit_for): Likewise.
+       * fileio.c (file_offset): Likewise.
+       * filelock.c (read_lock_data, lock_file): Likewise.
+       * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
+       Likewise.
+       * font.c (font_intern_prop, font_style_symbolic): Likewise.
+       * lisp.h (FIXNUM_OVERFLOW_P): Likewise.
+       * lread.c (read1): Likewise.
+       * minibuf.c (read_minibuf_noninteractive): Likewise.
+       * nsterm.m (x_set_frame_alpha): Likewise.
+       * process.c (wait_reading_process_output): Likewise.
+       * region-cache.c (delete_cache_boundaries): Likewise.
+       * xterm.c (x_set_frame_alpha): Likewise.
+
+2014-07-25  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * dispextern.h, xdisp.c (hourglass_shown_p, hourglass_atimer):
+       Now static.
+
+2014-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * atimer.c (set_alarm) [HAVE_ITIMERSPEC]: Use TIMER_ABSTIME
+       because atimer expiration is absolute rather than relative.
+
+2014-07-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32term.h (current_popup_menu, menubar_in_use): Move
+       declarations from w32term.c.
+
+2014-07-25  Martin Rudalics  <rudalics@gmx.at>
+
+       * w32fns.c (menubar_in_use): No more static.
+       * w32term.c (current_popup_menu, menubar_in_use): Declare.
+
+2014-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Move hourglass machinery to RIF.
+       * dispextern.h (struct redisplay_interface): New members
+       show_hourglass and hide_hourglass.  Indent comments.
+       (show_hourglass, hide_hourglass): Remove prototypes.
+       * nsterm.m (show_hourgass, hide_hourglass): Refactor to ...
+       (ns_show_hourglass, ns_hide_hourglass): ... new no-ops.
+       (ns_redisplay_interface): Add them.
+       * w32fns.c (show_hourglass, hide_hourglass): Refactor to ...
+       * w32term.c (w32_show_hourglass, w32_hide_hourglass): ... these.
+       (w32_arrow_cursor): New function to hack around non-GUI frames.
+       (w32_redisplay_interface): Add new functions.
+       * w32term.h (w32_arror_cursor): Add prototype.
+       * xdisp.c (show_hourglass): New function, refactored out from
+       platform-dependent code.
+       (cancel_hourglass): Now call to RIF function.
+       * xfns.c (show_hourglass, hide_hourglass): Refactor to ...
+       * xterm.c (x_show_hourglass, x_hide_hourglass): ... these.
+       (x_redisplay_interface): Add new functions.
+
+2014-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Fix error reported by Angelo Graziosi <angelo.graziosi@alice.it> in
+       <http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00274.html>
+       and complete previous change.
+       * frame.c (adjust_frame_height): New function.
+       (Fset_frame_height, Fset_frame_size): Use it.
+       (x_set_frame_parameters): Take frame top margin into account.
+
+2014-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * frame.c (Fset_frame_height): Take frame top margin into account.
+       Incorrect behavior was reported by Martin Rudalics <rudalics@gmx.at> in
+       <http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00258.html>
+
+2014-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xterm.h (struct x_output) [USE_X_TOOLKIT || USE_GTK]: Define
+       menubar_height as such.  Tweak comment.
+       [USE_LUCID && USE_TOOLKIT_SCROLL_BARS]: Likewise for
+       scroll_bar_top_shadow_pixel and scroll_bar_bottom_shadow_pixel.
+       All related users changed.
+       (FRAME_MENUBAR_HEIGHT) [!USE_X_TOOLKIT && !USE_GTK]: No-op.
+       * xterm.c (handle_one_xevent):
+       * gtkutil.c (xg_event_is_for_menubar):
+       * xfns.c (x_window) [USE_X_TOOLKIT]:
+       * xmenu.c (set_frame_menubar, free_frame_menubar): Prefer
+       to use FRAME_MENUBAR_HEIGHT.
+
+2014-07-21  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * frame.c (Fframe_parameters): Always report frame height without
+       menu and tool bar lines.
+
+2014-07-21  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsterm.m (applicationDidFinishLaunching:): Call
        antialiasThresholdDidChange, register for antialias changes (Bug#17534).
 
        * macfont.h (macfont_update_antialias_threshold): Declare.
 
-2014-07-17  Eli Zaretskii  <eliz@gnu.org>
+2014-07-21  Eli Zaretskii  <eliz@gnu.org>
 
        * w32select.c (setup_windows_coding_system): Apply
        CODING_ANNOTATION_MASK to the common_flags member of struct
        row has zero buffer position as their start position.  Reported by
        martin rudalics <rudalics@gmx.at>.
 
-2014-07-16  Eli Zaretskii  <eliz@gnu.org>
-
        * xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent
        infinite looping in redisplay when display lines don't have enough
        space to display even a single character.  (Bug#18036)
 
-2014-07-13  Eli Zaretskii  <eliz@gnu.org>
+2014-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * frame.h (struct frame) [USE_X_TOOLKIT]: New member shell_position.
+       * xfns.c (x_window): Use it to allow xfree later.
+       (x_encode_text): Drop 3rd arg; unused.  Tweak comment and adjust users
+       where appropriate.  Use bool for booleans and remove redundant checks.
+       (Fx_backspace_delete_keys_p): Use XkbFreeKeyboard; explain why.
+       * xterm.c (x_free_frame_resources): Free shell_position.
+
+2014-07-19  K. Handa  <handa@gnu.org>
+
+       * xfaces.c (realize_x_face): Call font_load_for_lface with no
+       mandatory font spec (Bug#17973).
+
+2014-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * font.c (font_score): Return the worst score if the size of
+       ENTITY is wrong by more than a factor 2 (Bug#17973).
+
+2014-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * frame.c (frame_unspecified_color): New function
+       refactored out from ...
+       (Fframe_parameters, Fframe_parameter): ... adjusted users.
+       (x_fullscreen_adjust, set_frame_param): Move Windows-specific
+       function to ...
+       * w32term.c (x_fullscreen_adjust, set_frame_param): ... static here.
+       * frame.h (x_fullscreen_adjust) [HAVE_NTGUI]:
+       * lisp.h (set_frame_param): Remove prototype.
+       * xterm.c (x_display_pixel_width, x_display_pixel_height): Now ...
+       * xterm.h (x_display_pixel_width, x_display_pixel_height): ...
+       inlined from here.
+
+       Prefer 'x_display_info *' to 'Display *' in X selection code.
+       This helps to avoid unneeded calls to x_display_info_for_display.
+       * xterm.h (struct selection_input_event): Record 'x_display_info *'
+       instead of 'Display *'.
+       (SELECTION_EVENT_DPYINFO): New macro.
+       (SELECTION_EVENT_DISPLAY): Now inline function to prohibit using
+       it as an lvalue.  Mention this in comment.
+       * xterm.c (handle_one_xevent): Use SELECTION_EVENT_DPYINFO.
+       * xselect.c (x_get_window_property_as_lisp_data, x_atom_to_symbol)
+       (selection_data_to_lisp_data, receive_incremental_selection):
+       Convert to use 'x_display_info *'.  Adjust users where appropriate.
+       (lisp_data_to_selection_data): Likewise.  Also pass 'struct
+       selection data *' as last arg to not return values in args.
+       (unexpect_property_change): Use common removal technique.
+
+2014-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * print.c (print_preprocess): Adjust to match changed
+       sub char-table structure and avoid crash (Bug#18038).
+
+       * data.c (wrong_choice): Not static any more.
+       * lisp.h (wrong_choice): Add prototype.
+       * frame.h (struct frame) [USE_X_TOOLKIT || HAVE_NTGUI]:
+       Declare namebuf as such.  Tweak comment.
+       [USE_GTK]: Likewise for tool_bar_position.
+       (fset_tool_bar_position) [USE_GTK]: Ditto.
+       (FRAME_TOOL_BAR_POSITION): New macro.
+       * frame.c (x_report_frame_params):
+       * gtkutil.c (update_frame_tool_bar):
+       * xfns.c (Fx_create_frame): Use it.
+       (x_set_tool_bar_position): Add meaningful diagnostic messages.
+
+2014-07-16  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (decode_mode_spec): Call file-remote-p on the current
        buffer's default-directory only if it is a string.  (Bug#17986)
 
+2014-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       More precise control over values of some buffer-local variables.
+       * keyboard.c (Qvertical_scroll_bar):
+       * frame.c (Qleft, Qright): Move to ...
+       * buffer.c (Qleft, Qright, Qvertical_scroll_bar): ... here.
+       * buffer.c (Qchoice, Qrange, Qoverwrite_mode, Qfraction): New symbols.
+       (syms_of_buffer): DEFSYM all of the above, attach special properties.
+       Use special symbols to DEFVAR_PER_BUFFER overwrite-mode,
+       vertical-scroll-bar, scroll-up-aggressively
+       and scroll-down-aggressively.
+       * buffer.h (Qchoice, Qrange, Qleft, Qright, Qvertical_scroll_bar):
+       Add declarations.
+       * nsfns.m, frame.h (Qleft, Qright):
+       * nsterm.m (Qleft): Remove declarations.
+       * gtkutil.c (toplevel): Include buffer.h.
+       * data.c (wrong_choice, wrong_range): New functions.
+       (store_symval_forwarding): Handle special properties of buffer-local
+       variables and use functions from the above to signal error, if any.
+
+       * frame.h (enum fullscreen_type) [HAVE_WINDOW_SYSTEM]: Use more natural
+       values.  Add comment.
+       (struct frame): Re-arrange layout to avoid extra padding and use bit
+       fields for output_method, want_fullscreen and vertical_scroll_bar_type.
+       (FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS)
+       (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT)
+       (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT) [!HAVE_WINDOW_SYSTEM]:
+       Define as no-ops because there are no scroll bars anyway.
+       * frame.c (make_frame, make_terminal_frame, make_initial_frame):
+       Adjust users.
+
+       * font.c (fset_font_data) [HAVE_XFT || HAVE_FREETYPE]:
+       Add convenient setter.
+       (font_put_frame_data, font_get_frame_data): Use it.
+
+2014-07-15  Daiki Ueno  <ueno@gnu.org>
+
+       * nsgui.h (XCHAR2B_BYTE1): Add missing parentheses around
+       pointer argument, before dereferencing.
+       (XCHAR2B_BYTE2): Likewise.
+
+2014-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xmenu.c (toplevel): Use LWLIB_ID for next_menubar_widget_id.
+       (pop_down_menu) [USE_X_TOOLKIT]: Accept integer arg.
+       (create_and_show_popup_menu, create_and_show_dialog) [USE_X_TOOLKIT]:
+       Use record_unwind_protect_int and avoid consing.
+       (syms_of_xmenu) [USE_X_TOOLKIT]: Declare WIDGET_ID_TICK_START.
+
+       * regex.c (re_search_2): Use ssize_t to avoid integer overflow.
+
+2014-07-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use binary-io module, O_BINARY, and "b" flag (Bug#18006).
+       * callproc.c (create_temp_file): Use mkostemp's O_BINARY flag.
+       * emacs.c [MSDOS]:
+       * emacs.c (main) [DOS_NT]: Don't mess with _fmode.
+       (main) [MSDOS]: Use SET_BINARY instead of setmode.
+       * minibuf.c: Include binary-io.h instead of fcntl.h.
+       (read_minibuf_noninteractive):
+       Use set_binary_mode instead of handcrafted code.
+       Don't call emacs_set_tty if emacs_get_tty failed.
+       * sysdep.c, systty.h (emacs_get_tty): Return int, not void.
+       * sysdep.c (emacs_open, emacs_pipe): Use O_BINARY.
+       * w32.c (pipe2): Adjust eassert to include O_BINARY.
+
+       * macros.c (Fstart_kbd_macro): Avoid need for overflow check.
+       This works around a GCC compiler bug when Emacs is configured with
+       --enable-gcc-warnings.
+
+2014-07-14  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lisp.h (CHECK_VECTOR_OR_STRING): Return number of elements
+       or characters in string, respectively.  Add comment.
+       * fringe.c (Fdefine_fringe_bitmap):
+       * fns.c (Fsubstring, substring_both): Use it.
+       * keymap.c (Fdefine_key, Flookup_key):
+       * macros.c (Fstart_kbd_macro): Likewise.  Avoid call to Flength.
+
+       * term.c (tty_menu_add_pane, tty_menu_add_selection):
+       Use menu_item_width.
+       (tty_menu_show): Simplify because tty_menu_create never return NULL.
+
+2014-07-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Improve behavior of 'bzr up; cd src; make -k'.
+       * Makefile.in (top_srcdir): New var.
+       (ntsource, lispsource, ALL_CFLAGS, gl-stamp, emacs.res):
+       Use '$(top_srcdir)' instead of '$(srcdir)/..';
+       its expansion is a bit shorter.
+       (../config.status): Actually build config.status instead of
+       just complaining.
+       (ACLOCAL_INPUTS, AUTOCONF_INPUTS):
+       New macros, copied and relocated from ../Makefile.in.
+       ($(top_srcdir)/aclocal.m4, $(top_srcdir)/configure, config.in)
+       (../config.status, Makefile): New dependencies and rules,
+       copied with relocation from ../Makefile.in.  This should be more
+       likely to rebuild the build machinery properly if you do a 'make'
+       in the src directory.
+
 2014-07-12  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (display_line): Don't call FETCH_BYTE with argument less
        * xfns.c (Fx_file_dialog) [USE_MOTIF, USE_GTK]: Update the doc
        string to match the one in w32fns.c.
 
-2014-07-08  Eli Zaretskii  <eliz@gnu.org>
+       * minibuf.c (read_minibuf_noninteractive) [WINDOWSNT]: Switch
+       stdin to binary mode only if it is connected to a terminal.
+
+2014-07-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Coalesce extern decls.
+       * minibuf.c (emacs_get_tty, emacs_set_tty, suppress_echo_on_tty):
+       * sysdep.c (emacs_get_tty, emacs_set_tty):
+       Move duplicate extern decls from here ...
+       * systty.h: ... to here, so that there's just one copy.
+
+2014-07-11  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (changeFont:): Add ifdef NS_IMPL_COCOA.
+
+       * nsfns.m (Fns_popup_font_panel): Ditto.
+
+2014-07-11  Eli Zaretskii  <eliz@gnu.org>
+
+       * minibuf.c (read_minibuf_noninteractive): Finish reading on '\r',
+       not only on '\n'.
+       [WINDOWSNT]: Switch stdin to binary mode when not echoing input.
+
+       * sysdep.c (emacs_get_tty, emacs_set_tty, suppress_echo_on_tty)
+       [DOS_NT]: Implement for WINDOWSNT.
+
+       * systty.h (struct emacs_tty) [DOS_NT]: The struct member is now
+       unsigned.
+
+2014-07-11  Michael Albinus  <michael.albinus@gmx.de>
+
+       * sysdep.c (suppress_echo_on_tty): New function.
+       * minibuf.c (read_minibuf_noninteractive): Use it.
+
+2014-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (Fmemory_info) [HAVE_LINUX_SYSINFO]: Return nil if
+       sysinfo failed.  Adjust docstring.
+
+2014-07-11  Eli Zaretskii  <eliz@gnu.org>
+
+       Implement memory-info for MS-DOS.
+       * dosfns.c (dos_memory_info): New function.
+       * dosfns.h (dos_memory_info): Add prototype.
+       * alloc.c (Fmemory_info) [MSDOS]: Call dos_memory_info.
+       * vm-limit.c (get_lim_data) [MSDOS]: Call dos_memory_info, instead
+       of doing some of its job.
+
+       * minibuf.c (read_minibuf_noninteractive) [WINDOWSNT]: Don't
+       reference termios structure members.
+
+2014-07-11  Michael Albinus  <michael.albinus@gmx.de>
+
+       * sysdep.c (emacs_get_tty, emacs_set_tty): Make them externally visible.
+
+       * minibuf.c (top): Include systty.h.  Declare external
+       emacs_get_tty and emacs_set_tty.
+       (Vread_hide_char): New lisp variable.
+       (read_minibuf_noninteractive): Hide characters with
+       Vread_hide_char if it is a character.  (Bug#17839)
+
+2014-07-10  Eli Zaretskii  <eliz@gnu.org>
+
+       Implement memory-info for MS-Windows.
+       * w32.c (w32_memory_info): New function.
+       * w32.h (w32_memory_info): Prototype it.
+       * alloc.c (Fmemory_info) [WINDOWSNT]: Call it.
+
+2014-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * coding.h (struct coding_system): Remove 'error_positions' (unused)
+       and 'errors' (set but unused) fields.  Use bitfields for 'eol_seen',
+       'mode', 'common_flags' and 'result' fields, adjust layout to avoid
+       extra padding and shrink struct coding_system by 56 bytes (x86_64).
+       * coding.c (decode_coding_utf_8, decode_coding_utf_16)
+       (decode_coding_emacs_mule, decode_coding_iso_2022, decode_coding_sjis)
+       (decode_coding_big5, decode_coding_charset, decode_coding)
+       (encode_coding): Adjust users.
+
+       * alloc.c (Fmemory_info): New function.
+
+2014-07-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * syntax.c (back_comment): Use more-natural location for label.
+
+       * font.c, font.h (font_unparse_fcname): Now static.
+       Define only if HAVE_XFT || HAVE_FREETYPE || HAVE_NS.
+
+2014-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Next minor cleanup of font subsystem.
+       * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no
+       users) and FONT_FORMAT_INDEX (set by a few font drivers but never
+       really used).
+       (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove;
+       unused.
+       * ftfont.h (ftfont_font_format): Remove prototype.
+       * ftfont.c (ftfont_font_format): Remove; now unused.
+       (ftfont_open):
+       * nsfont.m (nsfont_open):
+       * w32font.c (w32font_open_internal):
+       * w32uniscribe.c (uniscribe_open):
+       * xfont.c (xfont_open):
+       * xftfont.c (xftfont_open): All users changed.
+
+       * coding.c (ALLOC_CONVERSION_WORK_AREA): Prefer ptrdiff_t to int and
+       so avoid integer overflow if decoded gap size exceeds INT_MAX bytes.
+
+2014-07-09  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (move_it_to): Adjust calculation of line_start_x to what
        x_produce_glyphs does when it generates a stretch glyph that
        represents a TAB.  (Bug#17969)
 
-2014-07-05  Eli Zaretskii  <eliz@gnu.org>
-
        * xdisp.c (pos_visible_p): If CHARPOS is at beginning of window,
        and there is a display property at that position, don't call
        move_it_to to move to a position before window start.  (Bug#17942)
        Fix condition for finding CHARPOS by the first call to move_it_to.
        (Bug#17944)
 
-2014-07-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * syntax.c (find_defun_start): Try the cache even
        if !open_paren_in_column_0_is_defun_start.
        (back_comment): If find_defun_start was pessimistic, use the
        scan_sexps_forward result to improve the cache (bug#16526).
 
-2014-07-04  Daniel Colascione  <dancol@dancol.org>
-
-       Backport from trunk.
-       * xfns.c (create_frame_xic): Pass XNStatusAttributes to XCreateIC
-       only if xic_style calls for it.  This change allows Emacs to work
-       with ibus.  Also, don't leak resources if create_frame_xic fails,
-       and stop caching xic_style across different displays (Bug#17928).
-       (supported_xim_styles): Make const.
-       (best_xim_style): Remove first parameter: it's always just
-       supported_xim_styles.  Change to look at supported_xim_styles directly.
-
-2014-07-04  Eli Zaretskii  <eliz@gnu.org>
+2014-07-09  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (redisplay_window): If redisplay of a window ends up
        with point in a partially visible line at end of the window, make
        * w32.c (network_interface_info): Make sure the argument is a
        Lisp string.
 
-2014-07-01  Eli Zaretskii  <eliz@gnu.org>
+2014-07-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * process.c (read_and_dispose_of_process_output): Fix typo
+       in previous patch: we want nonnegative fds, not nonzero fds.
+
+2014-07-08  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * chartab.c (char_table_translate): Move to...
+       * character.h (char_table_translate): ... inline function here.
+       Avoid Faref and assume that args are always valid.  This helps to
+       speedup search, which is especially important for a huge buffers.
+       * lisp.h (char_table_translate): Remove prototype.
+
+       * nsfont.m (nsfont_close): Free glyphs and metrics arrays as well.
+       * font.c (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]:
+       New function, with an intention to avoid code duplication between
+       a few font drivers.
+       * font.h (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]:
+       Add prototype.
+       * ftfont.c (ftfont_open):
+       * macfont.m (macfont_open):
+       * xftfont.c (xftfont_open): Use it.
+
+2014-07-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * process.c: Add sanity checks for file descriptors (Bug#17844).
+       (wait_reading_process_output, Fprocess_filter_multibyte_p):
+       Check that infd is nonnegative before using it as an fd.
+       (read_and_dispose_of_process_output, Fprocess_send_eof):
+       Likewise, for outfd.
+       (wait_reading_process_output): Omit unnecessary check of infd.
+
+2014-07-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Minor fixups related to usage of the 'long' type.
+       * gnutls.c (emacs_gnutls_handshake):
+       * xfaces.c (dump_realized_face):
+       Work even if 'long' is narrower than 'void *'.
+       * termcap.c (scan_file):
+       * xselect.c (x_decline_selection_request)
+       (x_reply_selection_request, x_get_window_property):
+       * xterm.c (x_set_frame_alpha):
+       Remove unnecessary 'L' suffixes of integer constants.
+       * xfns.c (hack_wm_protocols):
+       * xselect.c (x_fill_property_data):
+       * xterm.c (x_set_offset, x_set_window_size_1, x_make_frame_invisible):
+       Remove unnecessary casts to 'long'.
+       (set_machine_and_pid_properties): Don't assume pid_t fits in 32 bits.
+
+       Minor ImageMagick safety fixes.
+       * image.c (imagemagick_compute_animated_image):
+       Remove useless assignment to local.  Avoid problems if dest_width is 0.
+       (imagemagick_load_image): Use int for pixel counts that can't
+       exceed INT_MAX.  Avoid problem if PixelGetNextIteratorRow returns
+       a row width greater than the image width (or greater than LONG_MAX!).
+
+2014-07-04  K. Handa  <handa@gnu.org>
+
+       * coding.c (MIN_CHARBUF_SIZE): Delete it.
+       (MAX_CHARBUF_EXTRA_SIZE): New macro.
+       (ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE.
+
+2014-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * font.h (struct font_driver): Remove get_outline and free_outline;
+       not used by any font driver.
+       * ftfont.c (ftfont_driver):
+       * macfont.m (macfont_driver):
+       * nsfont.m (nsfont_driver):
+       * w32font.c (w32font_driver):
+       * w32uniscribe.c (uniscribe_font_driver):
+       * xfont.c (xfont_driver): Related users changed.
+       * xselect.c (x_get_window_property): Use convenient xmalloc.
+       Call to xfree only if some data was really allocated.
+
+2014-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       On MS-Windows, display busy cursor on all GUI frames.
+       This is similar to what we have on X.  Quickly tested by Dani Moncayo.
+       * w32fns.c (toplevel): Remove hourglass_hwnd; no longer used.
+       (w32_show_hourglass, w32_hide_hourglass, w32_note_current_window):
+       Likewise.
+       (hide_hourglass, show_hourglass): Redesign to match X counterparts.
+       * xdisp.c (start_hourglass): Remove Windows-specific bits.
+
+2014-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Use convenient alists to manage per-frame font driver-specific data.
+       * frame.h (struct frame): Rename font_data_list to...
+       [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now.
+       * font.h (struct font_data_list): Remove; no longer need a special
+       data type.
+       (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]:
+       Adjust prototypes.
+       * font.c (font_put_frame_data, font_get_frame_data)
+       [HAVE_XFT || HAVE_FREETYPE]: Prefer alist functions to ad-hoc list
+       management.
+       * xftfont.c (xftfont_get_xft_draw, xftfont_end_for_frame):
+       Related users changed.
+       * ftxfont.c (ftxfont_get_gcs, ftxfont_end_for_frame): Likewise.
+       Prefer convenient xmalloc and xfree.
+
+2014-07-03  Eli Zaretskii  <eliz@gnu.org>
 
        * dispnew.c (prepare_desired_row): Accept 2 additional arguments:
        the window whose glyph row is being prepared and a flag whether it
 
        * dispextern.h (prepare_desired_row): Adjust prototype.
 
-2014-07-01  Dmitry Antipov  <dmantipov@yandex.ru>
+2014-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * xfaces.c (init_frame_faces): Always realize basic faces (Bug#17889).
        * menu.c (Fx_popup_dialog): Set Vmenu_updating_frame to avoid crash
        caused by xw_popup_dialog in daemon mode (Bug#17891).
 
-2014-06-30  Eli Zaretskii  <eliz@gnu.org>
+2014-07-03  Eli Zaretskii  <eliz@gnu.org>
 
        * frame.c (do_switch_frame): When switching to another TTY frame,
        make sure FrameCols and FrameRows are in sync with the new frame's
        data.  (Bug#17875)
 
+2014-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects.
+       * lisp.h (struct Lisp_Sub_Char_Table): Use C integers for depth and
+       min_char slots.  Adjust comment.
+       (enum char_table_specials): Rename from CHAR_TABLE_STANDARD_SLOTS.
+       Add SUB_CHAR_TABLE_OFFSET member.
+       (make_uninit_sub_char_table): New function.
+       (toplevel): Add compile-time assert to verify suitable member layout
+       in Lisp_Sub_Char_Table.
+       * alloc.c (mark_char_table): Add extra argument to denote char table
+       subtype.  Adjust to match new layout of sub char-table.
+       (mark_object): Always mark sub char-tables with mark_char_table.
+       * chartab.c (make_sub_char_table, copy_sub_char_table)
+       (sub_char_table_ref, sub_char_table_ref_and_range, sub_char_table_set)
+       (sub_char_table_set_range, optimize_sub_char_table, map_sub_char_table)
+       (map_sub_char_table_for_charset, uniprop_table_uncompress):
+       All related users changed.
+       * lread.c (read1): Adjust to match new layout of sub char-table.
+       * print.c (print_object): Likewise (Bug#17898).
+
+2014-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * keymap.c (get_keyelt): Simplify.
+       (copy_keymap_item): Remove left-over code for when we had
+       key-shortcut caches.
+
+2014-06-30  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (judge): EmacsScroller: Move dealloc code here.
+       (dealloc): Remove for EmacsScroller.
+
+       * nsterm.h (EmacsScroller): Remove dealloc.
+
+2014-06-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * coding.c (MIN_CHARBUF_SIZE): Enlarge to 32.  (Bug#17881)
+
+2014-06-30  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsmenu.m (update_frame_tool_bar): Set wait_for_tool_bar to NO
+       when setNeedsDisplay is called so we don't trigger redisplay for every
+       tool bar update.
+
+       * nsterm.m (any_help_event_p): New variable.
+       (mouseMoved:): Set any_help_event_p to YES if help event is
+       generated.  Remove else with empty help event that triggered redisplay
+       for every mouse move.
+       (windowDidResignKey:): If any_help_event_p, generate empty help event.
+
+2014-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xfns.c (Qsuppress_icon): Remove; no real users.
+       (syms_of_xfns): Don't DEFSYM it.  Remove ancient comments.
+       * w32fns.c (Qsuppress_icon): Remove, for the same reason.
+       (syms_of_w32fns): Don't DEFSYM it.
+
+2014-06-29  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (ns-app): Mark as PHONY.
+
+2014-06-28  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (mostlyclean): There are no libXMenu11.a,
+       liblw.a in this directory.
+
 2014-06-28  Andreas Schwab  <schwab@linux-m68k.org>
 
        * coding.c (encode_coding_utf_8): Correctly count produced_chars
        also in unibyte case.  (Bug#17865)
 
-2014-06-25  Glenn Morris  <rgm@gnu.org>
+2014-06-28  K. Handa  <handa@gnu.org>
+
+       * coding.c (MAX_CHARBUF_SIZE): Renamed from CHARBUF_SIZE.
+       (MIN_CHARBUF_SIZE): New macro.
+       (ALLOC_CONVERSION_WORK_AREA): New arg SIZE.  Callers changed.
+
+2014-06-27  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in: Replace BOOTSTRAPEMACS sleight-of-hand
+       with an order-only dependence on bootstrap-emacs.  (Bug#2151)
+       (.el.elc): Replace suffix rule with pattern rule.
+       (%.elc): New pattern rule, with order-only prerequisite.
+       ($(lisp)): No more need to depend on BOOTSTRAPEMACS.
+       ($(lispsource)/loaddefs.el): Use an order-only prerequisite
+       in place of BOOTSTRAPEMACS.
+
+2014-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
 
-       * puresize.h (BASE_PURESIZE): Increase a bit.  (Bug#17846)
+       * fns.c (Fcompare_strings): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE.
+
+2014-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Consistently use validate_subarray to verify substring.
+       * fns.c (validate_substring): Not static any more.  Adjust to
+       use ptrdiff_t, not EMACS_INT, because string and vector limits
+       can't exceed ptrdiff_t even if EMACS_INT is wider.
+       (Fcompare_strings, Fsubstring, Fsubstring_no_properties)
+       (secure_hash): Adjust user.
+       * lisp.h (validate_subarray): Add prototype.
+       * coding.c (Fundecodable_char_position):
+       * composite.c (Fcomposition_get_gstring, Fcompose_string_internal):
+       Use validate_subarray.  Adjust comment to mention substring.
+
+2014-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Do not allow out-of-range character position in Fcompare_strings.
+       * fns.c (validate_subarray): Add prototype.
+       (Fcompare_substring): Use validate_subarray to check ranges.
+       Adjust comment to mention that the semantics was changed.  Also see
+       http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00447.html.
+
+2014-06-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Be more consistent about the 'Qfoo' naming convention.
+       * image.c (Fimagemagick_types):
+       * lisp.h (lisp_h_CHECK_TYPE, CHECK_TYPE, CHECK_ARRAY):
+       * process.c (Fmake_network_process):
+       Rename C local identifier 'Qfoo to avoid giving the false
+       impression that it stands for the symbol 'foo'.
+
+2014-06-23  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Simplify and cleanup character conversion stuff.
+       * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe):
+       Remove prototypes.
+       * character.c (multibyte_char_to_unibyte)
+       (multibyte_char_to_unibyte_safe): Remove; no longer used.
+       * character.h (make_char): Remove; unused.
+       (CHAR_TO_BYTE8, CHAR_TO_BYTE_SAFE): Simplify.
+       (ASCII_BYTE_P): Remove; ASCII_CHAR_P does the same thing.
+       * buffer.c, charset.c, charset.h, cmds.c, coding.c, editfns.c:
+       * fileio.c, indent.c, insdel.c, keyboard.c, lread.c, print.c:
+       * search.c, term.c, xdisp.c, xterm.c: Related users changed.
+
+2014-06-22  Mario Lang  <mlang@delysid.org>
+
+       * w32fns.c (Fw32_shell_execute): The the -> the.
+
+2014-06-22  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xmenu.c (mouse_position_for_popup):
+       * xselect.c (mouse_position_for_drop): Do not duplicate ...
+       * xfns.c (x_relative_mouse_position): ... and prefer this function.
+       * menu.c (Fx_popup_menu):
+       * xselect.c (x_handle_dnd_message): Adjust users.
+       * menu.h (mouse_position_for_popup): Remove prototype.
+       * xterm.h (x_relative_mouse_position): Add prototype.
+       * xterm.c (x_find_topmost_parent): Break from the loop and do not
+       call XFree if XQueryTree returns zero.
 
 2014-06-21  Eli Zaretskii  <eliz@gnu.org>
 
        * fileio.c (Ffile_acl): Port to OS X, where acl_get_file (...,
        ACL_TYPE_ACCESS) doesn't work.
 
-2014-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * keyboard.c (read_key_sequence): Don't invoke Vprefix_help_command
        before checking key-translation-map (bug#17659).
 
-2014-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
+2014-06-21  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * font.c (font_make_object): Avoid dangling pointer which may
        crash GC (Bug#17771).
 
-2014-06-18  Eli Zaretskii  <eliz@gnu.org>
+2014-06-21  Eli Zaretskii  <eliz@gnu.org>
 
        * image.c [5 < GIFLIB_MAJOR + (1 <= GIFLIB_MINOR)]: Declare the
        prototype of DGifCloseFile as appropriate for older and newer
        (gif_load): Call gif_close instead of DGifCloseFile.  Divulge the
        error string where appropriate.  (Bug#17790)
 
-2014-06-16  Eli Zaretskii  <eliz@gnu.org>
-
        * xdisp.c (Fmove_point_visually): Instead of testing for keyboard
        macro execution, make sure point didn't move since last complete
        redisplay, as the condition for using the glyph matrix
        information.  (Bug#17777)
 
-2014-06-14  Eli Zaretskii  <eliz@gnu.org>
+2014-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Minor cleanup of fonset code.
+       * fontset.c (FONTSET_ID, set_fontset_id, FONTSET_NAME)
+       (set_fontset_name, FONTSET_ASCII, set_fontset_ascii)
+       (FONTSET_BASE, set_fontset_base, FONTSET_FRAME)
+       (set_fontset_frame, FONTSET_NOFONT_FACE, set_fontset_nofont_face)
+       (FONTSET_DEFAULT, set_fontset_default, FONTSET_FALLBACK)
+       (set_fontset_fallback): Reorder extra slots and avoid unused slots.
+       (free_realized_fontset): Remove because a no-op since 2008.
+       (free_face_fontset): Adjust user.
+       (syms_of_fontset): Shrink fontset by one extra slot.
+
+2014-06-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Omit redundant extern decls.
+       Most of this patch is from Dmitry Antipov, in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00263.html
+       * commands.h (update_mode_lines):
+       * frame.h (Qbackground_color, Qforeground_color)
+       (x_set_menu_bar_lines):
+       * ftfont.c (ftfont_font_format):
+       * intervals.h (Qkeymap, Qfont):
+       * keyboard.c (timer_check, safe_run_hooks, Qregion_extract_function):
+       * lisp.h (Ffboundp, Qnil, Qt, Qlambda, Qintegerp, Qwholenump)
+       (Qsymbolp, Qlisp, Qconsp, Qstringp, Qarrayp, Qbufferp, Qmarkerp)
+       (Qvectorp, Qbuffer_or_string_p, Qchar_table_p, Qvector_or_char_table_p)
+       (Qfloatp, Qnumberp, Qfont_spec, Qfont_entity, Qfont_object)
+       (Fbyteorder, wrong_type_argument, Fmax_char, syms_of_composite)
+       (Fidentity, extract_float, init_display, syms_of_display, Qdisplay):
+       (Qimage, Qbox, redisplay_preserve_echo_area, char_table_ref)
+       (char_table_set, char_table_translate, Qautoload, Qbottom, Qtop)
+       (Qvisible, Qfont, Qfront_sticky, Qrear_nonsticky, init_sigio)
+       (Qtool_bar, Qheader_line):
+       * macros.c (Fexecute_kbd_macro):
+       * xdisp.c (Ftool_bar_height, Ftool_bar_height):
+       * xterm.c (x_delete_terminal, XSetIMValues):
+       * xterm.h (x_set_window_size, x_query_color, x_get_focus_frame)
+       (x_implicitly_set_name, popup_activated)
+       (widget_store_internal_border):
+       Remove redundant decls.
+       * frame.c [USE_X_TOOLKIT]: Include widget.h.
+       * keyboard.c (Fexit_recursive_edit, Fabort_recursive_edit):
+       Remove _Noreturn, as make-docfile now does that for us.
+       * lisp.h (DEFUN): Don't declare fnname here; rely on make-docfile.
+       (Qregion_extract_function): New decl.
+       * window.c, xfns.c: Include menu.h.
+
+2014-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * callint.c (Fcall_interactively): Fix up last change (bug#17701).
+
+2014-06-17  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * fileio.c (Fread_file_name): Do not pass redundant args and ...
+       * callint.c (read_file_name): ... convert to static here.
+       * lisp.h (Fread_file_name): Do not EXFUN it.
+       (STRING_COPYIN): Remove; unused.
+       * composite.c (CHAR_COMPOSABLE_P): Replace unsafe macro with ...
+       (char_composable_p): ... static function.  All users changed.
+       * eval.c (toplevel): Remove redundant #include directives.
+       * xterm.c (x_initialize): Add static to match prototype.
+       * ccl.c (Fccl_execute_on_string):
+       * font.c (fon_intern_prop): Use make_specified_string.
+
+2014-06-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * Makefile.in (ns-app): Fix typo that broke build on OS X.
+       Reported by David Caldwell in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00251.html
+
+2014-06-16  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Do not ask for XRender extension each time XFT font is opened.
+       * xftfont.c (xftfont_open): Move call to XRenderQueryExtension ...
+       * xterm.c (x_term_init) [HAVE_XFT]: ... to here.  Adjust comment.
+
+2014-06-15  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in: Use `make -C' rather than `cd && make' throughout.
+
+2014-06-15  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (Fmove_point_visually): Don't use the glyph matrix
        information if we are in the middle of executing a keyboard macro,
        since redisplay doesn't update the screen until the macro is
        finished.  (Bug#17777)
 
-2014-06-13  Eli Zaretskii  <eliz@gnu.org>
-
        * alloc.c (cleanup_vector): Don't dereference a font driver
        pointer if it is NULL.  (Bug#17771)
 
+2014-06-13  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in ($(leimdir)/leim-list.el, $(srcdir)/macuvs.h)
+       ($(lispsource)/international/charprop.el)
+       ($(libsrc)/make-docfile$(EXEEXT), $(lwlibdir)/liblw.a)
+       ($(oldXMenudir)/libXMenu11.a, ns-app, .el.elc)
+       ($(lispsource)/loaddefs.el, bootstrap-emacs$(EXEEXT)):
+       GNU make automatically passes command-line arguments to sub-makes.
+
+2014-06-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Avoid hangs in accept-process-output (Bug#17647).
+       * lisp.h, process.c (wait_reading_process_input):
+       Return int, not bool.  All uses changed.
+       * process.c (SELECT_CANT_DO_WRITE_MASK):
+       Remove macro, replacing with ...
+       (SELECT_CAN_DO_WRITE_MASK): ... new constant, with inverted sense.
+       All uses changed.
+       (status_notify): New arg WAIT_PROC.  Return int, not void.
+       All uses changed.
+
+2014-06-13  Eli Zaretskii  <eliz@gnu.org>
+
+       * menu.c (Fx_popup_menu): Don't call the frame's menu_show_hook if
+       the frame is the initial frame, because the hook is not set up
+       then, and Emacs crashes.
+       Reported by Fabrice Popineau <fabrice.popineau@gmail.com>.
+
+2014-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * keymap.c (silly_event_symbol_error): Don't recommend the use
+       of strings.
+
 2014-06-11  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (set_cursor_from_row): Fix an off-by-one error when
        matching overlay strings with 'cursor' property against buffer
        positions traversed in the glyph row.  (Bug#17744)
 
-2014-06-08  Glenn Morris  <rgm@gnu.org>
+2014-06-11  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.h (EmacsApp): Always compile in shouldKeepRunning, isFirst
+       on Cocoa.
+
+       * nsterm.m (run): Always compile for Cocoa.  Use runtime check to
+       determine 10.9 (Bug#17751).
+
+       * macfont.m (macfont_draw): Positions were not freed.
+
+2014-06-10  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * dispextern.h (PREPARE_FACE_FOR_DISPLAY): Remove as a duplicate of ...
+       * xfaces.c (prepare_face_for_display) [HAVE_WINDOW_SYSTEM]: ... this
+       function.  Also adjust comment.
+       * fringe.c, w32term.c, xdisp.c, xterm.c: All users changed.
+
+       * dispextern.h (struct face) [HAVE_XFT]: Ifdef 'extra' member.
+       * font.c (font_done_for_face):
+       * xface.c (realize_non_ascii_face): Adjust user.
+       * font.h (struct font_driver): Convert 'prepare_face' to return
+       void because its return value is never used anyway.
+       * xfont.c (xfont_prepare_face): Return void.
+       * xftfont.c (xftfont_prepare_face): Likewise.  Use xmalloc.
+       (xftfont_done_face): Use xfree.
+
+       * dispextern.h (last_tool_bar_item): Remove declaration.
+       * frame.h (struct frame): New member last_tool_bar_item.
+       * frame.c (make_frame): Initialize it.
+       * xdisp.c (toplevel): Remove last_tool_bar_item.
+       (handle_tool_bar_click, note_tool_bar_highlight):
+       * w32term.c (w32_read_socket, w32_initialize):
+       * xterm.c (handle_one_xevent, x_initialize): Adjust users.
+
+       * frame.h (window_system_available) [!HAVE_WINDOW_SYSTEM]: Always false.
+       * frame.c (window_system_available) [HAVE_WINDOW_SYSTEM]: Now here.
+
+2014-06-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Say (accept-process-output P)'s result pertains to P if P is non-nil.
+       * process.c (Faccept_process_output)
+       (wait_reading_process_output): Mention that if PROCESS is non-nil,
+       the return value is about PROCESS, not about other processes.
+
+2014-06-09  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Further adjustments to mark_object and friends.
+       Now the mark_object's stack is just 32 bytes on a 64-bit
+       system, which means extra 20% off the stack usage.
+       * alloc.c (mark_save_value): As before, refactored out from ...
+       (mark_object): ... adjusted user.  Also add comment.
+
+2014-06-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix core dump after a dropped X connection (Bug#17704).
+       * sysdep.c (stuff_char): Don't abort merely because the selected frame
+       is dead, as we may be shutting down.
+
+2014-06-08  Glenn Morris  <rgm@gnu.org>
+
+       * fileio.c (write-region-inhibit-fsync): Doc tweak.
+
+       * data.c (Flss, Fgtr, Fleq, Fgeq): Doc tweaks.
+
+2014-06-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       If a C name must be extern on some platforms, make it extern on all.
+       * dispextern.h (set_vertical_scroll_bar, erase_phys_cursor)
+       (load_color):
+       * font.h (ftxfont_driver) [HAVE_XFT]:
+       * keyboard.h (menu_items_inuse, ignore_mouse_drag_p, make_ctrl_char):
+       * lisp.h (get_frame_param):
+       * menu.h (tty_menu_show):
+       * process.h (conv_sockaddr_to_lisp, catch_child_signal):
+       * termhooks.h (encode_terminal_code):
+       * xterm.h (x_menu_wait_for_event):
+       Always declare.
+       * frame.c (get_frame_param):
+       * fringe.c (max_used_fringe_bitmap):
+       * ftxfont.c (ftxfont_driver):
+       * keyboard.c (ignore_mouse_drag_p, make_ctrl_char):
+       * menu.c (menu_items_inuse):
+       * process.c (conv_sockaddr_to_lisp, catch_child_signal):
+       * term.c (encode_terminal_code, tty_menu_show):
+       * xdisp.c (set_vertical_scroll_bar, erase_phys_cursor):
+       * xfaces.c (load_color):
+       * xmenu.c (x_menu_wait_for_event):
+       Now always extern.
+
+2014-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Change object marking routines to minimize stack usage.
+       This change moves a few cold paths from mark_object to NO_INLINE
+       functions and adjusts symbol marking loop.  According to GCC 4.8.2
+       -Wstack-usage, this reduces mark_object's stack usage from 80 to
+       48 bytes on a 64-bit system.  For a long byte-force-recompile runs,
+       stack usage at the mark phase is reduced up to 28%.  Surprisingly,
+       it also gains up to 3% in speed (with default '-O2 -g3' flags).
+       * alloc.c (mark_compiled, mark_localized_symbol): New functions,
+       refactored out from ...
+       (mark_object): ... adjusted user.  Also mark symbols in a tight
+       inner loop.
+       (mark_face_cache): Add NO_INLINE.
+
+2014-06-08  Eli Zaretskii  <eliz@gnu.org>
+
+       * sysdep.c (reset_sys_modes): Use cursorX, not curX, as the latter
+       contains garbage on WINDOWSNT (which could potentially infloop at
+       exit).
+
+       Minimize cursor motion during TTY menu updates.
+       * term.c (tty_menu_display): Don't position cursor here.
+       Instead, pass the cursor coordinates to update_frame_with_menu.
+       (tty_menu_activate): Send the hide cursor command only once in an
+       iteration through the outer 'while' loop.
+
+       * dispnew.c (update_frame_1): Accept an additional argument
+       SET_CURSOR_P, and position the cursor at the end of the frame
+       update only if that argument is non-zero.  All callers changed to
+       provide the additional argument as non-zero, except for
+       update_frame_with_menu.
+       (update_frame_with_menu): Accept 2 additional arguments ROW and
+       COL; if they are non-negative, instruct update_frame_1 not to
+       position the cursor, and instead position it according to ROW and COL.
+
+       * dispextern.h (update_frame_with_menu): Update prototype.
+
+2014-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * callproc.c (call_process): Don't check read-only if we don't insert
+       anything (bug#17666).
+
+2014-06-08  Eli Zaretskii  <eliz@gnu.org>
+
+       * dispnew.c (update_frame_with_menu): Set display_completed.
+
+2014-06-07  Eli Zaretskii  <eliz@gnu.org>
+
+       * term.c (tty_menu_show) [WINDOWSNT]: Make tty_menu_show extern
+       only for WINDOWSNT.
+       * menu.h (tty_menu_show) [WINDOWSNT]: Declare extern only for WINDOWSNT.
+
+2014-06-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * term.c (tty_menu_show) [!HAVE_NTGUI]: Now static.
+       * menu.h (tty_menu_show) [!HAVE_NTGUI]: Omit extern decl.
+
+2014-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * window.c (Frecenter): Signal an error if window-buffer is not
+       current-buffer.
+
+       * keyboard.c (make_lispy_position): Don't include a buffer position in
+       mode/header-line mouse events.
+
+       * keyboard.c (read_char): Handle (t . <event>) in the second use of
+       Vunread_command_events (bug#17650).
+
+2014-06-06  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xterm.c (x_setup_pointer_blanking):
+       Conditionally probe Xfixes until this stuff is stabilized (Bug#17609).
+
+2014-06-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * keyboard.c, process.c: Do not define POLL_FOR_INPUT here
+       because it will be defined in generated config.h if needed.
+
+2014-06-04  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Use terminal-specific hooks to display popup dialogs.
+       * termhooks.h (struct terminal): New field popup_dialog_hook.
+       * menu.c (emulate_dialog_with_menu): New function, refactored from ...
+       (Fx_popup_dialog): ... adjusted user.  Also remove old #if 0
+       code and use popup_dialog_hook.
+       * nsmenu.m (ns_popup_dialog): Make hook-compatible.
+       * nsterm.h (ns_popup_dialog): Adjust prototype.
+       * nsterm.m (ns_create_terminal):
+       * w32term.c (w32_create_terminal):
+       * xterm.c (x_create_terminal) [USE_X_TOOLKIT || USE_GTK]:
+       Setup popup_dialog_hook.
+
+2014-06-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32heap.c (report_temacs_memory_usage): Improve the report by
+       reporting the large blocks that are actually occupied at dump time.
+
+       * w32console.c (initialize_w32_display): Set the console
+       menu_show_hook, otherwise TTY menus are broken on w32.
+
+2014-06-04  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Use terminal-specific hooks to display menus.
+       * termhooks.h (struct terminal): New field menu_show_hook.
+       * menu.h (<anonymous enum>): Bit flags for menu hooks.
+       (x_menu_show, w32_menu_show, ns_menu_show, tty_menu_show):
+       Adjust prototypes.
+       * menu.c (Fx_popup_menu): Use bit flags and menu_show_hook.
+       * nsmenu.m (ns_menu_show):
+       * w32menu.c (w32_menu_show):
+       * xmenu.c (x_menu_show):
+       * term.c (tty_menu_show): Adjust to use bit flags.
+       (set_tty_hooks): Set menu_show_hook.
+       * xterm.c (x_create_terminal):
+       * nsterm.m (ns_create_terminal):
+       * msdos.c (initialize_msdos_display):
+       * w32term.c (w32_create_terminal): Likewise.
+
+2014-06-03  Juanma Barranquero  <lekktu@gmail.com>
+
+       * w32heap.c (DUMPED_HEAP_SIZE) [!_WIN64]: Reduce to 11 MB.
+
+2014-06-03  Eli Zaretskii  <eliz@gnu.org>
+
+       * sysselect.h (fd_CLR, fd_ISSET, fd_SET, FD_CLR, FD_ISSET)
+       (FD_SET): Don't define on WINDOWSNT.
+
+2014-06-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * emacs.c: Include "sysselect.h", to define its inline functions.
+       Problem reported by Glenn Morris in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00077.html
+
+       Do not require libXt-devel when building with gtk.
+       * gtkutil.h, menu.h: Include lwlib-widget.h, not lwlib-h, to avoid
+       dependency on libXt-devel.
+       * menu.h [HAVE_NTGUI]: Include lwlib-widget.h in this case too.
+       (enum button_type, widget_value) [HAVE_NTGUI]: Remove, as
+       lwlib-widget.h now does this.
+       * nsmenu.m (ns_menu_show): "enabled" -> "enable" to fix typo.
+
+2014-06-03  Paul Eggert  <eggert@penguin.cs.ucla.edu>
+
+       If ENABLE_CHECKING, range-check args of FD_CLR, FD_ISSET, FD_SET.
+       * process.c (add_read_fd, delete_read_fd, add_write_fd)
+       (delete_write_fd, wait_reading_process_output):
+       Remove now-redundant easserts.
+       * sysselect.h (SYSSELECT_H): New macro, to avoid double-inclusion woes.
+       Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
+       (fd_CLR, fd_ISSET, fd_SET): New inline functions.
+       (FD_CLR, FD_ISSET, FD_SET): Redefine in terms of these functions.
+
+2014-06-03  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h.  Don't use
+       HEAPSIZE; instead, define separate values for the 32- and 64-bit builds.
+       (calloc): Don't undef, it is never defined.
+       (HEAP_ENTRY_SHIFT): Remove unused macro.
+
+       * Makefile.in (C_HEAP_SWITCH): Remove.
+       (ALL_CFLAGS): Don't use $(C_HEAP_SWITCH).
+
+       Fix MS-Windows build broken by menu changes on 2014-06-02.
+       * w32menu.c (w32_menu_show): Fix a typo that broke compilation.
+
+       * menu.h (enum button_type, struct _widget_value) [HAVE_NTGUI]:
+       Define instead of including ../lwlib/lwlib.h, which causes
+       compilation errors due to missing X11 headers.
+
+2014-06-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * process.c (wait_reading_process_output): Omit incorrect test of
+       p->infd against zero.  Add easserts for infd having a plausible value.
+
+2014-06-02  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Adjust to match recent lwlib changes.
+       * menu.h (xmalloc_widget_value): Replace by ...
+       (make_widget_value): ... new prototype.
+       * menu.c (xmalloc_widget_value): Replace by ...
+       (make_widget_value): ... new function.
+       (free_menubar_widget_value_tree, digest_single_submenu): Adjust users.
+       * gtkutil.c (malloc_widget_value, free_widget_value):
+       (widget_value_free_list, malloc_cpt): Remove old lwlib-compatible code.
+       * keyboard.h (enum button_type, struct _widget_value):
+       * gtkutil.h, nsgui.h, w32gui.h (malloc_widget_value, free_widget_value):
+       Likewise.
+       * nsmenu.m (ns_update_menubar, ns_menu_show):
+       * w32menu.c (set_frame_menubar, w32_menu_show, w32_dialog_show):
+       * xmenu.c (set_frame_menubar, xmenu_show, x_dialog_show): Adjust users.
+       * xterm.h (XtParent) [USE_GTK]: Remove unused macro.
+
+2014-06-02  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * image.c (x_query_frame_background_color)
+       [HAVE_PNG || HAVE_NS || HAVE_IMAGEMAGICK || HAVE_RSVG]:
+       Fix --enable-gcc-warnings compilation without image libraries.
+
+2014-06-02  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32heap.c (malloc_after_dump, realloc_after_dump): Update the
+       emulated break value only if it goes up.
+       (sbrk): Add assertion that the INCREMENT argument is strictly
+       zero.  Improve and correct the commentary.
+
+2014-06-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Improve AIX-related merge from emacs-24.
+       * conf_post.h (FLEXIBLE_ARRAY_MEMBER): Fix comment.
+       * lisp.h (ENUMABLE) [!_AIX]: Don't define to 0 merely because we're
+       not on AIX; since we're on the trunk we can use enums more broadly.
+
+       * frame.c (x_set_frame_parameters): Don't read uninitialized storage.
+
+2014-06-02  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * xterm.c (xg_scroll_callback): Remove position, for jump set portion
+       to min(value, whole).
+
+2014-06-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Bring back the changes to GDB-visible symbols, but only on AIX.
+       And only if it's not pre-4.2 GCC.
+       * lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): New macros.
+       (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them.
+       (ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
+       New macros.
+
+2014-06-02  Eli Zaretskii  <eliz@gnu.org>
+
+       * fileio.c (Finsert_file_contents): Call prepare_to_modify_buffer
+       with PT, not GPT.  (Bug#16433)
+
+       Revert last changes to GDB-visible symbols.
+       * lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): Delete macros.
+       (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Don't use them.
+       (ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
+       Delete macros.
+
+2014-06-02  Glenn Morris  <rgm@gnu.org>
+
+       * cmds.c (Fself_insert_command): Allow zero repeat count.  (Bug#17649)
+
+2014-06-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix port to 32-bit AIX with xlc (Bug#17598).
+       * alloc.c (gdb_make_enums_visible): Remove FLOAT_TO_STRING_BUFSIZE.
+       * conf_post.h (FLEXIBLE_ARRAY_MEMBER) [__IBMC__]: Don't define to empty.
+       * lisp.h (FLOAT_TO_STRING_BUFSIZE): Make it a macro, instead of an enum,
+       to work around a compiler bug in IBM xlc 12.1.
+
+2014-06-02  Eli Zaretskii  <eliz@gnu.org>
+
+       * xterm.c (x_update_window_end): Don't invalidate the entire
+       mouse-highlight info, just signal frame_up_to_date_hook that mouse
+       highlight needs to be redisplayed.  (Bug#17588)
+
+2014-06-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port the GDB-visible symbols to AIX.
+       Without them, GDB doesn't work to debug Emacs, since the AIX linker
+       optimizes away the relevant external symbols.  Use enums instead;
+       this suffices for the AIX port, which is 32-bit-only anyway.
+       * lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): New macros.
+       (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them.
+       (ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
+       New macros.
+
+       Include sources used to create macuvs.h.
+       * Makefile.in ($(srcdir)/macuvs.h): New rule.
+       * macuvs.h: Use automatically-generated header.
+
+2014-06-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port signal-handling to DragonFly BSD (Bug#17646).
+       * callproc.c, sysdep.c (block_child_signal, unblock_child_signal):
+       Move implementations from callproc.c to sysdep.c.
+       * process.h, syssignal.h (block_child_signal, unblock_child_signal):
+       Move declarations from process.h to syssignal.h.
+
+2014-06-01  Juanma Barranquero  <lekktu@gmail.com>
+
+       * callint.c (Ffuncall_interactively): Add usage.
+
+2014-06-01  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsfns.m (ns_appkit_version_str): Add os version for Cocoa.
+
+2014-05-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32heap.c (malloc_before_dump, malloc_after_dump)
+       (malloc_before_dump, realloc_after_dump, realloc_before_dump)
+       (mmap_alloc, mmap_realloc): Check for errors more thoroughly and
+       set errno where appropriate to emulate CRT functions.
+
+2014-05-30  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Debugging facility to check whether 'const char *' points to
+       relocatable data of non-pure Lisp string.
+       * alloc.c (maybe_lisp_pointer): New function, refactored out of ...
+       (mark_maybe_pointer): ... adjusted user.
+       (relocatable_string_data_p): New function.
+       * lisp.h (relocatable_string_data_p): Add prototype.
+       * xdisp.c (message_with_string): If ENABLE_CHECKING, make sure
+       the pointer to relocatable Lisp data is not used.
+
+2014-05-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't let SIGINT handling block SIGCHLD indefinitely (Bug#17561).
+       * atimer.c (block_atimers):
+       * callproc.c (block_child_signal): Block SIGINT too;
+       otherwise, its handler might now unblock signals that it shouldn't.
+       * keyboard.c (read_char): Clear signal mask, since we may
+       be in a SIGINT handler, and many signals may be masked.
+       * keyboard.c (handle_interrupt):
+       * sysdep.c (handle_arith_signal):
+       Clear signal mask instead of just unblocking the signal that
+       was received, since several signals may be blocked at this point.
+
+2014-05-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * Makefile.in (TEMACS_POST_LINK): Remove target.
+       (emacs$(EXEEXT)): Remove $(ADDSECTION) from prerequisites.
+       (temacs$(EXEEXT)): Remove $(TEMACS_POST_LINK) from the recipe.
+
+2014-05-29  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xmenu.c (xdialog_show): Remove prototype, rename to
+       x_dialog_show, remove 2nd arg because it's always zero
+       and simplify accordingly.
+       (xw_popup_dialog): Adjust user.
+       * w32menu.c (w32_dialog_show): Adjust prototype, remove
+       2nd arg because it's always zero and simplify accordingly.
+       (w32_popup_dialog): Adjust user.
+
+2014-05-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32heap.c (report_temacs_memory_usage): New function.
+
+       * unexw32.c (unexec) [ENABLE_CHECKING]:
+       Call report_temacs_memory_usage.
+
+       * w32heap.h (report_temacs_memory_usage): Add prototype.
+
+2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't substitute sigprocmask for pthread_sigmask (Bug#17561).
+       * Makefile.in (LIB_PTHREAD_SIGMASK): Remove; all uses removed.
+
+2014-05-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * buffer.c (init_buffer): Accept an argument 'initialized'.
+       [USE_MMAP_FOR_BUFFERS]: If 'initialized' is non-zero, reset
+       mmap_regions and mmap_fd, to avoid referencing stale data from the
+       dump phase.  Add an assertion for buffer text of buffers created
+       in temacs before this function is called.  (Bug#17622)
+       (mmap_regions_1, mmap_fd_1): Remove unused variables.
+
+       * lisp.h (init_buffer): Update prototype.
+
+       * emacs.c (main): Pass 'initialized' as the argument to init_buffer.
+
+2014-05-29  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (Fgarbage_collect): Fix compilation with
+       GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
+
+2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * frame.c, frame.h (frame_char_to_pixel_position)
+       (frame_set_mouse_position): Now static, and made private in
+       frame.c rather than public in frame.h.
 
-       * fileio.c (write-region-inhibit-fsync): Doc tweak.
+2014-05-28  Dmitry Antipov  <dmantipov@yandex.ru>
 
-       * data.c (Flss, Fgtr, Fleq, Fgeq): Doc tweaks.
+       Refactor mouse positioning stuff to avoid code duplication.
+       * frame.h (frame_char_to_pixel_position): New function.
+       (x_set_mouse_position): Rename to...
+       (frame_set_mouse_position): ...new function.
+       (frame_set_mouse_pixel_position): Add prototype.
+       * nsterm.m, w32term.c, xterm.c (x_set_mouse_pixel_position):
+       Rename to frame_set_mouse_pixel_position.
+       * frame.c (Fset_mouse_pixel_position, Fset_mouse_position):
+       Adjust users.
+       * xterm.h, w32term.h ( x_set_mouse_position)
+       (x_set_mouse_pixel_position): Remove prototypes.
 
-2014-06-04  Eli Zaretskii  <eliz@gnu.org>
+2014-05-28  Dmitry Antipov  <dmantipov@yandex.ru>
 
-       * sysdep.c (reset_sys_modes): Use cursorX, not curX, as the latter
-       contains garbage on WINDOWSNT (which could potentially infloop at
-       exit).
+       On X, always make pointer visible when deleting frame (Bug#17609).
+       * frame.c (frame_make_pointer_visible, frame_make_pointer_invisible):
+       Pass frame as arg.
+       * frame.h (frame_make_pointer_visible, frame_make_pointer_invisible):
+       Adjust prototypes.
+       * cmds.c (Fself_insert_command): Use SELECTED_FRAME.
+       * keyboard.c (gobble_input): If there is no terminal input error,
+       make sure the pointer is visible for all frames on this terminal.
+       * xterm.c (x_free_frame_resources): Enable pointer visibility if
+       it was previously disabled.
 
-       Minimize cursor motion during TTY menu updates.
-       * term.c (tty_menu_display): Don't position cursor here.  Instead,
-       pass the cursor coordinates to update_frame_with_menu.
-       (tty_menu_activate): Send the hide cursor command only once in an
-       iteration through the outer 'while' loop.
+2014-05-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * dispnew.c (update_frame_1): Accept an additional argument
-       SET_CURSOR_P, and position the cursor at the end of the frame
-       update only if that argument is non-zero.  All callers changed to
-       provide the additional argument as non-zero, except for
-       update_frame_with_menu.
-       (update_frame_with_menu): Accept 2 additional arguments ROW and
-       COL; if they are non-negative, instruct update_frame_1 not to
-       position the cursor, and instead position it according to ROW and
-       COL.
+       * data.c (Fzerop): Move to Elisp.
+       (syms_of_data): Don't defsubr it.
+       * keyboard.c (echo_keystrokes_p): New function.
+       (read_char, record_menu_key, read_key_sequence): Use it.
 
-       * dispextern.h (update_frame_with_menu): Update prototype.
+       * callint.c (Qfuncall_interactively): New var.
+       (Qcall_interactively): Remove.
+       (Ffuncall_interactively): New function.
+       (Fcall_interactively): Use it.
+       (syms_of_callint): Defsubr it.
 
-2014-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * callproc.c (call_process): Don't check read-only if we don't insert
-       anything (bug#17666).
+       * bytecode.c (FETCH) [BYTE_CODE_SAFE]: Check the bytecode wasn't
+       relocated from under us.
 
-2014-06-02  Eli Zaretskii  <eliz@gnu.org>
+2014-05-27  Fabrice Popineau  <fabrice.popineau@gmail.com>
 
-       * dispnew.c (update_frame_with_menu): Set display_completed.
+       Use mmap(2) emulation for allocating buffer text on MS-Windows.
+       * Makefile.in (C_HEAP_SWITCH): Get the predefined heap size from
+       configure.
+       (ADDSECTION, MINGW_TEMACS_POST_LINK): Remove, no longer used.
 
-2014-06-01  Paul Eggert  <eggert@cs.ucla.edu>
+       * lisp.h (NONPOINTER_BITS): Modify the condition to define to zero
+       for MinGW, since it no longer uses gmalloc.
 
-       * frame.c (x_set_frame_parameters): Don't read uninitialized storage.
+       * buffer.c: Do not define mmap allocations functions for Windows.
+       Remove mmap_find which is unused. Remove mmap_set_vars which does
+       nothing useful.
+       [WINDOWSNT]: Include w32heap.h.
+       (init_buffer): Always allocate new memory for buffers.
 
-2014-06-01  Jan Djärv  <jan.h.d@swipnet.se>
+       * emacs.c: Remove mmap_set_vars calls.
 
-       * xterm.c (xg_scroll_callback): Remove position, for jump set portion
-       to min(value, whole).
+       * image.c (free_image): Undef free for Windows because it is
+       redirected to our private version.
 
-2014-06-01  Paul Eggert  <eggert@cs.ucla.edu>
+       * unexw32.c (COPY_PROC_CHUNK): Use %p format for 64bits compatibility.
+       (copy_executable_and_dump_data): Remove dumping the heap section.
+       (unexec): Restore using_dynamic_heap after dumping.
 
-       Bring back the changes to GDB-visible symbols, but only on AIX.
-       And only if it's not pre-4.2 GCC.
-       * lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): New macros.
-       (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them.
-       (ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
-       New macros.
+       * w32heap.c (dumped_data_commit, malloc_after_dump)
+       (malloc_before_dump, realloc_after_dump, realloc_before_dump)
+       (free_after_dump, free_before_dump, mmap_alloc, mmap_realloc)
+       (mmap_free): New functions.
 
-2014-05-31  Eli Zaretskii  <eliz@gnu.org>
+       * w32heap.h: Declare dumped_data and mmap_* function prototypes.
 
-       * fileio.c (Finsert_file_contents): Call prepare_to_modify_buffer
-       with PT, not GPT.  (Bug#16433)
+2014-05-27  Paul Eggert  <eggert@cs.ucla.edu>
 
-       Revert last changes to GDB-visible symbols.
-       * lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): Delete macros.
-       (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Don't use them.
-       (ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
-       Delete macros.
+       * image.c (imagemagick_load_image): Use MagickRealType for local
+       'color_scale', instead of double, to avoid a GCC warning about
+       double promotion.
 
-2014-05-31  Glenn Morris  <rgm@gnu.org>
+       * xfns.c (Fx_window_property): Remove unused local.
 
-       * cmds.c (Fself_insert_command): Allow zero repeat count.  (Bug#17649)
+       Don't kill already-reaped process (Bug#17561).
+       * process.c (process_send_signal): Fix race condition where a
+       subprocess was reaped by a signal handler between the check for
+       liveness and calling 'kill', which meant that Emacs could in
+       theory kill an innocent bystander process.  Do the fix by blocking
+       SIGCHLD in a critical section that checks liveness before killing.
 
-2014-05-30  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
-       Fix port to 32-bit AIX with xlc (Bug#17598).
-       * alloc.c (gdb_make_enums_visible): Remove FLOAT_TO_STRING_BUFSIZE.
-       * conf_post.h (FLEXIBLE_ARRAY_MEMBER) [__IBMC__]: Don't define to empty.
-       * lisp.h (FLOAT_TO_STRING_BUFSIZE): Make it a macro, instead of an enum,
-       to work around a compiler bug in IBM xlc 12.1.
+       * w32.c (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT): Define only if undefined.
 
-2014-05-29  Eli Zaretskii  <eliz@gnu.org>
+2014-05-26  Ken Brown  <kbrown@cornell.edu>
 
-       * xterm.c (x_update_window_end): Don't invalidate the entire
-       mouse-highlight info, just signal frame_up_to_date_hook that mouse
-       highlight needs to be redisplayed.  (Bug#17588)
+       * w32term.c (x_delete_display): Don't free dpyinfo->w32_id_name,
+       even if !CYGWIN (see bug#17510).
 
-2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-26  Jan Djärv  <jan.h.d@swipnet.se>
 
-       Port the GDB-visible symbols to AIX.
-       Without them, GDB doesn't work to debug Emacs, since the AIX linker
-       optimizes away the relevant external symbols.  Use enums instead;
-       this suffices for the AIX port, which is 32-bit-only anyway.
-       * lisp.h (ENUMABLE, DEFINE_GDB_SYMBOL_ENUM): New macros.
-       (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them.
-       (ARRAY_MARK_FLAG_val, PSEUDOVECTOR_FLAG_val, VALMASK_val):
-       New macros.
+       * nsfns.m (Fns_do_applescript): Surround NSApp run
+       with calls to ns_init_events, ns_finish_events (Bug#17424).
 
-2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
+       * nsterm.h (ns_init_events, ns_finish_events): Declare.
 
-       Include sources used to create macuvs.h.
-       * Makefile.in ($(srcdir)/macuvs.h): New rule.
-       * macuvs.h: Use automatically-generated header.
+       * nsterm.m (ns_init_events, ns_finish_events): New functions.
+       (ns_read_socket, ns_select): Call ns_init_events, ns_finish_events.
 
-2014-05-25  Eli Zaretskii  <eliz@gnu.org>
+       * nsfns.m (ns_do_applescript): Surround executeAndReturnError
+       with calls to ns_init_events, ns_finish_events (Bug#17424).
+
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (move_it_in_display_line_to): Don't record wrap position
        if we are iterating over an object that generates glyphs for
        marginal areas.  (Bug#17585)
 
-2014-05-24  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        * xdisp.c (safe__call1, safe__eval): Now static.
 
-2014-05-24  Eli Zaretskii  <eliz@gnu.org>
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (safe__call): Accept va_list argument instead of '...'.
        (safe_call, safe__call1): Construct a va_list argument for safe_call.
        (safe_call1): Call safe_call instead of safe__call directly.
 
-2014-05-24  Ken Brown  <kbrown@cornell.edu>
+2014-05-26  Ken Brown  <kbrown@cornell.edu>
 
        * w32term.c (x_delete_display) [CYGWIN]: Don't free
        dpyinfo->w32_id_name, to make sure it doesn't get freed more than
        once.  (Bug#17510)
 
-2014-05-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-05-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * xdisp.c: Bind inhibit-quit during pre-redisplay-function.
        (safe__call, safe__call1, safe__eval): New functions.
        (prepare_menu_bars): Use it for pre-redisplay-function (bug#17577).
        (display_mode_element): Same for `:eval'.
 
-2014-05-22  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix port to 32-bit AIX (Bug#17540).
        * unexaix.c (copy_text_and_data): Don't add text_scnptr to ptr
        twice.  _text already includes this offset.
        (unrelocate_symbols): Don't cast 64-bit integer to pointer.
 
-2014-05-21  Eli Zaretskii  <eliz@gnu.org>
+2014-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (move_it_in_display_line_to): Avoid infinite recursion:
        when closest_pos is identical to to_charpos, don't recurse, since
        we already tried that, and failed.  (Bug#17539)
 
-2014-05-20  Eli Zaretskii  <eliz@gnu.org>
-
        * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: If we are
        unwinding when frame's faces were not initialized yet, increment
        the frame's image-cache reference count before calling
        x_free_frame_resources.  Don't dereference
        dpyinfo->terminal->image_cache if it is NULL.  (Bug#17524)
 
-2014-05-11  Glenn Morris  <rgm@gnu.org>
+2014-05-25  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsfont.m (nsfont_draw): Simplify as arguments are adjusted in
+       nsterm.m now.
+
+       * nsterm.m (ns_draw_glyph_string): Move isComposite and end from
+       macfont.m, call draw with adjusted arguments so font drivers
+       don't need to do that.
+
+       * macfont.m (macfont_draw): Merge changes from Macport.
+
+2014-05-24  Eli Zaretskii  <eliz@gnu.org>
+
+       * alloc.c (garbage_collect_1): New function, with all of the guts
+       of Fgarbage_collect.
+       (mark_stack): Accept an argument END and don't mark Lisp objects
+       on the stack beyond the address given by END.  Calculation of END
+       was moved to Fgarbage_collect.
+       (Fgarbage_collect): Calculate the end address of the stack portion
+       that needs to be examined by mark_stack, and pass that address to
+       garbage_collect_1, which will pass it to mark_stack.
+       See http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00270.html
+       for more details about the underlying problems.  In particular,
+       this avoids dumping Emacs with the large hash-table whose value is
+       held in purify-flag for most of the time loadup.el runs.
+
+2014-05-24  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * xfns.c (x_window_property_intern): New function (code from
+       x_window_property).
+       (Fx_window_property): Call x_window_property_intern.  If property
+       not found and NILP (source) and outer window != inner window,
+       check outer window for property (Bug#17537).
+
+2014-05-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Supply malloc and alloc_size attributes for extern allocators.
+       This documents the C API, and helps GCC generate a bit better code.
+       * conf_post.h (ATTRIBUTE_MALLOC, ATTRIBUTE_ALLOC_SIZE)
+       (ATTRIBUTE_MALLOC_SIZE): New macros.
+       * gmalloc.c (malloc, realloc, calloc):
+       * gtkutil.h (malloc_widget_value):
+       * lisp.h (ralloc, r_re_alloc, xmalloc, xzalloc, xrealloc, xnmalloc)
+       (xnrealloc, xstrdup, xlispstrdup, record_xmalloc):
+       Use them.
+
+2014-05-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't assume that ImageMagick uses a 16-bit quantum (Bug#17519).
+       * image.c (imagemagick_load_image): Port to hosts that do not use
+       a 16-bit quantum, i.e., QuantumRange does not equal 65535.
+
+2014-05-21  Leo Liu  <sdl.web@gmail.com>
+
+       * fns.c (Fnreverse): Accept strings for SEQ and update doc-string.
+
+2014-05-20  Michael Albinus  <michael.albinus@gmx.de>
+
+       * dbusbind.c (xd_signature): Revert last 2 patches.
+
+2014-05-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Allow any non-nil value to count as true in bool-vector.
+       Likewise for xd_signature in dbusbind.c.
+       This is more consistent with the usual practice in Emacs, which is
+       that any non-nil value counts as true.
+       * alloc.c (Fbool_vector): Don't require args to be t or nil.
+       * dbusbind.c (xd_signature): Likewise, for booleans.
+       * data.c, lisp.h (Qbooleanp):
+       * lisp.h (CHECK_BOOLEAN): Remove.  All uses removed.
+
+2014-05-19  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lisp.h (CHECK_BOOLEAN): New function.
+       * alloc.c (Fbool_vector): New function.
+       (syms_of_alloc): Defsubr it.
+       * data.c (Qbooleanp): New symbol.
+       (syms_of_data): DEFSYM it.
+       * dbusbind.c (xd_signature): Use CHECK_BOOLEAN.
+
+       * font.c (font_matching_entity): Extract font-entity object
+       from the vector of matching entities (Bug#17486).
+
+2014-05-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Assume C99 or later (Bug#17487).
+       * bytecode.c (B__dummy__): Remove.
+       * conf_post.h (bool_bf) [!NS_IMPL_GNUSTEP]: Use bool.
+       (FLEXIBLE_ARRAY_MEMBER): Now always empty.
+       * dbusbind.c (XD_DEBUG_MESSAGE) [!DBUS_DEBUG]:
+       * regex.c (DEBUG_PRINT): Assume varargs macros.
+       * lisp.h (DEFUN_FUNCTION_INIT): Remove.  All uses now assume C99.
+
+2014-05-17  Fabrice Popineau  <fabrice.popineau@gmail.com>
+
+       * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Always map new
+       memory for every buffer that was dumped.
+
+2014-05-15  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * fns.c (Freverse): Allow vectors, bool vectors and strings.
+       (Fnreverse): Allow vectors and bool vectors.
+
+2014-05-14  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Minor cleanup for terminal setup.
+       * termhooks.h (create_terminal): Adjust prototype.
+       * terminal.c (create_terminal): Pass output method and RIF as args.
+       (init_initial_terminal):
+       * nsterm.m (ns_create_terminal):
+       * term.c (init_tty):
+       * w32term.c (w32_create_terminal):
+       * xterm.c (x_create_terminal): Adjust users.
+       Avoid redundant NULL initializers and add comments.
+
+2014-05-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * keyboard.c (Qdeactivate_mark): Now static.
+
+2014-05-13  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       If available, use Xfixes extension to do pointer blanking.
+       * Makefile.in (XFIXES_CFLAGS, XFIXES_LIBS): New var.
+       * xfns.c (x_set_mouse_color): Do not call make_invisible_cursor here.
+       (make_invisible_cursor): Move to...
+       * xterm.c (make_invisible_cursor): ...here.
+       (x_probe_xfixes_extension, xfixes_toggle_visible_pointer)
+       (x_toggle_visible_pointer, x_setup_pointer_blanking): New functions.
+       (x_term_init): Call to x_setup_pointer_blanking.
+       (XTtoggle_invisible_pointer): Use blanking specific to this display.
+       * xterm.h (struct x_display_info): New member toggle_visible_pointer.
+
+2014-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * xdisp.c (draw_glyphs): Set clipping to highlight boundaries.
+
+2014-05-12  Glenn Morris  <rgm@gnu.org>
 
        * fileio.c (Ffile_executable_p): Doc tweak.
 
-2014-05-10  Jan Djärv  <jan.h.d@swipnet.se>
+2014-05-12  Jan Djärv  <jan.h.d@swipnet.se>
 
        * xsettings.c (init_gsettings): Use g_settings_schema_source_lookup
        instead of deprecated g_settings_list_schemas if possible (Bug#17434).
 
-2014-05-07  Paul Eggert  <eggert@cs.ucla.edu>
+2014-05-08  Paul Eggert  <eggert@cs.ucla.edu>
 
        * minibuf.c (read_minibuf): Avoid C99ism in previous patch (Bug#17430).
 
-2014-05-07  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+2014-05-08  Jarek Czekalski  <jarekczek@poczta.onet.pl>
 
        Fix initialization of minibuffer history variable (Bug#17430).
        * minibuf.c (read_minibuf): Initialize histval to Qnil if unbound.
        Move the initialization up to prevent any "value void" message.
 
-2014-05-06  Samuel Bronson  <naesten@gmail.com>
+2014-05-08  Samuel Bronson  <naesten@gmail.com>
 
        * keyboard.c (Frecursive_edit): Ensure inc&dec of command_loop_level
        are matched (bug#17413).
 
-2014-05-06  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+2014-05-08  Jarek Czekalski  <jarekczek@poczta.onet.pl>
 
        Stop tooltips pulling Emacs window to front (Bug#17408).
        * w32fns.c (Fx_show_tip): Add SWP_NOOWNERZORDER flag to
        SetWindowPos invocations.
 
-2014-05-05  Jan Djärv  <jan.h.d@swipnet.se>
+2014-05-08  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsselect.m (Fx_selection_exists_p): Just return Qnil if window system
        not initialized (Bug#17398).
 
+2014-05-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * image.c: Include <png.h> before <setjmp.h> (Bug#17429).
+
+2014-05-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * image.c: Do not use libpng if HAVE_NS, as NS does its own thing.
+       [HAVE_NS]: Do not include png.h.
+       (x_query_frame_background_color): New function.
+       (png_load_body, imagemagick_load_image, svg_load_image): Use it.
+       (png_load_body): Coalesce duplicate code.
+
 2014-05-04  Paul Eggert  <eggert@cs.ucla.edu>
 
-       Revert recent libpng changes (Bug#17339).
-       * Makefile.in (PNG_CFLAGS): Remove; all uses removed.
-       * image.c [HAVE_LIBPNG_PNG_H]: Include <libpng/png.h>, not <png.h>.
+       Consult libpng-config more consistently (Bug#17339).
+       * Makefile.in (PNG_CFLAGS): New var.
+       (ALL_CFLAGS): Use it.
+       * image.c [HAVE_PNG]: Don't worry about <libpng/png.h>, as
+       CFLAGS now handles this.
 
 2014-05-03  Paul Eggert  <eggert@cs.ucla.edu>
 
 
        * buffer.c (overlay_strings): Fix the wording of the commentary.
 
-2014-05-02  Paul Eggert  <eggert@cs.ucla.edu>
-
-       Consult libpng-config more consistently (Bug#17339).
-       * Makefile.in (PNG_CFLAGS): New var.
-       (ALL_CFLAGS): Use it.
-       * image.c [HAVE_PNG]: Don't worry about <libpng/png.h>, as
-       CFLAGS now handles this.
-
 2014-05-01  Glenn Morris  <rgm@gnu.org>
 
        * floatfns.c (Fisnan):
        GCC 4.9.0 warned about this, and I couldn't easily prove to my own
        satisfaction that they would always be initialized.
 
-2014-04-29  Eli Zaretskii  <eliz@gnu.org>
+2014-04-30  Eli Zaretskii  <eliz@gnu.org>
 
-       * term.c (tty_menu_display): Move the cursor to the active menu
-       item.
+       * term.c (tty_menu_display): Move the cursor to the active menu item.
        (tty_menu_activate): Return the cursor to the active menu item
-       after displaying the menu and after displaying help-echo.  See
-       http://lists.gnu.org/archive/html/emacs-devel/2014-04/msg00402.html
+       after displaying the menu and after displaying help-echo.
+       See http://lists.gnu.org/archive/html/emacs-devel/2014-04/msg00402.html
        for the details of why this is needed by screen readers and
        Braille displays.
 
-2014-04-29  Glenn Morris  <rgm@gnu.org>
+2014-04-30  Glenn Morris  <rgm@gnu.org>
 
        * process.c (handle_child_signal):
        Handle systems without WCONTINUED.  (Bug#15110, 17339)
 
-2014-04-23  Eli Zaretskii  <eliz@gnu.org>
+2014-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * window.c (struct saved_window): Remove mark.
+       (Fset_window_configuration, save_window_save)
+       (compare_window_configurations): Don't touch marks any more.
+
+2014-04-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use bits_word for gcmarkbits.
+       * alloc.c (struct cons_block, struct float_block): On 64-bit hosts,
+       bits_word is typically a tad more efficient for mark bits than
+       unsigned is, so use bits_word.  All uses changed.
+       * lisp.h (BITS_PER_INT): Remove; no longer used.
+
+       Avoid undefined behavior in signed left shift.
+       This ports to GCC 4.9.0 with -fsanitize=undefined.
+       * alloc.c (bool_vector_fill, SETMARKBIT, UNSETMARKBIT):
+       * data.c (Fash):
+       * regex.c (extract_number):
+       * lisp.h (make_number, XINT):
+       Do not shift a 1 bit left into a sign bit.
+       * alloc.c (struct cons_block, struct float_block): Use unsigned,
+       not int, for gcmarkbits.  All uses changed.
+
+2014-04-25  Eli Zaretskii  <eliz@gnu.org>
 
        * search.c (Fnewline_cache_check): Don't try to count newlines
        outside the buffer's restriction, as find_newline doesn't support that.
 
+2014-04-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * window.c (Fset_window_configuration): Deactivate the mark before
+       unsetting the mark.
+       (set_window_buffer): Ignore window_initialized.
+       (window_initialized): Remove.
+       * keyboard.c (Qdeactivate_mark): Not static any more.
+       * buffer.c (buffer_local_value): Rename from buffer_local_value_1.
+       Update all callers.
+
+2014-04-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * conf_post.h (ADDRESS_SANITIZER_WORKAROUND): Port to GCC 4.9.0
+       and to clang 3.4, which have fixed the bug.  This should let us
+       run a bit faster on these platforms when address sanitization is
+       in effect.
+
 2014-04-22  Paul Eggert  <eggert@cs.ucla.edu>
 
        Port to GCC 4.9.0 with --enable-gcc-warnings.
        (Fnewline_cache_check): New function.
        (syms_of_search): Defsubr it.
 
-2014-04-21  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+2014-04-22  Jarek Czekalski  <jarekczek@poczta.onet.pl>
 
        Fix freezing with scroll bars of GTK3 Toolkit (bug#15801).
        * keyboard.c (unblock_input): Add comment.
        * xgselect.c (xg_select): Prevent Glib main loop recursion.
 
+2014-04-22  Daniel Colascione  <dancol@dancol.org>
+
+       * lread.c (readevalloop_eager_expand_eval): New function
+       that can recurse into toplevel forms.
+       (readevalloop): Call it.
+       * lisp.h: Declare Qprogn.
+       * callint.c (Qprogn): No longer static.
+
 2014-04-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * intervals.c (rotate_right, rotate_left): Fix up length computation.
        Also change identifiers to match the comments, and add more assertions
        (bug#16234).
 
-2014-04-18  Eli Zaretskii  <eliz@gnu.org>
-
-       * xdisp.c (insert_left_trunc_glyphs): Ensure the left truncation
-       glyph is written to TEXT_AREA of the temporary glyph_row.
-       (Bug#17288)
-
 2014-04-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        * emacs.c (close_output_streams): Don't clear and restore errno.
 
-2014-04-17  Jan Djärv  <jan.h.d@swipnet.se>
+2014-04-18  Jan Djärv  <jan.h.d@swipnet.se>
 
        * xterm.c (x_make_frame_visible): Prevent endless loop when frame
        never becomes visible, i.e. using XMonad  (Bug#17237).
 
-2014-04-17  Eli Zaretskii  <eliz@gnu.org>
+2014-04-18  Eli Zaretskii  <eliz@gnu.org>
 
-       * xdisp.c (Fline_pixel_height): Don't assume that the current
-       buffer and the selected window's buffer are one and the same.
-       (Bug#17281)
+       * xdisp.c (insert_left_trunc_glyphs): Ensure the left truncation
+       glyph is written to TEXT_AREA of the temporary glyph_row.  (Bug#17288)
+       (Fline_pixel_height): Don't assume that the current buffer and the
+       selected window's buffer are one and the same.  (Bug#17281)
 
        * insdel.c (invalidate_buffer_caches): Invalidate the bidi
        paragraph-start cache before the newline cache.  (Bug#17269)
 
+2014-04-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * term.c (tty_send_additional_strings): No need to fflush here,
+       as callers fflush.
+       (tty_set_terminal_modes): fflush after sending additional strings,
+       not before.
+
+2014-04-17  Daniel Colascione  <dancol@dancol.org>
+
+       * term.c (Qtty_mode_set_strings, Qtty_mode_reset_strings):
+       New symbols.
+       (tty_send_additional_strings): New function.
+       (tty_set_terminal_modes, tty_reset_terminal_modes): Use it.
+       (syms_of_term): Intern tty-mode-set-strings and
+       tty-mode-reset-strings.
+
 2014-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * window.c (save_window_save): Lookup window_point_insertion_type in
        Move vfork-related portions under #ifndef MSDOS.
        (syms_of_callproc): Unify templates of MSDOS and WINDOWSNT.
 
-2014-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * buffer.c (Foverlays_at): Add argument `sorted'.
 
-2014-04-14  Eli Zaretskii  <eliz@gnu.org>
+2014-04-16  Eli Zaretskii  <eliz@gnu.org>
 
        * insdel.c (invalidate_buffer_caches): When deleting or replacing
        text, invalidate the bidi_paragraph_cache upto and including the
        preceding newline.
 
-2014-04-13  Paul Eggert  <eggert@cs.ucla.edu>
+2014-04-16  Paul Eggert  <eggert@cs.ucla.edu>
 
        Port to IRIX 6.5 (Bug#9684).
-       * alloc.c (TAGGABLE_NULL): New constant,
-       for porting to hosts with nontrivial DATA_SEG_BITS settings.
-       (next_vector, set_next_vector): Use it.
        * conf_post.h (INET6) [IRIX6_5]: Define.
        (HAVE_GETADDRINFO) [IRIX6_5]: Undef.
        * data.c (BITS_PER_ULL): Don't assume ULLONG_MAX is defined.
-       * lisp.h (lisp_h_XPNTR): Don't OR in bits that aren't masked out,
-       for consistency with how TAGGABLE_NULL is computed.
 
-2014-04-13  Eli Zaretskii  <eliz@gnu.org>
+2014-04-16  Eli Zaretskii  <eliz@gnu.org>
 
        * keyboard.c (Fopen_dribble_file): Encode the dribble file-name
        before passing it to system APIs.
 
-       * puresize.h (BASE_PURESIZE): Bump by 1K.  (Bug#17255)
-
-2014-04-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-04-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * bytecode.c (exec_byte_code): Rework the volatiles.  Most importantly,
        make sure stack.byte_string_start is not de-adjusted by pushhandler.
 
-2014-04-12  Paul Eggert  <eggert@cs.ucla.edu>
+2014-04-16  Paul Eggert  <eggert@cs.ucla.edu>
 
        * keyboard.c (Fopen_dribble_file): Avoid some races.  (Bug#17187)
 
+2014-04-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Remove DATA_SEG_BITS.
+       The DATA_SEG_BITS hack was needed for older 32 bit platforms.
+       As a result of this change, Emacs won't work on IRIX 6.5 with IRIX
+       cc, but that platform is so old that SGI itself stopped supporting
+       it in December 2013.  If you still need Emacs on IRIX, please
+       either compile with GCC and port the undumping code, or run
+       './configure --with-wide-int'.
+       * alloc.c (gdb_make_enums_visible): Update to match lisp.h.
+       * lisp.h (GCTYPEBITS): Move definition up, and switch to the
+       DEFINE_GDB_SYMBOL_START way to define it.
+       (NONPOINTER_BITS): New macro.
+       (EMACS_INT): Use it.
+       [!USE_LSB_TAG && !WIDE_EMACS_INT]: Fail, and suggest reporting
+       the problem and/or configuring --with-wide-int.
+       (USE_LSB_TAG): Simplify, based on above changes.
+       (gdb_DATA_SEG_BITS): Remove.  All uses removed.
+       * vm-limit.c (exceeds_lisp_ptr): Remove.  All uses removed.
+
 2014-04-12  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (move_it_by_lines): If a large portion of buffer text is
        * indent.c (Fvertical_motion): Handle correctly the case when the
        display string is preceded by an empty line.
 
-2014-04-11  Eli Zaretskii  <eliz@gnu.org>
-
        * w32.c (sys_umask) <WRITE_USER>: Remove redundant constant, and
        use S_IWRITE instead.
 
 
        * keyboard.c (Fopen_dribble_file): Make file private.  (Bug#17187)
 
-2014-04-09  Ken Brown  <kbrown@cornell.edu>
+2014-04-11  Ken Brown  <kbrown@cornell.edu>
 
        * Makefile.in (EMACS_MANIFEST): Revert last change.
 
+2014-04-10  Daniel Colascione  <dancol@dancol.org>
+
+       * puresize.h (BASE_PURESIZE): Increase.
+
+2014-04-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * keyboard.c (syms_of_keyboard): Make deactivate-mark buffer-local.
+
+       * insdel.c (prepare_to_modify_buffer_1): Cancel lock-file checks and
+       region handling (and don't call signal_before_change) if
+       inhibit_modification_hooks is set.
+       (signal_before_change): Don't check inhibit_modification_hooks any more.
+
+2014-04-08  Daniel Colascione  <dancol@dancol.org>
+
+       * alloc.c (sweep_symbols, mark_object): Assert that symbol
+       function cells contain valid lisp objects.  (Modified version of
+       patch from Dmitry).
+
+       * alloc.c (detect_suspicious_free): Split actual stack capturing
+       out into new function for easier breakpoint setting.
+       (note_suspicious_free): New function.
+
 2014-04-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * lisp.h (struct Lisp_Symbol): New bitfield `pinned'.
        (Fgarbage_collect): Use it.
        (gc_sweep): Remove hack made unnecessary.
 
-2014-04-05  Glenn Morris  <rgm@gnu.org>
+2014-04-07  Glenn Morris  <rgm@gnu.org>
 
        * keyboard.c (Fopen_dribble_file): Doc tweak.
 
-2014-04-04  Jan Djärv  <jan.h.d@swipnet.se>
+2014-04-07  Ken Brown  <kbrown@cornell.edu>
 
-       Backport from trunk.
-       * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool
-       bar is zero height, just return (Bug#16976).
-       (initFrameFromEmacs:): Initialize wait_for_tool_bar.
-       * nsterm.h (EmacsView): Add wait_for_tool_bar.
-       * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar
-       is nil.  If waiting for toolbar to complete, force a redraw.
-       (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976).
+       * Makefile.in (EMACS_MANIFEST): Update comment.  (Bug#17176)
 
-2014-04-03  Ken Brown  <kbrown@cornell.edu>
+2014-04-07  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * Makefile.in (EMACS_MANIFEST): Update comment.  (Bug#17176)
+       * alloc.c: Simplify by removing use of HAVE_EXECINFO_H.
+       We have a substitute execinfo.h on hosts that lack it.
+       (suspicious_free_history): Make it EXTERNALLY_VISIBLE so it
+       isn't optimized away.
+
+2014-04-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'.
+       * alloc.c (memory_full):
+       * charset.c (syms_of_charset):
+       * doc.c (Fsnarf_documentation):
+       * emacs.c (main):
+       * font.c (BUILD_STYLE_TABLE):
+       * keyboard.c (make_lispy_event):
+       * profiler.c (setup_cpu_timer):
+       * xgselect.c (xg_select):
+       * xterm.c (record_event, STORE_KEYSYM_FOR_DEBUG):
+       Use ARRAYELTS.
+       * font.c (FONT_PROPERTY_TABLE_SIZE): Remove.
+       Replace the only use with ARRAYELTS (font_property_table).
+       * xfaces.c (DIM): Remove.  All uses replaced by ARRAYELTS.
+
+2014-04-03  Daniel Colascione  <dancol@dancol.org>
+
+       * xterm.c (x_term_init):
+       * xfns.c (best_xim_style):
+       * xfaces.c (Fdump_colors):
+       * w32fns.c (w32_default_color_map):
+       * w32.c (init_environment, N_ENV_VARS):
+       * unexcw.c (read_exe_header):
+       * term.c (term_get_fkeys_1):
+       * sysdep.c (init_baud_rate):
+       * nsterm.m (ns_convert_key):
+       * nsfns.m (get_geometry_from_preferences):
+       * msdos.c (dos_set_window_size, init_environment):
+       * macfont.m (mac_font_get_glyph_for_cid)
+       (macfont_store_descriptor_attributes)
+       (macfont_create_attributes_with_spec, mac_ctfont_get_glyph_for_cid):
+       * keyboard.c (command_loop_1, read_menu_command, make_lispy_event)
+       (NUM_MOD_NAMES, read_key_sequence_vs, Fcurrent_input_mode)
+       (syms_of_keyboard):
+       * image.c (xpm_str_to_color_key):
+       * fringe.c (MAX_STANDARD_FRINGE_BITMAPS):
+       * frame.c (x_set_frame_parameters):
+       * fileio.c (Ffile_selinux_context):
+       * emacs.c (sort_args):
+       * dosfns.c (msdos_stdcolor_name):
+       * dired.c (file_attributes):
+       * chartab.c (uniprop_decoder_count, uniprop_encode_count):
+       Change expressions of the form sizeof(arr) / sizeof(arr[0])
+       to ARRAYELTS (arr).
+
+2014-04-02  Daniel Colascione  <dancol@dancol.org>
+
+       * data.c (Ffset): Abort if we're trying to set a function call to
+       a dead lisp object.
+
+       * lisp.h (ARRAYELTS): New macro.
+
+       * alloc.c: Include execinfo.h if available.
+       (SUSPICIOUS_OBJECT_CHECKING): New macro; define unconditionally.
+       (suspicious_free_record): New structure.
+       (suspicious_objects, suspicious_object_index)
+       (suspicious_free_history, suspicious_free_history_index):
+       New variables.
+       (find_suspicious_object_in_range, detect_suspicious_free)
+       (Fsuspicious_object): New functions.
+       (cleanup_vector): Call find_suspicious_object_in_range.
 
 2014-04-02  Martin Rudalics  <rudalics@gmx.at>
 
        * xterm.c (x_new_font): Don't calculate non-toolkit scrollbar
        width from font width (Bug#17163).
 
-2014-03-30  Martin Rudalics  <rudalics@gmx.at>
-
        * frame.c (x_set_frame_parameters): Calculate default values of
        new frame sizes only after all other frame parameters have been
        processed (Bug#17142).
 
-2014-03-28  Ken Brown  <kbrown@cornell.edu>
+2014-04-02  Ken Brown  <kbrown@cornell.edu>
 
        * conf_post.h (SYSTEM_PURESIZE_EXTRA) [CYGWIN]: Set to 10000.
        (Bug#17112)
 
-2014-03-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+2014-04-02  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * xterm.c (x_draw_image_glyph_string): Adjust image background
        width accordingly when its x position is adjusted.  (Bug#17115)
 
+2014-04-02  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * font.c (font_list_entities): Do not add empty vector to font cache.
+       (font_matching_entity): Likewise.  If matching entity is found, insert
+       1-item vector with this entity instead of entity itself (Bug#17125).
+
+       * xterm.c (x_term_init) [USE_LUCID]: Fix minor memory leak.
+
+2014-04-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fns.c (validate_subarray): Rename from validate_substring,
+       since it works for vectors too.  New arg ARRAY.  Optimize for the
+       non-nil case.  Instead of returning bool, throw an error if out of
+       range, so that the caller needn't do that.  All uses changed.
+       Report original values if out of range.
+       (Fsubstring, Fsubstring_no_properties, secure_hash):
+       Also optimize the case where FROM is 0 or TO is the size.
+
+2014-03-31  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * search.c (Freplace_match): Use make_specified_string.
+       * xterm.c, w32term.c (x_set_glyph_string_gc): Use emacs_abort
+       to catch bogus override face of glyph strings.
+       * fns.c (Fsubstring, Fsubstring_no_properties, secure_hash):
+       Move common substring range checking code to...
+       (validate_substring): ...this function.
+
+2014-03-31  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsmenu.m (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976)
+
+2014-03-30  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool
+       bar is zero height, just return (Bug#16976).
+       (initFrameFromEmacs:): Initialize wait_for_tool_bar.
+
+       * nsterm.h (EmacsView): Add wait_for_tool_bar.
+
+       * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar
+       is nil.  If waiting for toolbar to complete, force a redraw.
+
+2014-03-28  Glenn Morris  <rgm@gnu.org>
+
+       * emacs.c (emacs_version): Use PACKAGE_VERSION rather than VERSION.
+       (emacs_bugreport): New variable.
+       (usage_message): Use PACKAGE_BUGREPORT.
+       (syms_of_emacs) <report-emacs-bug-address>: New variable.
+
+       * emacs.c (syms_of_emacs) <system-configuration-features>: New var.
+
+2014-03-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port recent signal-related changes to FreeBSD.
+       Problem reported by Herbert J. Skuhra.
+       * lisp.h (block_tty_out_signal, unblock_tty_out_signal):
+       Move decls from here ...
+       * syssignal.h: ... to here, so that lisp.h doesn't depend on signal.h.
+
 2014-03-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * w32term.c (x_draw_image_glyph_string): Fix computation of height
        and width of image background when it is displayed with a 'box'
        face.  (Bug#17115)
 
-2014-03-26  Paul Eggert  <eggert@penguin.cs.ucla.edu>
+2014-03-27  Paul Eggert  <eggert@penguin.cs.ucla.edu>
 
        More backward-compatible fix to char-equal core dump (Bug#17011).
        * editfns.c (Fchar_equal): In unibyte buffers, assume values in
        range 128-255 are raw bytes.  Suggested by Eli Zaretskii.
 
+2014-03-27  Juanma Barranquero  <lekktu@gmail.com>
+
+       * image.c (init_svg_functions): When loading SVG-related libraries,
+       free already loaded libraries if the initialization fails.
+       (rsvg_handle_set_size_callback): Remove declaration, unused.
+
+2014-03-26  Paul Eggert  <eggert@cs.ucla.edu>
+
        Fix core dump in char-equal (Bug#17011).
        * editfns.c (Fchar_equal): Do not use MAKE_CHAR_MULTIBYTE in
        unibyte buffers, as we can't tell whether the characters are
 
        * insdel.c (adjust_markers_for_delete): Remove unused local.
 
-2014-03-24  Barry O'Reilly  <gundaetiapo@gmail.com>
+2014-03-26  Barry O'Reilly  <gundaetiapo@gmail.com>
 
        Have (MARKER . ADJUSTMENT) undo records always be immediately
        after their corresponding (TEXT . POS) record in undo list.
        (record_point): at_boundary calculation no longer needs to account
        for marker adjustments.
 
-2014-03-24  Martin Rudalics  <rudalics@gmx.at>
+2014-03-26  Martin Rudalics  <rudalics@gmx.at>
 
        * w32term.c (x_set_window_size): Refine fix from 2014-03-14
        (Bug#17077).
 
-2014-03-23  Glenn Morris  <rgm@gnu.org>
+2014-03-26  Glenn Morris  <rgm@gnu.org>
 
        * fileio.c (Ffile_symlink_p): Doc fix. (Bug#17073)
 
-2014-03-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-03-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * buffer.c (struct sortvec): Add field `spriority'.
        (compare_overlays): Use it.
        (sort_overlays): Set it.
 
-2014-03-23  Eli Zaretskii  <eliz@gnu.org>
+2014-03-26  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (redisplay_window): If all previous attempts to find the
        cursor row failed, try a few alternatives before falling back to
        the top-most row of the window.  Use row_containing_pos.  (Bug#17047)
 
-2014-03-22  Daniel Colascione  <dancol@dancol.org>
+2014-03-26  Juanma Barranquero  <lekktu@gmail.com>
 
-       * process.c (conv_sockaddr_to_lisp): When extracting the string
-       names of AF_LOCAL sockets, stop before reading uninitialized
-       memory.
+       * image.c (x_bitmap_height, x_bitmap_width) [HAVE_X_WINDOWS]:
+       * sysdep.c (reset_sigio) [!DOS_NT]: Declare conditionally.
+
+       * keyboard.c (read_decoded_event_from_main_queue): #ifdef out
+       variables on Windows.
+
+       * w32fns.c (Ffile_system_info): Use parenthesis in and/or expression.
+
+       * w32.c (unsetenv): Remove unused var `retval'.
+       (emacs_gnutls_pull): Remove unused vars `fdset' and `timeout'.
+
+       * w32notify.c (watch_worker): Remove unnecesary var sleep_result.
+       (start_watching): Remove unused var `thr'.
+
+       * w32proc.c (sys_spawnve): Comment out unused vars `first', `last'.
+       (find_child_console): Remove unnecesary var `thread_id'.
+
+       * w32term.c (w32_read_socket): Comment out unused vars `row', `columns'.
+       (x_focus_frame): #ifdef 0 unused variable `dpyinfo'.
+
+2014-03-26  Glenn Morris  <rgm@gnu.org>
+
+       * filelock.c (Flock_buffer): Doc tweak.
+
+       * buffer.c (Frestore_buffer_modified_p, Fkill_buffer):
+       * emacs.c (shut_down_emacs):
+       * fileio.c (Finsert_file_contents, write_region):
+       * filelock.c (top-level, syms_of_filelock):
+       * insdel.c (prepare_to_modify_buffer_1):
+       CLASH_DETECTION is always defined now.
+
+2014-03-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (w32_delayed_load): Call DisableThreadLibraryCalls on the
+       DLL handle, to speed up thread startup.
+
+2014-03-25  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Handle sigmask better with nested signal handlers  (Bug#15561).
+       * atimer.c (sigmask_atimers): Remove.
+       Remaining use rewritten to use body of this function.
+       * atimer.c (block_atimers, unblock_atimers):
+       * callproc.c (block_child_signal, unblock_child_signal):
+       * sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
+       New arg OLDSET.  All callers changed.
+       * atimer.c (block_atimers, unblock_atimers):
+       * callproc.c (block_child_signal, unblock_child_signal):
+       * keyboard.c (handle_interrupt):
+       * sound.c (vox_configure, vox_close):
+       Restore the old signal mask rather than unilaterally clearing bits
+       from the mask, in case a handler is running within another
+       handler.  All callers changed.
+       * lisp.h, process.c, process.h, term.c:
+       Adjust decls and callers to match new API.
+       * sysdep.c (emacs_sigaction_init): Don't worry about masking SIGFPE;
+       signal handlers aren't supposed to use floating point anyway.
+       (handle_arith_signal): Unblock just SIGFPE rather than clearing mask.
+
+2014-03-23  Daniel Colascione  <dancol@dancol.org>
+
+       Split gc_sweep into discrete functions for legibility and better
+       stack traces.
+
+       * alloc.c (sweep_strings, sweep_vectors): Add NO_INLINE
+       (sweep_vectors): Fix typo in comment.
+       (sweep_conses, sweep_floats, sweep_intervals)
+       (sweep_symbols, sweep_misc, sweep_buffers): New functions.
+       (gc_sweep): Call new functions, to which existing functionality is
+       moved.
+       * fns.c (sweep_weak_hash_tables): Add NO_INLINE.
+
+2014-03-23  Juanma Barranquero  <lekktu@gmail.com>
+
+       * w32fns.c (Fw32_shell_execute): Declare `result' only on Cygwin.
+
+2014-03-23  Daniel Colascione  <dancol@dancol.org>
+
+       * xfns.c (create_frame_xic): Pass XNStatusAttributes to XCreateIC
+       only if xic_style calls for it.  This change allows Emacs to work
+       with ibus.  Also, don't leak resources if create_frame_xic fails,
+       and stop caching xic_style across different displays.
+       (supported_xim_styles): Make const.
+       (best_xim_style): Remove first parameter: it's always just
+       supported_xim_styles.  Change to look at supported_xim_styles
+       directly.
+
+2014-03-23  Daniel Colascione  <dancol@dancol.org>
+
+       * term.c (init_tty): Rearrange condition for clarity; print
+       appropriate diagnostic.
 
 2014-03-23  Daniel Colascione  <dancol@dancol.org>
 
        * process.c (DATAGRAM_CONN_P): Don't underflow datagram_address
        array.  (ASAN caught.)
 
+2014-03-22  Glenn Morris  <rgm@gnu.org>
+
+       * callproc.c (init_callproc): In etc, look for NEWS rather than GNU.
+
+2014-03-22  Daniel Colascione  <dancol@dancol.org>
+
+       * process.c (conv_sockaddr_to_lisp): When extracting the string
+       names of AF_LOCAL sockets, stop before reading uninitialized memory.
+
 2014-03-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        Fix regression introduced by patch for Bug#10500.
        constrain frame size in SW_SHOWMAXIMIZED case so we can truly
        maximize a frame for odd default fonts.
 
+2014-03-21  Glenn Morris  <rgm@gnu.org>
+
+       * minibuf.c (history-length): Increase default from 30 to 100.
+
+2014-03-21  Daniel Colascione  <dancol@dancol.org>
+
+       * xterm.c (x_bitmap_icon): Stop reading the icon bitmap from disk
+       every time we switch to minibuffer.
+
+       * alloc.c (lisp_align_malloc, allocate_string_data)
+       (allocate_vectorlike): Allow mmap allocation of lisp objects.
+       (pointers_fit_in_lispobj_p, mmap_lisp_allowed_p): New functions.
+
+2014-03-21  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32fns.c (Fw32_shell_execute) [!CYGWIN]: Use ShellExecuteEx, to
+       support more "verbs".
+
+2014-03-21  Daniel Colascione  <dancol@dancol.org>
+
+       Always prohibit dumping a dumped Emacs.
+
+       * emacs.c (might_dump): New variable.
+       (Fdump_emacs): Always prohibit dumping of dumped Emacs.
+       * lisp.h (might_dump): Declare.
+       * unexcw.c (unexec): Remove now-redundant multiple-dump detection code.
+
 2014-03-20  Paul Eggert  <eggert@cs.ucla.edu>
 
        * doc.c (store_function_docstring): Fix pointer signedness mismatch.
index 70e31b50946fb71c10e923a75d74c4568542c207..0dc48868dd84bceb1812f3880d06d78f194c10a0 100644 (file)
@@ -1,7 +1,7 @@
 ### @configure_input@
 
-# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014 Free Software
-# Foundation, Inc.
+# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014
+#   Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -28,9 +28,10 @@ SHELL = @SHELL@
 # Here are the things that we expect ../configure to edit.
 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
 srcdir = @srcdir@
+top_srcdir = @top_srcdir@
 # MinGW CPPFLAGS may use this.
 abs_top_srcdir=@abs_top_srcdir@
-ntsource = $(srcdir)/../nt
+ntsource = $(top_srcdir)/nt
 VPATH = $(srcdir)
 CC = @CC@
 WINDRES = @WINDRES@
@@ -48,7 +49,7 @@ MKDIR_P = @MKDIR_P@
 # LIBS = @LIBS@
 LIBOBJS = @LIBOBJS@
 
-lispsource = $(srcdir)/../lisp
+lispsource = $(top_srcdir)/lisp
 lib = ../lib
 libsrc = ../lib-src
 etc = ../etc
@@ -77,6 +78,7 @@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
 C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
 
 GNUSTEP_CFLAGS=@GNUSTEP_CFLAGS@
+PNG_CFLAGS=@PNG_CFLAGS@
 
 ## Define C_SWITCH_X_SITE to contain any special flags your compiler
 ## may need to deal with X Windows.  For instance, if you've defined
@@ -121,7 +123,7 @@ LIBS_SYSTEM=@LIBS_SYSTEM@
 ## -lm, or empty.
 LIB_MATH=@LIB_MATH@
 
-## -lpthreads, or empty.
+## -lpthread, or empty.
 LIB_PTHREAD=@LIB_PTHREAD@
 
 LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@
@@ -230,6 +232,9 @@ XRANDR_CFLAGS = @XRANDR_CFLAGS@
 XINERAMA_LIBS = @XINERAMA_LIBS@
 XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
 
+XFIXES_LIBS = @XFIXES_LIBS@
+XFIXES_CFLAGS = @XFIXES_CFLAGS@
+
 ## widget.o if USE_X_TOOLKIT, otherwise empty.
 WIDGET_OBJ=@WIDGET_OBJ@
 
@@ -286,21 +291,14 @@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
 LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
 LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
 
-LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
-
 INTERVALS_H = dispextern.h intervals.h composite.h
 
 GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
 
 RUN_TEMACS = ./temacs
 
-## Invoke ../nt/addsection for MinGW, ":" elsewhere.
-TEMACS_POST_LINK = @TEMACS_POST_LINK@
-ADDSECTION = @ADDSECTION@
+## Static heap size for temacs on MinGW.
 EMACS_HEAPSIZE = @EMACS_HEAPSIZE@
-MINGW_TEMACS_POST_LINK = \
- mv temacs$(EXEEXT) temacs.tmp; \
- ../nt/addsection temacs.tmp temacs$(EXEEXT) EMHEAP $(EMACS_HEAPSIZE)
 
 UNEXEC_OBJ = @UNEXEC_OBJ@
 
@@ -322,10 +320,11 @@ MKDEPDIR=@MKDEPDIR@
 ##
 ## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
 ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \
-  -I$(lib) -I$(srcdir)/../lib \
+  -I$(lib) -I$(top_srcdir)/lib \
   $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
   $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \
-  $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \
+  $(PNG_CFLAGS) $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \
+  $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) $(XFIXES_CFLAGS) \
   $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
   $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \
   $(LIBGNUTLS_CFLAGS) $(GFILENOTIFY_CFLAGS) \
@@ -405,29 +404,29 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
    $(LIBX_OTHER) $(LIBSOUND) \
    $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \
    $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \
-   $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \
+   $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) $(XFIXES_LIBS) \
    $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
    $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
    $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
-   $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
+   $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) \
    $(GFILENOTIFY_LIBS) $(LIB_MATH) $(LIBZ)
 
 all: emacs$(EXEEXT) $(OTHER_FILES)
 .PHONY: all
 
 $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
-       cd ../leim && $(MAKE) $(MFLAGS) leim-list.el EMACS="$(bootstrap_exe)"
+       $(MAKE) -C ../leim leim-list.el EMACS="$(bootstrap_exe)"
 
 $(srcdir)/macuvs.h $(lispsource)/international/charprop.el: \
   bootstrap-emacs$(EXEEXT)
-       cd ../admin/unidata && $(MAKE) $(MFLAGS) all EMACS="../$(bootstrap_exe)"
+       $(MAKE) -C ../admin/unidata all EMACS="../$(bootstrap_exe)"
 
 ## The dumped Emacs is as functional and more efficient than
 ## bootstrap-emacs, so we replace the latter with the former.
 ## Strictly speaking, emacs does not depend directly on all of $lisp,
 ## since not all pieces are used on all platforms.  But DOC depends
 ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
-emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \
+emacs$(EXEEXT): temacs$(EXEEXT) \
                 $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \
                 $(lispsource)/international/charprop.el
        if test "$(CANNOT_DUMP)" = "yes"; then \
@@ -461,7 +460,7 @@ $(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
        $(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) `sed -n -e 's| \\\\||' -e 's|^[   ]*$$(lispsource)/||p' $(srcdir)/lisp.mk`
 
 $(libsrc)/make-docfile$(EXEEXT):
-       cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)
+       $(MAKE) -C $(libsrc) make-docfile$(EXEEXT)
 
 buildobj.h: Makefile
        for i in $(ALLOBJS); do \
@@ -476,13 +475,13 @@ GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
 
 gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
        $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl.tmp
-       $(srcdir)/../build-aux/move-if-change gl.tmp globals.h
+       $(top_srcdir)/build-aux/move-if-change gl.tmp globals.h
        echo timestamp > $@
 
 $(ALLOBJS): globals.h
 
 $(lib)/libgnu.a: $(config_h)
-       cd $(lib) && $(MAKE) libgnu.a
+       $(MAKE) -C $(lib) libgnu.a
 
 ## We have to create $(etc) here because init_cmdargs tests its
 ## existence when setting Vinstallation_directory (FIXME?).
@@ -493,7 +492,6 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
        $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
          -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
        $(MKDIR_P) $(etc)
-       $(TEMACS_POST_LINK)
        test "$(CANNOT_DUMP)" = "yes" || \
          test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
        test "$(CANNOT_DUMP)" = "yes" || test -z "$(SETFATTR)" || \
@@ -502,37 +500,40 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
 ## The following oldxmenu-related rules are only (possibly) used if
 ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them.
 $(lwlibdir)/liblw.a: $(config_h) globals.h lisp.h FORCE
-       cd $(lwlibdir) && \
-         $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' \
-           liblw.a
+       $(MAKE) -C $(lwlibdir) liblw.a
 $(oldXMenudir)/libXMenu11.a: FORCE
-       cd $(oldXMenudir) && \
-         $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' \
-           libXMenu11.a
+       $(MAKE) -C $(oldXMenudir) libXMenu11.a
 FORCE:
 .PHONY: FORCE
 
-../config.status: config.in epaths.in
-       @echo "The file ${?:.in=.h} needs to be set up from $?."
-       @echo "Please run the 'configure' script again."
-       exit 1
+ACLOCAL_INPUTS = $(top_srcdir)/configure.ac $(wildcard $(top_srcdir)/m4/*.m4)
+AUTOCONF_INPUTS = $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
+$(top_srcdir)/aclocal.m4: $(ACLOCAL_INPUTS)
+$(top_srcdir)/configure config.in: $(AUTOCONF_INPUTS)
+.PRECIOUS: ../config.status Makefile
+../config.status: $(top_srcdir)/configure $(top_srcdir)/lisp/version.el
+Makefile: ../config.status $(srcdir)/Makefile.in
+$(top_srcdir)/aclocal.m4 $(top_srcdir)/configure config.in ../config.status \
+  Makefile:
+       $(MAKE) -C .. am--refresh
 
 doc.o: buildobj.h
 
 emacs.res: $(ntsource)/emacs.rc \
           $(ntsource)/icons/emacs.ico \
           $(ntsource)/$(EMACS_MANIFEST)
-       $(WINDRES) -O COFF --include-dir=$(srcdir)/../nt \
+       $(WINDRES) -O COFF --include-dir=$(top_srcdir)/nt \
          -o $@ $(ntsource)/emacs.rc
 
+.PHONY: ns-app
 ns-app: emacs$(EXEEXT)
-       cd ../nextstep && $(MAKE) $(MFLAGS) all
+       $(MAKE) -C ../nextstep all
 
 .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
 .PHONY: versionclean extraclean
 
 mostlyclean:
-       rm -f temacs$(EXEEXT) core *.core \#* *.o libXMenu11.a liblw.a
+       rm -f temacs$(EXEEXT) core *.core \#* *.o
        rm -f ../etc/DOC
        rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT)
        rm -f buildobj.h
@@ -585,10 +586,10 @@ TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(srcdir)/$(ctagsfiles3)
 ## Arrange to make tags tables for ../lisp and ../lwlib,
 ## which the above TAGS file for the C files includes by reference.
 ../lisp/TAGS:
-       cd ../lisp && $(MAKE) TAGS ETAGS="$(ETAGS)"
+       $(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)"
 
 $(lwlibdir)/TAGS:
-       cd $(lwlibdir) && $(MAKE) TAGS ETAGS="$(ETAGS)"
+       $(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)"
 
 tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS
 .PHONY: tags
@@ -601,47 +602,34 @@ tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS
 ## such as loaddefs.el or *.elc can typically be produced by any old
 ## Emacs executable, so we would like to avoid rebuilding them whenever
 ## we build a new Emacs executable.
+##
+## (In other words, changing a single file src/foo.c would force
+## dumping a new bootstrap-emacs, then re-byte-compiling all preloaded
+## elisp files, and only then dump the actual src/emacs, which is not
+## wrong, but is overkill in 99.99% of the cases.)
+##
 ## To solve the circularity, we use 2 different Emacs executables,
 ## "emacs" is the main target and "bootstrap-emacs" is the one used
 ## to build the *.elc and loaddefs.el files.
-## To solve the freshness issue, we used to use a third file "witness-emacs"
-## which was used to witness the fact that there is a bootstrap-emacs
-## executable, and then have dependencies on witness-emacs rather than
-## bootstrap-emacs, but that lead to problems in parallel builds (because
-## witness-emacs needed to be free from dependencies (to avoid rebuilding
-## it), so it was compiled in parallel, leading typically to having 2
-## processes dumping bootstrap-emacs at the same time).
-## So instead, we replace the witness-emacs dependencies by conditional
-## bootstrap-dependencies (via $(BOOTSTRAPEMACS)).  Of course, since we do
-## not want to rely on GNU Make features, we have to rely on an external
-## script to do the conditional part of the dependency
-## (i.e. see the $(SUBDIR) rule ../Makefile.in).
-
-.SUFFIXES: .elc .el
-
-## These suffix rules do not allow additional dependencies, sadly, so
-## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
-## separately below.
-## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)"
-.el.elc:
-       @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
-                            THEFILE=$< EMACS="$(bootstrap_exe)"
-
-## Since the .el.elc rule cannot specify an extra dependency, we do it here.
-$(lisp): $(BOOTSTRAPEMACS)
+## To solve the freshness issue, in the past we tried various clever tricks,
+## but now that we require GNU make, we can simply specify
+## bootstrap-emacs$(EXEEXT) as an order-only prerequisite.
+
+%.elc: %.el | bootstrap-emacs$(EXEEXT)
+       @$(MAKE) -C ../lisp compile-onefile THEFILE=$< EMACS="$(bootstrap_exe)"
 
 ## VCSWITNESS points to the file that holds info about the current checkout.
 ## We use it as a heuristic to decide when to rebuild loaddefs.el.
 ## If empty it is ignored; the parent makefile can set it to some other value.
 VCSWITNESS =
 
-$(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS)
-       cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS="$(bootstrap_exe)"
+$(lispsource)/loaddefs.el: $(VCSWITNESS) | bootstrap-emacs$(EXEEXT)
+       $(MAKE) -C ../lisp autoloads EMACS="$(bootstrap_exe)"
 
 ## Dump an Emacs executable named bootstrap-emacs containing the
 ## files from loadup.el in source form.
 bootstrap-emacs$(EXEEXT): temacs$(EXEEXT)
-       cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
+       $(MAKE) -C ../lisp update-subdirs
        if test "$(CANNOT_DUMP)" = "yes"; then \
          rm -f bootstrap-emacs$(EXEEXT); \
          ln temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
@@ -651,7 +639,7 @@ bootstrap-emacs$(EXEEXT): temacs$(EXEEXT)
          mv -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
        fi
        @: Compile some files earlier to speed up further compilation.
-       cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS="$(bootstrap_exe)"
+       $(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)"
 
 ## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
 @deps_frag@
index a3f3f5478cb75f018c2c7537dd26feff3396806b..a8ad44491fad7f3ba8318a5ed8597d04a1a18288 100644 (file)
@@ -47,6 +47,15 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif /* HAVE_WINDOW_SYSTEM */
 
 #include <verify.h>
+#include <execinfo.h>           /* For backtrace.  */
+
+#ifdef HAVE_LINUX_SYSINFO
+#include <sys/sysinfo.h>
+#endif
+
+#ifdef MSDOS
+#include "dosfns.h"            /* For dos_memory_info.  */
+#endif
 
 #if (defined ENABLE_CHECKING                   \
      && defined HAVE_VALGRIND_VALGRIND_H       \
@@ -192,6 +201,35 @@ static ptrdiff_t pure_bytes_used_non_lisp;
 
 const char *pending_malloc_warning;
 
+#if 0 /* Normally, pointer sanity only on request... */
+#ifdef ENABLE_CHECKING
+#define SUSPICIOUS_OBJECT_CHECKING 1
+#endif
+#endif
+
+/* ... but unconditionally use SUSPICIOUS_OBJECT_CHECKING while the GC
+   bug is unresolved.  */
+#define SUSPICIOUS_OBJECT_CHECKING 1
+
+#ifdef SUSPICIOUS_OBJECT_CHECKING
+struct suspicious_free_record
+{
+  void *suspicious_object;
+  void *backtrace[128];
+};
+static void *suspicious_objects[32];
+static int suspicious_object_index;
+struct suspicious_free_record suspicious_free_history[64] EXTERNALLY_VISIBLE;
+static int suspicious_free_history_index;
+/* Find the first currently-monitored suspicious pointer in range
+   [begin,end) or NULL if no such pointer exists.  */
+static void *find_suspicious_object_in_range (void *begin, void *end);
+static void detect_suspicious_free (void *ptr);
+#else
+# define find_suspicious_object_in_range(begin, end) NULL
+# define detect_suspicious_free(ptr) (void)
+#endif
+
 /* Maximum amount of C stack to save when a GC happens.  */
 
 #ifndef MAX_SAVE_STACK
@@ -403,6 +441,23 @@ XFLOAT_INIT (Lisp_Object f, double n)
   XFLOAT (f)->u.data = n;
 }
 
+static bool
+pointers_fit_in_lispobj_p (void)
+{
+  return (UINTPTR_MAX <= VAL_MAX) || USE_LSB_TAG;
+}
+
+static bool
+mmap_lisp_allowed_p (void)
+{
+  /* If we can't store all memory addresses in our lisp objects, it's
+     risky to let the heap use mmap and give us addresses from all
+     over our address space.  We also can't use mmap for lisp objects
+     if we might dump: unexec doesn't preserve the contents of mmaped
+     regions.  */
+  return pointers_fit_in_lispobj_p () && !might_dump;
+}
+
 \f
 /************************************************************************
                                Malloc
@@ -1073,10 +1128,8 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
       intptr_t aligned; /* int gets warning casting to 64-bit pointer.  */
 
 #ifdef DOUG_LEA_MALLOC
-      /* Prevent mmap'ing the chunk.  Lisp data may not be mmap'ed
-        because mapped region contents are not preserved in
-        a dumped Emacs.  */
-      mallopt (M_MMAP_MAX, 0);
+      if (!mmap_lisp_allowed_p ())
+        mallopt (M_MMAP_MAX, 0);
 #endif
 
 #ifdef USE_ALIGNED_ALLOC
@@ -1097,8 +1150,8 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
        ((void **) abase)[-1] = base;
 
 #ifdef DOUG_LEA_MALLOC
-      /* Back to a reasonable maximum of mmap'ed areas.  */
-      mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
+      if (!mmap_lisp_allowed_p ())
+          mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
 #endif
 
 #if ! USE_LSB_TAG
@@ -1733,23 +1786,15 @@ allocate_string_data (struct Lisp_String *s,
       size_t size = offsetof (struct sblock, data) + needed;
 
 #ifdef DOUG_LEA_MALLOC
-      /* Prevent mmap'ing the chunk.  Lisp data may not be mmap'ed
-        because mapped region contents are not preserved in
-        a dumped Emacs.
-
-         In case you think of allowing it in a dumped Emacs at the
-         cost of not being able to re-dump, there's another reason:
-         mmap'ed data typically have an address towards the top of the
-         address space, which won't fit into an EMACS_INT (at least on
-         32-bit systems with the current tagging scheme).  --fx  */
-      mallopt (M_MMAP_MAX, 0);
+      if (!mmap_lisp_allowed_p ())
+        mallopt (M_MMAP_MAX, 0);
 #endif
 
       b = lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP);
 
 #ifdef DOUG_LEA_MALLOC
-      /* Back to a reasonable maximum of mmap'ed areas.  */
-      mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
+      if (!mmap_lisp_allowed_p ())
+        mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
 #endif
 
       b->next_free = b->data;
@@ -1810,6 +1855,7 @@ allocate_string_data (struct Lisp_String *s,
 
 /* Sweep and compact strings.  */
 
+NO_INLINE /* For better stack traces */
 static void
 sweep_strings (void)
 {
@@ -2093,7 +2139,7 @@ bool_vector_fill (Lisp_Object a, Lisp_Object init)
       unsigned char *data = bool_vector_uchar_data (a);
       int pattern = NILP (init) ? 0 : (1 << BOOL_VECTOR_BITS_PER_CHAR) - 1;
       ptrdiff_t nbytes = bool_vector_bytes (nbits);
-      int last_mask = ~ (~0 << ((nbits - 1) % BOOL_VECTOR_BITS_PER_CHAR + 1));
+      int last_mask = ~ (~0u << ((nbits - 1) % BOOL_VECTOR_BITS_PER_CHAR + 1));
       memset (data, pattern, nbytes - 1);
       data[nbytes - 1] = pattern & last_mask;
     }
@@ -2136,6 +2182,21 @@ LENGTH must be a number.  INIT matters only in whether it is t or nil.  */)
   return bool_vector_fill (val, init);
 }
 
+DEFUN ("bool-vector", Fbool_vector, Sbool_vector, 0, MANY, 0,
+       doc: /* Return a new bool-vector with specified arguments as elements.
+Any number of arguments, even zero arguments, are allowed.
+usage: (bool-vector &rest OBJECTS)  */)
+  (ptrdiff_t nargs, Lisp_Object *args)
+{
+  ptrdiff_t i;
+  Lisp_Object vector;
+
+  vector = make_uninit_bool_vector (nargs);
+  for (i = 0; i < nargs; i++)
+    bool_vector_set (vector, i, !NILP (args[i]));
+
+  return vector;
+}
 
 /* Make a string from NBYTES bytes at CONTENTS, and compute the number
    of characters from the contents.  This string may be unibyte or
@@ -2294,21 +2355,21 @@ make_formatted_string (char *buf, const char *format, ...)
 #define FLOAT_BLOCK_SIZE                                       \
   (((BLOCK_BYTES - sizeof (struct float_block *)               \
      /* The compiler might add padding at the end.  */         \
-     - (sizeof (struct Lisp_Float) - sizeof (int))) * CHAR_BIT) \
+     - (sizeof (struct Lisp_Float) - sizeof (bits_word))) * CHAR_BIT) \
    / (sizeof (struct Lisp_Float) * CHAR_BIT + 1))
 
 #define GETMARKBIT(block,n)                            \
-  (((block)->gcmarkbits[(n) / (sizeof (int) * CHAR_BIT)]       \
-    >> ((n) % (sizeof (int) * CHAR_BIT)))              \
+  (((block)->gcmarkbits[(n) / BITS_PER_BITS_WORD]      \
+    >> ((n) % BITS_PER_BITS_WORD))                     \
    & 1)
 
 #define SETMARKBIT(block,n)                            \
-  (block)->gcmarkbits[(n) / (sizeof (int) * CHAR_BIT)] \
-  |= 1 << ((n) % (sizeof (int) * CHAR_BIT))
+  ((block)->gcmarkbits[(n) / BITS_PER_BITS_WORD]       \
+   |= (bits_word) 1 << ((n) % BITS_PER_BITS_WORD))
 
 #define UNSETMARKBIT(block,n)                          \
-  (block)->gcmarkbits[(n) / (sizeof (int) * CHAR_BIT)] \
-  &= ~(1 << ((n) % (sizeof (int) * CHAR_BIT)))
+  ((block)->gcmarkbits[(n) / BITS_PER_BITS_WORD]       \
+   &= ~((bits_word) 1 << ((n) % BITS_PER_BITS_WORD)))
 
 #define FLOAT_BLOCK(fptr) \
   ((struct float_block *) (((uintptr_t) (fptr)) & ~(BLOCK_ALIGN - 1)))
@@ -2320,7 +2381,7 @@ struct float_block
 {
   /* Place `floats' at the beginning, to ease up FLOAT_INDEX's job.  */
   struct Lisp_Float floats[FLOAT_BLOCK_SIZE];
-  int gcmarkbits[1 + FLOAT_BLOCK_SIZE / (sizeof (int) * CHAR_BIT)];
+  bits_word gcmarkbits[1 + FLOAT_BLOCK_SIZE / BITS_PER_BITS_WORD];
   struct float_block *next;
 };
 
@@ -2401,7 +2462,7 @@ make_float (double float_value)
 #define CONS_BLOCK_SIZE                                                \
   (((BLOCK_BYTES - sizeof (struct cons_block *)                        \
      /* The compiler might add padding at the end.  */         \
-     - (sizeof (struct Lisp_Cons) - sizeof (int))) * CHAR_BIT) \
+     - (sizeof (struct Lisp_Cons) - sizeof (bits_word))) * CHAR_BIT)   \
    / (sizeof (struct Lisp_Cons) * CHAR_BIT + 1))
 
 #define CONS_BLOCK(fptr) \
@@ -2414,7 +2475,7 @@ struct cons_block
 {
   /* Place `conses' at the beginning, to ease up CONS_INDEX's job.  */
   struct Lisp_Cons conses[CONS_BLOCK_SIZE];
-  int gcmarkbits[1 + CONS_BLOCK_SIZE / (sizeof (int) * CHAR_BIT)];
+  bits_word gcmarkbits[1 + CONS_BLOCK_SIZE / BITS_PER_BITS_WORD];
   struct cons_block *next;
 };
 
@@ -2651,20 +2712,16 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0,
    pointer cannot be tagged, represent it with a Lisp 0.
    Usually you don't want to touch this.  */
 
-enum { TAGGABLE_NULL = (DATA_SEG_BITS & ~VALMASK) == 0 };
-
 static struct Lisp_Vector *
 next_vector (struct Lisp_Vector *v)
 {
-  if (! TAGGABLE_NULL && EQ (v->contents[0], make_number (0)))
-    return 0;
   return XUNTAG (v->contents[0], 0);
 }
 
 static void
 set_next_vector (struct Lisp_Vector *v, struct Lisp_Vector *p)
 {
-  v->contents[0] = TAGGABLE_NULL || p ? make_lisp_ptr (p, 0) : make_number (0);
+  v->contents[0] = make_lisp_ptr (p, 0);
 }
 
 /* This value is balanced well enough to avoid too much internal overhead
@@ -2920,6 +2977,7 @@ vector_nbytes (struct Lisp_Vector *v)
 static void
 cleanup_vector (struct Lisp_Vector *vector)
 {
+  detect_suspicious_free (vector);
   if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT)
       && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK)
          == FONT_OBJECT_MAX))
@@ -2939,6 +2997,7 @@ cleanup_vector (struct Lisp_Vector *vector)
 
 /* Reclaim space used by unmarked vectors.  */
 
+NO_INLINE /* For better stack traces */
 static void
 sweep_vectors (void)
 {
@@ -2993,7 +3052,7 @@ sweep_vectors (void)
 
              if (vector == (struct Lisp_Vector *) block->data
                  && !VECTOR_IN_BLOCK (next, block))
-               /* This block should be freed because all of it's
+               /* This block should be freed because all of its
                   space was coalesced into the only free vector.  */
                free_this_block = 1;
              else
@@ -3063,10 +3122,8 @@ allocate_vectorlike (ptrdiff_t len)
       size_t nbytes = header_size + len * word_size;
 
 #ifdef DOUG_LEA_MALLOC
-      /* Prevent mmap'ing the chunk.  Lisp data may not be mmap'ed
-        because mapped region contents are not preserved in
-        a dumped Emacs.  */
-      mallopt (M_MMAP_MAX, 0);
+      if (!mmap_lisp_allowed_p ())
+        mallopt (M_MMAP_MAX, 0);
 #endif
 
       if (nbytes <= VBLOCK_BYTES_MAX)
@@ -3083,10 +3140,13 @@ allocate_vectorlike (ptrdiff_t len)
        }
 
 #ifdef DOUG_LEA_MALLOC
-      /* Back to a reasonable maximum of mmap'ed areas.  */
-      mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
+      if (!mmap_lisp_allowed_p ())
+        mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
 #endif
 
+      if (find_suspicious_object_in_range (p, (char *) p + nbytes))
+        emacs_abort ();
+
       consing_since_gc += nbytes;
       vector_cells_consed += len;
     }
@@ -3741,7 +3801,7 @@ memory_full (size_t nbytes)
       memory_full_cons_threshold = sizeof (struct cons_block);
 
       /* The first time we get here, free the spare memory.  */
-      for (i = 0; i < sizeof (spare_memory) / sizeof (char *); i++)
+      for (i = 0; i < ARRAYELTS (spare_memory); i++)
        if (spare_memory[i])
          {
            if (i == 0)
@@ -4502,6 +4562,15 @@ mark_maybe_object (Lisp_Object obj)
     }
 }
 
+/* Return true if P can point to Lisp data, and false otherwise.
+   USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT.
+   Otherwise, assume that Lisp data is aligned on even addresses.  */
+
+static bool
+maybe_lisp_pointer (void *p)
+{
+  return !((intptr_t) p % (USE_LSB_TAG ? GCALIGNMENT : 2));
+}
 
 /* If P points to Lisp data, mark that as live if it isn't already
    marked.  */
@@ -4516,10 +4585,7 @@ mark_maybe_pointer (void *p)
     VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p));
 #endif
 
-  /* Quickly rule out some values which can't point to Lisp data.
-     USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT.
-     Otherwise, assume that Lisp data is aligned on even addresses.  */
-  if ((intptr_t) p % (USE_LSB_TAG ? GCALIGNMENT : 2))
+  if (!maybe_lisp_pointer (p))
     return;
 
   m = mem_find (p);
@@ -4831,61 +4897,8 @@ dump_zombies (void)
    from the stack start.  */
 
 static void
-mark_stack (void)
+mark_stack (void *end)
 {
-  void *end;
-
-#ifdef HAVE___BUILTIN_UNWIND_INIT
-  /* Force callee-saved registers and register windows onto the stack.
-     This is the preferred method if available, obviating the need for
-     machine dependent methods.  */
-  __builtin_unwind_init ();
-  end = &end;
-#else /* not HAVE___BUILTIN_UNWIND_INIT */
-#ifndef GC_SAVE_REGISTERS_ON_STACK
-  /* jmp_buf may not be aligned enough on darwin-ppc64 */
-  union aligned_jmpbuf {
-    Lisp_Object o;
-    sys_jmp_buf j;
-  } j;
-  volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base;
-#endif
-  /* This trick flushes the register windows so that all the state of
-     the process is contained in the stack.  */
-  /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is
-     needed on ia64 too.  See mach_dep.c, where it also says inline
-     assembler doesn't work with relevant proprietary compilers.  */
-#ifdef __sparc__
-#if defined (__sparc64__) && defined (__FreeBSD__)
-  /* FreeBSD does not have a ta 3 handler.  */
-  asm ("flushw");
-#else
-  asm ("ta 3");
-#endif
-#endif
-
-  /* Save registers that we need to see on the stack.  We need to see
-     registers used to hold register variables and registers used to
-     pass parameters.  */
-#ifdef GC_SAVE_REGISTERS_ON_STACK
-  GC_SAVE_REGISTERS_ON_STACK (end);
-#else /* not GC_SAVE_REGISTERS_ON_STACK */
-
-#ifndef GC_SETJMP_WORKS  /* If it hasn't been checked yet that
-                           setjmp will definitely work, test it
-                           and print a message with the result
-                           of the test.  */
-  if (!setjmp_tested_p)
-    {
-      setjmp_tested_p = 1;
-      test_setjmp ();
-    }
-#endif /* GC_SETJMP_WORKS */
-
-  sys_setjmp (j.j);
-  end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j;
-#endif /* not GC_SAVE_REGISTERS_ON_STACK */
-#endif /* not HAVE___BUILTIN_UNWIND_INIT */
 
   /* This assumes that the stack is a contiguous region in memory.  If
      that's not the case, something has to be done here to iterate
@@ -5015,9 +5028,34 @@ valid_lisp_object_p (Lisp_Object obj)
 #endif
 }
 
+/* If GC_MARK_STACK, return 1 if STR is a relocatable data of Lisp_String
+   (i.e. there is a non-pure Lisp_Object X so that SDATA (X) == STR) and 0
+   if not.  Otherwise we can't rely on valid_lisp_object_p and return -1.
+   This function is slow and should be used for debugging purposes.  */
 
+int
+relocatable_string_data_p (const char *str)
+{
+  if (PURE_POINTER_P (str))
+    return 0;
+#if GC_MARK_STACK
+  if (str)
+    {
+      struct sdata *sdata
+       = (struct sdata *) (str - offsetof (struct sdata, data));
+
+      if (valid_pointer_p (sdata)
+         && valid_pointer_p (sdata->string)
+         && maybe_lisp_pointer (sdata->string))
+       return (valid_lisp_object_p
+               (make_lisp_ptr (sdata->string, Lisp_String))
+               && (const char *) sdata->string->data == str);
+    }
+  return 0;
+#endif /* GC_MARK_STACK */
+  return -1;
+}
 
-\f
 /***********************************************************************
                       Pure Storage Management
  ***********************************************************************/
@@ -5493,22 +5531,15 @@ mark_pinned_symbols (void)
     }
 }
 
-DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "",
-       doc: /* Reclaim storage for Lisp objects no longer needed.
-Garbage collection happens automatically if you cons more than
-`gc-cons-threshold' bytes of Lisp data since previous garbage collection.
-`garbage-collect' normally returns a list with info on amount of space in use,
-where each entry has the form (NAME SIZE USED FREE), where:
-- NAME is a symbol describing the kind of objects this entry represents,
-- SIZE is the number of bytes used by each one,
-- USED is the number of those objects that were found live in the heap,
-- FREE is the number of those objects that are not live but that Emacs
-  keeps around for future allocations (maybe because it does not know how
-  to return them to the OS).
-However, if there was overflow in pure space, `garbage-collect'
-returns nil, because real GC can't be done.
-See Info node `(elisp)Garbage Collection'.  */)
-  (void)
+/* Subroutine of Fgarbage_collect that does most of the work.  It is a
+   separate function so that we could limit mark_stack in searching
+   the stack frames below this function, thus avoiding the rare cases
+   where mark_stack finds values that look like live Lisp objects on
+   portions of stack that couldn't possibly contain such live objects.
+   For more details of this, see the discussion at
+   http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00270.html.  */
+static Lisp_Object
+garbage_collect_1 (void *end)
 {
   struct buffer *nextb;
   char stack_top_variable;
@@ -5606,7 +5637,7 @@ See Info node `(elisp)Garbage Collection'.  */)
 
 #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \
      || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS)
-  mark_stack ();
+  mark_stack (end);
 #else
   {
     register struct gcpro *tail;
@@ -5629,7 +5660,7 @@ See Info node `(elisp)Garbage Collection'.  */)
 #endif
 
 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
-  mark_stack ();
+  mark_stack (end);
 #endif
 
   /* Everything is now marked, except for the data in font caches
@@ -5789,6 +5820,87 @@ See Info node `(elisp)Garbage Collection'.  */)
   return retval;
 }
 
+DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "",
+       doc: /* Reclaim storage for Lisp objects no longer needed.
+Garbage collection happens automatically if you cons more than
+`gc-cons-threshold' bytes of Lisp data since previous garbage collection.
+`garbage-collect' normally returns a list with info on amount of space in use,
+where each entry has the form (NAME SIZE USED FREE), where:
+- NAME is a symbol describing the kind of objects this entry represents,
+- SIZE is the number of bytes used by each one,
+- USED is the number of those objects that were found live in the heap,
+- FREE is the number of those objects that are not live but that Emacs
+  keeps around for future allocations (maybe because it does not know how
+  to return them to the OS).
+However, if there was overflow in pure space, `garbage-collect'
+returns nil, because real GC can't be done.
+See Info node `(elisp)Garbage Collection'.  */)
+  (void)
+{
+#if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS             \
+     || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS    \
+     || GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES)
+  void *end;
+
+#ifdef HAVE___BUILTIN_UNWIND_INIT
+  /* Force callee-saved registers and register windows onto the stack.
+     This is the preferred method if available, obviating the need for
+     machine dependent methods.  */
+  __builtin_unwind_init ();
+  end = &end;
+#else /* not HAVE___BUILTIN_UNWIND_INIT */
+#ifndef GC_SAVE_REGISTERS_ON_STACK
+  /* jmp_buf may not be aligned enough on darwin-ppc64 */
+  union aligned_jmpbuf {
+    Lisp_Object o;
+    sys_jmp_buf j;
+  } j;
+  volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base;
+#endif
+  /* This trick flushes the register windows so that all the state of
+     the process is contained in the stack.  */
+  /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is
+     needed on ia64 too.  See mach_dep.c, where it also says inline
+     assembler doesn't work with relevant proprietary compilers.  */
+#ifdef __sparc__
+#if defined (__sparc64__) && defined (__FreeBSD__)
+  /* FreeBSD does not have a ta 3 handler.  */
+  asm ("flushw");
+#else
+  asm ("ta 3");
+#endif
+#endif
+
+  /* Save registers that we need to see on the stack.  We need to see
+     registers used to hold register variables and registers used to
+     pass parameters.  */
+#ifdef GC_SAVE_REGISTERS_ON_STACK
+  GC_SAVE_REGISTERS_ON_STACK (end);
+#else /* not GC_SAVE_REGISTERS_ON_STACK */
+
+#ifndef GC_SETJMP_WORKS  /* If it hasn't been checked yet that
+                           setjmp will definitely work, test it
+                           and print a message with the result
+                           of the test.  */
+  if (!setjmp_tested_p)
+    {
+      setjmp_tested_p = 1;
+      test_setjmp ();
+    }
+#endif /* GC_SETJMP_WORKS */
+
+  sys_setjmp (j.j);
+  end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j;
+#endif /* not GC_SAVE_REGISTERS_ON_STACK */
+#endif /* not HAVE___BUILTIN_UNWIND_INIT */
+  return garbage_collect_1 (end);
+#elif (GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE)
+  /* Old GCPROs-based method without stack marking.  */
+  return garbage_collect_1 (NULL);
+#else
+  emacs_abort ();
+#endif /* GC_MARK_STACK */
+}
 
 /* Mark Lisp objects in glyph matrix MATRIX.  Currently the
    only interesting objects referenced from glyphs are strings.  */
@@ -5854,14 +5966,15 @@ mark_vectorlike (struct Lisp_Vector *ptr)
    symbols.  */
 
 static void
-mark_char_table (struct Lisp_Vector *ptr)
+mark_char_table (struct Lisp_Vector *ptr, enum pvec_type pvectype)
 {
   int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK;
-  int i;
+  /* Consult the Lisp_Sub_Char_Table layout before changing this.  */
+  int i, idx = (pvectype == PVEC_SUB_CHAR_TABLE ? SUB_CHAR_TABLE_OFFSET : 0);
 
   eassert (!VECTOR_MARKED_P (ptr));
   VECTOR_MARK (ptr);
-  for (i = 0; i < size; i++)
+  for (i = idx; i < size; i++)
     {
       Lisp_Object val = ptr->contents[i];
 
@@ -5870,13 +5983,26 @@ mark_char_table (struct Lisp_Vector *ptr)
       if (SUB_CHAR_TABLE_P (val))
        {
          if (! VECTOR_MARKED_P (XVECTOR (val)))
-           mark_char_table (XVECTOR (val));
+           mark_char_table (XVECTOR (val), PVEC_SUB_CHAR_TABLE);
        }
       else
        mark_object (val);
     }
 }
 
+NO_INLINE /* To reduce stack depth in mark_object.  */
+static Lisp_Object
+mark_compiled (struct Lisp_Vector *ptr)
+{
+  int i, size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK;
+
+  VECTOR_MARK (ptr);
+  for (i = 0; i < size; i++)
+    if (i != COMPILED_CONSTANTS)
+      mark_object (ptr->contents[i]);
+  return size > COMPILED_CONSTANTS ? ptr->contents[COMPILED_CONSTANTS] : Qnil;
+}
+
 /* Mark the chain of overlays starting at PTR.  */
 
 static void
@@ -5917,6 +6043,7 @@ mark_buffer (struct buffer *buffer)
 
 /* Mark Lisp faces in the face cache C.  */
 
+NO_INLINE /* To reduce stack depth in mark_object.  */
 static void
 mark_face_cache (struct face_cache *c)
 {
@@ -5939,6 +6066,48 @@ mark_face_cache (struct face_cache *c)
     }
 }
 
+NO_INLINE /* To reduce stack depth in mark_object.  */
+static void
+mark_localized_symbol (struct Lisp_Symbol *ptr)
+{
+  struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr);
+  Lisp_Object where = blv->where;
+  /* If the value is set up for a killed buffer or deleted
+     frame, restore its global binding.  If the value is
+     forwarded to a C variable, either it's not a Lisp_Object
+     var, or it's staticpro'd already.  */
+  if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where)))
+      || (FRAMEP (where) && !FRAME_LIVE_P (XFRAME (where))))
+    swap_in_global_binding (ptr);
+  mark_object (blv->where);
+  mark_object (blv->valcell);
+  mark_object (blv->defcell);
+}
+
+NO_INLINE /* To reduce stack depth in mark_object.  */
+static void
+mark_save_value (struct Lisp_Save_Value *ptr)
+{
+  /* If `save_type' is zero, `data[0].pointer' is the address
+     of a memory area containing `data[1].integer' potential
+     Lisp_Objects.  */
+  if (GC_MARK_STACK && ptr->save_type == SAVE_TYPE_MEMORY)
+    {
+      Lisp_Object *p = ptr->data[0].pointer;
+      ptrdiff_t nelt;
+      for (nelt = ptr->data[1].integer; nelt > 0; nelt--, p++)
+       mark_maybe_object (*p);
+    }
+  else
+    {
+      /* Find Lisp_Objects in `data[N]' slots and mark them.  */
+      int i;
+      for (i = 0; i < SAVE_VALUE_SLOTS; i++)
+       if (save_type (ptr, i) == SAVE_OBJECT)
+         mark_object (ptr->data[i].object);
+    }
+}
+
 /* Remove killed buffers or items whose car is a killed buffer from
    LIST, and mark other items.  Return changed LIST, which is marked.  */
 
@@ -5966,7 +6135,13 @@ mark_discard_killed_buffers (Lisp_Object list)
   return list;
 }
 
-/* Determine type of generic Lisp_Object and mark it accordingly.  */
+/* Determine type of generic Lisp_Object and mark it accordingly.
+
+   This function implements a straightforward depth-first marking
+   algorithm and so the recursion depth may be very high (a few
+   tens of thousands is not uncommon).  To minimize stack usage,
+   a few cold paths are moved out to NO_INLINE functions above.
+   In general, inlining them doesn't help you to gain more speed.  */
 
 void
 mark_object (Lisp_Object arg)
@@ -6083,22 +6258,13 @@ mark_object (Lisp_Object arg)
            break;
 
          case PVEC_COMPILED:
-           { /* We could treat this just like a vector, but it is better
-                to save the COMPILED_CONSTANTS element for last and avoid
-                recursion there.  */
-             int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK;
-             int i;
-
-             VECTOR_MARK (ptr);
-             for (i = 0; i < size; i++)
-               if (i != COMPILED_CONSTANTS)
-                 mark_object (ptr->contents[i]);
-             if (size > COMPILED_CONSTANTS)
-               {
-                 obj = ptr->contents[COMPILED_CONSTANTS];
-                 goto loop;
-               }
-           }
+           /* Although we could treat this just like a vector, mark_compiled
+              returns the COMPILED_CONSTANTS element, which is marked at the
+              next iteration of goto-loop here.  This is done to avoid a few
+              recursive calls to mark_object.  */
+           obj = mark_compiled (ptr);
+           if (!NILP (obj))
+             goto loop;
            break;
 
          case PVEC_FRAME:
@@ -6163,7 +6329,8 @@ mark_object (Lisp_Object arg)
            break;
 
          case PVEC_CHAR_TABLE:
-           mark_char_table (ptr);
+         case PVEC_SUB_CHAR_TABLE:
+           mark_char_table (ptr, (enum pvec_type) pvectype);
            break;
 
          case PVEC_BOOL_VECTOR:
@@ -6186,12 +6353,13 @@ mark_object (Lisp_Object arg)
     case Lisp_Symbol:
       {
        register struct Lisp_Symbol *ptr = XSYMBOL (obj);
-       struct Lisp_Symbol *ptrx;
-
+      nextsym:
        if (ptr->gcmarkbit)
          break;
        CHECK_ALLOCATED_AND_LIVE (live_symbol_p);
        ptr->gcmarkbit = 1;
+       /* Attempt to catch bogus objects.  */
+        eassert (valid_lisp_object_p (ptr->function) >= 1);
        mark_object (ptr->function);
        mark_object (ptr->plist);
        switch (ptr->redirect)
@@ -6205,21 +6373,8 @@ mark_object (Lisp_Object arg)
              break;
            }
          case SYMBOL_LOCALIZED:
-           {
-             struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr);
-             Lisp_Object where = blv->where;
-             /* If the value is set up for a killed buffer or deleted
-                frame, restore it's global binding.  If the value is
-                forwarded to a C variable, either it's not a Lisp_Object
-                var, or it's staticpro'd already.  */
-             if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where)))
-                 || (FRAMEP (where) && !FRAME_LIVE_P (XFRAME (where))))
-               swap_in_global_binding (ptr);
-             mark_object (blv->where);
-             mark_object (blv->valcell);
-             mark_object (blv->defcell);
-             break;
-           }
+           mark_localized_symbol (ptr);
+           break;
          case SYMBOL_FORWARDED:
            /* If the value is forwarded to a buffer or keyboard field,
               these are marked when we see the corresponding object.
@@ -6231,14 +6386,10 @@ mark_object (Lisp_Object arg)
        if (!PURE_POINTER_P (XSTRING (ptr->name)))
          MARK_STRING (XSTRING (ptr->name));
        MARK_INTERVAL_TREE (string_intervals (ptr->name));
-
+       /* Inner loop to mark next symbol in this bucket, if any.  */
        ptr = ptr->next;
        if (ptr)
-         {
-           ptrx = ptr;         /* Use of ptrx avoids compiler bug on Sun.  */
-           XSETSYMBOL (obj, ptrx);
-           goto loop;
-         }
+         goto nextsym;
       }
       break;
 
@@ -6259,27 +6410,7 @@ mark_object (Lisp_Object arg)
 
        case Lisp_Misc_Save_Value:
          XMISCANY (obj)->gcmarkbit = 1;
-         {
-           struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
-           /* If `save_type' is zero, `data[0].pointer' is the address
-              of a memory area containing `data[1].integer' potential
-              Lisp_Objects.  */
-           if (GC_MARK_STACK && ptr->save_type == SAVE_TYPE_MEMORY)
-             {
-               Lisp_Object *p = ptr->data[0].pointer;
-               ptrdiff_t nelt;
-               for (nelt = ptr->data[1].integer; nelt > 0; nelt--, p++)
-                 mark_maybe_object (*p);
-             }
-           else
-             {
-               /* Find Lisp_Objects in `data[N]' slots and mark them.  */
-               int i;
-               for (i = 0; i < SAVE_VALUE_SLOTS; i++)
-                 if (save_type (ptr, i) == SAVE_OBJECT)
-                   mark_object (ptr->data[i].object);
-             }
-         }
+         mark_save_value (XSAVE_VALUE (obj));
          break;
 
        case Lisp_Misc_Overlay:
@@ -6399,332 +6530,398 @@ survives_gc_p (Lisp_Object obj)
 
 
 \f
-/* Sweep: find all structures not marked, and free them.  */
 
+NO_INLINE /* For better stack traces */
 static void
-gc_sweep (void)
+sweep_conses (void)
 {
-  /* Remove or mark entries in weak hash tables.
-     This must be done before any object is unmarked.  */
-  sweep_weak_hash_tables ();
-
-  sweep_strings ();
-  check_string_bytes (!noninteractive);
-
-  /* Put all unmarked conses on free list.  */
-  {
-    register struct cons_block *cblk;
-    struct cons_block **cprev = &cons_block;
-    register int lim = cons_block_index;
-    EMACS_INT num_free = 0, num_used = 0;
+  struct cons_block *cblk;
+  struct cons_block **cprev = &cons_block;
+  int lim = cons_block_index;
+  EMACS_INT num_free = 0, num_used = 0;
 
-    cons_free_list = 0;
+  cons_free_list = 0;
 
-    for (cblk = cons_block; cblk; cblk = *cprev)
-      {
-       register int i = 0;
-       int this_free = 0;
-       int ilim = (lim + BITS_PER_INT - 1) / BITS_PER_INT;
+  for (cblk = cons_block; cblk; cblk = *cprev)
+    {
+      int i = 0;
+      int this_free = 0;
+      int ilim = (lim + BITS_PER_BITS_WORD - 1) / BITS_PER_BITS_WORD;
 
-       /* Scan the mark bits an int at a time.  */
-       for (i = 0; i < ilim; i++)
-         {
-           if (cblk->gcmarkbits[i] == -1)
-             {
-               /* Fast path - all cons cells for this int are marked.  */
-               cblk->gcmarkbits[i] = 0;
-               num_used += BITS_PER_INT;
-             }
-           else
-             {
-               /* Some cons cells for this int are not marked.
-                  Find which ones, and free them.  */
-               int start, pos, stop;
-
-               start = i * BITS_PER_INT;
-               stop = lim - start;
-               if (stop > BITS_PER_INT)
-                 stop = BITS_PER_INT;
-               stop += start;
-
-               for (pos = start; pos < stop; pos++)
-                 {
-                   if (!CONS_MARKED_P (&cblk->conses[pos]))
-                     {
-                       this_free++;
-                       cblk->conses[pos].u.chain = cons_free_list;
-                       cons_free_list = &cblk->conses[pos];
+      /* Scan the mark bits an int at a time.  */
+      for (i = 0; i < ilim; i++)
+        {
+          if (cblk->gcmarkbits[i] == BITS_WORD_MAX)
+            {
+              /* Fast path - all cons cells for this int are marked.  */
+              cblk->gcmarkbits[i] = 0;
+              num_used += BITS_PER_BITS_WORD;
+            }
+          else
+            {
+              /* Some cons cells for this int are not marked.
+                 Find which ones, and free them.  */
+              int start, pos, stop;
+
+              start = i * BITS_PER_BITS_WORD;
+              stop = lim - start;
+              if (stop > BITS_PER_BITS_WORD)
+                stop = BITS_PER_BITS_WORD;
+              stop += start;
+
+              for (pos = start; pos < stop; pos++)
+                {
+                  if (!CONS_MARKED_P (&cblk->conses[pos]))
+                    {
+                      this_free++;
+                      cblk->conses[pos].u.chain = cons_free_list;
+                      cons_free_list = &cblk->conses[pos];
 #if GC_MARK_STACK
-                       cons_free_list->car = Vdead;
+                      cons_free_list->car = Vdead;
 #endif
-                     }
-                   else
-                     {
-                       num_used++;
-                       CONS_UNMARK (&cblk->conses[pos]);
-                     }
-                 }
-             }
-         }
+                    }
+                  else
+                    {
+                      num_used++;
+                      CONS_UNMARK (&cblk->conses[pos]);
+                    }
+                }
+            }
+        }
 
-       lim = CONS_BLOCK_SIZE;
-       /* If this block contains only free conses and we have already
-          seen more than two blocks worth of free conses then deallocate
-          this block.  */
-       if (this_free == CONS_BLOCK_SIZE && num_free > CONS_BLOCK_SIZE)
-         {
-           *cprev = cblk->next;
-           /* Unhook from the free list.  */
-           cons_free_list = cblk->conses[0].u.chain;
-           lisp_align_free (cblk);
-         }
-       else
-         {
-           num_free += this_free;
-           cprev = &cblk->next;
-         }
-      }
-    total_conses = num_used;
-    total_free_conses = num_free;
-  }
+      lim = CONS_BLOCK_SIZE;
+      /* If this block contains only free conses and we have already
+         seen more than two blocks worth of free conses then deallocate
+         this block.  */
+      if (this_free == CONS_BLOCK_SIZE && num_free > CONS_BLOCK_SIZE)
+        {
+          *cprev = cblk->next;
+          /* Unhook from the free list.  */
+          cons_free_list = cblk->conses[0].u.chain;
+          lisp_align_free (cblk);
+        }
+      else
+        {
+          num_free += this_free;
+          cprev = &cblk->next;
+        }
+    }
+  total_conses = num_used;
+  total_free_conses = num_free;
+}
 
-  /* Put all unmarked floats on free list.  */
-  {
-    register struct float_block *fblk;
-    struct float_block **fprev = &float_block;
-    register int lim = float_block_index;
-    EMACS_INT num_free = 0, num_used = 0;
+NO_INLINE /* For better stack traces */
+static void
+sweep_floats (void)
+{
+  register struct float_block *fblk;
+  struct float_block **fprev = &float_block;
+  register int lim = float_block_index;
+  EMACS_INT num_free = 0, num_used = 0;
 
-    float_free_list = 0;
+  float_free_list = 0;
 
-    for (fblk = float_block; fblk; fblk = *fprev)
-      {
-       register int i;
-       int this_free = 0;
-       for (i = 0; i < lim; i++)
-         if (!FLOAT_MARKED_P (&fblk->floats[i]))
-           {
-             this_free++;
-             fblk->floats[i].u.chain = float_free_list;
-             float_free_list = &fblk->floats[i];
-           }
-         else
-           {
-             num_used++;
-             FLOAT_UNMARK (&fblk->floats[i]);
-           }
-       lim = FLOAT_BLOCK_SIZE;
-       /* If this block contains only free floats and we have already
-          seen more than two blocks worth of free floats then deallocate
-          this block.  */
-       if (this_free == FLOAT_BLOCK_SIZE && num_free > FLOAT_BLOCK_SIZE)
-         {
-           *fprev = fblk->next;
-           /* Unhook from the free list.  */
-           float_free_list = fblk->floats[0].u.chain;
-           lisp_align_free (fblk);
-         }
-       else
-         {
-           num_free += this_free;
-           fprev = &fblk->next;
-         }
-      }
-    total_floats = num_used;
-    total_free_floats = num_free;
-  }
+  for (fblk = float_block; fblk; fblk = *fprev)
+    {
+      register int i;
+      int this_free = 0;
+      for (i = 0; i < lim; i++)
+        if (!FLOAT_MARKED_P (&fblk->floats[i]))
+          {
+            this_free++;
+            fblk->floats[i].u.chain = float_free_list;
+            float_free_list = &fblk->floats[i];
+          }
+        else
+          {
+            num_used++;
+            FLOAT_UNMARK (&fblk->floats[i]);
+          }
+      lim = FLOAT_BLOCK_SIZE;
+      /* If this block contains only free floats and we have already
+         seen more than two blocks worth of free floats then deallocate
+         this block.  */
+      if (this_free == FLOAT_BLOCK_SIZE && num_free > FLOAT_BLOCK_SIZE)
+        {
+          *fprev = fblk->next;
+          /* Unhook from the free list.  */
+          float_free_list = fblk->floats[0].u.chain;
+          lisp_align_free (fblk);
+        }
+      else
+        {
+          num_free += this_free;
+          fprev = &fblk->next;
+        }
+    }
+  total_floats = num_used;
+  total_free_floats = num_free;
+}
 
-  /* Put all unmarked intervals on free list.  */
-  {
-    register struct interval_block *iblk;
-    struct interval_block **iprev = &interval_block;
-    register int lim = interval_block_index;
-    EMACS_INT num_free = 0, num_used = 0;
+NO_INLINE /* For better stack traces */
+static void
+sweep_intervals (void)
+{
+  register struct interval_block *iblk;
+  struct interval_block **iprev = &interval_block;
+  register int lim = interval_block_index;
+  EMACS_INT num_free = 0, num_used = 0;
 
-    interval_free_list = 0;
+  interval_free_list = 0;
 
-    for (iblk = interval_block; iblk; iblk = *iprev)
-      {
-       register int i;
-       int this_free = 0;
+  for (iblk = interval_block; iblk; iblk = *iprev)
+    {
+      register int i;
+      int this_free = 0;
 
-       for (i = 0; i < lim; i++)
-         {
-           if (!iblk->intervals[i].gcmarkbit)
-             {
-               set_interval_parent (&iblk->intervals[i], interval_free_list);
-               interval_free_list = &iblk->intervals[i];
-               this_free++;
-             }
-           else
-             {
-               num_used++;
-               iblk->intervals[i].gcmarkbit = 0;
-             }
-         }
-       lim = INTERVAL_BLOCK_SIZE;
-       /* If this block contains only free intervals and we have already
-          seen more than two blocks worth of free intervals then
-          deallocate this block.  */
-       if (this_free == INTERVAL_BLOCK_SIZE && num_free > INTERVAL_BLOCK_SIZE)
-         {
-           *iprev = iblk->next;
-           /* Unhook from the free list.  */
-           interval_free_list = INTERVAL_PARENT (&iblk->intervals[0]);
-           lisp_free (iblk);
-         }
-       else
-         {
-           num_free += this_free;
-           iprev = &iblk->next;
-         }
-      }
-    total_intervals = num_used;
-    total_free_intervals = num_free;
-  }
+      for (i = 0; i < lim; i++)
+        {
+          if (!iblk->intervals[i].gcmarkbit)
+            {
+              set_interval_parent (&iblk->intervals[i], interval_free_list);
+              interval_free_list = &iblk->intervals[i];
+              this_free++;
+            }
+          else
+            {
+              num_used++;
+              iblk->intervals[i].gcmarkbit = 0;
+            }
+        }
+      lim = INTERVAL_BLOCK_SIZE;
+      /* If this block contains only free intervals and we have already
+         seen more than two blocks worth of free intervals then
+         deallocate this block.  */
+      if (this_free == INTERVAL_BLOCK_SIZE && num_free > INTERVAL_BLOCK_SIZE)
+        {
+          *iprev = iblk->next;
+          /* Unhook from the free list.  */
+          interval_free_list = INTERVAL_PARENT (&iblk->intervals[0]);
+          lisp_free (iblk);
+        }
+      else
+        {
+          num_free += this_free;
+          iprev = &iblk->next;
+        }
+    }
+  total_intervals = num_used;
+  total_free_intervals = num_free;
+}
 
-  /* Put all unmarked symbols on free list.  */
-  {
-    register struct symbol_block *sblk;
-    struct symbol_block **sprev = &symbol_block;
-    register int lim = symbol_block_index;
-    EMACS_INT num_free = 0, num_used = 0;
+NO_INLINE /* For better stack traces */
+static void
+sweep_symbols (void)
+{
+  register struct symbol_block *sblk;
+  struct symbol_block **sprev = &symbol_block;
+  register int lim = symbol_block_index;
+  EMACS_INT num_free = 0, num_used = 0;
 
-    symbol_free_list = NULL;
+  symbol_free_list = NULL;
 
-    for (sblk = symbol_block; sblk; sblk = *sprev)
-      {
-       int this_free = 0;
-       union aligned_Lisp_Symbol *sym = sblk->symbols;
-       union aligned_Lisp_Symbol *end = sym + lim;
+  for (sblk = symbol_block; sblk; sblk = *sprev)
+    {
+      int this_free = 0;
+      union aligned_Lisp_Symbol *sym = sblk->symbols;
+      union aligned_Lisp_Symbol *end = sym + lim;
 
-       for (; sym < end; ++sym)
-         {
-           if (!sym->s.gcmarkbit)
-             {
-               if (sym->s.redirect == SYMBOL_LOCALIZED)
-                 xfree (SYMBOL_BLV (&sym->s));
-               sym->s.next = symbol_free_list;
-               symbol_free_list = &sym->s;
+      for (; sym < end; ++sym)
+        {
+          if (!sym->s.gcmarkbit)
+            {
+              if (sym->s.redirect == SYMBOL_LOCALIZED)
+                xfree (SYMBOL_BLV (&sym->s));
+              sym->s.next = symbol_free_list;
+              symbol_free_list = &sym->s;
 #if GC_MARK_STACK
-               symbol_free_list->function = Vdead;
+              symbol_free_list->function = Vdead;
 #endif
-               ++this_free;
-             }
-           else
-             {
-               ++num_used;
-               eassert (!STRING_MARKED_P (XSTRING (sym->s.name)));
-               sym->s.gcmarkbit = 0;
-             }
-         }
+              ++this_free;
+            }
+          else
+            {
+              ++num_used;
+              sym->s.gcmarkbit = 0;
+              /* Attempt to catch bogus objects.  */
+              eassert (valid_lisp_object_p (sym->s.function) >= 1);
+            }
+        }
 
-       lim = SYMBOL_BLOCK_SIZE;
-       /* If this block contains only free symbols and we have already
-          seen more than two blocks worth of free symbols then deallocate
-          this block.  */
-       if (this_free == SYMBOL_BLOCK_SIZE && num_free > SYMBOL_BLOCK_SIZE)
-         {
-           *sprev = sblk->next;
-           /* Unhook from the free list.  */
-           symbol_free_list = sblk->symbols[0].s.next;
-           lisp_free (sblk);
-         }
-       else
-         {
-           num_free += this_free;
-           sprev = &sblk->next;
-         }
-      }
-    total_symbols = num_used;
-    total_free_symbols = num_free;
-  }
+      lim = SYMBOL_BLOCK_SIZE;
+      /* If this block contains only free symbols and we have already
+         seen more than two blocks worth of free symbols then deallocate
+         this block.  */
+      if (this_free == SYMBOL_BLOCK_SIZE && num_free > SYMBOL_BLOCK_SIZE)
+        {
+          *sprev = sblk->next;
+          /* Unhook from the free list.  */
+          symbol_free_list = sblk->symbols[0].s.next;
+          lisp_free (sblk);
+        }
+      else
+        {
+          num_free += this_free;
+          sprev = &sblk->next;
+        }
+    }
+  total_symbols = num_used;
+  total_free_symbols = num_free;
+}
 
-  /* Put all unmarked misc's on free list.
-     For a marker, first unchain it from the buffer it points into.  */
-  {
-    register struct marker_block *mblk;
-    struct marker_block **mprev = &marker_block;
-    register int lim = marker_block_index;
-    EMACS_INT num_free = 0, num_used = 0;
+NO_INLINE /* For better stack traces */
+static void
+sweep_misc (void)
+{
+  register struct marker_block *mblk;
+  struct marker_block **mprev = &marker_block;
+  register int lim = marker_block_index;
+  EMACS_INT num_free = 0, num_used = 0;
 
-    marker_free_list = 0;
+  /* Put all unmarked misc's on free list.  For a marker, first
+     unchain it from the buffer it points into.  */
 
-    for (mblk = marker_block; mblk; mblk = *mprev)
-      {
-       register int i;
-       int this_free = 0;
+  marker_free_list = 0;
 
-       for (i = 0; i < lim; i++)
-         {
-           if (!mblk->markers[i].m.u_any.gcmarkbit)
-             {
-               if (mblk->markers[i].m.u_any.type == Lisp_Misc_Marker)
-                 unchain_marker (&mblk->markers[i].m.u_marker);
-               /* Set the type of the freed object to Lisp_Misc_Free.
-                  We could leave the type alone, since nobody checks it,
-                  but this might catch bugs faster.  */
-               mblk->markers[i].m.u_marker.type = Lisp_Misc_Free;
-               mblk->markers[i].m.u_free.chain = marker_free_list;
-               marker_free_list = &mblk->markers[i].m;
-               this_free++;
-             }
-           else
-             {
-               num_used++;
-               mblk->markers[i].m.u_any.gcmarkbit = 0;
-             }
-         }
-       lim = MARKER_BLOCK_SIZE;
-       /* If this block contains only free markers and we have already
-          seen more than two blocks worth of free markers then deallocate
-          this block.  */
-       if (this_free == MARKER_BLOCK_SIZE && num_free > MARKER_BLOCK_SIZE)
-         {
-           *mprev = mblk->next;
-           /* Unhook from the free list.  */
-           marker_free_list = mblk->markers[0].m.u_free.chain;
-           lisp_free (mblk);
-         }
-       else
-         {
-           num_free += this_free;
-           mprev = &mblk->next;
-         }
-      }
+  for (mblk = marker_block; mblk; mblk = *mprev)
+    {
+      register int i;
+      int this_free = 0;
 
-    total_markers = num_used;
-    total_free_markers = num_free;
-  }
+      for (i = 0; i < lim; i++)
+        {
+          if (!mblk->markers[i].m.u_any.gcmarkbit)
+            {
+              if (mblk->markers[i].m.u_any.type == Lisp_Misc_Marker)
+                unchain_marker (&mblk->markers[i].m.u_marker);
+              /* Set the type of the freed object to Lisp_Misc_Free.
+                 We could leave the type alone, since nobody checks it,
+                 but this might catch bugs faster.  */
+              mblk->markers[i].m.u_marker.type = Lisp_Misc_Free;
+              mblk->markers[i].m.u_free.chain = marker_free_list;
+              marker_free_list = &mblk->markers[i].m;
+              this_free++;
+            }
+          else
+            {
+              num_used++;
+              mblk->markers[i].m.u_any.gcmarkbit = 0;
+            }
+        }
+      lim = MARKER_BLOCK_SIZE;
+      /* If this block contains only free markers and we have already
+         seen more than two blocks worth of free markers then deallocate
+         this block.  */
+      if (this_free == MARKER_BLOCK_SIZE && num_free > MARKER_BLOCK_SIZE)
+        {
+          *mprev = mblk->next;
+          /* Unhook from the free list.  */
+          marker_free_list = mblk->markers[0].m.u_free.chain;
+          lisp_free (mblk);
+        }
+      else
+        {
+          num_free += this_free;
+          mprev = &mblk->next;
+        }
+    }
 
-  /* Free all unmarked buffers */
-  {
-    register struct buffer *buffer, **bprev = &all_buffers;
+  total_markers = num_used;
+  total_free_markers = num_free;
+}
 
-    total_buffers = 0;
-    for (buffer = all_buffers; buffer; buffer = *bprev)
-      if (!VECTOR_MARKED_P (buffer))
-       {
-         *bprev = buffer->next;
-         lisp_free (buffer);
-       }
-      else
-       {
-         VECTOR_UNMARK (buffer);
-         /* Do not use buffer_(set|get)_intervals here.  */
-         buffer->text->intervals = balance_intervals (buffer->text->intervals);
-         total_buffers++;
-         bprev = &buffer->next;
-       }
-  }
+NO_INLINE /* For better stack traces */
+static void
+sweep_buffers (void)
+{
+  register struct buffer *buffer, **bprev = &all_buffers;
 
+  total_buffers = 0;
+  for (buffer = all_buffers; buffer; buffer = *bprev)
+    if (!VECTOR_MARKED_P (buffer))
+      {
+        *bprev = buffer->next;
+        lisp_free (buffer);
+      }
+    else
+      {
+        VECTOR_UNMARK (buffer);
+        /* Do not use buffer_(set|get)_intervals here.  */
+        buffer->text->intervals = balance_intervals (buffer->text->intervals);
+        total_buffers++;
+        bprev = &buffer->next;
+      }
+}
+
+/* Sweep: find all structures not marked, and free them.  */
+static void
+gc_sweep (void)
+{
+  /* Remove or mark entries in weak hash tables.
+     This must be done before any object is unmarked.  */
+  sweep_weak_hash_tables ();
+
+  sweep_strings ();
+  check_string_bytes (!noninteractive);
+  sweep_conses ();
+  sweep_floats ();
+  sweep_intervals ();
+  sweep_symbols ();
+  sweep_misc ();
+  sweep_buffers ();
   sweep_vectors ();
   check_string_bytes (!noninteractive);
 }
 
+DEFUN ("memory-info", Fmemory_info, Smemory_info, 0, 0, 0,
+       doc: /* Return a list of (TOTAL-RAM FREE-RAM TOTAL-SWAP FREE-SWAP).
+All values are in Kbytes.  If there is no swap space,
+last two values are zero.  If the system is not supported
+or memory information can't be obtained, return nil.  */)
+  (void)
+{
+#if defined HAVE_LINUX_SYSINFO
+  struct sysinfo si;
+  uintmax_t units;
 
+  if (sysinfo (&si))
+    return Qnil;
+#ifdef LINUX_SYSINFO_UNIT
+  units = si.mem_unit;
+#else
+  units = 1;
+#endif
+  return list4i ((uintmax_t) si.totalram * units / 1024,
+                (uintmax_t) si.freeram * units / 1024,
+                (uintmax_t) si.totalswap * units / 1024,
+                (uintmax_t) si.freeswap * units / 1024);
+#elif defined WINDOWSNT
+  unsigned long long totalram, freeram, totalswap, freeswap;
+
+  if (w32_memory_info (&totalram, &freeram, &totalswap, &freeswap) == 0)
+    return list4i ((uintmax_t) totalram / 1024,
+                  (uintmax_t) freeram / 1024,
+                  (uintmax_t) totalswap / 1024,
+                  (uintmax_t) freeswap / 1024);
+  else
+    return Qnil;
+#elif defined MSDOS
+  unsigned long totalram, freeram, totalswap, freeswap;
+
+  if (dos_memory_info (&totalram, &freeram, &totalswap, &freeswap) == 0)
+    return list4i ((uintmax_t) totalram / 1024,
+                  (uintmax_t) freeram / 1024,
+                  (uintmax_t) totalswap / 1024,
+                  (uintmax_t) freeswap / 1024);
+  else
+    return Qnil;
+}
+#else /* not HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */
+  /* FIXME: add more systems.  */
+  return Qnil;
+#endif /* HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */
+}
 
-\f
 /* Debugging aids.  */
 
 DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0,
@@ -6821,6 +7018,78 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max)
    return found;
 }
 
+#ifdef SUSPICIOUS_OBJECT_CHECKING
+
+static void *
+find_suspicious_object_in_range (void *begin, void *end)
+{
+  char *begin_a = begin;
+  char *end_a = end;
+  int i;
+
+  for (i = 0; i < ARRAYELTS (suspicious_objects); ++i)
+    {
+      char *suspicious_object = suspicious_objects[i];
+      if (begin_a <= suspicious_object && suspicious_object < end_a)
+       return suspicious_object;
+    }
+
+  return NULL;
+}
+
+static void
+note_suspicious_free (void* ptr)
+{
+  struct suspicious_free_record* rec;
+
+  rec = &suspicious_free_history[suspicious_free_history_index++];
+  if (suspicious_free_history_index ==
+      ARRAYELTS (suspicious_free_history))
+    {
+      suspicious_free_history_index = 0;
+    }
+
+  memset (rec, 0, sizeof (*rec));
+  rec->suspicious_object = ptr;
+  backtrace (&rec->backtrace[0], ARRAYELTS (rec->backtrace));
+}
+
+static void
+detect_suspicious_free (void* ptr)
+{
+  int i;
+
+  eassert (ptr != NULL);
+
+  for (i = 0; i < ARRAYELTS (suspicious_objects); ++i)
+    if (suspicious_objects[i] == ptr)
+      {
+        note_suspicious_free (ptr);
+        suspicious_objects[i] = NULL;
+      }
+}
+
+#endif /* SUSPICIOUS_OBJECT_CHECKING */
+
+DEFUN ("suspicious-object", Fsuspicious_object, Ssuspicious_object, 1, 1, 0,
+       doc: /* Return OBJ, maybe marking it for extra scrutiny.
+If Emacs is compiled with suspicous object checking, capture
+a stack trace when OBJ is freed in order to help track down
+garbage collection bugs.  Otherwise, do nothing and return OBJ.   */)
+   (Lisp_Object obj)
+{
+#ifdef SUSPICIOUS_OBJECT_CHECKING
+  /* Right now, we care only about vectors.  */
+  if (VECTORLIKEP (obj))
+    {
+      suspicious_objects[suspicious_object_index++] = XVECTOR (obj);
+      if (suspicious_object_index == ARRAYELTS (suspicious_objects))
+       suspicious_object_index = 0;
+    }
+#endif
+  return obj;
+}
+
 #ifdef ENABLE_CHECKING
 
 bool suppress_checking;
@@ -6980,6 +7249,7 @@ The time is in seconds as a floating point value.  */);
   defsubr (&Scons);
   defsubr (&Slist);
   defsubr (&Svector);
+  defsubr (&Sbool_vector);
   defsubr (&Smake_byte_code);
   defsubr (&Smake_list);
   defsubr (&Smake_vector);
@@ -6990,7 +7260,9 @@ The time is in seconds as a floating point value.  */);
   defsubr (&Spurecopy);
   defsubr (&Sgarbage_collect);
   defsubr (&Smemory_limit);
+  defsubr (&Smemory_info);
   defsubr (&Smemory_use_counts);
+  defsubr (&Ssuspicious_object);
 
 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
   defsubr (&Sgc_status);
@@ -7005,11 +7277,10 @@ The time is in seconds as a floating point value.  */);
 union
 {
   enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS;
-  enum CHAR_TABLE_STANDARD_SLOTS CHAR_TABLE_STANDARD_SLOTS;
+  enum char_table_specials char_table_specials;
   enum char_bits char_bits;
   enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE;
   enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE;
-  enum enum_USE_LSB_TAG enum_USE_LSB_TAG;
   enum Lisp_Bits Lisp_Bits;
   enum Lisp_Compiled Lisp_Compiled;
   enum maxargs maxargs;
index d98ddac0171c41b785cceb964900e171e439a652..ce782f6adb6e00bd716f001a41df0dc9eeffade5 100644 (file)
@@ -26,6 +26,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "atimer.h"
 #include <unistd.h>
 
+#ifdef HAVE_TIMERFD
+#include <errno.h>
+# include <sys/timerfd.h>
+#endif
+
 /* Free-list of atimer structures.  */
 
 static struct atimer *free_atimers;
@@ -40,32 +45,35 @@ static struct atimer *stopped_atimers;
 
 static struct atimer *atimers;
 
+#ifdef HAVE_ITIMERSPEC
 /* The alarm timer and whether it was properly initialized, if
    POSIX timers are available.  */
-#ifdef HAVE_ITIMERSPEC
 static timer_t alarm_timer;
 static bool alarm_timer_ok;
+
+# ifdef HAVE_TIMERFD
+/* File descriptor for timer, or -1 if it could not be created.  */
+static int timerfd;
+# else
+enum { timerfd = -1 };
+# endif
 #endif
 
 /* Block/unblock SIGALRM.  */
 
 static void
-sigmask_atimers (int how)
+block_atimers (sigset_t *oldset)
 {
   sigset_t blocked;
   sigemptyset (&blocked);
   sigaddset (&blocked, SIGALRM);
-  pthread_sigmask (how, &blocked, 0);
-}
-static void
-block_atimers (void)
-{
-  sigmask_atimers (SIG_BLOCK);
+  sigaddset (&blocked, SIGINT);
+  pthread_sigmask (SIG_BLOCK, &blocked, oldset);
 }
 static void
-unblock_atimers (void)
+unblock_atimers (sigset_t const *oldset)
 {
-  sigmask_atimers (SIG_UNBLOCK);
+  pthread_sigmask (SIG_SETMASK, oldset, 0);
 }
 
 /* Function prototypes.  */
@@ -75,20 +83,20 @@ static void schedule_atimer (struct atimer *);
 static struct atimer *append_atimer_lists (struct atimer *,
                                            struct atimer *);
 
-/* Start a new atimer of type TYPE.  TIME specifies when the timer is
+/* Start a new atimer of type TYPE.  TIMESTAMP specifies when the timer is
    ripe.  FN is the function to call when the timer fires.
    CLIENT_DATA is stored in the client_data member of the atimer
    structure returned and so made available to FN when it is called.
 
-   If TYPE is ATIMER_ABSOLUTE, TIME is the absolute time at which the
+   If TYPE is ATIMER_ABSOLUTE, TIMESTAMP is the absolute time at which the
    timer fires.
 
-   If TYPE is ATIMER_RELATIVE, the timer is ripe TIME s/us in the
+   If TYPE is ATIMER_RELATIVE, the timer is ripe TIMESTAMP seconds in the
    future.
 
    In both cases, the timer is automatically freed after it has fired.
 
-   If TYPE is ATIMER_CONTINUOUS, the timer fires every TIME s/us.
+   If TYPE is ATIMER_CONTINUOUS, the timer fires every TIMESTAMP seconds.
 
    Value is a pointer to the atimer started.  It can be used in calls
    to cancel_atimer; don't free it yourself.  */
@@ -98,9 +106,9 @@ start_atimer (enum atimer_type type, struct timespec timestamp,
              atimer_callback fn, void *client_data)
 {
   struct atimer *t;
+  sigset_t oldset;
 
-  /* Round TIME up to the next full second if we don't have
-     itimers.  */
+  /* Round TIMESTAMP up to the next full second if we don't have itimers.  */
 #ifndef HAVE_SETITIMER
   if (timestamp.tv_nsec != 0 && timestamp.tv_sec < TYPE_MAXIMUM (time_t))
     timestamp = make_timespec (timestamp.tv_sec + 1, 0);
@@ -122,7 +130,7 @@ start_atimer (enum atimer_type type, struct timespec timestamp,
   t->fn = fn;
   t->client_data = client_data;
 
-  block_atimers ();
+  block_atimers (&oldset);
 
   /* Compute the timer's expiration time.  */
   switch (type)
@@ -143,7 +151,7 @@ start_atimer (enum atimer_type type, struct timespec timestamp,
 
   /* Insert the timer in the list of active atimers.  */
   schedule_atimer (t);
-  unblock_atimers ();
+  unblock_atimers (&oldset);
 
   /* Arrange for a SIGALRM at the time the next atimer is ripe.  */
   set_alarm ();
@@ -158,8 +166,9 @@ void
 cancel_atimer (struct atimer *timer)
 {
   int i;
+  sigset_t oldset;
 
-  block_atimers ();
+  block_atimers (&oldset);
 
   for (i = 0; i < 2; ++i)
     {
@@ -186,7 +195,7 @@ cancel_atimer (struct atimer *timer)
        }
     }
 
-  unblock_atimers ();
+  unblock_atimers (&oldset);
 }
 
 
@@ -217,7 +226,8 @@ append_atimer_lists (struct atimer *list_1, struct atimer *list_2)
 void
 stop_other_atimers (struct atimer *t)
 {
-  block_atimers ();
+  sigset_t oldset;
+  block_atimers (&oldset);
 
   if (t)
     {
@@ -242,7 +252,7 @@ stop_other_atimers (struct atimer *t)
 
   stopped_atimers = append_atimer_lists (atimers, stopped_atimers);
   atimers = t;
-  unblock_atimers ();
+  unblock_atimers (&oldset);
 }
 
 
@@ -256,8 +266,9 @@ run_all_atimers (void)
     {
       struct atimer *t = atimers;
       struct atimer *next;
+      sigset_t oldset;
 
-      block_atimers ();
+      block_atimers (&oldset);
       atimers = stopped_atimers;
       stopped_atimers = NULL;
 
@@ -268,7 +279,7 @@ run_all_atimers (void)
          t = next;
        }
 
-      unblock_atimers ();
+      unblock_atimers (&oldset);
     }
 }
 
@@ -286,12 +297,20 @@ set_alarm (void)
       struct timespec now, interval;
 
 #ifdef HAVE_ITIMERSPEC
-      if (alarm_timer_ok)
+      if (0 <= timerfd || alarm_timer_ok)
        {
          struct itimerspec ispec;
          ispec.it_value = atimers->expiration;
          ispec.it_interval.tv_sec = ispec.it_interval.tv_nsec = 0;
-         if (timer_settime (alarm_timer, 0, &ispec, 0) == 0)
+# ifdef HAVE_TIMERFD
+         if (timerfd_settime (timerfd, TFD_TIMER_ABSTIME, &ispec, 0) == 0)
+           {
+             add_timer_wait_descriptor (timerfd);
+             return;
+           }
+# endif
+         if (alarm_timer_ok
+             && timer_settime (alarm_timer, TIMER_ABSTIME, &ispec, 0) == 0)
            return;
        }
 #endif
@@ -373,6 +392,37 @@ handle_alarm_signal (int sig)
   pending_signals = 1;
 }
 
+#ifdef HAVE_TIMERFD
+
+/* Called from wait_reading_process_output when FD, which
+   should be equal to TIMERFD, is available for reading.  */
+
+void
+timerfd_callback (int fd, void *arg)
+{
+  ptrdiff_t nbytes;
+  uint64_t expirations;
+
+  eassert (fd == timerfd);
+  nbytes = emacs_read (fd, &expirations, sizeof (expirations));
+
+  if (nbytes == sizeof (expirations))
+    {
+      /* Timer should expire just once.  */
+      eassert (expirations == 1);
+      do_pending_atimers ();
+    }
+  else if (nbytes < 0)
+    /* For some not yet known reason, we may get weird event and no
+       data on timer descriptor.  This can break Gnus at least, see:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00503.html.  */
+    eassert (errno == EAGAIN);
+  else
+    /* I don't know what else can happen with this descriptor.  */
+    emacs_abort ();
+}
+
+#endif /* HAVE_TIMERFD */
 
 /* Do pending timers.  */
 
@@ -381,9 +431,10 @@ do_pending_atimers (void)
 {
   if (atimers)
     {
-      block_atimers ();
+      sigset_t oldset;
+      block_atimers (&oldset);
       run_timers ();
-      unblock_atimers ();
+      unblock_atimers (&oldset);
     }
 }
 
@@ -397,23 +448,121 @@ turn_on_atimers (bool on)
   if (on)
     set_alarm ();
   else
-    alarm (0);
+    {
+#ifdef HAVE_ITIMERSPEC
+      struct itimerspec ispec;
+      memset (&ispec, 0, sizeof ispec);
+      if (alarm_timer_ok)
+       timer_settime (alarm_timer, TIMER_ABSTIME, &ispec, 0);
+# ifdef HAVE_TIMERFD
+      timerfd_settime (timerfd, TFD_TIMER_ABSTIME, &ispec, 0);
+# endif
+#endif
+      alarm (0);
+    }
 }
 
+/* This is intended to use from automated tests.  */
+
+#ifdef ENABLE_CHECKING
+
+#define MAXTIMERS 10
+
+struct atimer_result
+{
+  /* Time when we expect this timer to trigger.  */
+  struct timespec expected;
+
+  /* Timer status: -1 if not triggered, 0 if triggered
+     too early or too late, 1 if triggered timely.  */
+  int intime;
+};
+
+static void
+debug_timer_callback (struct atimer *t)
+{
+  struct timespec now = current_timespec ();
+  struct atimer_result *r = (struct atimer_result *) t->client_data;
+  int result = timespec_cmp (now, r->expected);
+
+  if (result < 0)
+    /* Too early.  */
+    r->intime = 0;
+  else if (result >= 0)
+    {
+#ifdef HAVE_SETITIMER
+      struct timespec delta = timespec_sub (now, r->expected);
+      /* Too late if later than expected + 0.01s.  FIXME:
+        this should depend from system clock resolution.  */
+      if (timespec_cmp (delta, make_timespec (0, 10000000)) > 0)
+       r->intime = 0;
+      else
+#endif /* HAVE_SETITIMER */
+       r->intime = 1;
+    }
+}
+
+DEFUN ("debug-timer-check", Fdebug_timer_check, Sdebug_timer_check, 0, 0, 0,
+       doc: /* Run internal self-tests to check timers subsystem.
+Return t if all self-tests are passed, nil otherwise.  */)
+  (void)
+{
+  int i, ok;
+  struct atimer *timer;
+  struct atimer_result *results[MAXTIMERS];
+  struct timespec t = make_timespec (0, 0);
+
+  /* Arm MAXTIMERS relative timers to trigger with 0.1s intervals.  */
+  for (i = 0; i < MAXTIMERS; i++)
+    {
+      results[i] = xmalloc (sizeof (struct atimer_result));
+      t = timespec_add (t, make_timespec (0, 100000000));
+      results[i]->expected = timespec_add (current_timespec (), t);
+      results[i]->intime = -1;
+      timer = start_atimer (ATIMER_RELATIVE, t,
+                           debug_timer_callback, results[i]);
+    }
+
+  /* Wait for 1s but process timers.  */
+  wait_reading_process_output (1, 0, 0, false, Qnil, NULL, 0);
+  /* Shut up the compiler by "using" this variable.  */
+  (void) timer;
+
+  for (i = 0, ok = 0; i < MAXTIMERS; i++)
+    ok += results[i]->intime, xfree (results[i]);
+
+  return ok == MAXTIMERS ? Qt : Qnil;
+}
+
+#endif /* ENABLE_CHECKING */
 
 void
 init_atimer (void)
 {
-  struct sigaction action;
 #ifdef HAVE_ITIMERSPEC
-  struct sigevent sigev;
-  sigev.sigev_notify = SIGEV_SIGNAL;
-  sigev.sigev_signo = SIGALRM;
-  sigev.sigev_value.sival_ptr = &alarm_timer;
-  alarm_timer_ok = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0;
+# ifdef HAVE_TIMERFD
+  /* Until this feature is considered stable, you can ask to not use it.  */
+  timerfd = (egetenv ("EMACS_IGNORE_TIMERFD") ? -1 :
+            timerfd_create (CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC));
+# endif
+  if (timerfd < 0)
+    {
+      struct sigevent sigev;
+      sigev.sigev_notify = SIGEV_SIGNAL;
+      sigev.sigev_signo = SIGALRM;
+      sigev.sigev_value.sival_ptr = &alarm_timer;
+      alarm_timer_ok
+       = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0;
+    }
 #endif
   free_atimers = stopped_atimers = atimers = NULL;
-  /* pending_signals is initialized in init_keyboard.*/
+
+  /* pending_signals is initialized in init_keyboard.  */
+  struct sigaction action;
   emacs_sigaction_init (&action, handle_alarm_signal);
   sigaction (SIGALRM, &action, 0);
+
+#ifdef ENABLE_CHECKING
+  defsubr (&Sdebug_timer_check);
+#endif
 }
index 379787abca79917f4c78faf5984f6c52d64c18fb..2386977cf8717448904ce5dc8fffacdeac18f8ab 100644 (file)
@@ -77,5 +77,8 @@ void init_atimer (void);
 void turn_on_atimers (bool);
 void stop_other_atimers (struct atimer *);
 void run_all_atimers (void);
+#ifdef HAVE_TIMERFD
+void timerfd_callback (int, void *);
+#endif
 
 #endif /* EMACS_ATIMER_H */
index 8077e47fa0bf8dd650f312b72d28544baf6b1e54..1973a93a57d87b5933c900961058552021ae3dca 100644 (file)
@@ -1,7 +1,6 @@
 /* Buffer manipulation primitives for GNU Emacs.
 
-Copyright (C) 1985-1989, 1993-1995, 1997-2014 Free Software Foundation,
-Inc.
+Copyright (C) 1985-1989, 1993-1995, 1997-2014 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -42,6 +41,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "keymap.h"
 #include "frame.h"
 
+#ifdef WINDOWSNT
+#include "w32heap.h"           /* for mmap_* */
+#endif
+
 struct buffer *current_buffer;         /* The current buffer.  */
 
 /* First buffer in chain of all buffers (in reverse order of creation).
@@ -142,6 +145,10 @@ Lisp_Object Qmodification_hooks;
 Lisp_Object Qinsert_in_front_hooks;
 Lisp_Object Qinsert_behind_hooks;
 
+Lisp_Object Qchoice, Qrange, Qleft, Qright;
+Lisp_Object Qvertical_scroll_bar, Qhorizontal_scroll_bar;
+static Lisp_Object Qoverwrite_mode, Qfraction;
+
 static void alloc_buffer_text (struct buffer *, ptrdiff_t);
 static void free_buffer_text (struct buffer *b);
 static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *);
@@ -337,6 +344,11 @@ bset_scroll_bar_width (struct buffer *b, Lisp_Object val)
   b->INTERNAL_FIELD (scroll_bar_width) = val;
 }
 static void
+bset_scroll_bar_height (struct buffer *b, Lisp_Object val)
+{
+  b->INTERNAL_FIELD (scroll_bar_height) = val;
+}
+static void
 bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val)
 {
   b->INTERNAL_FIELD (scroll_down_aggressively) = val;
@@ -362,6 +374,11 @@ bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val)
   b->INTERNAL_FIELD (vertical_scroll_bar_type) = val;
 }
 static void
+bset_horizontal_scroll_bar_type (struct buffer *b, Lisp_Object val)
+{
+  b->INTERNAL_FIELD (horizontal_scroll_bar_type) = val;
+}
+static void
 bset_word_wrap (struct buffer *b, Lisp_Object val)
 {
   b->INTERNAL_FIELD (word_wrap) = val;
@@ -1159,10 +1176,10 @@ DEFUN ("buffer-local-value", Fbuffer_local_value,
        Sbuffer_local_value, 2, 2, 0,
        doc: /* Return the value of VARIABLE in BUFFER.
 If VARIABLE does not have a buffer-local binding in BUFFER, the value
-is the default binding of the variable. */)
+is the default binding of the variable.  */)
   (register Lisp_Object variable, register Lisp_Object buffer)
 {
-  register Lisp_Object result = buffer_local_value_1 (variable, buffer);
+  register Lisp_Object result = buffer_local_value (variable, buffer);
 
   if (EQ (result, Qunbound))
     xsignal1 (Qvoid_variable, variable);
@@ -1175,7 +1192,7 @@ is the default binding of the variable. */)
    locally unbound.  */
 
 Lisp_Object
-buffer_local_value_1 (Lisp_Object variable, Lisp_Object buffer)
+buffer_local_value (Lisp_Object variable, Lisp_Object buffer)
 {
   register struct buffer *buf;
   register Lisp_Object result;
@@ -1380,7 +1397,6 @@ It is not ensured that mode lines will be updated to show the modified
 state of the current buffer.  Use with care.  */)
   (Lisp_Object flag)
 {
-#ifdef CLASH_DETECTION
   Lisp_Object fn;
 
   /* If buffer becoming modified, lock the file.
@@ -1400,7 +1416,6 @@ state of the current buffer.  Use with care.  */)
       else if (already && NILP (flag))
        unlock_file (fn);
     }
-#endif /* CLASH_DETECTION */
 
   /* Here we have a problem.  SAVE_MODIFF is used here to encode
      buffer-modified-p (as SAVE_MODIFF<MODIFF) as well as
@@ -1820,10 +1835,8 @@ cleaning up all windows currently displaying the buffer to be killed. */)
 
   /* Now there is no question: we can kill the buffer.  */
 
-#ifdef CLASH_DETECTION
   /* Unlock this buffer's file, if it is locked.  */
   unlock_buffer (b);
-#endif /* CLASH_DETECTION */
 
   GCPRO1 (buffer);
   kill_buffer_processes (buffer);
@@ -2427,6 +2440,14 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
                       make_number
                       (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))),
                       XWINDOW (w)->contents);
+       /* Blindly copied from pointm part.  */
+       if (MARKERP (XWINDOW (w)->old_pointm)
+           && (EQ (XWINDOW (w)->contents, buf1)
+               || EQ (XWINDOW (w)->contents, buf2)))
+         Fset_marker (XWINDOW (w)->old_pointm,
+                      make_number
+                      (BUF_BEGV (XBUFFER (XWINDOW (w)->contents))),
+                      XWINDOW (w)->contents);
        if (MARKERP (XWINDOW (w)->start)
            && (EQ (XWINDOW (w)->contents, buf1)
                || EQ (XWINDOW (w)->contents, buf2)))
@@ -2531,7 +2552,7 @@ current buffer is cleared.  */)
              p = GAP_END_ADDR;
              stop = Z;
            }
-         if (ASCII_BYTE_P (*p))
+         if (ASCII_CHAR_P (*p))
            p++, pos++;
          else if (CHAR_BYTE8_HEAD_P (*p))
            {
@@ -2603,7 +2624,7 @@ current buffer is cleared.  */)
              stop = Z;
            }
 
-         if (ASCII_BYTE_P (*p))
+         if (ASCII_CHAR_P (*p))
            p++, pos++;
          else if (EQ (flag, Qt)
                   && ! CHAR_BYTE8_HEAD_P (*p)
@@ -4637,7 +4658,8 @@ evaporate_overlays (ptrdiff_t pos)
                         Allocation with mmap
  ***********************************************************************/
 
-#ifdef USE_MMAP_FOR_BUFFERS
+/* Note: WINDOWSNT implements this stuff on w32heap.c.  */
+#if defined USE_MMAP_FOR_BUFFERS && !defined WINDOWSNT
 
 #include <sys/mman.h>
 
@@ -4703,11 +4725,6 @@ static struct mmap_region *mmap_regions;
 
 static int mmap_fd;
 
-/* Temporary storage for mmap_set_vars, see there.  */
-
-static struct mmap_region *mmap_regions_1;
-static int mmap_fd_1;
-
 /* Page size on this system.  */
 
 static int mmap_page_size;
@@ -4779,36 +4796,6 @@ mmap_init (void)
   mmap_page_size = getpagesize ();
 }
 
-/* Return a region overlapping address range START...END, or null if
-   none.  END is not including, i.e. the last byte in the range
-   is at END - 1.  */
-
-static struct mmap_region *
-mmap_find (void *start, void *end)
-{
-  struct mmap_region *r;
-  char *s = start, *e = end;
-
-  for (r = mmap_regions; r; r = r->next)
-    {
-      char *rstart = (char *) r;
-      char *rend   = rstart + r->nbytes_mapped;
-
-      if (/* First byte of range, i.e. START, in this region?  */
-         (s >= rstart && s < rend)
-         /* Last byte of range, i.e. END - 1, in this region?  */
-         || (e > rstart && e <= rend)
-         /* First byte of this region in the range?  */
-         || (rstart >= s && rstart < e)
-         /* Last byte of this region in the range?  */
-         || (rend > s && rend <= e))
-       break;
-    }
-
-  return r;
-}
-
-
 /* Unmap a region.  P is a pointer to the start of the user-araa of
    the region.  */
 
@@ -4885,38 +4872,6 @@ mmap_enlarge (struct mmap_region *r, int npages)
 }
 
 
-/* Set or reset variables holding references to mapped regions.
-   If not RESTORE_P, set all variables to null.  If RESTORE_P, set all
-   variables to the start of the user-areas of mapped regions.
-
-   This function is called from Fdump_emacs to ensure that the dumped
-   Emacs doesn't contain references to memory that won't be mapped
-   when Emacs starts.  */
-
-void
-mmap_set_vars (bool restore_p)
-{
-  struct mmap_region *r;
-
-  if (restore_p)
-    {
-      mmap_regions = mmap_regions_1;
-      mmap_fd = mmap_fd_1;
-      for (r = mmap_regions; r; r = r->next)
-       *r->var = MMAP_USER_AREA (r);
-    }
-  else
-    {
-      for (r = mmap_regions; r; r = r->next)
-       *r->var = NULL;
-      mmap_regions_1 = mmap_regions;
-      mmap_regions = NULL;
-      mmap_fd_1 = mmap_fd;
-      mmap_fd = -1;
-    }
-}
-
-
 /* Allocate a block of storage large enough to hold NBYTES bytes of
    data.  A pointer to the data is returned in *VAR.  VAR is thus the
    address of some variable which will use the data area.
@@ -5221,7 +5176,9 @@ init_buffer_once (void)
   bset_right_fringe_width (&buffer_defaults, Qnil);
   bset_fringes_outside_margins (&buffer_defaults, Qnil);
   bset_scroll_bar_width (&buffer_defaults, Qnil);
+  bset_scroll_bar_height (&buffer_defaults, Qnil);
   bset_vertical_scroll_bar_type (&buffer_defaults, Qt);
+  bset_horizontal_scroll_bar_type (&buffer_defaults, Qt);
   bset_indicate_empty_lines (&buffer_defaults, Qnil);
   bset_indicate_buffer_boundaries (&buffer_defaults, Qnil);
   bset_fringe_indicator_alist (&buffer_defaults, Qnil);
@@ -5289,7 +5246,9 @@ init_buffer_once (void)
   XSETFASTINT (BVAR (&buffer_local_flags, right_fringe_width), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, fringes_outside_margins), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_width), idx); ++idx;
+  XSETFASTINT (BVAR (&buffer_local_flags, scroll_bar_height), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx;
+  XSETFASTINT (BVAR (&buffer_local_flags, horizontal_scroll_bar_type), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, indicate_empty_lines), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx;
   XSETFASTINT (BVAR (&buffer_local_flags, fringe_indicator_alist), idx); ++idx;
@@ -5334,23 +5293,57 @@ init_buffer_once (void)
 }
 
 void
-init_buffer (void)
+init_buffer (int initialized)
 {
   char *pwd;
   Lisp_Object temp;
   ptrdiff_t len;
 
 #ifdef USE_MMAP_FOR_BUFFERS
- {
-   /* When using the ralloc implementation based on mmap(2), buffer
-      text pointers will have been set to null in the dumped Emacs.
-      Map new memory.  */
-   struct buffer *b;
-
-   FOR_EACH_BUFFER (b)
-     if (b->text->beg == NULL)
-       enlarge_buffer_text (b, 0);
- }
+  if (initialized)
+    {
+      struct buffer *b;
+
+#ifndef WINDOWSNT
+      /* These must be reset in the dumped Emacs, to avoid stale
+        references to mmap'ed memory from before the dump.
+
+        WINDOWSNT doesn't need this because it doesn't track mmap'ed
+        regions by hand (see w32heap.c, which uses system APIs for
+        that purpose), and thus doesn't use mmap_regions.  */
+      mmap_regions = NULL;
+      mmap_fd = -1;
+#endif
+
+      /* The dumped buffers reference addresses of buffer text
+        recorded by temacs, that cannot be used by the dumped Emacs.
+        We map new memory for their text here.
+
+        Implementation note: the buffers we carry from temacs are:
+        " prin1", "*scratch*", " *Minibuf-0*", "*Messages*", and
+        " *code-conversion-work*".  They are created by
+        init_buffer_once and init_window_once (which are not called
+        in the dumped Emacs), and by the first call to coding.c routines.  */
+      FOR_EACH_BUFFER (b)
+        {
+         b->text->beg = NULL;
+         enlarge_buffer_text (b, 0);
+       }
+    }
+  else
+    {
+      struct buffer *b;
+
+      /* Only buffers with allocated buffer text should be present at
+        this point in temacs.  */
+      FOR_EACH_BUFFER (b)
+        {
+         eassert (b->text->beg != NULL);
+       }
+    }
+#else  /* not USE_MMAP_FOR_BUFFERS */
+  /* Avoid compiler warnings.  */
+  initialized = initialized;
 #endif /* USE_MMAP_FOR_BUFFERS */
 
   Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
@@ -5455,6 +5448,10 @@ syms_of_buffer (void)
   staticpro (&Qpermanent_local);
   staticpro (&Qkill_buffer_hook);
 
+  DEFSYM (Qleft, "left");
+  DEFSYM (Qright, "right");
+  DEFSYM (Qrange, "range");
+
   DEFSYM (Qpermanent_local_hook, "permanent-local-hook");
   DEFSYM (Qoverlayp, "overlayp");
   DEFSYM (Qevaporate, "evaporate");
@@ -5470,6 +5467,18 @@ syms_of_buffer (void)
   DEFSYM (Qafter_change_functions, "after-change-functions");
   DEFSYM (Qkill_buffer_query_functions, "kill-buffer-query-functions");
 
+  DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar");
+  Fput (Qvertical_scroll_bar, Qchoice, list4 (Qnil, Qt, Qleft, Qright));
+  DEFSYM (Qhorizontal_scroll_bar, "horizontal-scroll-bar");
+
+  DEFSYM (Qfraction, "fraction");
+  Fput (Qfraction, Qrange, Fcons (make_float (0.0), make_float (1.0)));
+
+  DEFSYM (Qoverwrite_mode, "overwrite-mode");
+  Fput (Qoverwrite_mode, Qchoice,
+       list3 (Qnil, intern ("overwrite-mode-textual"),
+              intern ("overwrite-mode-binary")));
+
   Fput (Qprotected_field, Qerror_conditions,
        listn (CONSTYPE_PURE, 2, Qprotected_field, Qerror));
   Fput (Qprotected_field, Qerror_message,
@@ -5875,7 +5884,8 @@ in a file, save the ^M as a newline.  */);
                     Qnil,
                     doc: /* Non-nil means display ... on previous line when a line is invisible.  */);
 
-  DEFVAR_PER_BUFFER ("overwrite-mode", &BVAR (current_buffer, overwrite_mode), Qnil,
+  DEFVAR_PER_BUFFER ("overwrite-mode", &BVAR (current_buffer, overwrite_mode),
+                    Qoverwrite_mode,
                     doc: /* Non-nil if self-insertion should replace existing text.
 The value should be one of `overwrite-mode-textual',
 `overwrite-mode-binary', or nil.
@@ -5968,8 +5978,13 @@ in a window.  To make the change take effect, call `set-window-buffer'.  */);
                     doc: /* Width of this buffer's scroll bars in pixels.
 A value of nil means to use the scroll bar width from the window's frame.  */);
 
+  DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, scroll_bar_height),
+                    Qintegerp,
+                    doc: /* Height of this buffer's scroll bars in pixels.
+A value of nil means to use the scroll bar heiht from the window's frame.  */);
+
   DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type),
-                    Qnil,
+                    Qvertical_scroll_bar,
                     doc: /* Position of this buffer's vertical scroll bar.
 The value takes effect whenever you tell a window to display this buffer;
 for instance, with `set-window-buffer' or when `display-buffer' displays it.
@@ -5978,6 +5993,17 @@ A value of `left' or `right' means put the vertical scroll bar at that side
 of the window; a value of nil means don't show any vertical scroll bars.
 A value of t (the default) means do whatever the window's frame specifies.  */);
 
+  DEFVAR_PER_BUFFER ("horizontal-scroll-bar", &BVAR (current_buffer, horizontal_scroll_bar_type),
+                    Qnil,
+                    doc: /* Position of this buffer's horizontal scroll bar.
+The value takes effect whenever you tell a window to display this buffer;
+for instance, with `set-window-buffer' or when `display-buffer' displays it.
+
+A value of `bottom' means put the horizontal scroll bar at the bottom of
+the window; a value of nil means don't show any horizonal scroll bars.
+A value of t (the default) means do whatever the window's frame
+specifies.  */);
+
   DEFVAR_PER_BUFFER ("indicate-empty-lines",
                     &BVAR (current_buffer, indicate_empty_lines), Qnil,
                     doc: /* Visually indicate empty lines after the buffer end.
@@ -6044,7 +6070,7 @@ BITMAP is the corresponding fringe bitmap shown for the logical
 cursor type.  */);
 
   DEFVAR_PER_BUFFER ("scroll-up-aggressively",
-                    &BVAR (current_buffer, scroll_up_aggressively), Qfloatp,
+                    &BVAR (current_buffer, scroll_up_aggressively), Qfraction,
                     doc: /* How far to scroll windows upward.
 If you move point off the bottom, the window scrolls automatically.
 This variable controls how far it scrolls.  The value nil, the default,
@@ -6057,7 +6083,7 @@ window scrolls by a full window height.  Meaningful values are
 between 0.0 and 1.0, inclusive.  */);
 
   DEFVAR_PER_BUFFER ("scroll-down-aggressively",
-                    &BVAR (current_buffer, scroll_down_aggressively), Qfloatp,
+                    &BVAR (current_buffer, scroll_down_aggressively), Qfraction,
                     doc: /* How far to scroll windows downward.
 If you move point off the top, the window scrolls automatically.
 This variable controls how far it scrolls.  The value nil, the default,
index de117eb9c61a15a9a42f1e5f5e86f9bd6b93cffd..fd989925976e6d41ce7153080319d738803758bf 100644 (file)
@@ -694,10 +694,12 @@ struct buffer
      othersize draw them between margin areas and text.  */
   Lisp_Object INTERNAL_FIELD (fringes_outside_margins);
 
-  /* Width and type of scroll bar areas for windows displaying
+  /* Width, height and types of scroll bar areas for windows displaying
      this buffer.  */
   Lisp_Object INTERNAL_FIELD (scroll_bar_width);
+  Lisp_Object INTERNAL_FIELD (scroll_bar_height);
   Lisp_Object INTERNAL_FIELD (vertical_scroll_bar_type);
+  Lisp_Object INTERNAL_FIELD (horizontal_scroll_bar_type);
 
   /* Non-nil means indicate lines not displaying text (in a style
      like vi).  */
@@ -1079,7 +1081,7 @@ extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **);
 extern void validate_region (Lisp_Object *, Lisp_Object *);
 extern void set_buffer_internal_1 (struct buffer *);
 extern void set_buffer_temp (struct buffer *);
-extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object);
+extern Lisp_Object buffer_local_value (Lisp_Object, Lisp_Object);
 extern void record_buffer (Lisp_Object);
 extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t);
 extern void mmap_set_vars (bool);
@@ -1135,6 +1137,8 @@ extern Lisp_Object Qbefore_change_functions;
 extern Lisp_Object Qafter_change_functions;
 extern Lisp_Object Qfirst_change_hook;
 extern Lisp_Object Qpriority, Qbefore_string, Qafter_string;
+extern Lisp_Object Qchoice, Qrange, Qleft, Qright;
+extern Lisp_Object Qvertical_scroll_bar, Qhorizontal_scroll_bar;
 
 /* FOR_EACH_LIVE_BUFFER (LIST_VAR, BUF_VAR) followed by a statement is
    a `for' loop which iterates over the buffers from Vbuffer_alist.  */
index f1bdfd9d9c5f28c87851c0f19e4e4a88598d9a57..ca6681f21e95d0dbde078cd498534dfc824e51d1 100644 (file)
@@ -292,8 +292,6 @@ enum byte_code_op
     Bscan_buffer = 0153, /* No longer generated as of v18.  */
     Bset_mark = 0163, /* this loser is no longer generated as of v18 */
 #endif
-
-    B__dummy__ = 0  /* Pacify C89.  */
 };
 
 /* Whether to maintain a `top' and `bottom' field in the stack frame.  */
@@ -390,7 +388,11 @@ unmark_byte_stack (void)
 \f
 /* Fetch the next byte from the bytecode stream.  */
 
+#ifdef BYTE_CODE_SAFE
+#define FETCH (eassert (stack.byte_string_start == SDATA (stack.byte_string)), *stack.pc++)
+#else
 #define FETCH *stack.pc++
+#endif
 
 /* Fetch two bytes from the bytecode stream and make a 16-bit number
    out of them.  */
index 35411bf9b5c08512dc507b7a7d7da7d8f9622782..817f84d897be5d5335098e1c67b3eae4a0299e8c 100644 (file)
@@ -29,7 +29,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "keymap.h"
 
 Lisp_Object Qminus, Qplus;
-static Lisp_Object Qcall_interactively;
+static Lisp_Object Qfuncall_interactively;
 static Lisp_Object Qcommand_debug_status;
 static Lisp_Object Qenable_recursive_minibuffers;
 
@@ -38,8 +38,8 @@ static Lisp_Object Qread_number;
 
 Lisp_Object Qmouse_leave_buffer_hook;
 
-static Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif;
-Lisp_Object Qwhen;
+static Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qif;
+Lisp_Object Qwhen, Qprogn;
 static Lisp_Object preserved_fns;
 
 /* Marker used within call-interactively to refer to point.  */
@@ -233,6 +233,43 @@ fix_command (Lisp_Object input, Lisp_Object values)
     }
 }
 
+/* Helper function to call `read-file-name' from C.  */
+
+static Lisp_Object
+read_file_name (Lisp_Object default_filename, Lisp_Object mustmatch,
+               Lisp_Object initial, Lisp_Object predicate)
+{
+  struct gcpro gcpro1;
+  Lisp_Object args[7];
+
+  GCPRO1 (default_filename);
+  args[0] = intern ("read-file-name");
+  args[1] = callint_message;
+  args[2] = Qnil;
+  args[3] = default_filename;
+  args[4] = mustmatch;
+  args[5] = initial;
+  args[6] = predicate;
+  RETURN_UNGCPRO (Ffuncall (7, args));
+}
+
+/* BEWARE: Calling this directly from C would defeat the purpose!  */
+DEFUN ("funcall-interactively", Ffuncall_interactively, Sfuncall_interactively,
+       1, MANY, 0, doc: /* Like `funcall' but marks the call as interactive.
+I.e. arrange that within the called function `called-interactively-p' will
+return non-nil.
+usage: (funcall-interactively FUNCTION &rest ARGUMENTS)  */)
+     (ptrdiff_t nargs, Lisp_Object *args)
+{
+  ptrdiff_t speccount = SPECPDL_INDEX ();
+  temporarily_switch_to_single_kboard (NULL);
+
+  /* Nothing special to do here, all the work is inside
+     `called-interactively-p'.  Which will look for us as a marker in the
+     backtrace.  */
+  return unbind_to (speccount, Ffuncall (nargs, args));
+}
+
 DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0,
        doc: /* Call FUNCTION, providing args according to its interactive calling specs.
 Return the value FUNCTION returns.
@@ -374,8 +411,13 @@ invoke it.  If KEYS is omitted or nil, the return value of
       Vreal_this_command = save_real_this_command;
       kset_last_command (current_kboard, save_last_command);
 
-      temporarily_switch_to_single_kboard (NULL);
-      return unbind_to (speccount, apply1 (function, specs));
+      {
+       Lisp_Object args[3];
+       args[0] = Qfuncall_interactively;
+       args[1] = function;
+       args[2] = specs;
+       return unbind_to (speccount, Fapply (3, args));
+      }
     }
 
   /* Here if function specifies a string to control parsing the defaults.  */
@@ -446,10 +488,11 @@ invoke it.  If KEYS is omitted or nil, the return value of
       else break;
     }
 
-  /* Count the number of arguments, which is one plus the number of arguments
-     the interactive spec would have us give to the function.  */
+  /* Count the number of arguments, which is two (the function itself and
+     `funcall-interactively') plus the number of arguments the interactive spec
+     would have us give to the function.  */
   tem = string;
-  for (nargs = 1; *tem; )
+  for (nargs = 2; *tem; )
     {
       /* 'r' specifications ("point and mark as 2 numeric args")
         produce *two* arguments.  */
@@ -488,13 +531,13 @@ invoke it.  If KEYS is omitted or nil, the return value of
     specbind (Qenable_recursive_minibuffers, Qt);
 
   tem = string;
-  for (i = 1; *tem; i++)
+  for (i = 2; *tem; i++)
     {
-      visargs[0] = make_string (tem + 1, strcspn (tem + 1, "\n"));
-      if (strchr (SSDATA (visargs[0]), '%'))
-       callint_message = Fformat (i, visargs);
+      visargs[1] = make_string (tem + 1, strcspn (tem + 1, "\n"));
+      if (strchr (SSDATA (visargs[1]), '%'))
+       callint_message = Fformat (i - 1, visargs + 1);
       else
-       callint_message = visargs[0];
+       callint_message = visargs[1];
 
       switch (*tem)
        {
@@ -551,25 +594,21 @@ invoke it.  If KEYS is omitted or nil, the return value of
          break;
 
        case 'D':               /* Directory name.  */
-         args[i] = Fread_file_name (callint_message, Qnil,
-                                    BVAR (current_buffer, directory), Qlambda, Qnil,
-                                    Qfile_directory_p);
+         args[i] = read_file_name (BVAR (current_buffer, directory), Qlambda, Qnil,
+                                   Qfile_directory_p);
          break;
 
        case 'f':               /* Existing file name.  */
-         args[i] = Fread_file_name (callint_message,
-                                    Qnil, Qnil, Qlambda, Qnil, Qnil);
+         args[i] = read_file_name (Qnil, Qlambda, Qnil, Qnil);
          break;
 
        case 'F':               /* Possibly nonexistent file name.  */
-         args[i] = Fread_file_name (callint_message,
-                                    Qnil, Qnil, Qnil, Qnil, Qnil);
+         args[i] = read_file_name (Qnil, Qnil, Qnil, Qnil);
          break;
 
        case 'G':               /* Possibly nonexistent file name,
                                   default to directory alone.  */
-         args[i] = Fread_file_name (callint_message,
-                                    Qnil, Qnil, Qnil, empty_unibyte_string, Qnil);
+         args[i] = read_file_name (Qnil, Qnil, empty_unibyte_string, Qnil);
          break;
 
        case 'i':               /* Ignore an argument -- Does not do I/O.  */
@@ -789,21 +828,22 @@ invoke it.  If KEYS is omitted or nil, the return value of
 
   QUIT;
 
-  args[0] = function;
+  args[0] = Qfuncall_interactively;
+  args[1] = function;
 
   if (arg_from_tty || !NILP (record_flag))
     {
       /* We don't need `visargs' any more, so let's recycle it since we need
         an array of just the same size.  */
-      visargs[0] = function;
-      for (i = 1; i < nargs; i++)
+      visargs[1] = function;
+      for (i = 2; i < nargs; i++)
        {
          if (varies[i] > 0)
            visargs[i] = list1 (intern (callint_argfuns[varies[i]]));
          else
            visargs[i] = quotify_arg (args[i]);
        }
-      Vcommand_history = Fcons (Flist (nargs, visargs),
+      Vcommand_history = Fcons (Flist (nargs - 1, visargs + 1),
                                Vcommand_history);
       /* Don't keep command history around forever.  */
       if (INTEGERP (Vhistory_length) && XINT (Vhistory_length) > 0)
@@ -816,7 +856,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
 
   /* If we used a marker to hold point, mark, or an end of the region,
      temporarily, convert it to an integer now.  */
-  for (i = 1; i < nargs; i++)
+  for (i = 2; i < nargs; i++)
     if (varies[i] >= 1 && varies[i] <= 4)
       XSETINT (args[i], marker_position (args[i]));
 
@@ -829,11 +869,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
   kset_last_command (current_kboard, save_last_command);
 
   {
-    Lisp_Object val;
-    specbind (Qcommand_debug_status, Qnil);
-
-    temporarily_switch_to_single_kboard (NULL);
-    val = Ffuncall (nargs, args);
+    Lisp_Object val = Ffuncall (nargs, args);
     UNGCPRO;
     return unbind_to (speccount, val);
   }
@@ -888,7 +924,7 @@ syms_of_callint (void)
   DEFSYM (Qplus, "+");
   DEFSYM (Qhandle_shift_selection, "handle-shift-selection");
   DEFSYM (Qread_number, "read-number");
-  DEFSYM (Qcall_interactively, "call-interactively");
+  DEFSYM (Qfuncall_interactively, "funcall-interactively");
   DEFSYM (Qcommand_debug_status, "command-debug-status");
   DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers");
   DEFSYM (Qmouse_leave_buffer_hook, "mouse-leave-buffer-hook");
@@ -946,5 +982,6 @@ a way to turn themselves off when a mouse command switches windows.  */);
 
   defsubr (&Sinteractive);
   defsubr (&Scall_interactively);
+  defsubr (&Sfuncall_interactively);
   defsubr (&Sprefix_numeric_value);
 }
index 7ba3e398b41e9f6cace04b6175444d68c68d8be7..2f68ea6f32802e361b7507611206f6aada9fc502 100644 (file)
@@ -105,29 +105,6 @@ enum
 
 static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
 \f
-
-#ifndef MSDOS
-/* Block SIGCHLD.  */
-
-void
-block_child_signal (void)
-{
-  sigset_t blocked;
-  sigemptyset (&blocked);
-  sigaddset (&blocked, SIGCHLD);
-  pthread_sigmask (SIG_BLOCK, &blocked, 0);
-}
-
-/* Unblock SIGCHLD.  */
-
-void
-unblock_child_signal (void)
-{
-  pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
-}
-
-#endif /* !MSDOS */
-
 /* Return the current buffer's working directory, or the home
    directory if it's unreachable, as a string suitable for a system call.
    Signal an error if the result would not be an accessible directory.  */
@@ -167,7 +144,8 @@ void
 record_kill_process (struct Lisp_Process *p, Lisp_Object tempfile)
 {
 #ifndef MSDOS
-  block_child_signal ();
+  sigset_t oldset;
+  block_child_signal (&oldset);
 
   if (p->alive)
     {
@@ -176,7 +154,7 @@ record_kill_process (struct Lisp_Process *p, Lisp_Object tempfile)
       kill (- p->pid, SIGKILL);
     }
 
-  unblock_child_signal ();
+  unblock_child_signal (&oldset);
 #endif /* !MSDOS */
 }
 
@@ -321,6 +299,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
   char *tempfile = NULL;
   int pid;
 #else
+  sigset_t oldset;
   pid_t pid;
 #endif
   int child_errno;
@@ -637,7 +616,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
 #ifndef MSDOS
 
   block_input ();
-  block_child_signal ();
+  block_child_signal (&oldset);
 
 #ifdef WINDOWSNT
   pid = child_setup (filefd, fd_output, fd_error, new_argv, 0, current_dir);
@@ -679,7 +658,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
 
   if (pid == 0)
     {
-      unblock_child_signal ();
+      unblock_child_signal (&oldset);
 
       setsid ();
 
@@ -715,7 +694,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
        }
     }
 
-  unblock_child_signal ();
+  unblock_child_signal (&oldset);
   unblock_input ();
 
   if (pid < 0)
@@ -1003,7 +982,7 @@ create_temp_file (ptrdiff_t nargs, Lisp_Object *args,
 
     count = SPECPDL_INDEX ();
     record_unwind_protect_nothing ();
-    fd = mkostemp (tempfile, O_CLOEXEC);
+    fd = mkostemp (tempfile, O_BINARY | O_CLOEXEC);
     if (fd < 0)
       report_file_error ("Failed to open temporary file using pattern",
                         pattern);
@@ -1628,13 +1607,13 @@ init_callproc (void)
 
       srcdir = Fexpand_file_name (build_string ("../src/"), lispdir);
 
-      tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
+      tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory);
       tem1 = Ffile_exists_p (tem);
       if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1))
        {
          Lisp_Object newdir;
          newdir = Fexpand_file_name (build_string ("../etc/"), lispdir);
-         tem = Fexpand_file_name (build_string ("GNU"), newdir);
+         tem = Fexpand_file_name (build_string ("NEWS"), newdir);
          tem1 = Ffile_exists_p (tem);
          if (!NILP (tem1))
            Vdata_directory = newdir;
index 187f60270187f2a3a48efb906d9cf7ab7bf9c287..54093bf5677a33d4c72a791277bdb1609867413a 100644 (file)
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2160,11 +2160,8 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY
     ASET (status, i, make_number (ccl.reg[i]));
   ASET (status, 8, make_number (ccl.ic));
 
-  if (NILP (unibyte_p))
-    val = make_multibyte_string ((char *) outbuf, produced_chars,
-                                outp - outbuf);
-  else
-    val = make_unibyte_string ((char *) outbuf, produced_chars);
+  val = make_specified_string ((const char *) outbuf, produced_chars,
+                              outp - outbuf, NILP (unibyte_p));
   xfree (outbuf);
 
   return val;
index 12a95203527a803b82e7462d8a92bcb388d1c1a2..a8e48dfd774231eabd94c3fa7b22054ca1b08745 100644 (file)
@@ -233,32 +233,6 @@ translate_char (Lisp_Object table, int c)
   return c;
 }
 
-/* Convert ASCII or 8-bit character C to unibyte.  If C is none of
-   them, return (C & 0xFF).  */
-
-int
-multibyte_char_to_unibyte (int c)
-{
-  if (c < 0x80)
-    return c;
-  if (CHAR_BYTE8_P (c))
-    return CHAR_TO_BYTE8 (c);
-  return (c & 0xFF);
-}
-
-/* Like multibyte_char_to_unibyte, but return -1 if C is not supported
-   by charset_unibyte.  */
-
-int
-multibyte_char_to_unibyte_safe (int c)
-{
-  if (c < 0x80)
-    return c;
-  if (CHAR_BYTE8_P (c))
-    return CHAR_TO_BYTE8 (c);
-  return -1;
-}
-
 DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0,
        doc: /* Return non-nil if OBJECT is a character.
 In Emacs Lisp, characters are represented by character codes, which
index 6f243a1392d95086e762645d92960219bf467d02..66cd4e47ef858f4f995026e7a5993d267e7953bb 100644 (file)
@@ -67,20 +67,15 @@ INLINE_HEADER_BEGIN
 #define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00)
 
 #define UNIBYTE_TO_CHAR(byte) \
-  (ASCII_BYTE_P (byte) ? (byte) : BYTE8_TO_CHAR (byte))
+  (ASCII_CHAR_P (byte) ? (byte) : BYTE8_TO_CHAR (byte))
 
 /* Return the raw 8-bit byte for character C.  */
-#define CHAR_TO_BYTE8(c)       \
-  (CHAR_BYTE8_P (c)            \
-   ? (c) - 0x3FFF00            \
-   : multibyte_char_to_unibyte (c))
+#define CHAR_TO_BYTE8(c) (CHAR_BYTE8_P (c) ? (c) - 0x3FFF00 : (c & 0xFF))
 
 /* Return the raw 8-bit byte for character C,
    or -1 if C doesn't correspond to a byte.  */
-#define CHAR_TO_BYTE_SAFE(c)   \
-  (CHAR_BYTE8_P (c)            \
-   ? (c) - 0x3FFF00            \
-   : multibyte_char_to_unibyte_safe (c))
+#define CHAR_TO_BYTE_SAFE(c)                                           \
+  (ASCII_CHAR_P (c) ? c : (CHAR_BYTE8_P (c) ? (c) - 0x3FFF00 : -1))
 
 /* Nonzero iff BYTE is the 1st byte of a multibyte form of a character
    that corresponds to a raw 8-bit byte.  */
@@ -101,13 +96,6 @@ INLINE_HEADER_BEGIN
 /* This is the maximum byte length of multibyte form.  */
 #define MAX_MULTIBYTE_LENGTH 5
 
-/* Return a Lisp character whose character code is C.  Assumes C is
-   a valid character code.  */
-#define make_char(c) make_number (c)
-
-/* Nonzero iff C is an ASCII byte.  */
-#define ASCII_BYTE_P(c) UNSIGNED_CMP (c, <, 0x80)
-
 /* Nonzero iff X is a character.  */
 #define CHARACTERP(x) (NATNUMP (x) && XFASTINT (x) <= MAX_CHAR)
 
@@ -222,7 +210,7 @@ INLINE_HEADER_BEGIN
 
 /* Nonzero iff BYTE starts a character in a multibyte form.
    This is equivalent to:
-       (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte))  */
+       (ASCII_CHAR_P (byte) || LEADING_CODE_P (byte))  */
 #define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
 
 /* How many bytes a character that starts with BYTE occupies in a
@@ -679,6 +667,20 @@ extern Lisp_Object string_escape_byte8 (Lisp_Object);
 #define GET_TRANSLATION_TABLE(id) \
   (XCDR (XVECTOR (Vtranslation_table_vector)->contents[(id)]))
 
+/* Look up the element in char table OBJ at index CH, and return it as
+   an integer.  If the element is not a character, return CH itself.  */
+
+INLINE int
+char_table_translate (Lisp_Object obj, int ch)
+{
+  /* This internal function is expected to be called with valid arguments,
+     so there is a eassert instead of CHECK_xxx for the sake of speed.  */
+  eassert (CHAR_VALID_P (ch));
+  eassert (CHAR_TABLE_P (obj));
+  obj = CHAR_TABLE_REF (obj, ch);
+  return CHARACTERP (obj) ? XINT (obj) : ch;
+}
+
 INLINE_HEADER_END
 
 #endif /* EMACS_CHARACTER_H */
index 3566b156736939053160394e0e1e563717323980..341ac356aff2674c71dbd3ab87c6d6d91869f455 100644 (file)
@@ -389,12 +389,12 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries,
        {
          if (ascii_compatible_p)
            {
-             if (! ASCII_BYTE_P (from_c))
+             if (! ASCII_CHAR_P (from_c))
                {
                  if (from_c < nonascii_min_char)
                    nonascii_min_char = from_c;
                }
-             else if (! ASCII_BYTE_P (to_c))
+             else if (! ASCII_CHAR_P (to_c))
                {
                  nonascii_min_char = 0x80;
                }
@@ -1522,7 +1522,7 @@ find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars,
 
            if (!NILP (table))
              c = translate_char (table, c);
-           if (ASCII_BYTE_P (c))
+           if (ASCII_CHAR_P (c))
              ASET (charsets, charset_ascii, Qt);
            else
              ASET (charsets, charset_eight_bit, Qt);
@@ -2386,7 +2386,7 @@ syms_of_charset (void)
   }
 
   charset_table = charset_table_init;
-  charset_table_size = sizeof charset_table_init / sizeof *charset_table_init;
+  charset_table_size = ARRAYELTS (charset_table_init);
   charset_table_used = 0;
 
   defsubr (&Scharsetp);
index 32c624beff8405d122f859719d341a4edc099a5c..4176ce5ecc63d36787552381ea6f9654d41937b4 100644 (file)
@@ -403,7 +403,7 @@ extern Lisp_Object Vchar_charset_set;
    Try some optimization before calling decode_char.  */
 
 #define DECODE_CHAR(charset, code)                                     \
-  ((ASCII_BYTE_P (code) && (charset)->ascii_compatible_p)              \
+  ((ASCII_CHAR_P (code) && (charset)->ascii_compatible_p)              \
    ? (code)                                                            \
    : ((code) < (charset)->min_code || (code) > (charset)->max_code)    \
    ? -1                                                                        \
index 2a8bbc6983a328aa696ae6b5c2fbe20e367b6011..50be063759a3d9e290ce95451bc0690f802a0c93 100644 (file)
@@ -140,15 +140,11 @@ the char-table has no extra slot.  */)
 static Lisp_Object
 make_sub_char_table (int depth, int min_char, Lisp_Object defalt)
 {
-  Lisp_Object table;
-  int size = (PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents)
-             + chartab_size[depth]);
-
-  table = Fmake_vector (make_number (size), defalt);
-  XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE);
-  XSUB_CHAR_TABLE (table)->depth = make_number (depth);
-  XSUB_CHAR_TABLE (table)->min_char = make_number (min_char);
+  int i;
+  Lisp_Object table = make_uninit_sub_char_table (depth, min_char);
 
+  for (i = 0; i < chartab_size[depth]; i++)
+    XSUB_CHAR_TABLE (table)->contents[i] = defalt;
   return table;
 }
 
@@ -172,8 +168,8 @@ char_table_ascii (Lisp_Object table)
 static Lisp_Object
 copy_sub_char_table (Lisp_Object table)
 {
-  int depth = XINT (XSUB_CHAR_TABLE (table)->depth);
-  int min_char = XINT (XSUB_CHAR_TABLE (table)->min_char);
+  int depth = XSUB_CHAR_TABLE (table)->depth;
+  int min_char = XSUB_CHAR_TABLE (table)->min_char;
   Lisp_Object copy = make_sub_char_table (depth, min_char, Qnil);
   int i;
 
@@ -220,10 +216,8 @@ static Lisp_Object
 sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop)
 {
   struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
-  int depth = XINT (tbl->depth);
-  int min_char = XINT (tbl->min_char);
   Lisp_Object val;
-  int idx = CHARTAB_IDX (c, depth, min_char);
+  int idx = CHARTAB_IDX (c, tbl->depth, tbl->min_char);
 
   val = tbl->contents[idx];
   if (is_uniprop && UNIPROP_COMPRESSED_FORM_P (val))
@@ -265,8 +259,7 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to,
                              Lisp_Object defalt, bool is_uniprop)
 {
   struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
-  int depth = XINT (tbl->depth);
-  int min_char = XINT (tbl->min_char);
+  int depth = tbl->depth, min_char = tbl->min_char;
   int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
   Lisp_Object val;
 
@@ -402,8 +395,7 @@ static void
 sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop)
 {
   struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
-  int depth = XINT ((tbl)->depth);
-  int min_char = XINT ((tbl)->min_char);
+  int depth = tbl->depth, min_char = tbl->min_char;
   int i = CHARTAB_IDX (c, depth, min_char);
   Lisp_Object sub;
 
@@ -458,8 +450,7 @@ sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val,
                          bool is_uniprop)
 {
   struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
-  int depth = XINT ((tbl)->depth);
-  int min_char = XINT ((tbl)->min_char);
+  int depth = tbl->depth, min_char = tbl->min_char;
   int chars_in_block = chartab_chars[depth];
   int i, c, lim = chartab_size[depth];
 
@@ -672,26 +663,12 @@ or a character code.  Return VALUE.  */)
   return value;
 }
 
-/* Look up the element in TABLE at index CH, and return it as an
-   integer.  If the element is not a character, return CH itself.  */
-
-int
-char_table_translate (Lisp_Object table, int ch)
-{
-  Lisp_Object value;
-  value = Faref (table, make_number (ch));
-  if (! CHARACTERP (value))
-    return ch;
-  return XINT (value);
-}
-
 static Lisp_Object
 optimize_sub_char_table (Lisp_Object table, Lisp_Object test)
 {
   struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
-  int depth = XINT (tbl->depth);
+  int i, depth = tbl->depth;
   Lisp_Object elt, this;
-  int i;
   bool optimizable;
 
   elt = XSUB_CHAR_TABLE (table)->contents[0];
@@ -778,8 +755,8 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
     {
       struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
 
-      depth = XINT (tbl->depth);
-      min_char = XINT (tbl->min_char);
+      depth = tbl->depth;
+      min_char = tbl->min_char;
       max_char = min_char + chartab_chars[depth - 1] - 1;
     }
   else
@@ -973,12 +950,10 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
                                unsigned from, unsigned to)
 {
   struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
-  int depth = XINT (tbl->depth);
-  int c, i;
+  int i, c = tbl->min_char, depth = tbl->depth;
 
   if (depth < 3)
-    for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth];
-        i++, c += chartab_chars[depth])
+    for (i = 0; i < chartab_size[depth]; i++, c += chartab_chars[depth])
       {
        Lisp_Object this;
 
@@ -1000,7 +975,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
          }
       }
   else
-    for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; i++, c ++)
+    for (i = 0; i < chartab_size[depth]; i++, c++)
       {
        Lisp_Object this;
        unsigned code;
@@ -1147,8 +1122,7 @@ static Lisp_Object
 uniprop_table_uncompress (Lisp_Object table, int idx)
 {
   Lisp_Object val = XSUB_CHAR_TABLE (table)->contents[idx];
-  int min_char = (XINT (XSUB_CHAR_TABLE (table)->min_char)
-                 + chartab_chars[2] * idx);
+  int min_char = XSUB_CHAR_TABLE (table)->min_char + chartab_chars[2] * idx;
   Lisp_Object sub = make_sub_char_table (3, min_char, Qnil);
   const unsigned char *p, *pend;
 
@@ -1221,9 +1195,7 @@ uniprop_decode_value_run_length (Lisp_Object table, Lisp_Object value)
 static uniprop_decoder_t uniprop_decoder [] =
   { uniprop_decode_value_run_length };
 
-static int uniprop_decoder_count
-  = (sizeof uniprop_decoder) / sizeof (uniprop_decoder[0]);
-
+static const int uniprop_decoder_count = ARRAYELTS (uniprop_decoder);
 
 /* Return the decoder of char-table TABLE or nil if none.  */
 
@@ -1301,9 +1273,7 @@ static uniprop_encoder_t uniprop_encoder[] =
     uniprop_encode_value_run_length,
     uniprop_encode_value_numeric };
 
-static int uniprop_encoder_count
-  = (sizeof uniprop_encoder) / sizeof (uniprop_encoder[0]);
-
+static const int uniprop_encoder_count = ARRAYELTS (uniprop_encoder);
 
 /* Return the encoder of char-table TABLE or nil if none.  */
 
index 1a510afa2716c48c24620b55e37e9e1a77c010ad..20234638778ab22a6f722fc7efca2a27fcd193a7 100644 (file)
@@ -315,7 +315,7 @@ At the end, it runs `post-self-insert-hook'.  */)
     int val = internal_self_insert (character, XFASTINT (n));
     if (val == 2)
       nonundocount = 0;
-    frame_make_pointer_invisible ();
+    frame_make_pointer_invisible (SELECTED_FRAME ());
   }
 
   return Qnil;
@@ -359,9 +359,7 @@ internal_self_insert (int c, EMACS_INT n)
     }
   else
     {
-      str[0] = (SINGLE_BYTE_CHAR_P (c)
-               ? c
-               : multibyte_char_to_unibyte (c));
+      str[0] = SINGLE_BYTE_CHAR_P (c) ? c : CHAR_TO_BYTE8 (c);
       len = 1;
     }
   if (!NILP (overwrite)
index bd4a8be08b3b49da3f6abbc83373cc9c481aea9d..523a6bf0f275b857d40a5ea091de43192c31ed39 100644 (file)
@@ -1485,8 +1485,7 @@ decode_coding_utf_8 (struct coding_system *coding)
       src = src_base;
       consumed_chars = consumed_chars_base;
       ONE_MORE_BYTE (c);
-      *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
-      coding->errors++;
+      *charbuf++ = ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
     }
 
  no_more_source:
@@ -1685,7 +1684,6 @@ decode_coding_utf_16 (struct coding_system *coding)
          /* The first two bytes are not BOM.  Treat them as bytes
             for a normal character.  */
          src = src_base;
-         coding->errors++;
        }
       CODING_UTF_16_BOM (coding) = utf_without_bom;
     }
@@ -1725,7 +1723,7 @@ decode_coding_utf_16 (struct coding_system *coding)
        ONE_MORE_BYTE (c2);
       if (c2 < 0)
        {
-         *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
+         *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
          *charbuf++ = -c2;
          continue;
        }
@@ -1742,7 +1740,6 @@ decode_coding_utf_16 (struct coding_system *coding)
                c1 = surrogate & 0xFF, c2 = surrogate >> 8;
              *charbuf++ = c1;
              *charbuf++ = c2;
-             coding->errors++;
              if (UTF_16_HIGH_SURROGATE_P (c))
                CODING_UTF_16_SURROGATE (coding) = surrogate = c;
              else
@@ -2108,7 +2105,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
 
        case 1:
          code = c;
-         charset_ID = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit;
+         charset_ID = ASCII_CHAR_P (code) ? charset_ascii : charset_eight_bit;
          break;
 
        default:
@@ -2596,9 +2593,8 @@ decode_coding_emacs_mule (struct coding_system *coding)
       src = src_base;
       consumed_chars = consumed_chars_base;
       ONE_MORE_BYTE (c);
-      *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+      *charbuf++ = ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
       char_offset++;
-      coding->errors++;
     }
 
  no_more_source:
@@ -3573,7 +3569,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
 
       if (CODING_ISO_EXTSEGMENT_LEN (coding) > 0)
        {
-         *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
+         *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
          char_offset++;
          CODING_ISO_EXTSEGMENT_LEN (coding)--;
          continue;
@@ -3600,7 +3596,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
            }
          else
            {
-             *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
+             *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1);
              char_offset++;
            }
          continue;
@@ -3974,7 +3970,7 @@ decode_coding_iso_2022 (struct coding_system *coding)
          MAYBE_FINISH_COMPOSITION ();
          for (; src_base < src; src_base++, char_offset++)
            {
-             if (ASCII_BYTE_P (*src_base))
+             if (ASCII_CHAR_P (*src_base))
                *charbuf++ = *src_base;
              else
                *charbuf++ = BYTE8_TO_CHAR (*src_base);
@@ -4004,9 +4000,8 @@ decode_coding_iso_2022 (struct coding_system *coding)
       src = src_base;
       consumed_chars = consumed_chars_base;
       ONE_MORE_BYTE (c);
-      *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+      *charbuf++ = c < 0 ? -c : ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
       char_offset++;
-      coding->errors++;
       /* Reset the invocation and designation status to the safest
         one; i.e. designate ASCII to the graphic register 0, and
         invoke that register to the graphic plane 0.  This typically
@@ -4837,7 +4832,6 @@ decode_coding_sjis (struct coding_system *coding)
       ONE_MORE_BYTE (c);
       *charbuf++ = c < 0 ? -c : BYTE8_TO_CHAR (c);
       char_offset++;
-      coding->errors++;
     }
 
  no_more_source:
@@ -4933,7 +4927,6 @@ decode_coding_big5 (struct coding_system *coding)
       ONE_MORE_BYTE (c);
       *charbuf++ = c < 0 ? -c : BYTE8_TO_CHAR (c);
       char_offset++;
-      coding->errors++;
     }
 
  no_more_source:
@@ -5640,9 +5633,8 @@ decode_coding_charset (struct coding_system *coding)
       src = src_base;
       consumed_chars = consumed_chars_base;
       ONE_MORE_BYTE (c);
-      *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c);
+      *charbuf++ = c < 0 ? -c : ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c);
       char_offset++;
-      coding->errors++;
     }
 
  no_more_source:
@@ -7265,16 +7257,20 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos)
                      coding->dst_object);
 }
 
+#define MAX_CHARBUF_SIZE 0x4000
+/* How many units decoding functions expect in coding->charbuf at
+   most.  Currently, decode_coding_emacs_mule expects the following
+   size, and that is the largest value.  */
+#define MAX_CHARBUF_EXTRA_SIZE ((MAX_ANNOTATION_LENGTH * 3) + 1)
 
-#define CHARBUF_SIZE 0x4000
-
-#define ALLOC_CONVERSION_WORK_AREA(coding)                             \
-  do {                                                                 \
-    coding->charbuf = SAFE_ALLOCA (CHARBUF_SIZE * sizeof (int));       \
-    coding->charbuf_size = CHARBUF_SIZE;                               \
+#define ALLOC_CONVERSION_WORK_AREA(coding, size)               \
+  do {                                                         \
+    ptrdiff_t units = min ((size) + MAX_CHARBUF_EXTRA_SIZE,    \
+                          MAX_CHARBUF_SIZE);                   \
+    coding->charbuf = SAFE_ALLOCA (units * sizeof (int));      \
+    coding->charbuf_size = units;                              \
   } while (0)
 
-
 static void
 produce_annotation (struct coding_system *coding, ptrdiff_t pos)
 {
@@ -7371,9 +7367,8 @@ decode_coding (struct coding_system *coding)
   coding->produced = coding->produced_char = 0;
   coding->chars_at_source = 0;
   record_conversion_result (coding, CODING_RESULT_SUCCESS);
-  coding->errors = 0;
 
-  ALLOC_CONVERSION_WORK_AREA (coding);
+  ALLOC_CONVERSION_WORK_AREA (coding, coding->src_bytes);
 
   attrs = CODING_ID_ATTRS (coding->id);
   translation_table = get_translation_table (attrs, 0, NULL);
@@ -7767,9 +7762,8 @@ encode_coding (struct coding_system *coding)
   coding->consumed = coding->consumed_char = 0;
   coding->produced = coding->produced_char = 0;
   record_conversion_result (coding, CODING_RESULT_SUCCESS);
-  coding->errors = 0;
 
-  ALLOC_CONVERSION_WORK_AREA (coding);
+  ALLOC_CONVERSION_WORK_AREA (coding, coding->src_chars);
 
   if (coding->encoder == encode_coding_ccl)
     {
@@ -8443,11 +8437,11 @@ from_unicode (Lisp_Object str)
 }
 
 Lisp_Object
-from_unicode_buffer (const wchar_twstr)
+from_unicode_buffer (const wchar_t *wstr)
 {
     return from_unicode (
         make_unibyte_string (
-            (char*) wstr,
+            (char *) wstr,
             /* we get one of the two final 0 bytes for free. */
             1 + sizeof (wchar_t) * wcslen (wstr)));
 }
@@ -9031,13 +9025,13 @@ DEFUN ("find-coding-systems-region-internal",
     p = pbeg = BYTE_POS_ADDR (start_byte);
   pend = p + (end_byte - start_byte);
 
-  while (p < pend && ASCII_BYTE_P (*p)) p++;
-  while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--;
+  while (p < pend && ASCII_CHAR_P (*p)) p++;
+  while (p < pend && ASCII_CHAR_P (*(pend - 1))) pend--;
 
   work_table = Fmake_char_table (Qnil, Qnil);
   while (p < pend)
     {
-      if (ASCII_BYTE_P (*p))
+      if (ASCII_CHAR_P (*p))
        p++;
       else
        {
@@ -9091,8 +9085,7 @@ DEFUN ("find-coding-systems-region-internal",
 
 DEFUN ("unencodable-char-position", Funencodable_char_position,
        Sunencodable_char_position, 3, 5, 0,
-       doc: /*
-Return position of first un-encodable character in a region.
+       doc: /* Return position of first un-encodable character in a region.
 START and END specify the region and CODING-SYSTEM specifies the
 encoding to check.  Return nil if CODING-SYSTEM does encode the region.
 
@@ -9102,8 +9095,9 @@ list of positions.
 
 If optional 5th argument STRING is non-nil, it is a string to search
 for un-encodable characters.  In that case, START and END are indexes
-to the string.  */)
-  (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object count, Lisp_Object string)
+to the string and treated as in `substring'.  */)
+  (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system,
+   Lisp_Object count, Lisp_Object string)
 {
   EMACS_INT n;
   struct coding_system coding;
@@ -9140,12 +9134,7 @@ to the string.  */)
   else
     {
       CHECK_STRING (string);
-      CHECK_NATNUM (start);
-      CHECK_NATNUM (end);
-      if (! (XINT (start) <= XINT (end) && XINT (end) <= SCHARS (string)))
-       args_out_of_range_3 (string, start, end);
-      from = XINT (start);
-      to = XINT (end);
+      validate_subarray (string, start, end, SCHARS (string), &from, &to);
       if (! STRING_MULTIBYTE (string))
        return Qnil;
       p = SDATA (string) + string_char_to_byte (string, from);
@@ -9169,7 +9158,7 @@ to the string.  */)
       int c;
 
       if (ascii_compatible)
-       while (p < stop && ASCII_BYTE_P (*p))
+       while (p < stop && ASCII_CHAR_P (*p))
          p++, from++;
       if (p >= stop)
        {
@@ -9285,12 +9274,12 @@ is nil.  */)
     p = pbeg = BYTE_POS_ADDR (start_byte);
   pend = p + (end_byte - start_byte);
 
-  while (p < pend && ASCII_BYTE_P (*p)) p++, pos++;
-  while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--;
+  while (p < pend && ASCII_CHAR_P (*p)) p++, pos++;
+  while (p < pend && ASCII_CHAR_P (*(pend - 1))) pend--;
 
   while (p < pend)
     {
-      if (ASCII_BYTE_P (*p))
+      if (ASCII_CHAR_P (*p))
        p++;
       else
        {
@@ -9598,7 +9587,7 @@ Return the corresponding character.  */)
   CHECK_CODING_SYSTEM_GET_SPEC (Vsjis_coding_system, spec);
   attrs = AREF (spec, 0);
 
-  if (ASCII_BYTE_P (ch)
+  if (ASCII_CHAR_P (ch)
       && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
     return code;
 
@@ -9679,7 +9668,7 @@ Return the corresponding character.  */)
   CHECK_CODING_SYSTEM_GET_SPEC (Vbig5_coding_system, spec);
   attrs = AREF (spec, 0);
 
-  if (ASCII_BYTE_P (ch)
+  if (ASCII_CHAR_P (ch)
       && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
     return code;
 
index 4e8b1056e434d67b275d78b9dd9a287f1d1e6625..ffd839f4212f67cad0fb392c89010e0e3552c218 100644 (file)
@@ -434,11 +434,37 @@ struct coding_system
 
   /* Flag bits of the coding system.  The meaning of each bit is common
      to all types of coding systems.  */
-  int common_flags;
+  unsigned common_flags : 14;
 
   /* Mode bits of the coding system.  See the comments of the macros
      CODING_MODE_XXX.  */
-  unsigned int mode;
+  unsigned mode : 5;
+
+  /* The following two members specify how binary 8-bit code 128..255
+     are represented in source and destination text respectively.  True
+     means they are represented by 2-byte sequence, false means they are
+     represented by 1-byte as is (see the comment in character.h).  */
+  bool_bf src_multibyte : 1;
+  bool_bf dst_multibyte : 1;
+
+  /* True if the source of conversion is not in the member
+     `charbuf', but at `src_object'.  */
+  bool_bf chars_at_source : 1;
+
+  /* Nonzero if the result of conversion is in `destination'
+     buffer rather than in `dst_object'.  */
+  bool_bf raw_destination : 1;
+
+  /* Set to true if charbuf contains an annotation.  */
+  bool_bf annotated : 1;
+
+  /* Used internally in coding.c.  See the comment of detect_ascii.  */
+  unsigned eol_seen : 3;
+
+  /* Finish status of code conversion.  */
+  ENUM_BF (coding_result_code) result : 3;
+
+  int max_charset_id;
 
   /* Detailed information specific to each type of coding system.  */
   union
@@ -451,16 +477,8 @@ struct coding_system
       struct undecided_spec undecided;
     } spec;
 
-  int max_charset_id;
   unsigned char *safe_charsets;
 
-  /* The following two members specify how binary 8-bit code 128..255
-     are represented in source and destination text respectively.  True
-     means they are represented by 2-byte sequence, false means they are
-     represented by 1-byte as is (see the comment in character.h).  */
-  bool_bf src_multibyte : 1;
-  bool_bf dst_multibyte : 1;
-
   /* How may heading bytes we can skip for decoding.  This is set to
      -1 in setup_coding_system, and updated by detect_coding.  So,
      when this is equal to the byte length of the text being
@@ -472,21 +490,9 @@ struct coding_system
      sequence.  Set by detect_coding_utf_8.  */
   ptrdiff_t detected_utf8_bytes, detected_utf8_chars;
 
-  /* Used internally in coding.c.  See the comment of detect_ascii.  */
-  int eol_seen;
-
   /* The following members are set by encoding/decoding routine.  */
   ptrdiff_t produced, produced_char, consumed, consumed_char;
 
-  /* Number of error source data found in a decoding routine.  */
-  ptrdiff_t errors;
-
-  /* Store the positions of error source data.  */
-  ptrdiff_t *error_positions;
-
-  /* Finish status of code conversion.  */
-  enum coding_result_code result;
-
   ptrdiff_t src_pos, src_pos_byte, src_chars, src_bytes;
   Lisp_Object src_object;
   const unsigned char *source;
@@ -510,17 +516,6 @@ struct coding_system
   int *charbuf;
   int charbuf_size, charbuf_used;
 
-  /* True if the source of conversion is not in the member
-     `charbuf', but at `src_object'.  */
-  bool_bf chars_at_source : 1;
-
-  /* Nonzero if the result of conversion is in `destination'
-     buffer rather than in `dst_object'.  */
-  bool_bf raw_destination : 1;
-
-  /* Set to true if charbuf contains an annotation.  */
-  bool_bf annotated : 1;
-
   unsigned char carryover[64];
   int carryover_bytes;
 
@@ -743,7 +738,7 @@ extern wchar_t *to_unicode (Lisp_Object str, Lisp_Object *buf);
 extern Lisp_Object from_unicode (Lisp_Object str);
 
 /* Convert WSTR to an Emacs string.  */
-extern Lisp_Object from_unicode_buffer (const wchar_twstr);
+extern Lisp_Object from_unicode_buffer (const wchar_t *wstr);
 
 #endif /* WINDOWSNT || CYGWIN */
 
index 36e3518b5ea30d789e40f80964345ecb4dec9e8a..1a09f683563dd2804316da6e658ccf7a6f1c96bb 100644 (file)
@@ -39,7 +39,3 @@ extern Lisp_Object unread_switch_frame;
 /* Nonzero if input is coming from the keyboard.  */
 
 #define INTERACTIVE (NILP (Vexecuting_kbd_macro) && !noninteractive)
-
-/* Set this nonzero to force reconsideration of mode line.  */
-
-extern int update_mode_lines;
index fa8821419086e53551d924c5c55cdab6bd1f2b1c..66a20759ec67ef8476055b023116fd3b889fab58 100644 (file)
@@ -921,17 +921,18 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos,
   return unbind_to (count, lgstring);
 }
 
-static Lisp_Object _work_val;
-
 /* 1 iff the character C is composable.  Characters of general
    category Z? or C? are not composable except for ZWNJ and ZWJ. */
 
-#define CHAR_COMPOSABLE_P(C)                                           \
-  ((C) > ' '                                                           \
-   && ((C) == 0x200C || (C) == 0x200D                                  \
-       || (_work_val = CHAR_TABLE_REF (Vunicode_category_table, (C)),  \
-          (INTEGERP (_work_val)                                        \
-           && (XINT (_work_val) <= UNICODE_CATEGORY_So)))))
+static bool
+char_composable_p (int c)
+{
+  Lisp_Object val;
+  return (c > ' '                      
+         && (c == 0x200C || c == 0x200D
+             || (val = CHAR_TABLE_REF (Vunicode_category_table, c),
+                 (INTEGERP (val) && (XINT (val) <= UNICODE_CATEGORY_So)))));
+}
 
 /* Update cmp_it->stop_pos to the next position after CHARPOS (and
    BYTEPOS) where character composition may happen.  If BYTEPOS is
@@ -1067,7 +1068,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
        p = SDATA (string) + bytepos;
       c = STRING_CHAR_AND_LENGTH (p, len);
       limit = bytepos + len;
-      while (CHAR_COMPOSABLE_P (c))
+      while (char_composable_p (c))
        {
          val = CHAR_TABLE_REF (Vcomposition_function_table, c);
          if (! NILP (val))
@@ -1144,7 +1145,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
       /* Skip all uncomposable characters.  */
       if (NILP (string))
        {
-         while (charpos - 1 > endpos && ! CHAR_COMPOSABLE_P (c))
+         while (charpos - 1 > endpos && ! char_composable_p (c))
            {
              DEC_BOTH (charpos, bytepos);
              c = FETCH_MULTIBYTE_CHAR (bytepos);
@@ -1152,7 +1153,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
        }
       else
        {
-         while (charpos - 1 > endpos && ! CHAR_COMPOSABLE_P (c))
+         while (charpos - 1 > endpos && ! char_composable_p (c))
            {
              p--;
              while (! CHAR_HEAD_P (*p))
@@ -1486,7 +1487,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit,
                  |-B-|-C-|--D--|
 
      Here, it is known that characters after positions 1 and 9 can
-     never be composed (i.e. ! CHAR_COMPOSABLE_P (CH)), and
+     never be composed (i.e. ! char_composable_p (CH)), and
      composition A is an invalid one because it's partially covered by
      the valid composition C.  And to know whether a composition is
      valid or not, the only way is to start searching forward from a
@@ -1510,7 +1511,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit,
   while (1)
     {
       c = STRING_CHAR (cur.p);
-      if (! CHAR_COMPOSABLE_P (c))
+      if (! char_composable_p (c))
        {
          if (limit <= pos)     /* case (1)  */
            {
@@ -1519,7 +1520,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit,
                  return 0;
                BACKWARD_CHAR (cur, stop);
                c = STRING_CHAR (cur.p);
-             } while (! CHAR_COMPOSABLE_P (c));
+             } while (! char_composable_p (c));
              fore_check_limit = cur.pos + 1;
            }
          else                  /* case (2) */
@@ -1535,7 +1536,7 @@ find_automatic_composition (ptrdiff_t pos, ptrdiff_t limit,
          prev = cur;
          BACKWARD_CHAR (cur, stop);
          c = STRING_CHAR (cur.p);
-         if (! CHAR_COMPOSABLE_P (c))
+         if (! char_composable_p (c))
            {
              cur = prev;
              break;
@@ -1683,9 +1684,10 @@ Otherwise (for terminal display), FONT-OBJECT must be a terminal ID, a
 frame, or nil for the selected frame's terminal device.
 
 If the optional 4th argument STRING is not nil, it is a string
-containing the target characters between indices FROM and TO.
-Otherwise FROM and TO are character positions in current buffer;
-they can be in either order, and can be integers or markers.
+containing the target characters between indices FROM and TO,
+which are treated as in `substring'.  Otherwise FROM and TO are
+character positions in current buffer; they can be in either order,
+and can be integers or markers.
 
 A glyph-string is a vector containing information about how to display
 a specific character sequence.  The format is:
@@ -1741,15 +1743,10 @@ should be ignored.  */)
     }
   else
     {
-      CHECK_NATNUM (from);
-      CHECK_NATNUM (to);
       CHECK_STRING (string);
+      validate_subarray (string, from, to, SCHARS (string), &frompos, &topos);
       if (! STRING_MULTIBYTE (string))
        error ("Attempt to shape unibyte text");
-      if (! (XINT (from) <= XINT (to) && XINT (to) <= SCHARS (string)))
-       args_out_of_range_3 (string, from, to);
-      frompos = XFASTINT (from);
-      topos = XFASTINT (to);
       frombyte = string_char_to_byte (string, frompos);
     }
 
@@ -1794,21 +1791,18 @@ DEFUN ("compose-string-internal", Fcompose_string_internal,
        Scompose_string_internal, 3, 5, 0,
        doc: /* Internal use only.
 
-Compose text between indices START and END of STRING.
-Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC
+Compose text between indices START and END of STRING, where
+START and END are treated as in `substring'.  Optional 4th
+and 5th arguments are COMPONENTS and MODIFICATION-FUNC
 for the composition.  See `compose-string' for more details.  */)
-  (Lisp_Object string, Lisp_Object start, Lisp_Object end, Lisp_Object components, Lisp_Object modification_func)
+  (Lisp_Object string, Lisp_Object start, Lisp_Object end,
+   Lisp_Object components, Lisp_Object modification_func)
 {
-  CHECK_STRING (string);
-  CHECK_NUMBER (start);
-  CHECK_NUMBER (end);
+  ptrdiff_t from, to;
 
-  if (XINT (start) < 0 ||
-      XINT (start) > XINT (end)
-      || XINT (end) > SCHARS (string))
-    args_out_of_range (start, end);
-
-  compose_text (XINT (start), XINT (end), components, modification_func, string);
+  CHECK_STRING (string);
+  validate_subarray (string, start, end, SCHARS (string), &from, &to);
+  compose_text (from, to, components, modification_func, string);
   return string;
 }
 
index 446c827561308603730be5bfd25ec2ad84cd2eb0..a995acfd91546910d1008e9d32ae1efddf7f63a1 100644 (file)
@@ -34,9 +34,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdbool.h>
 
-/* The pre-C99 <stdbool.h> emulation doesn't work for bool bitfields.
-   Nor does compiling Objective-C with standard GCC.  */
-#if __STDC_VERSION__ < 199901 || NS_IMPL_GNUSTEP
+/* The type of bool bitfields.  Needed to compile Objective-C with
+   standard GCC.  It was also needed to port to pre-C99 compilers,
+   although we don't care about that any more.  */
+#if NS_IMPL_GNUSTEP
 typedef unsigned int bool_bf;
 #else
 typedef bool bool_bf;
@@ -87,10 +88,6 @@ typedef bool bool_bf;
 #ifdef HPUX
 #undef srandom
 #undef random
-/* We try to avoid checking for random and rint on hpux in
-   configure.ac, but some other configure test might check for them as
-   a dependency, so to be safe we also undefine them here.
- */
 #undef HAVE_RANDOM
 #undef HAVE_RINT
 #endif  /* HPUX */
@@ -228,16 +225,30 @@ extern void _DebPrint (const char *fmt, ...);
 
 #define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
 
+#if 3 <= __GNUC__
+# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define ATTRIBUTE_MALLOC
+#endif
+
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+#else
+# define ATTRIBUTE_ALLOC_SIZE(args)
+#endif
+
+#define ATTRIBUTE_MALLOC_SIZE(args) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE (args)
+
 /* Work around GCC bug 59600: when a function is inlined, the inlined
    code may have its addresses sanitized even if the function has the
-   no_sanitize_address attribute.  This bug is present in GCC 4.8.2
-   and clang 3.3, the latest releases as of December 2013, and the
-   only platforms known to support address sanitization.  When the bug
-   is fixed the #if can be updated accordingly.  */
-#if ADDRESS_SANITIZER
-# define ADDRESS_SANITIZER_WORKAROUND NO_INLINE
+   no_sanitize_address attribute.  This bug is fixed in GCC 4.9.0 and
+   clang 3.4.  */
+#if (! ADDRESS_SANITIZER \
+     || ((4 < __GNUC__ + (9 <= __GNUC_MINOR__)) \
+        || 3 < __clang_major__ + (4 <= __clang_minor__)))
+# define ADDRESS_SANITIZER_WORKAROUND /* No workaround needed.  */
 #else
-# define ADDRESS_SANITIZER_WORKAROUND
+# define ADDRESS_SANITIZER_WORKAROUND NO_INLINE
 #endif
 
 /* Attribute of functions whose code should not have addresses
@@ -299,12 +310,10 @@ extern void _DebPrint (const char *fmt, ...);
      struct s { ...; t name[FLEXIBLE_ARRAY_MEMBER]; };
    and allocate (offsetof (struct s, name) + N * sizeof (t)) bytes.
    IBM xlc 12.1 claims to do C99 but mishandles flexible array members.  */
-#if 199901 <= __STDC_VERSION__ && !defined __IBMC__
-# define FLEXIBLE_ARRAY_MEMBER
-#elif __GNUC__ && !defined __STRICT_ANSI__
-# define FLEXIBLE_ARRAY_MEMBER 0
-#else
+#ifdef __IBMC__
 # define FLEXIBLE_ARRAY_MEMBER 1
+#else
+# define FLEXIBLE_ARRAY_MEMBER
 #endif
 
 /* Use this to suppress gcc's `...may be used before initialized' warnings. */
index 4cb569bd94336accf8ae81a40f97bc95838d4292..3e651414e6888c5786cec3ae4159a0f633ffa3ce 100644 (file)
@@ -727,6 +727,11 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
   if (AUTOLOADP (function))
     Fput (symbol, Qautoload, XCDR (function));
 
+  /* Convert to eassert or remove after GC bug is found.  In the
+     meantime, check unconditionally, at a slight perf hit.  */
+  if (valid_lisp_object_p (definition) < 1)
+    emacs_abort ();
+
   set_symbol_function (symbol, definition);
 
   return definition;
@@ -966,6 +971,48 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents)
     }
 }
 
+/* Used to signal a user-friendly error when symbol WRONG is
+   not a member of CHOICE, which should be a list of symbols.  */
+
+void
+wrong_choice (Lisp_Object choice, Lisp_Object wrong)
+{
+  ptrdiff_t i = 0, len = XINT (Flength (choice));
+  Lisp_Object obj, *args;
+
+  USE_SAFE_ALLOCA;
+  SAFE_ALLOCA_LISP (args, len * 2 + 1);
+
+  args[i++] = build_string ("One of ");
+
+  for (obj = choice; !NILP (obj); obj = XCDR (obj))
+    {
+      args[i++] = SYMBOL_NAME (XCAR (obj));
+      args[i++] = build_string (NILP (XCDR (obj)) ? " should be specified"
+                               : (NILP (XCDR (XCDR (obj))) ? " or " : ", "));
+    }
+
+  obj = Fconcat (i, args);
+  SAFE_FREE ();
+  xsignal2 (Qerror, obj, wrong);
+}
+
+/* Used to signal a user-friendly error if WRONG is not a number or
+   integer/floating-point number outsize of inclusive MIN..MAX range.  */
+
+static void
+wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong)
+{
+  Lisp_Object args[4];
+
+  args[0] = build_string ("Value should be from ");
+  args[1] = Fnumber_to_string (min);
+  args[2] = build_string (" to ");
+  args[3] = Fnumber_to_string (max);
+
+  xsignal2 (Qerror, Fconcat (4, args), wrong);
+}
+
 /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell
    of SYMBOL.  If SYMBOL is buffer-local, VALCONTENTS should be the
    buffer-independent contents of the value cell: forwarded just one
@@ -1022,10 +1069,33 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
        int offset = XBUFFER_OBJFWD (valcontents)->offset;
        Lisp_Object predicate = XBUFFER_OBJFWD (valcontents)->predicate;
 
-       if (!NILP (predicate) && !NILP (newval)
-           && NILP (call1 (predicate, newval)))
-         wrong_type_argument (predicate, newval);
+       if (!NILP (newval))
+         {
+           if (SYMBOLP (predicate))
+             {
+               Lisp_Object prop;
 
+               if ((prop = Fget (predicate, Qchoice), !NILP (prop)))
+                 {
+                   if (NILP (Fmemq (newval, prop)))
+                     wrong_choice (prop, newval);
+                 }
+               else if ((prop = Fget (predicate, Qrange), !NILP (prop)))
+                 {
+                   Lisp_Object min = XCAR (prop), max = XCDR (prop);
+
+                   if (!NUMBERP (newval)
+                       || !NILP (arithcompare (newval, min, ARITH_LESS))
+                       || !NILP (arithcompare (newval, max, ARITH_GRTR)))
+                     wrong_range (min, max, newval);
+                 }
+               else if (FUNCTIONP (predicate))
+                 {
+                   if (NILP (call1 (predicate, newval)))
+                     wrong_type_argument (predicate, newval);
+                 }
+             }
+         }
        if (buf == NULL)
          buf = current_buffer;
        set_per_buffer_value (buf, offset, newval);
@@ -2327,7 +2397,7 @@ arithcompare_driver (ptrdiff_t nargs, Lisp_Object *args,
   ptrdiff_t argnum;
   for (argnum = 1; argnum < nargs; ++argnum)
     {
-      if (EQ (Qnil, arithcompare (args[argnum-1], args[argnum], comparison)))
+      if (EQ (Qnil, arithcompare (args[argnum - 1], args[argnum], comparison)))
         return Qnil;
     }
   return Qt;
@@ -2379,24 +2449,6 @@ DEFUN ("/=", Fneq, Sneq, 2, 2, 0,
 {
   return arithcompare (num1, num2, ARITH_NOTEQUAL);
 }
-
-DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
-       doc: /* Return t if NUMBER is zero.  */)
-  (register Lisp_Object number)
-{
-  CHECK_NUMBER_OR_FLOAT (number);
-
-  if (FLOATP (number))
-    {
-      if (XFLOAT_DATA (number) == 0.0)
-       return Qt;
-      return Qnil;
-    }
-
-  if (!XINT (number))
-    return Qt;
-  return Qnil;
-}
 \f
 /* Convert the cons-of-integers, integer, or float value C to an
    unsigned value with maximum value MAX.  Signal an error if C does not
@@ -2888,7 +2940,7 @@ In this case, the sign bit is duplicated.  */)
   if (XINT (count) >= BITS_PER_EMACS_INT)
     XSETINT (val, 0);
   else if (XINT (count) > 0)
-    XSETINT (val, XINT (value) << XFASTINT (count));
+    XSETINT (val, XUINT (value) << XFASTINT (count));
   else if (XINT (count) <= -BITS_PER_EMACS_INT)
     XSETINT (val, XINT (value) < 0 ? -1 : 0);
   else
@@ -3643,7 +3695,6 @@ syms_of_data (void)
   defsubr (&Sleq);
   defsubr (&Sgeq);
   defsubr (&Sneq);
-  defsubr (&Szerop);
   defsubr (&Splus);
   defsubr (&Sminus);
   defsubr (&Stimes);
index 8ebc56c72c4bf5fb11504759007a7d30a52b683a..8997e01b068881387ac2446d2d558db60b0e8b08 100644 (file)
@@ -142,10 +142,7 @@ static bool xd_in_read_queued_messages = 0;
   } while (0)
 
 #else /* !DBUS_DEBUG */
-# if __STDC_VERSION__ < 199901
-#  define XD_DEBUG_MESSAGE (void) /* Pre-C99 compilers cannot debug.  */
-# else
-#  define XD_DEBUG_MESSAGE(...)                                                \
+# define XD_DEBUG_MESSAGE(...)                                         \
   do {                                                                 \
     if (!NILP (Vdbus_debug))                                           \
       {                                                                        \
@@ -154,7 +151,6 @@ static bool xd_in_read_queued_messages = 0;
        message ("%s: %s", __func__, s);                                \
       }                                                                        \
   } while (0)
-# endif
 # define XD_DEBUG_VALID_LISP_OBJECT_P(object)
 #endif
 
index 1d67d750983f5de32206c3b7588581a5ea4524e5..3fdbbe6605fe9743f8463fd0a4d85184268124cc 100644 (file)
@@ -1,7 +1,7 @@
 ### deps.mk --- src/Makefile fragment for GNU Emacs
 
-## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014 Free Software
-## Foundation, Inc.
+## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014
+##   Free Software Foundation, Inc.
 
 ## This file is part of GNU Emacs.
 
@@ -27,8 +27,6 @@
 ## Eg callproc.c only depends on w32.h for WINDOWSNT builds.
 ## One way to fix this would be to replace w32.h (etc) by $(W32_H),
 ## a variable set by configure.  Does not seem worth the trouble.
-## Since the w32 build does not even use this file, you might ask
-## why these dependencies are here at all...
 
 ## nsgui.h: In fact, every .o file depends directly or indirectly on
 ## dispextern.h and hence nsgui.h under NS.  But the ones that actually
index 55b2f6658c7290d12e751ddca173ada2aab07556..d3fe5b4943de727b5a922cb306a42baf54458fb3 100644 (file)
@@ -988,7 +988,7 @@ file_attributes (int fd, char const *name, Lisp_Object id_format)
   values[10] = INTEGER_TO_CONS (s.st_ino);
   values[11] = INTEGER_TO_CONS (s.st_dev);
 
-  return Flist (sizeof (values) / sizeof (values[0]), values);
+  return Flist (ARRAYELTS (values), values);
 }
 
 DEFUN ("file-attributes-lessp", Ffile_attributes_lessp, Sfile_attributes_lessp, 2, 2, 0,
index 46ed99844e7debcdb75806241f6f6b84f69be191..bb6f1eb2b5e73ee9e2b739b4e2f967e2c8f231df 100644 (file)
@@ -118,7 +118,8 @@ enum window_part
   ON_RIGHT_FRINGE,
   ON_LEFT_MARGIN,
   ON_RIGHT_MARGIN,
-  ON_SCROLL_BAR,
+  ON_VERTICAL_SCROLL_BAR,
+  ON_HORIZONTAL_SCROLL_BAR,
   ON_RIGHT_DIVIDER,
   ON_BOTTOM_DIVIDER
 };
@@ -1716,8 +1717,10 @@ struct face
      attributes except the font.  */
   struct face *ascii_face;
 
+#ifdef HAVE_XFT
   /* Extra member that a font-driver uses privately.  */
   void *extra;
+#endif
 };
 
 
@@ -1795,16 +1798,6 @@ struct face_cache
   bool_bf menu_face_changed_p : 1;
 };
 
-
-/* Prepare face FACE for use on frame F.  This must be called before
-   using X resources of FACE.  */
-
-#define PREPARE_FACE_FOR_DISPLAY(F, FACE)      \
-  do {                                         \
-     if ((FACE)->gc == 0)                      \
-       prepare_face_for_display ((F), (FACE)); \
-  } while (false)
-
 /* Return a pointer to the face with ID on frame F, or null if such a
    face doesn't exist.  */
 
@@ -2829,45 +2822,51 @@ struct redisplay_interface
                                 int h, int wd);
   void (*destroy_fringe_bitmap) (int which);
 
-/* Compute left and right overhang of glyph string S.
-   A NULL pointer if platform does not support this. */
+  /* Compute left and right overhang of glyph string S.
+     A NULL pointer if platform does not support this. */
   void (*compute_glyph_string_overhangs) (struct glyph_string *s);
 
-/* Draw a glyph string S.  */
+  /* Draw a glyph string S.  */
   void (*draw_glyph_string) (struct glyph_string *s);
 
-/* Define cursor CURSOR on frame F.  */
+  /* Define cursor CURSOR on frame F.  */
   void (*define_frame_cursor) (struct frame *f, Cursor cursor);
 
-/* Clear the area at (X,Y,WIDTH,HEIGHT) of frame F.  */
+  /* Clear the area at (X,Y,WIDTH,HEIGHT) of frame F.  */
   void (*clear_frame_area) (struct frame *f, int x, int y,
                             int width, int height);
 
-/* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH
-   at row GLYPH_ROW on window W if ON_P is true.  If ON_P is
-   false, don't draw cursor.  If ACTIVE_P is true, system caret
-   should track this cursor (when applicable).  */
+  /* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH
+     at row GLYPH_ROW on window W if ON_P is true.  If ON_P is
+     false, don't draw cursor.  If ACTIVE_P is true, system caret
+     should track this cursor (when applicable).  */
   void (*draw_window_cursor) (struct window *w,
                              struct glyph_row *glyph_row,
                              int x, int y,
                              enum text_cursor_kinds cursor_type,
                              int cursor_width, bool on_p, bool active_p);
 
-/* Draw vertical border for window W from (X,Y_0) to (X,Y_1).  */
+  /* Draw vertical border for window W from (X,Y_0) to (X,Y_1).  */
   void (*draw_vertical_window_border) (struct window *w,
                                        int x, int y_0, int y_1);
 
-/* Draw window divider for window W from (X_0, Y_0) to (X_1, ,Y_1).  */
+  /* Draw window divider for window W from (X_0, Y_0) to (X_1, ,Y_1).  */
   void (*draw_window_divider) (struct window *w,
                               int x_0, int x_1, int y_0, int y_1);
 
-/* Shift display of frame F to make room for inserted glyphs.
-   The area at pixel (X,Y) of width WIDTH and height HEIGHT is
-   shifted right by SHIFT_BY pixels.  */
+  /* Shift display of frame F to make room for inserted glyphs.
+     The area at pixel (X,Y) of width WIDTH and height HEIGHT is
+     shifted right by SHIFT_BY pixels.  */
   void (*shift_glyphs_for_insert) (struct frame *f,
                                    int x, int y, int width,
                                    int height, int shift_by);
 
+  /* Start display hourglass cursor on frame F.  */
+  void (*show_hourglass) (struct frame *f);
+
+  /* Cancel hourglass cursor on frame F.  */
+  void (*hide_hourglass) (struct frame *f);
+
 #endif /* HAVE_WINDOW_SYSTEM */
 };
 
@@ -3164,9 +3163,8 @@ int default_line_pixel_height (struct window *);
 int display_prop_intangible_p (Lisp_Object, Lisp_Object, ptrdiff_t, ptrdiff_t);
 void resize_echo_area_exactly (void);
 int resize_mini_window (struct window *, int);
-#if defined USE_TOOLKIT_SCROLL_BARS && !defined USE_GTK
 void set_vertical_scroll_bar (struct window *);
-#endif
+void set_horizontal_scroll_bar (struct window *);
 int try_window (Lisp_Object, struct text_pos, int);
 void window_box (struct window *, enum glyph_row_area,
                 int *, int *, int *, int *);
@@ -3239,9 +3237,7 @@ extern void draw_phys_cursor_glyph (struct window *,
                                     enum draw_glyphs_face);
 extern void get_phys_cursor_geometry (struct window *, struct glyph_row *,
                                       struct glyph *, int *, int *, int *);
-#if HAVE_NTGUI
 extern void erase_phys_cursor (struct window *);
-#endif
 extern void display_and_set_cursor (struct window *, bool, int, int, int, int);
 extern void x_update_cursor (struct frame *, bool);
 extern void x_clear_cursor (struct window *);
@@ -3280,7 +3276,6 @@ void draw_fringe_bitmap (struct window *, struct glyph_row *, int);
 void draw_row_fringe_bitmaps (struct window *, struct glyph_row *);
 bool draw_window_fringes (struct window *, bool);
 bool update_window_fringes (struct window *, bool);
-void compute_fringe_widths (struct frame *, bool);
 
 #ifdef HAVE_NTGUI
 void w32_init_fringe (struct redisplay_interface *);
@@ -3355,13 +3350,13 @@ void update_face_from_frame_parameter (struct frame *, Lisp_Object,
                                        Lisp_Object);
 Lisp_Object tty_color_name (struct frame *, int);
 void clear_face_cache (int);
-#ifdef MSDOS
 unsigned long load_color (struct frame *, struct face *, Lisp_Object,
                           enum lface_attribute_index);
-#endif
 char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
                         int *);
+#ifdef HAVE_WINDOW_SYSTEM
 void prepare_face_for_display (struct frame *, struct face *);
+#endif
 int lookup_named_face (struct frame *, Lisp_Object, int);
 int lookup_basic_face (struct frame *, int);
 int smaller_face (struct frame *, int, int);
@@ -3397,6 +3392,7 @@ void gamma_correct (struct frame *, COLORREF *);
 #ifdef HAVE_WINDOW_SYSTEM
 
 void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
+void x_change_tool_bar_height (struct frame *f, int);
 
 extern Lisp_Object tip_frame;
 extern Window tip_window;
@@ -3404,14 +3400,6 @@ extern frame_parm_handler x_frame_parm_handlers[];
 
 extern void start_hourglass (void);
 extern void cancel_hourglass (void);
-extern bool hourglass_shown_p;
-/* If non-null, an asynchronous timer that, when it expires, displays
-   an hourglass cursor on all frames.  */
-extern struct atimer *hourglass_atimer;
-
-/* Each GUI implements these.  FIXME: move into RIF. */
-extern void show_hourglass (struct atimer *);
-extern void hide_hourglass (void);
 
 /* Returns the background color of IMG, calculating one heuristically if
    necessary.  If non-zero, XIMG is an existing XImage object to use for
index 7be4e0b46151ac73b8b6bd2c64ba6098387fccd3..70862985e66ae8cfb471ebb7473cdc0a64feaf04 100644 (file)
@@ -72,7 +72,6 @@ struct dim
 static void update_frame_line (struct frame *, int);
 static int required_matrix_height (struct window *);
 static int required_matrix_width (struct window *);
-static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool, bool);
 static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
 static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
                                                  struct window *);
@@ -2016,12 +2015,12 @@ adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
       /* Size of frame matrices must equal size of frame.  Note
         that we are called for X frames with window widths NOT equal
         to the frame width (from CHANGE_FRAME_SIZE_1).  */
-      if (matrix_dim.width != FRAME_COLS (f)
-         || matrix_dim.height != FRAME_LINES (f))
+      if (matrix_dim.width != FRAME_TOTAL_COLS (f)
+         || matrix_dim.height != FRAME_TOTAL_LINES (f))
        return;
 
-      eassert (matrix_dim.width == FRAME_COLS (f)
-              && matrix_dim.height == FRAME_LINES (f));
+      eassert (matrix_dim.width == FRAME_TOTAL_COLS (f)
+              && matrix_dim.height == FRAME_TOTAL_LINES (f));
 
       /* Pointers to glyph memory in glyph rows are exchanged during
         the update phase of redisplay, which means in general that a
@@ -2123,11 +2122,11 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
     w->left_col = 0;
     w->pixel_top = FRAME_MENU_BAR_HEIGHT (f);
     w->top_line = FRAME_MENU_BAR_LINES (f);
+    w->total_cols = FRAME_TOTAL_COLS (f);
     w->pixel_width = (FRAME_PIXEL_WIDTH (f)
                       - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
-    w->total_cols = FRAME_TOTAL_COLS (f);
-    w->pixel_height = FRAME_TOOL_BAR_HEIGHT (f);
     w->total_lines = FRAME_TOOL_BAR_LINES (f);
+    w->pixel_height = FRAME_TOOL_BAR_HEIGHT (f);
     allocate_matrices_for_window_redisplay (w);
   }
 #endif
@@ -2956,7 +2955,7 @@ window_to_frame_vpos (struct window *w, int vpos)
   eassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
   eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
   vpos += WINDOW_TOP_EDGE_LINE (w);
-  eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame)));
+  eassert (vpos >= 0 && vpos <= FRAME_TOTAL_LINES (XFRAME (w->frame)));
   return vpos;
 }
 
@@ -3421,7 +3420,7 @@ update_window (struct window *w, bool force_p)
       mode_line_row = MATRIX_MODE_LINE_ROW (desired_matrix);
       if (mode_line_row->mode_line_p && mode_line_row->enabled_p)
        {
-         mode_line_row->y = yb;
+         mode_line_row->y = yb + WINDOW_SCROLL_BAR_AREA_HEIGHT (w);
          update_window_line (w, MATRIX_ROW_VPOS (mode_line_row,
                                                  desired_matrix),
                              &mouse_face_overwritten_p);
@@ -4537,7 +4536,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
        }
     }
 
-  pause_p = 0 < i && i < FRAME_LINES (f) - 1;
+  pause_p = 0 < i && i < FRAME_TOTAL_LINES (f) - 1;
 
   /* Now just clean up termcap drivers and set cursor, etc.  */
   if (!pause_p && set_cursor_p)
@@ -4570,7 +4569,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
                 cursor at the end of the prompt.  If the mini-buffer
                 is several lines high, find the last line that has
                 any text on it.  */
-             row = FRAME_LINES (f);
+             row = FRAME_TOTAL_LINES (f);
              do
                {
                  --row;
@@ -4598,7 +4597,7 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p,
              if (col >= FRAME_CURSOR_X_LIMIT (f))
                {
                  /* If we have another row, advance cursor into it.  */
-                 if (row < FRAME_LINES (f) - 1)
+                 if (row < FRAME_TOTAL_LINES (f) - 1)
                    {
                      col = FRAME_LEFT_SCROLL_BAR_COLS (f);
                      row++;
@@ -4648,12 +4647,12 @@ scrolling (struct frame *frame)
   int unchanged_at_top, unchanged_at_bottom;
   int window_size;
   int changed_lines;
-  int *old_hash = alloca (FRAME_LINES (frame) * sizeof (int));
-  int *new_hash = alloca (FRAME_LINES (frame) * sizeof (int));
-  int *draw_cost = alloca (FRAME_LINES (frame) * sizeof (int));
-  int *old_draw_cost = alloca (FRAME_LINES (frame) * sizeof (int));
+  int *old_hash = alloca (FRAME_TOTAL_LINES (frame) * sizeof (int));
+  int *new_hash = alloca (FRAME_TOTAL_LINES (frame) * sizeof (int));
+  int *draw_cost = alloca (FRAME_TOTAL_LINES (frame) * sizeof (int));
+  int *old_draw_cost = alloca (FRAME_TOTAL_LINES (frame) * sizeof (int));
   register int i;
-  int free_at_end_vpos = FRAME_LINES (frame);
+  int free_at_end_vpos = FRAME_TOTAL_LINES (frame);
   struct glyph_matrix *current_matrix = frame->current_matrix;
   struct glyph_matrix *desired_matrix = frame->desired_matrix;
 
@@ -4664,8 +4663,8 @@ scrolling (struct frame *frame)
      number of unchanged lines at the end.  */
   changed_lines = 0;
   unchanged_at_top = 0;
-  unchanged_at_bottom = FRAME_LINES (frame);
-  for (i = 0; i < FRAME_LINES (frame); i++)
+  unchanged_at_bottom = FRAME_TOTAL_LINES (frame);
+  for (i = 0; i < FRAME_TOTAL_LINES (frame); i++)
     {
       /* Give up on this scrolling if some old lines are not enabled.  */
       if (!MATRIX_ROW_ENABLED_P (current_matrix, i))
@@ -4687,7 +4686,7 @@ scrolling (struct frame *frame)
       if (old_hash[i] != new_hash[i])
        {
          changed_lines++;
-         unchanged_at_bottom = FRAME_LINES (frame) - i - 1;
+         unchanged_at_bottom = FRAME_TOTAL_LINES (frame) - i - 1;
        }
       else if (i == unchanged_at_top)
        unchanged_at_top++;
@@ -4697,10 +4696,10 @@ scrolling (struct frame *frame)
   /* If changed lines are few, don't allow preemption, don't scroll.  */
   if ((!FRAME_SCROLL_REGION_OK (frame)
        && changed_lines < baud_rate / 2400)
-      || unchanged_at_bottom == FRAME_LINES (frame))
+      || unchanged_at_bottom == FRAME_TOTAL_LINES (frame))
     return 1;
 
-  window_size = (FRAME_LINES (frame) - unchanged_at_top
+  window_size = (FRAME_TOTAL_LINES (frame) - unchanged_at_top
                 - unchanged_at_bottom);
 
   if (FRAME_SCROLL_REGION_OK (frame))
@@ -4714,7 +4713,7 @@ scrolling (struct frame *frame)
       && window_size >= 18 && baud_rate > 2400
       && (window_size >=
          10 * scrolling_max_lines_saved (unchanged_at_top,
-                                         FRAME_LINES (frame) - unchanged_at_bottom,
+                                         FRAME_TOTAL_LINES (frame) - unchanged_at_bottom,
                                          old_hash, new_hash, draw_cost)))
     return 0;
 
@@ -5471,52 +5470,11 @@ do_pending_window_change (bool safe)
     }
 }
 
-/* Change the frame height and/or width.  Values may be given as zero to
-   indicate no change is to take place.
-
-   new_height and new_width refer to the text portion of the frame.  It
-   doesn't matter for new_height, since text and total portion are the
-   same in that case.  But new_width must be enlarged to get the total
-   width of the frame.
-
-   If DELAY, assume we're being called from a signal handler, and
-   queue the change for later - perhaps the next redisplay.
-   Since this tries to resize windows, we can't call it
-   from a signal handler.
-
-   SAFE means this function is called from a place where it's
-   safe to change frame sizes while a redisplay is in progress.  */
-
-void
-change_frame_size (struct frame *f, int new_width, int new_height,
-                  bool pretend, bool delay, bool safe, bool pixelwise)
-{
-  Lisp_Object tail, frame;
-
-  if (FRAME_MSDOS_P (f))
-    {
-      /* On MS-DOS, all frames use the same screen, so a change in
-         size affects all frames.  Termcap now supports multiple
-         ttys. */
-      FOR_EACH_FRAME (tail, frame)
-       if (! FRAME_WINDOW_P (XFRAME (frame)))
-         change_frame_size_1 (XFRAME (frame), new_width, new_height,
-                              pretend, delay, safe, pixelwise);
-    }
-  else
-    change_frame_size_1 (f, new_width, new_height, pretend, delay, safe,
-                        pixelwise);
-}
 
 static void
 change_frame_size_1 (struct frame *f, int new_width, int new_height,
                     bool pretend, bool delay, bool safe, bool pixelwise)
 {
-  int new_text_width, new_text_height, new_root_width;
-  int old_root_width = WINDOW_PIXEL_WIDTH (XWINDOW (FRAME_ROOT_WINDOW (f)));
-  int new_cols, new_lines;
-  ptrdiff_t count = SPECPDL_INDEX ();
-
   /* If we can't deal with the change now, queue it for later.  */
   if (delay || (redisplaying_p && !safe))
     {
@@ -5524,123 +5482,63 @@ change_frame_size_1 (struct frame *f, int new_width, int new_height,
       f->new_height = new_height;
       f->new_pixelwise = pixelwise;
       delayed_size_change = 1;
-      return;
-    }
-
-  /* This size-change overrides any pending one for this frame.  */
-  f->new_height = 0;
-  f->new_width = 0;
-  f->new_pixelwise = 0;
-
-  /* If an argument is zero, set it to the current value.  */
-  if (pixelwise)
-    {
-      new_text_width = (new_width == 0) ? FRAME_TEXT_WIDTH (f) : new_width;
-      new_text_height = (new_height == 0) ? FRAME_TEXT_HEIGHT (f) : new_height;
-      /* Consider rounding here: Currently, the root window can be
-        larger than the frame in terms of columns/lines.  */
-      new_cols = new_text_width / FRAME_COLUMN_WIDTH (f);
-      new_lines = new_text_height / FRAME_LINE_HEIGHT (f);
     }
   else
     {
-      new_cols = (new_width == 0) ? FRAME_COLS (f) : new_width;
-      new_lines = (new_height == 0) ? FRAME_LINES (f) : new_height;
-      new_text_width = new_cols * FRAME_COLUMN_WIDTH (f);
-      new_text_height = new_lines * FRAME_LINE_HEIGHT (f);
-    }
-
-  /* Compute width of windows in F.  */
-  /* Round up to the smallest acceptable size.  */
-  check_frame_size (f, &new_text_width, &new_text_height, 1);
-
-  /* This is the width of the frame without vertical scroll bars and
-     fringe columns.  Do this after rounding - see discussion of
-     bug#9723.  */
-  new_root_width = (new_text_width
-                   + FRAME_SCROLL_BAR_AREA_WIDTH (f)
-                   + FRAME_TOTAL_FRINGE_WIDTH (f));
-  /* If we're not changing the frame size, quit now.  */
-  /* Frame width may be unchanged but the text portion may change, for
-     example, fullscreen and remove/add scroll bar.  */
-  if (new_text_height == FRAME_TEXT_HEIGHT (f)
-      && new_text_width == FRAME_TEXT_WIDTH (f)
-      && new_root_width == old_root_width
-      && (FRAME_PIXEL_HEIGHT (f) ==
-         FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height))
-      && (FRAME_PIXEL_WIDTH (f) ==
-         FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width)))
-    return;
-
-  block_input ();
-
-#ifdef MSDOS
-  /* We only can set screen dimensions to certain values supported
-     by our video hardware.  Try to find the smallest size greater
-     or equal to the requested dimensions.  */
-  dos_set_window_size (&new_lines, &new_cols);
-#endif
-
-  if (new_text_height != FRAME_TEXT_HEIGHT (f))
-    {
-      resize_frame_windows (f, new_text_height, 0, 1);
-
-      /* MSDOS frames cannot PRETEND, as they change frame size by
-        manipulating video hardware.  */
-      if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
-       FrameRows (FRAME_TTY (f)) = new_lines;
-    }
-
-  if (new_text_width != FRAME_TEXT_WIDTH (f)
-      || new_root_width != old_root_width)
-    {
-      resize_frame_windows (f, new_root_width, 1, 1);
-
-      /* MSDOS frames cannot PRETEND, as they change frame size by
-        manipulating video hardware.  */
-      if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
-       FrameCols (FRAME_TTY (f)) = new_cols;
+      /* This size-change overrides any pending one for this frame.  */
+      f->new_height = 0;
+      f->new_width = 0;
+      f->new_pixelwise = 0;
 
-#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
-      if (WINDOWP (f->tool_bar_window))
+      /* If an argument is zero, set it to the current value.  */
+      if (pixelwise)
        {
-         XWINDOW (f->tool_bar_window)->total_cols = new_cols;
-         XWINDOW (f->tool_bar_window)->pixel_width = new_root_width;
+         new_width = (new_width <= 0) ? FRAME_TEXT_WIDTH (f) : new_width;
+         new_height = (new_height <= 0) ? FRAME_TEXT_HEIGHT (f) : new_height;
+       }
+      else
+       {
+         new_width = (((new_width <= 0) ? FRAME_COLS (f) : new_width)
+                      * FRAME_COLUMN_WIDTH (f));
+         new_height = (((new_height <= 0) ? FRAME_LINES (f) : new_height)
+                       * FRAME_LINE_HEIGHT (f));
        }
-#endif
-    }
-
-  SET_FRAME_COLS (f, new_cols);
-  FRAME_LINES (f) = new_lines;
-  FRAME_TEXT_WIDTH (f) = new_text_width;
-  FRAME_TEXT_HEIGHT (f) = new_text_height;
-  FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width);
-  FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height);
 
-  {
-    struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
-    int text_area_x, text_area_y, text_area_width, text_area_height;
-
-    window_box (w, TEXT_AREA, &text_area_x, &text_area_y, &text_area_width,
-               &text_area_height);
-    if (w->cursor.x >= text_area_x + text_area_width)
-      w->cursor.hpos = w->cursor.x = 0;
-    if (w->cursor.y >= text_area_y + text_area_height)
-      w->cursor.vpos = w->cursor.y = 0;
-  }
+      /* Adjust frame size but make sure x_set_window_size does not
+        get called.  */
+      adjust_frame_size (f, new_width, new_height, 5, pretend);
+    }
+}
 
-  adjust_frame_glyphs (f);
-  calculate_costs (f);
-  SET_FRAME_GARBAGED (f);
-  f->resized_p = 1;
 
-  unblock_input ();
+/* Change text height/width of frame F.  Values may be given as zero to
+   indicate that no change is needed.
 
-  record_unwind_current_buffer ();
+   If DELAY, assume we're being called from a signal handler, and queue
+   the change for later - perhaps the next redisplay.  Since this tries
+   to resize windows, we can't call it from a signal handler.
 
-  run_window_configuration_change_hook (f);
+   SAFE means this function is called from a place where it's safe to
+   change frame sizes while a redisplay is in progress.  */
+void
+change_frame_size (struct frame *f, int new_width, int new_height,
+                  bool pretend, bool delay, bool safe, bool pixelwise)
+{
+  Lisp_Object tail, frame;
 
-  unbind_to (count, Qnil);
+  if (FRAME_MSDOS_P (f))
+    {
+      /* On MS-DOS, all frames use the same screen, so a change in
+         size affects all frames.  Termcap now supports multiple
+         ttys. */
+      FOR_EACH_FRAME (tail, frame)
+       if (! FRAME_WINDOW_P (XFRAME (frame)))
+         change_frame_size_1 (XFRAME (frame), new_width, new_height,
+                              pretend, delay, safe, pixelwise);
+    }
+  else
+    change_frame_size_1 (f, new_width, new_height, pretend, delay, safe,
+                        pixelwise);
 }
 \f
 /***********************************************************************
@@ -6171,7 +6069,8 @@ init_display (void)
     t->display_info.tty->top_frame = selected_frame;
     change_frame_size (XFRAME (selected_frame),
                        FrameCols (t->display_info.tty),
-                       FrameRows (t->display_info.tty), 0, 0, 1, 0);
+                       FrameRows (t->display_info.tty)
+                      - FRAME_MENU_BAR_LINES (f), 0, 0, 1, 0);
 
     /* Delete the initial terminal. */
     if (--initial_terminal->reference_count == 0
@@ -6193,7 +6092,7 @@ init_display (void)
   {
     struct frame *sf = SELECTED_FRAME ();
     int width = FRAME_TOTAL_COLS (sf);
-    int height = FRAME_LINES (sf);
+    int height = FRAME_TOTAL_LINES (sf);
 
     /* If these sizes are so big they cause overflow, just ignore the
        change.  It's not clear what better we could do.  The rest of
index b6a4cd0a27b668d594577fe7bf5bbcb1b5e17365..df8cfba3f2a1269204524b5c072ffd0251d227c6 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -595,7 +595,7 @@ the same file name is found in the `doc-directory'.  */)
        {
          #include "buildobj.h"
        };
-      int i = sizeof buildobj / sizeof *buildobj;
+      int i = ARRAYELTS (buildobj);
       while (0 <= --i)
        Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files);
       Vbuild_files = Fpurecopy (Vbuild_files);
index 071d73ea16ec249d08322f2f56e781f7b3256faf..e557dcba022abb7404d7020b4ca06748372e8cd3 100644 (file)
@@ -402,7 +402,7 @@ msdos_stdcolor_idx (const char *name)
 {
   int i;
 
-  for (i = 0; i < sizeof (vga_colors) / sizeof (vga_colors[0]); i++)
+  for (i = 0; i < ARRAYELTS (vga_colors); i++)
     if (xstrcasecmp (name, vga_colors[i]) == 0)
       return i;
 
@@ -422,7 +422,7 @@ msdos_stdcolor_name (int idx)
     return build_string (unspecified_fg);
   else if (idx == FACE_TTY_DEFAULT_BG_COLOR)
     return build_string (unspecified_bg);
-  else if (idx >= 0 && idx < sizeof (vga_colors) / sizeof (vga_colors[0]))
+  else if (idx >= 0 && idx < ARRAYELTS (vga_colors))
     return build_string (vga_colors[idx]);
   else
     return Qunspecified;       /* meaning the default */
@@ -640,6 +640,48 @@ system_process_attributes (Lisp_Object pid)
 
   return attrs;
 }
+\f
+/* Support for memory-info.  */
+int
+dos_memory_info (unsigned long *totalram, unsigned long *freeram,
+                unsigned long *totalswap, unsigned long *freeswap)
+{
+  _go32_dpmi_meminfo info;
+  unsigned long mem1, mem2, freemem;
+
+  _go32_dpmi_get_free_memory_information (&info);
+  /* DPMI server of Windows NT and its descendants reports in
+     info.available_memory a much lower amount that is really
+     available, which causes bogus "past 95% of memory limit"
+     warnings.  Try to overcome that via circumstantial evidence.  */
+  mem1 = info.available_memory;
+  mem2 = info.available_physical_pages;
+  /* DPMI Spec: "Fields that are unavailable will hold -1."  */
+  if ((long)mem1 == -1L)
+    mem1 = 0;
+  if ((long)mem2 == -1L)
+    mem2 = 0;
+  else
+    mem2 *= 4096;
+  /* Surely, the available memory is at least what we have physically
+     available, right?  */
+  if (mem1 >= mem2)
+    freemem = mem1;
+  else
+    freemem = mem2;
+  *freeram = freemem;
+  *totalswap =
+    ((long)info.max_pages_in_paging_file == -1L)
+    ? 0
+    : info.max_pages_in_paging_file * 4096;
+  *totalram =
+    ((long)info.total_physical_pages == -1L)
+    ? (freemem + (unsigned long)sbrk (0) + *totalswap)
+    : info.total_physical_pages * 4096;
+  *freeswap = 0;
+  return 0;
+}
+
 \f
 void
 dos_cleanup (void)
index 3409b2247b7463191a0d1fc30963b3a12bfadbf8..f32e6342fc93d044eb6d6131e161844aadb74ec0 100644 (file)
@@ -22,7 +22,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define DOS_COUNTRY_INFO 34    /* no of bytes returned by dos int 38h */
 extern unsigned char dos_country_info[DOS_COUNTRY_INFO];
-
+extern int dos_memory_info (unsigned long *, unsigned long *,
+                           unsigned long *, unsigned long *);
 #ifndef HAVE_X_WINDOWS
 extern int         msdos_stdcolor_idx  (const char *);
 extern Lisp_Object msdos_stdcolor_name (int);
index 9c1fcb0b7906f818cbc67a5e957af069a3a6b51c..e8d4478f2f66475f59f99452090de327f4979df0 100644 (file)
@@ -2238,7 +2238,7 @@ general_insert_function (void (*insert_func)
            len = CHAR_STRING (c, str);
          else
            {
-             str[0] = ASCII_CHAR_P (c) ? c : multibyte_char_to_unibyte (c);
+             str[0] = CHAR_TO_BYTE8 (c);
              len = 1;
            }
          (*insert_func) ((char *) str, len);
@@ -2852,7 +2852,7 @@ Both characters must have the same length of multi-byte form.  */)
       len = CHAR_STRING (fromc, fromstr);
       if (CHAR_STRING (toc, tostr) != len)
        error ("Characters in `subst-char-in-region' have different byte-lengths");
-      if (!ASCII_BYTE_P (*tostr))
+      if (!ASCII_CHAR_P (*tostr))
        {
          /* If *TOSTR is in the range 0x80..0x9F and TOCHAR is not a
             complete multibyte character, it may be combined with the
@@ -2945,7 +2945,7 @@ Both characters must have the same length of multi-byte form.  */)
                  : ((pos_byte_next < Z_BYTE
                      && ! CHAR_HEAD_P (FETCH_BYTE (pos_byte_next)))
                     || (pos_byte > BEG_BYTE
-                        && ! ASCII_BYTE_P (FETCH_BYTE (pos_byte - 1))))))
+                        && ! ASCII_CHAR_P (FETCH_BYTE (pos_byte - 1))))))
            {
              Lisp_Object tem, string;
 
@@ -3126,7 +3126,7 @@ It returns the number of characters changed.  */)
              else
                {
                  nc = tt[oc];
-                 if (! ASCII_BYTE_P (nc) && multibyte)
+                 if (! ASCII_CHAR_P (nc) && multibyte)
                    {
                      str_len = BYTE8_STRING (nc, buf);
                      str = buf;
@@ -3600,7 +3600,7 @@ specifier truncates the string to the given width.
 usage: (format STRING &rest OBJECTS)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
-  ptrdiff_t n;         /* The number of the next arg to substitute */
+  ptrdiff_t n;         /* The number of the next arg to substitute */
   char initial_buffer[4000];
   char *buf = initial_buffer;
   ptrdiff_t bufsize = sizeof initial_buffer;
@@ -3877,7 +3877,7 @@ usage: (format STRING &rest OBJECTS)  */)
 
                  if (p > buf
                      && multibyte
-                     && !ASCII_BYTE_P (*((unsigned char *) p - 1))
+                     && !ASCII_CHAR_P (*((unsigned char *) p - 1))
                      && STRING_MULTIBYTE (args[n])
                      && !CHAR_HEAD_P (SREF (args[n], 0)))
                    maybe_combine_byte = 1;
@@ -4167,7 +4167,7 @@ usage: (format STRING &rest OBJECTS)  */)
            {
              /* Copy a whole multibyte character.  */
              if (p > buf
-                 && !ASCII_BYTE_P (*((unsigned char *) p - 1))
+                 && !ASCII_CHAR_P (*((unsigned char *) p - 1))
                  && !CHAR_HEAD_P (*format))
                maybe_combine_byte = 1;
 
@@ -4181,7 +4181,7 @@ usage: (format STRING &rest OBJECTS)  */)
          else
            {
              unsigned char uc = *format++;
-             if (! multibyte || ASCII_BYTE_P (uc))
+             if (! multibyte || ASCII_CHAR_P (uc))
                convbytes = 1;
              else
                {
index fd93324de97740825fd75a7ec4c6909bee4dc687..a53b4cfd4edd910fdd3d89f48aaf165dd3b9948d 100644 (file)
@@ -1,7 +1,7 @@
 /* Fully extensible Emacs, running on Unix, intended for GNU.
 
-Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2014 Free Software
-Foundation, Inc.
+Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2014
+  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -51,6 +51,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "cygw32.h"
 #endif
 
+#ifdef MSDOS
+#include <binary-io.h>
+#endif
+
 #ifdef HAVE_WINDOW_SYSTEM
 #include TERM_HEADER
 #endif /* HAVE_WINDOW_SYSTEM */
@@ -80,6 +84,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "composite.h"
 #include "dispextern.h"
 #include "syntax.h"
+#include "sysselect.h"
 #include "systime.h"
 
 #ifdef HAVE_GNUTLS
@@ -105,8 +110,9 @@ extern void moncontrol (int mode);
 #include <sys/personality.h>
 #endif
 
-static const char emacs_version[] = VERSION;
+static const char emacs_version[] = PACKAGE_VERSION;
 static const char emacs_copyright[] = COPYRIGHT;
+static const char emacs_bugreport[] = PACKAGE_BUGREPORT;
 
 /* Empty lisp strings.  To avoid having to build any others.  */
 Lisp_Object empty_unibyte_string, empty_multibyte_string;
@@ -121,6 +127,9 @@ Lisp_Object Vlibrary_cache;
    on subsequent starts.  */
 bool initialized;
 
+/* Set to true if this instance of Emacs might dump.  */
+bool might_dump;
+
 #ifdef DARWIN_OS
 extern void unexec_init_emacs_zone (void);
 #endif
@@ -132,7 +141,7 @@ static void *malloc_state_ptr;
 /* From glibc, a routine that returns a copy of the malloc internal state.  */
 extern void *malloc_get_state (void);
 /* From glibc, a routine that overwrites the malloc internal state.  */
-extern int malloc_set_state (void*);
+extern int malloc_set_state (void *);
 /* True if the MALLOC_CHECK_ environment variable was set while
    dumping.  Used to work around a bug in glibc's malloc.  */
 static bool malloc_using_checking;
@@ -210,7 +219,7 @@ int initial_argc;
 static void sort_args (int argc, char **argv);
 static void syms_of_emacs (void);
 
-/* C89 needs each string be at most 509 characters, so the usage
+/* C99 needs each string to be at most 4095 characters, and the usage
    strings below are split to not overflow this limit.  */
 static char const *const usage_message[] =
   { "\
@@ -321,7 +330,7 @@ abbreviation for a --option.\n\
 Various environment variables and window system resources also affect\n\
 the operation of Emacs.  See the main documentation.\n\
 \n\
-Report bugs to bug-gnu-emacs@gnu.org.  First, please see the Bugs\n\
+Report bugs to " PACKAGE_BUGREPORT ".  First, please see the Bugs\n\
 section of the Emacs manual or the file BUGS.\n"
   };
 
@@ -731,6 +740,10 @@ main (int argc, char **argv)
   xputenv ("G_SLICE=always-malloc");
 #endif
 
+#ifndef CANNOT_DUMP
+  might_dump = !initialized;
+#endif
+
 #ifdef GNU_LINUX
   if (!initialized)
     {
@@ -909,20 +922,10 @@ main (int argc, char **argv)
 
 #endif /* not SYSTEM_MALLOC */
 
-#if defined (MSDOS) || defined (WINDOWSNT)
-  /* We do all file input/output as binary files.  When we need to translate
-     newlines, we do that manually.  */
-  _fmode = O_BINARY;
-#endif /* MSDOS || WINDOWSNT */
-
 #ifdef MSDOS
-  if (!isatty (fileno (stdin)))
-    setmode (fileno (stdin), O_BINARY);
-  if (!isatty (fileno (stdout)))
-    {
-      fflush (stdout);
-      setmode (fileno (stdout), O_BINARY);
-    }
+  SET_BINARY (fileno (stdin));
+  fflush (stdout);
+  SET_BINARY (fileno (stdout));
 #endif /* MSDOS */
 
   /* Skip initial setlocale if LC_ALL is "C", as it's not needed in that case.
@@ -1000,7 +1003,7 @@ main (int argc, char **argv)
     {
       int i;
       printf ("Usage: %s [OPTION-OR-FILENAME]...\n", argv[0]);
-      for (i = 0; i < sizeof usage_message / sizeof *usage_message; i++)
+      for (i = 0; i < ARRAYELTS (usage_message); i++)
        fputs (usage_message[i], stdout);
       exit (0);
     }
@@ -1368,7 +1371,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
   xputenv ("LANG=C");
 #endif
 
-  init_buffer ();      /* Init default directory of main buffer.  */
+  /* Init buffer storage and default directory of main buffer.  */
+  init_buffer (initialized);
 
   init_callproc_1 ();  /* Must precede init_cmdargs and init_sys_modes.  */
 
@@ -1809,7 +1813,7 @@ sort_args (int argc, char **argv)
            }
 
          /* Look for a match with a known old-fashioned option.  */
-         for (i = 0; i < sizeof (standard_args) / sizeof (standard_args[0]); i++)
+         for (i = 0; i < ARRAYELTS (standard_args); i++)
            if (!strcmp (argv[from], standard_args[i].name))
              {
                options[from] = standard_args[i].nargs;
@@ -1831,8 +1835,7 @@ sort_args (int argc, char **argv)
 
              match = -1;
 
-             for (i = 0;
-                  i < sizeof (standard_args) / sizeof (standard_args[0]); i++)
+             for (i = 0; i < ARRAYELTS (standard_args); i++)
                if (standard_args[i].longname
                    && !strncmp (argv[from], standard_args[i].longname,
                                 thislen))
@@ -2025,9 +2028,7 @@ shut_down_emacs (int sig, Lisp_Object stuff)
   kill_buffer_processes (Qnil);
   Fdo_auto_save (Qt, Qnil);
 
-#ifdef CLASH_DETECTION
   unlock_all_files ();
-#endif
 
   /* There is a tendency for a SIGIO signal to arrive within exit,
      and cause a SIGHUP because the input descriptor is already closed.  */
@@ -2082,6 +2083,9 @@ You must run Emacs in batch mode in order to dump it.  */)
   if (! noninteractive)
     error ("Dumping Emacs works only in batch mode");
 
+  if (!might_dump)
+    error ("Emacs can be dumped only once");
+
 #ifdef GNU_LINUX
 
   /* Warn if the gap between BSS end and heap start is larger than this.  */
@@ -2147,13 +2151,8 @@ You must run Emacs in batch mode in order to dump it.  */)
   malloc_state_ptr = malloc_get_state ();
 #endif
 
-#ifdef USE_MMAP_FOR_BUFFERS
-  mmap_set_vars (0);
-#endif
   unexec (SSDATA (filename), !NILP (symfile) ? SSDATA (symfile) : 0);
-#ifdef USE_MMAP_FOR_BUFFERS
-  mmap_set_vars (1);
-#endif
+
 #ifdef DOUG_LEA_MALLOC
   free (malloc_state_ptr);
 #endif
@@ -2452,6 +2451,12 @@ Emacs is running.  */);
               doc: /* String containing the configuration options Emacs was built with.  */);
   Vsystem_configuration_options = build_string (EMACS_CONFIG_OPTIONS);
 
+  DEFVAR_LISP ("system-configuration-features", Vsystem_configuration_features,
+              doc: /* String listing some of the main features this Emacs was compiled with.
+An element of the form \"FOO\" generally means that HAVE_FOO was
+defined during the build.  */);
+  Vsystem_configuration_features = build_string (EMACS_CONFIG_FEATURES);
+
   DEFVAR_BOOL ("noninteractive", noninteractive1,
               doc: /* Non-nil means Emacs is running without interactive terminal.  */);
 
@@ -2529,6 +2534,10 @@ This is nil during initialization.  */);
               doc: /* Version numbers of this version of Emacs.  */);
   Vemacs_version = build_string (emacs_version);
 
+  DEFVAR_LISP ("report-emacs-bug-address", Vreport_emacs_bug_address,
+              doc: /* Address of mailing list for GNU Emacs bugs.  */);
+  Vreport_emacs_bug_address = build_string (emacs_bugreport);
+
   DEFVAR_LISP ("dynamic-library-alist", Vdynamic_library_alist,
     doc: /* Alist of dynamic libraries vs external files implementing them.
 Each element is a list (LIBRARY FILE...), where the car is a symbol
index a96d413d09fc6494c9982d3046b05a29a8076a94..4b2e256a7224ea905f11c1a5002bbbdb5505d90c 100644 (file)
@@ -27,11 +27,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "commands.h"
 #include "keyboard.h"
 #include "dispextern.h"
-#include "frame.h"             /* For XFRAME.  */
-
-#if HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
 
 /* Chain of condition and catch handlers currently in effect.  */
 
@@ -97,10 +92,8 @@ static EMACS_INT when_entered_debugger;
 /* FIXME: We should probably get rid of this!  */
 Lisp_Object Vsignaling_function;
 
-/* If non-nil, Lisp code must not be run since some part of Emacs is
-   in an inconsistent state.  Currently, x-create-frame uses this to
-   avoid triggering window-configuration-change-hook while the new
-   frame is half-initialized.  */
+/* If non-nil, Lisp code must not be run since some part of Emacs is in
+   an inconsistent state.  Currently unused.  */
 Lisp_Object inhibit_lisp_code;
 
 /* These would ordinarily be static, but they need to be visible to GDB.  */
index c87a6f713124252a7c33b413306dca0edba08d69..f0bd75b170efb6e1e63220488c96bd057d7fb10c 100644 (file)
@@ -990,7 +990,7 @@ filesystem tree, not (expand-file-name ".."  dirname).  */)
        {
          unsigned char *p = SDATA (name);
 
-         while (*p && ASCII_BYTE_P (*p))
+         while (*p && ASCII_CHAR_P (*p))
            p++;
          if (*p == '\0')
            {
@@ -2911,7 +2911,7 @@ or if SELinux is disabled, or if Emacs lacks SELinux support.  */)
     }
 #endif
 
-  return Flist (sizeof (values) / sizeof (values[0]), values);
+  return Flist (ARRAYELTS (values), values);
 }
 \f
 DEFUN ("set-file-selinux-context", Fset_file_selinux_context,
@@ -4083,13 +4083,11 @@ by calling `format-decode', which see.  */)
 
   if (NILP (visit) && total > 0)
     {
-#ifdef CLASH_DETECTION
       if (!NILP (BVAR (current_buffer, file_truename))
          /* Make binding buffer-file-name to nil effective.  */
          && !NILP (BVAR (current_buffer, filename))
          && SAVE_MODIFF >= MODIFF)
        we_locked_file = 1;
-#endif /* CLASH_DETECTION */
       prepare_to_modify_buffer (PT, PT, NULL);
     }
 
@@ -4189,10 +4187,8 @@ by calling `format-decode', which see.  */)
 
   if (inserted == 0)
     {
-#ifdef CLASH_DETECTION
       if (we_locked_file)
        unlock_file (BVAR (current_buffer, file_truename));
-#endif
       Vdeactivate_mark = old_Vdeactivate_mark;
     }
   else
@@ -4341,14 +4337,12 @@ by calling `format-decode', which see.  */)
       SAVE_MODIFF = MODIFF;
       BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF;
       XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
-#ifdef CLASH_DETECTION
       if (NILP (handler))
        {
          if (!NILP (BVAR (current_buffer, file_truename)))
            unlock_file (BVAR (current_buffer, file_truename));
          unlock_file (filename);
        }
-#endif /* CLASH_DETECTION */
       if (not_regular)
        xsignal2 (Qfile_error,
                  build_string ("not a regular file"), orig_filename);
@@ -4818,13 +4812,11 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
   if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
     coding.mode |= CODING_MODE_SELECTIVE_DISPLAY;
 
-#ifdef CLASH_DETECTION
   if (open_and_close_file && !auto_saving)
     {
       lock_file (lockname);
       file_locked = 1;
     }
-#endif /* CLASH_DETECTION */
 
   encoded_filename = ENCODE_FILE (filename);
   fn = SSDATA (encoded_filename);
@@ -4846,10 +4838,8 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
       if (desc < 0)
        {
          int open_errno = errno;
-#ifdef CLASH_DETECTION
          if (file_locked)
            unlock_file (lockname);
-#endif /* CLASH_DETECTION */
          UNGCPRO;
          report_file_errno ("Opening output file", filename, open_errno);
        }
@@ -4864,10 +4854,8 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
       if (ret < 0)
        {
          int lseek_errno = errno;
-#ifdef CLASH_DETECTION
          if (file_locked)
            unlock_file (lockname);
-#endif /* CLASH_DETECTION */
          UNGCPRO;
          report_file_errno ("Lseek error", filename, lseek_errno);
        }
@@ -5010,10 +4998,8 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
 
   unbind_to (count, Qnil);
 
-#ifdef CLASH_DETECTION
   if (file_locked)
     unlock_file (lockname);
-#endif /* CLASH_DETECTION */
 
   /* Do this before reporting IO error
      to avoid a "file has changed on disk" warning on
@@ -5779,24 +5765,6 @@ before any other event (mouse or keypress) is handled.  */)
   return Qnil;
 }
 
-Lisp_Object
-Fread_file_name (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object initial, Lisp_Object predicate)
-{
-  struct gcpro gcpro1;
-  Lisp_Object args[7];
-
-  GCPRO1 (default_filename);
-  args[0] = intern ("read-file-name");
-  args[1] = prompt;
-  args[2] = dir;
-  args[3] = default_filename;
-  args[4] = mustmatch;
-  args[5] = initial;
-  args[6] = predicate;
-  RETURN_UNGCPRO (Ffuncall (7, args));
-}
-
-\f
 void
 init_fileio (void)
 {
index 5252db09104dd78ffd260f57e9326245fd825d75..f857c48814359a7e070b013947fe16dc07db44ef 100644 (file)
@@ -55,8 +55,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "w32.h"       /* for dostounix_filename */
 #endif
 
-#ifdef CLASH_DETECTION
-
 #ifdef HAVE_UTMP_H
 #include <utmp.h>
 #endif
@@ -773,7 +771,9 @@ DEFUN ("lock-buffer", Flock_buffer, Slock_buffer,
        0, 1, 0,
        doc: /* Lock FILE, if current buffer is modified.
 FILE defaults to current buffer's visited file,
-or else nothing is done if current buffer isn't visiting a file.  */)
+or else nothing is done if current buffer isn't visiting a file.
+
+If the option `create-lockfiles' is nil, this does nothing.  */)
   (Lisp_Object file)
 {
   if (NILP (file))
@@ -837,8 +837,6 @@ t if it is locked by you, else a string saying which user has locked it.  */)
   return ret;
 }
 
-#endif /* CLASH_DETECTION */
-
 void
 syms_of_filelock (void)
 {
@@ -850,9 +848,7 @@ syms_of_filelock (void)
               doc: /* Non-nil means use lockfiles to avoid editing collisions.  */);
   create_lockfiles = 1;
 
-#ifdef CLASH_DETECTION
   defsubr (&Sunlock_buffer);
   defsubr (&Slock_buffer);
   defsubr (&Sfile_locked_p);
-#endif
 }
index 499e4b490a6f508221d01d15918655d2b5e4510a..79967116a1132fa547ec2fd6f42267f8299bd4ce 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -50,7 +50,7 @@ static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
 static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512;
 
 static bool internal_equal (Lisp_Object, Lisp_Object, int, bool, Lisp_Object);
-\f
+
 DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
        doc: /* Return the argument unchanged.  */)
   (Lisp_Object arg)
@@ -232,6 +232,7 @@ string STR1, compare the part between START1 (inclusive) and END1
 \(exclusive).  If START1 is nil, it defaults to 0, the beginning of
 the string; if END1 is nil, it defaults to the length of the string.
 Likewise, in string STR2, compare the part between START2 and END2.
+Like in `substring', negative values are counted from the end.
 
 The strings are compared by the numeric values of their characters.
 For instance, STR1 is "less than" STR2 if its first differing
@@ -244,75 +245,39 @@ If string STR1 is less, the value is a negative number N;
   - 1 - N is the number of characters that match at the beginning.
 If string STR1 is greater, the value is a positive number N;
   N - 1 is the number of characters that match at the beginning.  */)
-  (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case)
+  (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2,
+   Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case)
 {
-  register ptrdiff_t end1_char, end2_char;
-  register ptrdiff_t i1, i1_byte, i2, i2_byte;
+  ptrdiff_t from1, to1, from2, to2, i1, i1_byte, i2, i2_byte;
 
   CHECK_STRING (str1);
   CHECK_STRING (str2);
-  if (NILP (start1))
-    start1 = make_number (0);
-  if (NILP (start2))
-    start2 = make_number (0);
-  CHECK_NATNUM (start1);
-  CHECK_NATNUM (start2);
-  if (! NILP (end1))
-    CHECK_NATNUM (end1);
-  if (! NILP (end2))
-    CHECK_NATNUM (end2);
-
-  end1_char = SCHARS (str1);
-  if (! NILP (end1) && end1_char > XINT (end1))
-    end1_char = XINT (end1);
-  if (end1_char < XINT (start1))
-    args_out_of_range (str1, start1);
-
-  end2_char = SCHARS (str2);
-  if (! NILP (end2) && end2_char > XINT (end2))
-    end2_char = XINT (end2);
-  if (end2_char < XINT (start2))
-    args_out_of_range (str2, start2);
-
-  i1 = XINT (start1);
-  i2 = XINT (start2);
+
+  validate_subarray (str1, start1, end1, SCHARS (str1), &from1, &to1);
+  validate_subarray (str2, start2, end2, SCHARS (str2), &from2, &to2);
+
+  i1 = from1;
+  i2 = from2;
 
   i1_byte = string_char_to_byte (str1, i1);
   i2_byte = string_char_to_byte (str2, i2);
 
-  while (i1 < end1_char && i2 < end2_char)
+  while (i1 < to1 && i2 < to2)
     {
       /* When we find a mismatch, we must compare the
         characters, not just the bytes.  */
       int c1, c2;
 
-      if (STRING_MULTIBYTE (str1))
-       FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c1, str1, i1, i1_byte);
-      else
-       {
-         c1 = SREF (str1, i1++);
-         MAKE_CHAR_MULTIBYTE (c1);
-       }
-
-      if (STRING_MULTIBYTE (str2))
-       FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c2, str2, i2, i2_byte);
-      else
-       {
-         c2 = SREF (str2, i2++);
-         MAKE_CHAR_MULTIBYTE (c2);
-       }
+      FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c1, str1, i1, i1_byte);
+      FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c2, str2, i2, i2_byte);
 
       if (c1 == c2)
        continue;
 
       if (! NILP (ignore_case))
        {
-         Lisp_Object tem;
-
-         tem = Fupcase (make_number (c1));
-         c1 = XINT (tem);
-         tem = Fupcase (make_number (c2));
-         c2 = XINT (tem);
+         c1 = XINT (Fupcase (make_number (c1)));
+         c2 = XINT (Fupcase (make_number (c2)));
        }
 
       if (c1 == c2)
@@ -322,15 +287,15 @@ If string STR1 is greater, the value is a positive number N;
         past the character that we are comparing;
         hence we don't add or subtract 1 here.  */
       if (c1 < c2)
-       return make_number (- i1 + XINT (start1));
+       return make_number (- i1 + from1);
       else
-       return make_number (i1 - XINT (start1));
+       return make_number (i1 - from1);
     }
 
-  if (i1 < end1_char)
-    return make_number (i1 - XINT (start1) + 1);
-  if (i2 < end2_char)
-    return make_number (- i1 + XINT (start1) - 1);
+  if (i1 < to1)
+    return make_number (i1 - from1 + 1);
+  if (i2 < to2)
+    return make_number (- i1 + from1 - 1);
 
   return Qt;
 }
@@ -1127,7 +1092,48 @@ Elements of ALIST that are not conses are also shared.  */)
   return alist;
 }
 
-DEFUN ("substring", Fsubstring, Ssubstring, 2, 3, 0,
+/* Check that ARRAY can have a valid subarray [FROM..TO),
+   given that its size is SIZE.
+   If FROM is nil, use 0; if TO is nil, use SIZE.
+   Count negative values backwards from the end.
+   Set *IFROM and *ITO to the two indexes used.  */
+
+void
+validate_subarray (Lisp_Object array, Lisp_Object from, Lisp_Object to,
+                  ptrdiff_t size, ptrdiff_t *ifrom, ptrdiff_t *ito)
+{
+  EMACS_INT f, t;
+
+  if (INTEGERP (from))
+    {
+      f = XINT (from);
+      if (f < 0)
+       f += size;
+    }
+  else if (NILP (from))
+    f = 0;
+  else
+    wrong_type_argument (Qintegerp, from);
+
+  if (INTEGERP (to))
+    {
+      t = XINT (to);
+      if (t < 0)
+       t += size;
+    }
+  else if (NILP (to))
+    t = size;
+  else
+    wrong_type_argument (Qintegerp, to);
+
+  if (! (0 <= f && f <= t && t <= size))
+    args_out_of_range_3 (array, from, to);
+
+  *ifrom = f;
+  *ito = t;
+}
+
+DEFUN ("substring", Fsubstring, Ssubstring, 1, 3, 0,
        doc: /* Return a new string whose contents are a substring of STRING.
 The returned string consists of the characters between index FROM
 \(inclusive) and index TO (exclusive) of STRING.  FROM and TO are
@@ -1137,52 +1143,31 @@ to the end of STRING.
 
 The STRING argument may also be a vector.  In that case, the return
 value is a new vector that contains the elements between index FROM
-\(inclusive) and index TO (exclusive) of that vector argument.  */)
-  (Lisp_Object string, register Lisp_Object from, Lisp_Object to)
+\(inclusive) and index TO (exclusive) of that vector argument.
+
+With one argument, just copy STRING (with properties, if any).  */)
+  (Lisp_Object string, Lisp_Object from, Lisp_Object to)
 {
   Lisp_Object res;
-  ptrdiff_t size;
-  EMACS_INT from_char, to_char;
-
-  CHECK_VECTOR_OR_STRING (string);
-  CHECK_NUMBER (from);
-
-  if (STRINGP (string))
-    size = SCHARS (string);
-  else
-    size = ASIZE (string);
+  ptrdiff_t size, ifrom, ito;
 
-  if (NILP (to))
-    to_char = size;
-  else
-    {
-      CHECK_NUMBER (to);
-
-      to_char = XINT (to);
-      if (to_char < 0)
-       to_char += size;
-    }
-
-  from_char = XINT (from);
-  if (from_char < 0)
-    from_char += size;
-  if (!(0 <= from_char && from_char <= to_char && to_char <= size))
-    args_out_of_range_3 (string, make_number (from_char),
-                        make_number (to_char));
+  size = CHECK_VECTOR_OR_STRING (string);
+  validate_subarray (string, from, to, size, &ifrom, &ito);
 
   if (STRINGP (string))
     {
-      ptrdiff_t to_byte =
-       (NILP (to) ? SBYTES (string) : string_char_to_byte (string, to_char));
-      ptrdiff_t from_byte = string_char_to_byte (string, from_char);
+      ptrdiff_t from_byte
+       = !ifrom ? 0 : string_char_to_byte (string, ifrom);
+      ptrdiff_t to_byte
+       = ito == size ? SBYTES (string) : string_char_to_byte (string, ito);
       res = make_specified_string (SSDATA (string) + from_byte,
-                                  to_char - from_char, to_byte - from_byte,
+                                  ito - ifrom, to_byte - from_byte,
                                   STRING_MULTIBYTE (string));
-      copy_text_properties (make_number (from_char), make_number (to_char),
+      copy_text_properties (make_number (ifrom), make_number (ito),
                            string, make_number (0), res, Qnil);
     }
   else
-    res = Fvector (to_char - from_char, aref_addr (string, from_char));
+    res = Fvector (ito - ifrom, aref_addr (string, ifrom));
 
   return res;
 }
@@ -1198,41 +1183,16 @@ If FROM or TO is negative, it counts from the end.
 With one argument, just copy STRING without its properties.  */)
   (Lisp_Object string, register Lisp_Object from, Lisp_Object to)
 {
-  ptrdiff_t size;
-  EMACS_INT from_char, to_char;
-  ptrdiff_t from_byte, to_byte;
+  ptrdiff_t from_char, to_char, from_byte, to_byte, size;
 
   CHECK_STRING (string);
 
   size = SCHARS (string);
+  validate_subarray (string, from, to, size, &from_char, &to_char);
 
-  if (NILP (from))
-    from_char = 0;
-  else
-    {
-      CHECK_NUMBER (from);
-      from_char = XINT (from);
-      if (from_char < 0)
-       from_char += size;
-    }
-
-  if (NILP (to))
-    to_char = size;
-  else
-    {
-      CHECK_NUMBER (to);
-      to_char = XINT (to);
-      if (to_char < 0)
-       to_char += size;
-    }
-
-  if (!(0 <= from_char && from_char <= to_char && to_char <= size))
-    args_out_of_range_3 (string, make_number (from_char),
-                        make_number (to_char));
-
-  from_byte = NILP (from) ? 0 : string_char_to_byte (string, from_char);
+  from_byte = !from_char ? 0 : string_char_to_byte (string, from_char);
   to_byte =
-    NILP (to) ? SBYTES (string) : string_char_to_byte (string, to_char);
+    to_char == size ? SBYTES (string) : string_char_to_byte (string, to_char);
   return make_specified_string (SSDATA (string) + from_byte,
                                to_char - from_char, to_byte - from_byte,
                                STRING_MULTIBYTE (string));
@@ -1246,11 +1206,7 @@ substring_both (Lisp_Object string, ptrdiff_t from, ptrdiff_t from_byte,
                ptrdiff_t to, ptrdiff_t to_byte)
 {
   Lisp_Object res;
-  ptrdiff_t size;
-
-  CHECK_VECTOR_OR_STRING (string);
-
-  size = STRINGP (string) ? SCHARS (string) : ASIZE (string);
+  ptrdiff_t size = CHECK_VECTOR_OR_STRING (string);
 
   if (!(0 <= from && from <= to && to <= size))
     args_out_of_range_3 (string, make_number (from), make_number (to));
@@ -1693,40 +1649,121 @@ changing the value of a sequence `foo'.  */)
 }
 
 DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0,
-       doc: /* Reverse LIST by modifying cdr pointers.
-Return the reversed list.  Expects a properly nil-terminated list.  */)
-  (Lisp_Object list)
+       doc: /* Reverse order of items in a list, vector or string SEQ.
+If SEQ is a list, it should be nil-terminated.
+This function may destructively modify SEQ to produce the value.  */)
+  (Lisp_Object seq)
 {
-  register Lisp_Object prev, tail, next;
+  if (NILP (seq))
+    return seq;
+  else if (STRINGP (seq))
+    return Freverse (seq);
+  else if (CONSP (seq))
+    {
+      Lisp_Object prev, tail, next;
 
-  if (NILP (list)) return list;
-  prev = Qnil;
-  tail = list;
-  while (!NILP (tail))
+      for (prev = Qnil, tail = seq; !NILP (tail); tail = next)
+       {
+         QUIT;
+         CHECK_LIST_CONS (tail, tail);
+         next = XCDR (tail);
+         Fsetcdr (tail, prev);
+         prev = tail;
+       }
+      seq = prev;
+    }
+  else if (VECTORP (seq))
     {
-      QUIT;
-      CHECK_LIST_CONS (tail, tail);
-      next = XCDR (tail);
-      Fsetcdr (tail, prev);
-      prev = tail;
-      tail = next;
+      ptrdiff_t i, size = ASIZE (seq);
+
+      for (i = 0; i < size / 2; i++)
+       {
+         Lisp_Object tem = AREF (seq, i);
+         ASET (seq, i, AREF (seq, size - i - 1));
+         ASET (seq, size - i - 1, tem);
+       }
+    }
+  else if (BOOL_VECTOR_P (seq))
+    {
+      ptrdiff_t i, size = bool_vector_size (seq);
+
+      for (i = 0; i < size / 2; i++)
+       {
+         bool tem = bool_vector_bitref (seq, i);
+         bool_vector_set (seq, i, bool_vector_bitref (seq, size - i - 1));
+         bool_vector_set (seq, size - i - 1, tem);
+       }
     }
-  return prev;
+  else
+    wrong_type_argument (Qarrayp, seq);
+  return seq;
 }
 
 DEFUN ("reverse", Freverse, Sreverse, 1, 1, 0,
-       doc: /* Reverse LIST, copying.  Return the reversed list.
+       doc: /* Return the reversed copy of list, vector, or string SEQ.
 See also the function `nreverse', which is used more often.  */)
-  (Lisp_Object list)
+  (Lisp_Object seq)
 {
   Lisp_Object new;
 
-  for (new = Qnil; CONSP (list); list = XCDR (list))
+  if (NILP (seq))
+    return Qnil;
+  else if (CONSP (seq))
     {
-      QUIT;
-      new = Fcons (XCAR (list), new);
+      for (new = Qnil; CONSP (seq); seq = XCDR (seq))
+       {
+         QUIT;
+         new = Fcons (XCAR (seq), new);
+       }
+      CHECK_LIST_END (seq, seq);
+    }
+  else if (VECTORP (seq))
+    {
+      ptrdiff_t i, size = ASIZE (seq);
+      
+      new = make_uninit_vector (size);
+      for (i = 0; i < size; i++)
+       ASET (new, i, AREF (seq, size - i - 1));
+    }
+  else if (BOOL_VECTOR_P (seq))
+    {
+      ptrdiff_t i;
+      EMACS_INT nbits = bool_vector_size (seq);
+
+      new = make_uninit_bool_vector (nbits);
+      for (i = 0; i < nbits; i++)
+       bool_vector_set (new, i, bool_vector_bitref (seq, nbits - i - 1));
+    }
+  else if (STRINGP (seq))
+    {
+      ptrdiff_t size = SCHARS (seq), bytes = SBYTES (seq);
+      
+      if (size == bytes)
+       {
+         ptrdiff_t i;
+
+         new = make_uninit_string (size);
+         for (i = 0; i < size; i++)
+           SSET (new, i, SREF (seq, size - i - 1));
+       }
+      else
+       {
+         unsigned char *p, *q;
+
+         new = make_uninit_multibyte_string (size, bytes);
+         p = SDATA (seq), q = SDATA (new) + bytes;
+         while (q > SDATA (new))
+           {
+             int ch, len;
+             
+             ch = STRING_CHAR_AND_LENGTH (p, len);
+             p += len, q -= len;
+             CHAR_STRING (ch, q);
+           }
+       }
     }
-  CHECK_LIST_END (list, list);
+  else
+    wrong_type_argument (Qsequencep, seq);
   return new;
 }
 \f
@@ -4032,6 +4069,7 @@ sweep_weak_table (struct Lisp_Hash_Table *h, bool remove_entries_p)
    current garbage collection.  Remove weak tables that don't survive
    from Vweak_hash_tables.  Called from gc_sweep.  */
 
+NO_INLINE /* For better stack traces */
 void
 sweep_weak_hash_tables (void)
 {
@@ -4570,12 +4608,12 @@ returns nil, then (funcall TEST x1 x2) also returns nil.  */)
 /* ALGORITHM is a symbol: md5, sha1, sha224 and so on. */
 
 static Lisp_Object
-secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror, Lisp_Object binary)
+secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start,
+            Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror,
+            Lisp_Object binary)
 {
   int i;
-  ptrdiff_t size;
-  EMACS_INT start_char = 0, end_char = 0;
-  ptrdiff_t start_byte, end_byte;
+  ptrdiff_t size, start_char = 0, start_byte, end_char = 0, end_byte;
   register EMACS_INT b, e;
   register struct buffer *bp;
   EMACS_INT temp;
@@ -4612,36 +4650,12 @@ secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_
        object = code_convert_string (object, coding_system, Qnil, 1, 0, 1);
 
       size = SCHARS (object);
+      validate_subarray (object, start, end, size, &start_char, &end_char);
 
-      if (!NILP (start))
-       {
-         CHECK_NUMBER (start);
-
-         start_char = XINT (start);
-
-         if (start_char < 0)
-           start_char += size;
-       }
-
-      if (NILP (end))
-       end_char = size;
-      else
-       {
-         CHECK_NUMBER (end);
-
-         end_char = XINT (end);
-
-         if (end_char < 0)
-           end_char += size;
-       }
-
-      if (!(0 <= start_char && start_char <= end_char && end_char <= size))
-       args_out_of_range_3 (object, make_number (start_char),
-                            make_number (end_char));
-
-      start_byte = NILP (start) ? 0 : string_char_to_byte (object, start_char);
-      end_byte =
-       NILP (end) ? SBYTES (object) : string_char_to_byte (object, end_char);
+      start_byte = !start_char ? 0 : string_char_to_byte (object, start_char);
+      end_byte = (end_char == size
+                 ? SBYTES (object)
+                 : string_char_to_byte (object, end_char));
     }
   else
     {
index afa138003f25571788d2b6ccc006019a3aae4771..054a68bfd94bbc55be79d741c4d8c8437e32763a 100644 (file)
@@ -225,7 +225,35 @@ font_make_object (int size, Lisp_Object entity, int pixelsize)
   return font_object;
 }
 
-\f
+#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) || defined (HAVE_NS)
+
+static int font_unparse_fcname (Lisp_Object, int, char *, int);
+
+/* Like above, but also set `type', `name' and `fullname' properties
+   of font-object.  */
+
+Lisp_Object
+font_build_object (int vectorsize, Lisp_Object type,
+                  Lisp_Object entity, double pixelsize)
+{
+  int len;
+  char name[256];
+  Lisp_Object font_object = font_make_object (vectorsize, entity, pixelsize);
+
+  ASET (font_object, FONT_TYPE_INDEX, type);
+  len = font_unparse_xlfd (entity, pixelsize, name, sizeof name);
+  if (len > 0)
+    ASET (font_object, FONT_NAME_INDEX, make_string (name, len));
+  len = font_unparse_fcname (entity, pixelsize, name, sizeof name);
+  if (len > 0)
+    ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len));
+  else
+    ASET (font_object, FONT_FULLNAME_INDEX,
+         AREF (font_object, FONT_NAME_INDEX));
+  return font_object;
+}
+
+#endif /* HAVE_XFT || HAVE_FREETYPE || HAVE_NS */
 
 static int font_pixel_size (struct frame *f, Lisp_Object);
 static Lisp_Object font_open_entity (struct frame *, Lisp_Object, int);
@@ -282,10 +310,8 @@ font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol)
 
   if (SYMBOLP (tem))
     return tem;
-  if (len == nchars || len != nbytes)
-    tem = make_unibyte_string (str, len);
-  else
-    tem = make_multibyte_string (str, nchars, len);
+  tem = make_specified_string (str, nchars, len,
+                              len != nchars && len == nbytes);
   return Fintern (tem, obarray);
 }
 
@@ -665,10 +691,6 @@ static const struct
     { &QCotf, font_prop_validate_otf }
   };
 
-/* Size (number of elements) of the above table.  */
-#define FONT_PROPERTY_TABLE_SIZE \
-  ((sizeof font_property_table) / (sizeof *font_property_table))
-
 /* Return an index number of font property KEY or -1 if KEY is not an
    already known property.  */
 
@@ -677,7 +699,7 @@ get_font_prop_index (Lisp_Object key)
 {
   int i;
 
-  for (i = 0; i < FONT_PROPERTY_TABLE_SIZE; i++)
+  for (i = 0; i < ARRAYELTS (font_property_table); i++)
     if (EQ (key, *font_property_table[i].key))
       return i;
   return -1;
@@ -1579,11 +1601,14 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
   return 0;
 }
 
+#if defined HAVE_XFT || defined HAVE_FREETYPE || defined HAVE_NS
+
 /* Store fontconfig's font name of FONT (font-spec or font-entity) in
    NAME (NBYTES length), and return the name length.  If
-   FONT_SIZE_INDEX of FONT is 0, use PIXEL_SIZE instead.  */
+   FONT_SIZE_INDEX of FONT is 0, use PIXEL_SIZE instead.
+   Return a negative value on error.  */
 
-int
+static int
 font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
 {
   Lisp_Object family, foundry;
@@ -1704,6 +1729,8 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
   return (p - name);
 }
 
+#endif
+
 /* Parse NAME (null terminated) and store information in FONT
    (font-spec or font-entity).  If NAME is successfully parsed, return
    0.  Otherwise return -1.  */
@@ -2131,10 +2158,14 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop)
         lowest bit is set if the DPI is different.  */
       EMACS_INT diff;
       EMACS_INT pixel_size = XINT (spec_prop[FONT_SIZE_INDEX]);
+      EMACS_INT entity_size = XINT (AREF (entity, FONT_SIZE_INDEX));
 
       if (CONSP (Vface_font_rescale_alist))
        pixel_size *= font_rescale_ratio (entity);
-      diff = eabs (pixel_size - XINT (AREF (entity, FONT_SIZE_INDEX))) << 1;
+      if (pixel_size * 2 < entity_size || entity_size * 2 < pixel_size)
+       /* This size is wrong by more than a factor 2: reject it!  */
+       return 0xFFFFFFFF;
+      diff = eabs (pixel_size - entity_size) << 1;
       if (! NILP (spec_prop[FONT_DPI_INDEX])
          && ! EQ (spec_prop[FONT_DPI_INDEX], AREF (entity, FONT_DPI_INDEX)))
        diff |= 1;
@@ -2756,22 +2787,21 @@ font_list_entities (struct frame *f, Lisp_Object spec)
          val = XCDR (val);
        else
          {
-           Lisp_Object copy;
-
            val = driver_list->driver->list (f, scratch_font_spec);
-           if (NILP (val))
-             val = zero_vector;
-           else
-             val = Fvconcat (1, &val);
-           copy = copy_font_spec (scratch_font_spec);
-           ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
-           XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
+           if (!NILP (val))
+             {
+               Lisp_Object copy = copy_font_spec (scratch_font_spec);
+
+               val = Fvconcat (1, &val);
+               ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
+               XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
+             }
          }
-       if (ASIZE (val) > 0
+       if (VECTORP (val) && ASIZE (val) > 0
            && (need_filtering
                || ! NILP (Vface_ignored_fonts)))
          val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size);
-       if (ASIZE (val) > 0)
+       if (VECTORP (val) && ASIZE (val) > 0)
          list = Fcons (val, list);
       }
 
@@ -2807,18 +2837,22 @@ font_matching_entity (struct frame *f, Lisp_Object *attrs, Lisp_Object spec)
        && (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
       {
        Lisp_Object cache = font_get_cache (f, driver_list->driver);
-       Lisp_Object copy;
 
        ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
        entity = assoc_no_quit (work, XCDR (cache));
        if (CONSP (entity))
-         entity = XCDR (entity);
+         entity = AREF (XCDR (entity), 0);
        else
          {
            entity = driver_list->driver->match (f, work);
-           copy = copy_font_spec (work);
-           ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
-           XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
+           if (!NILP (entity))
+             {
+               Lisp_Object copy = copy_font_spec (work);
+               Lisp_Object match = Fvector (1, &entity);
+
+               ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
+               XSETCDR (cache, Fcons (Fcons (copy, match), XCDR (cache)));
+             }
          }
        if (! NILP (entity))
          break;
@@ -3341,7 +3375,6 @@ font_done_for_face (struct frame *f, struct face *face)
 {
   if (face->font->driver->done_face)
     face->font->driver->done_face (f, face);
-  face->extra = NULL;
 }
 
 
@@ -3543,53 +3576,40 @@ font_update_drivers (struct frame *f, Lisp_Object new_drivers)
   return active_drivers;
 }
 
-int
-font_put_frame_data (struct frame *f, struct font_driver *driver, void *data)
+#if defined (HAVE_XFT) || defined (HAVE_FREETYPE)
+
+static void
+fset_font_data (struct frame *f, Lisp_Object val)
 {
-  struct font_data_list *list, *prev;
+  f->font_data = val;
+}
 
-  for (prev = NULL, list = f->font_data_list; list;
-       prev = list, list = list->next)
-    if (list->driver == driver)
-      break;
-  if (! data)
-    {
-      if (list)
-       {
-         if (prev)
-           prev->next = list->next;
-         else
-           f->font_data_list = list->next;
-         xfree (list);
-       }
-      return 0;
-    }
+void
+font_put_frame_data (struct frame *f, Lisp_Object driver, void *data)
+{
+  Lisp_Object val = assq_no_quit (driver, f->font_data);
 
-  if (! list)
+  if (!data)
+    fset_font_data (f, Fdelq (val, f->font_data));
+  else
     {
-      list = xmalloc (sizeof *list);
-      list->driver = driver;
-      list->next = f->font_data_list;
-      f->font_data_list = list;
+      if (NILP (val))
+       fset_font_data (f, Fcons (Fcons (driver, make_save_ptr (data)),
+                                 f->font_data));
+      else
+       XSETCDR (val, make_save_ptr (data));
     }
-  list->data = data;
-  return 0;
 }
 
-
 void *
-font_get_frame_data (struct frame *f, struct font_driver *driver)
+font_get_frame_data (struct frame *f, Lisp_Object driver)
 {
-  struct font_data_list *list;
-
-  for (list = f->font_data_list; list; list = list->next)
-    if (list->driver == driver)
-      break;
-  if (! list)
-    return NULL;
-  return list->data;
+  Lisp_Object val = assq_no_quit (driver, f->font_data);
+
+  return NILP (val) ? NULL : XSAVE_POINTER (XCDR (val), 0);
 }
 
+#endif /* HAVE_XFT || HAVE_FREETYPE */
 
 /* Sets attributes on a font.  Any properties that appear in ALIST and
    BOOLEAN_PROPERTIES or NON_BOOLEAN_PROPERTIES are set on the font.
@@ -4935,8 +4955,7 @@ If the named font is not yet loaded, return nil.  */)
 #endif
 
 \f
-#define BUILD_STYLE_TABLE(TBL) \
-  build_style_table ((TBL), sizeof TBL / sizeof (struct table_entry))
+#define BUILD_STYLE_TABLE(TBL) build_style_table (TBL, ARRAYELTS (TBL))
 
 static Lisp_Object
 build_style_table (const struct table_entry *entry, int nelement)
index e2e36460583b678d25da9e2be675200e7f85385f..cffc035cd4915d830328e09bff57296213523fa4 100644 (file)
@@ -162,9 +162,6 @@ enum font_property_index
     /* List of font-objects opened from the font-entity.  */
     FONT_OBJLIST_INDEX = FONT_SPEC_MAX,
 
-    /* Font-entity from which the font-object is opened.  */
-    FONT_ENTITY_INDEX = FONT_SPEC_MAX,
-
     /* This value is the length of font-entity vector.  */
     FONT_ENTITY_MAX,
 
@@ -182,9 +179,6 @@ enum font_property_index
        is not available.  */
     FONT_FILE_INDEX,
 
-    /* Format of the font (symbol) or nil if unknown.  */
-    FONT_FORMAT_INDEX,
-
     /* This value is the length of font-object vector.  */
     FONT_OBJECT_MAX
   };
@@ -442,15 +436,6 @@ struct font_bitmap
 #define FONT_OBJECT_P(x)       \
   (FONTP (x) && (ASIZE (x) & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)
 
-/* True iff ENTITY can't be loaded.  */
-#define FONT_ENTITY_NOT_LOADABLE(entity)       \
-  EQ (AREF (entity, FONT_OBJLIST_INDEX), Qt)
-
-/* Flag ENTITY not loadable.  */
-#define FONT_ENTITY_SET_NOT_LOADABLE(entity)   \
-  ASET (entity, FONT_OBJLIST_INDEX, Qt)
-
-
 /* Check macros for various font-related objects.  */
 
 #define CHECK_FONT(x)  \
@@ -564,11 +549,9 @@ struct font_driver
   /* Close FONT.  NOTE: this can be called by GC.  */
   void (*close) (struct font *font);
 
-  /* Optional (if FACE->extra is not used).
-     Prepare FACE for displaying characters by FONT on frame F by
-     storing some data in FACE->extra.  If successful, return 0.
-     Otherwise, return -1.  */
-  int (*prepare_face) (struct frame *f, struct face *face);
+  /* Prepare FACE for displaying characters by FONT on frame F by
+     storing some data in FACE->extra.  */
+  void (*prepare_face) (struct frame *f, struct face *face);
 
   /* Optional.
      Done FACE for displaying characters by FACE->font on frame F.  */
@@ -615,15 +598,6 @@ struct font_driver
 
 #endif /* HAVE_WINDOW_SYSTEM */
 
-  /* Optional.
-     Return an outline data for glyph-code CODE of FONT.  The format
-     of the outline data depends on the font-driver.  */
-  void *(*get_outline) (struct font *font, unsigned code);
-
-  /* Optional.
-     Free OUTLINE (that is obtained by the above method).  */
-  void (*free_outline) (struct font *font, void *outline);
-
   /* Optional.
      Get coordinates of the INDEXth anchor point of the glyph whose
      code is CODE.  Store the coordinates in *X and *Y.  Return 0 if
@@ -725,25 +699,14 @@ struct font_driver_list
   struct font_driver_list *next;
 };
 
-
-/* Chain of arbitrary data specific to each font driver.
-   Each frame has its own font data list at F->font_data_list.  */
-
-struct font_data_list
-{
-  /* Pointer to the font driver.  */
-  struct font_driver *driver;
-  /* Data specific to the font driver.  */
-  void *data;
-  /* Pointer to the next element of the chain.  */
-  struct font_data_list *next;
-};
-
 extern Lisp_Object copy_font_spec (Lisp_Object);
 extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object);
 
 extern Lisp_Object font_make_entity (void);
 extern Lisp_Object font_make_object (int, Lisp_Object, int);
+#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) || defined (HAVE_NS)
+extern Lisp_Object font_build_object (int, Lisp_Object, Lisp_Object, double);
+#endif
 
 extern Lisp_Object find_font_encoding (Lisp_Object);
 extern int font_registry_charsets (Lisp_Object, struct charset **,
@@ -789,8 +752,6 @@ extern void font_parse_family_registry (Lisp_Object family,
 extern int font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font);
 extern ptrdiff_t font_unparse_xlfd (Lisp_Object font, int pixel_size,
                                    char *name, int bytes);
-extern int font_unparse_fcname (Lisp_Object font, int pixel_size,
-                                char *name, int bytes);
 extern void register_font_driver (struct font_driver *driver, struct frame *f);
 extern void free_font_driver_list (struct frame *f);
 #ifdef ENABLE_CHECKING
@@ -811,11 +772,10 @@ extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object);
 extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop,
                                    Lisp_Object val);
 
-extern int font_put_frame_data (struct frame *f,
-                                struct font_driver *driver,
-                                void *data);
-extern void *font_get_frame_data (struct frame *f,
-                                  struct font_driver *driver);
+#if defined (HAVE_XFT) || defined (HAVE_FREETYPE)
+extern void font_put_frame_data (struct frame *, Lisp_Object, void *);
+extern void *font_get_frame_data (struct frame *f, Lisp_Object);
+#endif /* HAVE_XFT || HAVE_FREETYPE */
 
 extern void font_filter_properties (Lisp_Object font,
                                    Lisp_Object alist,
@@ -834,7 +794,8 @@ extern void syms_of_ftxfont (void);
 extern Lisp_Object Qxft;
 extern struct font_driver xftfont_driver;
 extern void syms_of_xftfont (void);
-#elif defined HAVE_FREETYPE
+#endif
+#if defined HAVE_FREETYPE || defined HAVE_XFT
 extern struct font_driver ftxfont_driver;
 #endif
 #ifdef HAVE_BDFFONT
index 13f5357be6463e19a53b3af8af985aeef024232d..e34719e5cdf7f627c39b0d25c688196b196d1742 100644 (file)
@@ -209,27 +209,27 @@ set_fontset_name (Lisp_Object fontset, Lisp_Object name)
   set_char_table_extras (fontset, 1, name);
 }
 
-#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4]
+#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[2]
 static void
 set_fontset_ascii (Lisp_Object fontset, Lisp_Object ascii)
 {
-  set_char_table_extras (fontset, 4, ascii);
+  set_char_table_extras (fontset, 2, ascii);
 }
 
 /* Access special values of (realized) FONTSET.  */
 
-#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2]
+#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[3]
 static void
 set_fontset_base (Lisp_Object fontset, Lisp_Object base)
 {
-  set_char_table_extras (fontset, 2, base);
+  set_char_table_extras (fontset, 3, base);
 }
 
-#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3]
+#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[4]
 static void
 set_fontset_frame (Lisp_Object fontset, Lisp_Object frame)
 {
-  set_char_table_extras (fontset, 3, frame);
+  set_char_table_extras (fontset, 4, frame);
 }
 
 #define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5]
@@ -239,20 +239,20 @@ set_fontset_nofont_face (Lisp_Object fontset, Lisp_Object face)
   set_char_table_extras (fontset, 5, face);
 }
 
-#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7]
+#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[6]
 static void
 set_fontset_default (Lisp_Object fontset, Lisp_Object def)
 {
-  set_char_table_extras (fontset, 7, def);
+  set_char_table_extras (fontset, 6, def);
 }
 
 /* For both base and realized fontset.  */
 
-#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8]
+#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[7]
 static void
 set_fontset_fallback (Lisp_Object fontset, Lisp_Object fallback)
 {
-  set_char_table_extras (fontset, 8, fallback);
+  set_char_table_extras (fontset, 7, fallback);
 }
 
 #define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset)))
@@ -852,21 +852,6 @@ fontset_ascii (int id)
   return elt;
 }
 
-static void
-free_realized_fontset (struct frame *f, Lisp_Object fontset)
-{
-#if 0
-  Lisp_Object tail;
-
-  if (0)
-    for (tail = FONTSET_OBJLIST (fontset); CONSP (tail); tail = XCDR (tail))
-      {
-       eassert (FONT_OBJECT_P (XCAR (tail)));
-       font_close_object (f, XCAR (tail));
-      }
-#endif
-}
-
 /* Free fontset of FACE defined on frame F.  Called from
    free_realized_face.  */
 
@@ -880,7 +865,6 @@ free_face_fontset (struct frame *f, struct face *face)
     return;
   eassert (! BASE_FONTSET_P (fontset));
   eassert (f == XFRAME (FONTSET_FRAME (fontset)));
-  free_realized_fontset (f, fontset);
   ASET (Vfontset_table, face->fontset, Qnil);
   if (face->fontset < next_fontset_id)
     next_fontset_id = face->fontset;
@@ -891,7 +875,6 @@ free_face_fontset (struct frame *f, struct face *face)
       fontset = AREF (Vfontset_table, id);
       eassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset));
       eassert (f == XFRAME (FONTSET_FRAME (fontset)));
-      free_realized_fontset (f, fontset);
       ASET (Vfontset_table, id, Qnil);
       if (id < next_fontset_id)
        next_fontset_id = face->fontset;
@@ -2159,7 +2142,7 @@ void
 syms_of_fontset (void)
 {
   DEFSYM (Qfontset, "fontset");
-  Fput (Qfontset, Qchar_table_extra_slots, make_number (9));
+  Fput (Qfontset, Qchar_table_extra_slots, make_number (8));
   DEFSYM (Qfontset_info, "fontset-info");
   Fput (Qfontset_info, Qchar_table_extra_slots, make_number (1));
 
index 0c13016435214ba34b96cbcead2b442814daa147..5dea57aece83a677dfbcdaf0d47ee5f097141682 100644 (file)
@@ -51,6 +51,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "msdos.h"
 #include "dosfns.h"
 #endif
+#ifdef USE_X_TOOLKIT
+#include "widget.h"
+#endif
 
 #ifdef HAVE_NS
 Lisp_Object Qns_parse_geometry;
@@ -75,7 +78,6 @@ Lisp_Object Qauto_raise, Qauto_lower;
 Lisp_Object Qborder_color, Qborder_width;
 Lisp_Object Qcursor_color, Qcursor_type;
 Lisp_Object Qheight, Qwidth;
-Lisp_Object Qleft, Qright;
 Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
 Lisp_Object Qtooltip;
 Lisp_Object Qinternal_border_width;
@@ -83,6 +85,7 @@ Lisp_Object Qright_divider_width, Qbottom_divider_width;
 Lisp_Object Qmouse_color;
 Lisp_Object Qminibuffer;
 Lisp_Object Qscroll_bar_width, Qvertical_scroll_bars;
+Lisp_Object Qscroll_bar_height, Qhorizontal_scroll_bars;
 Lisp_Object Qvisibility;
 Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
 Lisp_Object Qscreen_gamma;
@@ -114,7 +117,7 @@ Lisp_Object Qface_set_after_frame_default;
 static Lisp_Object Qfocus_in_hook;
 static Lisp_Object Qfocus_out_hook;
 static Lisp_Object Qdelete_frame_functions;
-
+static Lisp_Object Qframe_windows_min_size;
 static Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
 
 /* The currently selected frame.  */
@@ -163,19 +166,16 @@ decode_any_frame (register Lisp_Object frame)
   return XFRAME (frame);
 }
 
+#ifdef HAVE_WINDOW_SYSTEM
+
 bool
 window_system_available (struct frame *f)
 {
-  if (f)
-    return FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f);
-  else
-#ifdef HAVE_WINDOW_SYSTEM
-    return x_display_list != NULL;
-#else
-    return 0;
-#endif
+  return f ? FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f) : x_display_list != NULL;
 }
 
+#endif /* HAVE_WINDOW_SYSTEM */
+
 struct frame *
 decode_window_system_frame (Lisp_Object frame)
 {
@@ -194,6 +194,45 @@ check_window_system (struct frame *f)
           : "Window system is not in use or not initialized");
 }
 
+/* Return the value of frame parameter PROP in frame FRAME.  */
+
+Lisp_Object
+get_frame_param (register struct frame *frame, Lisp_Object prop)
+{
+  register Lisp_Object tem;
+
+  tem = Fassq (prop, frame->param_alist);
+  if (EQ (tem, Qnil))
+    return tem;
+  return Fcdr (tem);
+}
+
+/* Return 1 if `frame-inhibit-implied-resize' is non-nil or fullscreen
+   state of frame F would be affected by a vertical (horizontal if
+   HORIZONTAL is true) resize.  */
+bool
+frame_inhibit_resize (struct frame *f, bool horizontal)
+{
+
+  return (frame_inhibit_implied_resize
+         || !NILP (get_frame_param (f, Qfullscreen)));
+}
+
+#if 0
+bool
+frame_inhibit_resize (struct frame *f, bool horizontal)
+{
+  Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
+
+  return (frame_inhibit_implied_resize
+         || EQ (fullscreen, Qfullboth)
+         || EQ (fullscreen, Qfullscreen)
+         || EQ (fullscreen, Qmaximized)
+         || (horizontal && EQ (fullscreen, Qfullwidth))
+         || (!horizontal && EQ (fullscreen, Qfullheight)));
+}
+#endif
+
 static void
 set_menu_bar_lines_1 (Lisp_Object window, int n)
 {
@@ -325,6 +364,247 @@ predicates which report frame's specific UI-related capabilities.  */)
     return type;
 }
 
+static int
+frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object pixelwise)
+{
+  return XINT (call3 (Qframe_windows_min_size, frame, horizontal, pixelwise));
+}
+
+
+/* Make sure windows sizes of frame F are OK.  new_width and new_height
+   are in pixels.  A value of -1 means no change is requested for that
+   size (but the frame may still have to be resized to accomodate
+   windows with their minimum sizes.
+
+   The argument INHIBIT can assume the following values:
+
+   0 means to unconditionally call x_set_window_size even if sizes
+   apparently do not change.  Fx_create_frame uses this to pass the
+   initial size to the window manager.
+
+   1 means to call x_set_window_size iff the pixel size really changes.
+   Fset_frame_size, Fset_frame_height, ... use this.
+
+   2 means to unconditionally call x_set_window_size provided
+   frame_inhibit_resize allows it.  The menu bar code uses this.
+
+   3 means call x_set_window_size iff window minimum sizes must be
+   preserved or frame_inhibit_resize allows it, x_set_left_fringe,
+   x_set_scroll_bar_width, ... use this.
+
+   4 means call x_set_window_size iff window minimum sizes must be
+   preserved.  x_set_tool_bar_lines, x_set_right_divider_width, ... use
+   this.  BUT maybe the toolbar code shouldn't ....
+
+   5 means to never call x_set_window_size.  change_frame_size uses
+   this.
+
+   For 2 and 3 note that if frame_inhibit_resize inhibits resizing and
+   minimum sizes are not violated no internal resizing takes place
+   either.  For 2, 3, 4 and 5 note that even if no x_set_window_size
+   call is issued, window sizes may have to be adjusted in order to
+   support minimum size constraints for the frame's windows.
+
+   PRETEND is as for change_frame_size.  */
+void
+adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, bool pretend)
+{
+  int unit_width = FRAME_COLUMN_WIDTH (f);
+  int unit_height = FRAME_LINE_HEIGHT (f);
+  int old_pixel_width = FRAME_PIXEL_WIDTH (f);
+  int old_pixel_height = FRAME_PIXEL_HEIGHT (f);
+  int new_pixel_width, new_pixel_height;
+  /* The following two values are calculated from the old frame pixel
+     sizes and any "new" settings for tool bar, menu bar and internal
+     borders.  We do it this way to detect whether we have to call
+     x_set_window_size as consequence of the new settings.  */
+  int windows_width = FRAME_WINDOWS_WIDTH (f);
+  int windows_height = FRAME_WINDOWS_HEIGHT (f);
+  int min_windows_width, min_windows_height;
+  /* These are a bit tedious, maybe we should use a macro.  */
+  struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f));
+  int old_windows_width = WINDOW_PIXEL_WIDTH (r);
+  int old_windows_height
+    = (WINDOW_PIXEL_HEIGHT (r)
+       + (FRAME_HAS_MINIBUF_P (f)
+         ? WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_MINIBUF_WINDOW (f)))
+         : 0));
+  int new_windows_width, new_windows_height;
+  int old_text_width = FRAME_TEXT_WIDTH (f);
+  int old_text_height = FRAME_TEXT_HEIGHT (f);
+  /* If a size is < 0 use the old value.  */
+  int new_text_width = (new_width >= 0) ? new_width : old_text_width;
+  int new_text_height = (new_height >= 0) ? new_height : old_text_height;
+  int new_cols, new_lines;
+  bool inhibit_horizontal, inhibit_vertical;
+  Lisp_Object frame;
+
+  XSETFRAME (frame, f);
+  /* The following two values are calculated from the old window body
+     sizes and any "new" settings for scroll bars, dividers, fringes and
+     margins (though the latter should have been processed already).  */
+  min_windows_width = frame_windows_min_size (frame, Qt, Qt);
+  min_windows_height = frame_windows_min_size (frame, Qnil, Qt);
+
+  if (inhibit >= 2 && inhibit <= 4)
+    /* If INHIBIT is in [2..4] inhibit if the "old" window sizes stay
+       within the limits and either frame_inhibit_resize tells us to do
+       so or INHIBIT equals 4.  */
+    {
+      inhibit_horizontal = ((windows_width >= min_windows_width
+                            && (inhibit == 4 || frame_inhibit_resize (f, true)))
+                           ? true : false);
+      inhibit_vertical = ((windows_height >= min_windows_height
+                          && (inhibit == 4 || frame_inhibit_resize (f, false)))
+                         ? true : false);
+    }
+  else
+    /* Otherwise inhibit if INHIBIT equals 5.  */
+    inhibit_horizontal = inhibit_vertical = inhibit == 5;
+
+  new_pixel_width = ((inhibit_horizontal && (inhibit < 5))
+                    ? old_pixel_width
+                    : max (FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width),
+                           min_windows_width
+                           + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)));
+  new_windows_width = new_pixel_width - 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
+  new_text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, new_pixel_width);
+  new_cols = new_text_width / unit_width;
+
+  new_pixel_height = ((inhibit_vertical && (inhibit < 5))
+                     ? old_pixel_height
+                     : max (FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height),
+                            min_windows_height
+                            + FRAME_TOP_MARGIN_HEIGHT (f)
+                            + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)));
+  new_windows_height = (new_pixel_height
+                       - FRAME_TOP_MARGIN_HEIGHT (f)
+                       - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
+  new_text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, new_pixel_height);
+  new_lines = new_text_height / unit_height;
+
+#ifdef HAVE_WINDOW_SYSTEM
+  if (FRAME_WINDOW_P (f)
+      && f->official
+      && ((!inhibit_horizontal
+          && (new_pixel_width != old_pixel_width
+              || inhibit == 0 || inhibit == 2))
+         || (!inhibit_vertical
+             && (new_pixel_height != old_pixel_height
+                 || inhibit == 0 || inhibit == 2))))
+    /* We are either allowed to change the frame size or the minimum
+       sizes request such a change.  Do not care for fixing minimum
+       sizes here, we do that eventually when we're called from
+       change_frame_size.  */
+    {
+      /* Make sure we respect fullheight and fullwidth.  */
+      if (inhibit_horizontal)
+       new_text_width = old_text_width;
+      else if (inhibit_vertical)
+       new_text_height = old_text_height;
+
+      x_set_window_size (f, 0, new_text_width, new_text_height, 1);
+      f->resized_p = true;
+
+      return;
+    }
+#endif
+
+  if (new_text_width == old_text_width
+      && new_text_height == old_text_height
+      && new_windows_width == old_windows_width
+      && new_windows_height == old_windows_height
+      && new_pixel_width == old_pixel_width
+      && new_pixel_height == old_pixel_height)
+    /* No change.  Sanitize window sizes and return.  */
+    {
+      sanitize_window_sizes (frame, Qt);
+      sanitize_window_sizes (frame, Qnil);
+
+      return;
+    }
+
+  block_input ();
+
+#ifdef MSDOS
+  /* We only can set screen dimensions to certain values supported
+     by our video hardware.  Try to find the smallest size greater
+     or equal to the requested dimensions.  */
+  dos_set_window_size (&new_lines, &new_cols);
+#endif
+
+  if (new_windows_width != old_windows_width)
+    {
+      resize_frame_windows (f, new_windows_width, 1, 1);
+
+      /* MSDOS frames cannot PRETEND, as they change frame size by
+        manipulating video hardware.  */
+      if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
+       FrameCols (FRAME_TTY (f)) = new_cols;
+
+#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
+      if (WINDOWP (f->tool_bar_window))
+       {
+         XWINDOW (f->tool_bar_window)->pixel_width = new_windows_width;
+         XWINDOW (f->tool_bar_window)->total_cols
+           = new_windows_width / unit_width;
+       }
+#endif
+    }
+
+  if (new_windows_height != old_windows_height
+      /* When the top margin has changed we have to recalculate the top
+        edges of all windows.  No such calculation is necessary for the
+        left edges.  */
+      || WINDOW_TOP_PIXEL_EDGE (r) != FRAME_TOP_MARGIN_HEIGHT (f))
+    {
+      resize_frame_windows (f, new_windows_height, 0, 1);
+
+      /* MSDOS frames cannot PRETEND, as they change frame size by
+        manipulating video hardware.  */
+      if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
+       FrameRows (FRAME_TTY (f)) = new_lines;
+    }
+
+  /* Assign new sizes.  */
+  FRAME_TEXT_WIDTH (f) = new_text_width;
+  FRAME_TEXT_HEIGHT (f) = new_text_height;
+  FRAME_PIXEL_WIDTH (f) = new_pixel_width;
+  FRAME_PIXEL_HEIGHT (f) = new_pixel_height;
+  SET_FRAME_COLS (f, new_cols);
+  SET_FRAME_LINES (f, new_lines);
+
+  {
+    struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+    int text_area_x, text_area_y, text_area_width, text_area_height;
+
+    window_box (w, TEXT_AREA, &text_area_x, &text_area_y, &text_area_width,
+               &text_area_height);
+    if (w->cursor.x >= text_area_x + text_area_width)
+      w->cursor.hpos = w->cursor.x = 0;
+    if (w->cursor.y >= text_area_y + text_area_height)
+      w->cursor.vpos = w->cursor.y = 0;
+  }
+
+  /* Sanitize window sizes.  */
+  sanitize_window_sizes (frame, Qt);
+  sanitize_window_sizes (frame, Qnil);
+
+  adjust_frame_glyphs (f);
+  calculate_costs (f);
+  SET_FRAME_GARBAGED (f);
+
+  /* A frame was "resized" if one of its pixelsizes changed, even if its
+     X window wasn't resized at all.  */
+  f->resized_p = (new_pixel_width != old_pixel_width
+                 || new_pixel_height != old_pixel_height);
+
+  unblock_input ();
+
+  run_window_configuration_change_hook (f);
+}
+
+
 struct frame *
 make_frame (bool mini_p)
 {
@@ -337,9 +617,11 @@ make_frame (bool mini_p)
   f = allocate_frame ();
   XSETFRAME (frame, f);
 
+#ifdef USE_GTK
   /* Initialize Lisp data.  Note that allocate_frame initializes all
      Lisp data to nil, so do it only for slots which should not be nil.  */
   fset_tool_bar_position (f, Qtop);
+#endif
 
   /* Initialize non-Lisp data.  Note that allocate_frame zeroes out all
      non-Lisp data, so do it only for slots which should not be zero.
@@ -348,11 +630,16 @@ make_frame (bool mini_p)
   f->wants_modeline = true;
   f->redisplay = true;
   f->garbaged = true;
-  f->vertical_scroll_bar_type = vertical_scroll_bar_none;
+  f->official = false;
   f->column_width = 1;  /* !FRAME_WINDOW_P value.  */
   f->line_height = 1;  /* !FRAME_WINDOW_P value.  */
 #ifdef HAVE_WINDOW_SYSTEM
+  f->vertical_scroll_bar_type = vertical_scroll_bar_none;
+  f->horizontal_scroll_bars = false;
   f->want_fullscreen = FULLSCREEN_NONE;
+#if ! defined (USE_GTK) && ! defined (HAVE_NS)
+  f->last_tool_bar_item = -1;
+#endif
 #endif
 
   root_window = make_window ();
@@ -378,10 +665,10 @@ make_frame (bool mini_p)
 
   /* 10 is arbitrary,
      just so that there is "something there."
-     Correct size will be set up later with change_frame_size.  */
+     Correct size will be set up later with adjust_frame_size.  */
 
   SET_FRAME_COLS (f, 10);
-  FRAME_LINES (f) = 10;
+  SET_FRAME_LINES (f, 10);
   SET_FRAME_WIDTH (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f));
   SET_FRAME_HEIGHT (f, FRAME_LINES (f) * FRAME_LINE_HEIGHT (f));
 
@@ -419,11 +706,15 @@ make_frame (bool mini_p)
   }
 
   if (mini_p)
-    set_window_buffer (mini_window,
-                      (NILP (Vminibuffer_list)
-                       ? get_minibuffer (0)
-                       : Fcar (Vminibuffer_list)),
-                      0, 0);
+    {
+      set_window_buffer (mini_window,
+                        (NILP (Vminibuffer_list)
+                         ? get_minibuffer (0)
+                         : Fcar (Vminibuffer_list)),
+                        0, 0);
+      /* No horizontal scroll bars in minibuffers.  */
+      wset_horizontal_scroll_bar (mw, Qnil);
+    }
 
   fset_root_window (f, root_window);
   fset_selected_window (f, root_window);
@@ -567,7 +858,10 @@ make_initial_frame (void)
   FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
   FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
 
-  FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
+#ifdef HAVE_WINDOW_SYSTEM
+  f->vertical_scroll_bar_type = vertical_scroll_bar_none;
+  FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
+#endif
 
   /* The default value of menu-bar-mode is t.  */
   set_menu_bar_lines (f, make_number (1), Qnil);
@@ -617,7 +911,11 @@ make_terminal_frame (struct terminal *terminal)
   FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
 #endif /* not MSDOS */
 
-  FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
+#ifdef HAVE_WINDOW_SYSTEM
+  f->vertical_scroll_bar_type = vertical_scroll_bar_none;
+  FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
+#endif
+
   FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1;
   FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
 
@@ -739,7 +1037,7 @@ affects all frames on the same terminal device.  */)
   {
     int width, height;
     get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height);
-    change_frame_size (f, width, height, 0, 0, 0, 0);
+    adjust_frame_size (f, width, height, 5, 0);
   }
 
   adjust_frame_glyphs (f);
@@ -1365,7 +1663,9 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
   fset_buried_buffer_list (f, Qnil);
 
   free_font_driver_list (f);
+#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
   xfree (f->namebuf);
+#endif
   xfree (f->decode_mode_spec_buffer);
   xfree (FRAME_INSERT_COST (f));
   xfree (FRAME_DELETEN_COST (f));
@@ -1603,6 +1903,42 @@ and nil for X and Y.  */)
   return Fcons (lispy_dummy, Fcons (x, y));
 }
 
+#ifdef HAVE_WINDOW_SYSTEM
+
+/* On frame F, convert character coordinates X and Y to pixel
+   coordinates *PIX_X and *PIX_Y.  */
+
+static void
+frame_char_to_pixel_position (struct frame *f, int x, int y,
+                             int *pix_x, int *pix_y)
+{
+  *pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2;
+  *pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2;
+
+  if (*pix_x < 0)
+    *pix_x = 0;
+  if (*pix_x > FRAME_PIXEL_WIDTH (f))
+    *pix_x = FRAME_PIXEL_WIDTH (f);
+
+  if (*pix_y < 0)
+    *pix_y = 0;
+  if (*pix_y > FRAME_PIXEL_HEIGHT (f))
+    *pix_y = FRAME_PIXEL_HEIGHT (f);
+}
+
+/* On frame F, reposition mouse pointer to character coordinates X and Y.  */
+
+static void
+frame_set_mouse_position (struct frame *f, int x, int y)
+{
+  int pix_x, pix_y;
+
+  frame_char_to_pixel_position (f, x, y, &pix_x, &pix_y);
+  frame_set_mouse_pixel_position (f, pix_x, pix_y);
+}
+
+#endif /* HAVE_WINDOW_SYSTEM */
+
 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
        doc: /* Move the mouse pointer to the center of character cell (X,Y) in FRAME.
 Coordinates are relative to the frame, not a window,
@@ -1627,7 +1963,7 @@ before calling this function on it, like this.
 #ifdef HAVE_WINDOW_SYSTEM
   if (FRAME_WINDOW_P (XFRAME (frame)))
     /* Warping the mouse will cause enternotify and focus events.  */
-    x_set_mouse_position (XFRAME (frame), XINT (x), XINT (y));
+    frame_set_mouse_position (XFRAME (frame), XINT (x), XINT (y));
 #else
 #if defined (MSDOS)
   if (FRAME_MSDOS_P (XFRAME (frame)))
@@ -1668,7 +2004,7 @@ before calling this function on it, like this.
 #ifdef HAVE_WINDOW_SYSTEM
   if (FRAME_WINDOW_P (XFRAME (frame)))
     /* Warping the mouse will cause enternotify and focus events.  */
-    x_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y));
+    frame_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y));
 #else
 #if defined (MSDOS)
   if (FRAME_MSDOS_P (XFRAME (frame)))
@@ -1936,24 +2272,6 @@ If there is no window system support, this function does nothing.  */)
 }
 
 \f
-/* Return the value of frame parameter PROP in frame FRAME.  */
-
-#ifdef HAVE_WINDOW_SYSTEM
-#if !HAVE_NS && !HAVE_NTGUI
-static
-#endif
-Lisp_Object
-get_frame_param (register struct frame *frame, Lisp_Object prop)
-{
-  register Lisp_Object tem;
-
-  tem = Fassq (prop, frame->param_alist);
-  if (EQ (tem, Qnil))
-    return tem;
-  return Fcdr (tem);
-}
-#endif
-
 /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame.  */
 
 void
@@ -2037,20 +2355,6 @@ set_term_frame_name (struct frame *f, Lisp_Object name)
   update_mode_lines = 16;
 }
 
-#ifdef HAVE_NTGUI
-void
-set_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
-{
-  register Lisp_Object old_alist_elt;
-
-  old_alist_elt = Fassq (prop, f->param_alist);
-  if (EQ (old_alist_elt, Qnil))
-    fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist));
-  else
-    Fsetcdr (old_alist_elt, val);
-}
-#endif
-
 void
 store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
 {
@@ -2142,6 +2446,18 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
     }
 }
 
+/* Return color matches UNSPEC on frame F or nil if UNSPEC
+   is not an unspecified foreground or background color.  */
+
+static Lisp_Object
+frame_unspecified_color (struct frame *f, Lisp_Object unspec)
+{
+  return (!strncmp (SSDATA (unspec), unspecified_bg, SBYTES (unspec))
+         ? tty_color_name (f, FRAME_BACKGROUND_PIXEL (f))
+         : (!strncmp (SSDATA (unspec), unspecified_fg, SBYTES (unspec))
+            ? tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)) : Qnil));
+}
+
 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
        doc: /* Return the parameters-alist of frame FRAME.
 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.
@@ -2162,8 +2478,6 @@ If FRAME is omitted or nil, return information on the currently selected frame.
 
   if (!FRAME_WINDOW_P (f))
     {
-      int fg = FRAME_FOREGROUND_PIXEL (f);
-      int bg = FRAME_BACKGROUND_PIXEL (f);
       Lisp_Object elt;
 
       /* If the frame's parameter alist says the colors are
@@ -2172,31 +2486,23 @@ If FRAME is omitted or nil, return information on the currently selected frame.
       elt = Fassq (Qforeground_color, alist);
       if (CONSP (elt) && STRINGP (XCDR (elt)))
        {
-         if (strncmp (SSDATA (XCDR (elt)),
-                      unspecified_bg,
-                      SCHARS (XCDR (elt))) == 0)
-           store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg));
-         else if (strncmp (SSDATA (XCDR (elt)),
-                           unspecified_fg,
-                           SCHARS (XCDR (elt))) == 0)
-           store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
+         elt = frame_unspecified_color (f, XCDR (elt));
+         if (!NILP (elt))
+           store_in_alist (&alist, Qforeground_color, elt);
        }
       else
-       store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
+       store_in_alist (&alist, Qforeground_color,
+                       tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)));
       elt = Fassq (Qbackground_color, alist);
       if (CONSP (elt) && STRINGP (XCDR (elt)))
        {
-         if (strncmp (SSDATA (XCDR (elt)),
-                      unspecified_fg,
-                      SCHARS (XCDR (elt))) == 0)
-           store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg));
-         else if (strncmp (SSDATA (XCDR (elt)),
-                           unspecified_bg,
-                           SCHARS (XCDR (elt))) == 0)
-           store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
+         elt = frame_unspecified_color (f, XCDR (elt));
+         if (!NILP (elt))
+           store_in_alist (&alist, Qbackground_color, elt);
        }
       else
-       store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
+       store_in_alist (&alist, Qbackground_color,
+                       tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)));
       store_in_alist (&alist, intern ("font"),
                      build_string (FRAME_MSDOS_P (f)
                                    ? "ms-dos"
@@ -2276,29 +2582,7 @@ If FRAME is nil, describe the currently selected frame.  */)
                 important when param_alist's notion of colors is
                 "unspecified".  We need to do the same here.  */
              if (STRINGP (value) && !FRAME_WINDOW_P (f))
-               {
-                 const char *color_name;
-                 ptrdiff_t csz;
-
-                 if (EQ (parameter, Qbackground_color))
-                   {
-                     color_name = SSDATA (value);
-                     csz = SCHARS (value);
-                     if (strncmp (color_name, unspecified_bg, csz) == 0)
-                       value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
-                     else if (strncmp (color_name, unspecified_fg, csz) == 0)
-                       value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
-                   }
-                 else if (EQ (parameter, Qforeground_color))
-                   {
-                     color_name = SSDATA (value);
-                     csz = SCHARS (value);
-                     if (strncmp (color_name, unspecified_fg, csz) == 0)
-                       value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
-                     else if (strncmp (color_name, unspecified_bg, csz) == 0)
-                       value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
-                   }
-               }
+               value = frame_unspecified_color (f, value);
            }
          else
            value = Fcdr (Fassq (parameter, Fframe_parameters (frame)));
@@ -2501,12 +2785,19 @@ DEFUN ("frame-text-lines", Fframe_text_lines, Sframe_text_lines, 0, 1, 0,
 }
 
 DEFUN ("frame-total-cols", Fframe_total_cols, Sframe_total_cols, 0, 1, 0,
-       doc: /* Return total columns of FRAME.  */)
+       doc: /* Return number of total columns of FRAME.  */)
   (Lisp_Object frame)
 {
   return make_number (FRAME_TOTAL_COLS (decode_any_frame (frame)));
 }
 
+DEFUN ("frame-total-lines", Fframe_total_lines, Sframe_total_lines, 0, 1, 0,
+       doc: /* Return number of total lines of FRAME.  */)
+  (Lisp_Object frame)
+{
+  return make_number (FRAME_TOTAL_LINES (decode_any_frame (frame)));
+}
+
 DEFUN ("frame-text-width", Fframe_text_width, Sframe_text_width, 0, 1, 0,
        doc: /* Return text area width of FRAME in pixels.  */)
   (Lisp_Object frame)
@@ -2528,6 +2819,13 @@ DEFUN ("frame-scroll-bar-width", Fscroll_bar_width, Sscroll_bar_width, 0, 1, 0,
   return make_number (FRAME_SCROLL_BAR_AREA_WIDTH (decode_any_frame (frame)));
 }
 
+DEFUN ("frame-scroll-bar-height", Fscroll_bar_height, Sscroll_bar_height, 0, 1, 0,
+       doc: /* Return scroll bar height of FRAME in pixels.  */)
+  (Lisp_Object frame)
+{
+  return make_number (FRAME_SCROLL_BAR_AREA_HEIGHT (decode_any_frame (frame)));
+}
+
 DEFUN ("frame-fringe-width", Ffringe_width, Sfringe_width, 0, 1, 0,
        doc: /* Return fringe width of FRAME in pixels.  */)
   (Lisp_Object frame)
@@ -2555,7 +2853,7 @@ DEFUN ("frame-bottom-divider-width", Fbottom_divider_width, Sbottom_divider_widt
 {
   return make_number (FRAME_BOTTOM_DIVIDER_WIDTH (decode_any_frame (frame)));
 }
-\f
+
 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 4, 0,
        doc: /* Specify that the frame FRAME has HEIGHT text lines.
 Optional third arg PRETEND non-nil means that redisplay should use
@@ -2564,31 +2862,17 @@ not be changed.  Optional fourth argument PIXELWISE non-nil means that
 FRAME should be HEIGHT pixels high.  */)
   (Lisp_Object frame, Lisp_Object height, Lisp_Object pretend, Lisp_Object pixelwise)
 {
-  register struct frame *f = decode_live_frame (frame);
+  struct frame *f = decode_live_frame (frame);
+  int pixel_height;
 
   CHECK_TYPE_RANGED_INTEGER (int, height);
 
-  /* I think this should be done with a hook.  */
-#ifdef HAVE_WINDOW_SYSTEM
-  if (FRAME_WINDOW_P (f))
-    {
-      if (NILP (pixelwise))
-       {
-         if (XINT (height) != FRAME_LINES (f))
-           x_set_window_size (f, 1, FRAME_COLS (f), XINT (height), 0);
+  pixel_height = (!NILP (pixelwise)
+                 ? XINT (height)
+                 : XINT (height) * FRAME_LINE_HEIGHT (f));
+  if (pixel_height != FRAME_TEXT_HEIGHT (f))
+    adjust_frame_size (f, -1, pixel_height, 1, !NILP (pretend));
 
-         do_pending_window_change (0);
-       }
-      else if (XINT (height) != FRAME_TEXT_HEIGHT (f))
-       {
-         x_set_window_size (f, 1, FRAME_TEXT_WIDTH (f), XINT (height), 1);
-         do_pending_window_change (0);
-       }
-    }
-  else
-#endif
-    change_frame_size (f, 0, XINT (height), !NILP (pretend), 0, 0,
-                      NILP (pixelwise) ? 0 : 1);
   return Qnil;
 }
 
@@ -2600,31 +2884,17 @@ be changed.  Optional fourth argument PIXELWISE non-nil means that FRAME
 should be WIDTH pixels wide.  */)
   (Lisp_Object frame, Lisp_Object width, Lisp_Object pretend, Lisp_Object pixelwise)
 {
-  register struct frame *f = decode_live_frame (frame);
+  struct frame *f = decode_live_frame (frame);
+  int pixel_width;
 
   CHECK_TYPE_RANGED_INTEGER (int, width);
 
-  /* I think this should be done with a hook.  */
-#ifdef HAVE_WINDOW_SYSTEM
-  if (FRAME_WINDOW_P (f))
-    {
-      if (NILP (pixelwise))
-       {
-         if (XINT (width) != FRAME_COLS (f))
-           x_set_window_size (f, 1, XINT (width), FRAME_LINES (f), 0);
+  pixel_width = (!NILP (pixelwise)
+                ? XINT (width)
+                : XINT (width) * FRAME_COLUMN_WIDTH (f));
+  if (pixel_width != FRAME_TEXT_WIDTH (f))
+    adjust_frame_size (f, pixel_width, -1, 1, !NILP (pretend));
 
-         do_pending_window_change (0);
-       }
-      else if (XINT (width) != FRAME_TEXT_WIDTH (f))
-       {
-         x_set_window_size (f, 1, XINT (width), FRAME_TEXT_HEIGHT (f), 1);
-         do_pending_window_change (0);
-       }
-    }
-  else
-#endif
-    change_frame_size (f, XINT (width), 0, !NILP (pretend), 0, 0,
-                      NILP (pixelwise) ? 0 : 1);
   return Qnil;
 }
 
@@ -2633,32 +2903,22 @@ DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 4, 0,
 Optional argument PIXELWISE non-nil means to measure in pixels.  */)
   (Lisp_Object frame, Lisp_Object width, Lisp_Object height, Lisp_Object pixelwise)
 {
-  register struct frame *f = decode_live_frame (frame);
+  struct frame *f = decode_live_frame (frame);
+  int pixel_width, pixel_height;
 
   CHECK_TYPE_RANGED_INTEGER (int, width);
   CHECK_TYPE_RANGED_INTEGER (int, height);
 
-  /* I think this should be done with a hook.  */
-#ifdef HAVE_WINDOW_SYSTEM
-  if (FRAME_WINDOW_P (f))
-    {
-      if (!NILP (pixelwise)
-         ? (XINT (width) != FRAME_TEXT_WIDTH (f)
-            || XINT (height) != FRAME_TEXT_HEIGHT (f)
-            || f->new_height || f->new_width)
-         : (XINT (width) != FRAME_COLS (f)
-            || XINT (height) != FRAME_LINES (f)
-            || f->new_height || f->new_width))
-       {
-         x_set_window_size (f, 1, XINT (width), XINT (height),
-                            NILP (pixelwise) ? 0 : 1);
-         do_pending_window_change (0);
-       }
-    }
-  else
-#endif
-    change_frame_size (f, XINT (width), XINT (height), 0, 0, 0,
-                      NILP (pixelwise) ? 0 : 1);
+  pixel_width = (!NILP (pixelwise)
+                ? XINT (width)
+                : XINT (width) * FRAME_COLUMN_WIDTH (f));
+  pixel_height = (!NILP (pixelwise)
+                 ? XINT (height)
+                 : XINT (height) * FRAME_LINE_HEIGHT (f));
+
+  if (pixel_width != FRAME_TEXT_WIDTH (f)
+      || pixel_height != FRAME_TEXT_HEIGHT (f))
+    adjust_frame_size (f, pixel_width, pixel_height, 1, 0);
 
   return Qnil;
 }
@@ -2723,9 +2983,11 @@ static const struct frame_parm_table frame_parms[] =
   {"mouse-color",              &Qmouse_color},
   {"name",                     &Qname},
   {"scroll-bar-width",         &Qscroll_bar_width},
+  {"scroll-bar-height",                &Qscroll_bar_height},
   {"title",                    &Qtitle},
   {"unsplittable",             &Qunsplittable},
   {"vertical-scroll-bars",     &Qvertical_scroll_bars},
+  {"horizontal-scroll-bars",   &Qhorizontal_scroll_bars},
   {"visibility",               &Qvisibility},
   {"tool-bar-lines",           &Qtool_bar_lines},
   {"scroll-bar-foreground",    &Qscroll_bar_foreground},
@@ -2742,52 +3004,6 @@ static const struct frame_parm_table frame_parms[] =
   {"tool-bar-position",                &Qtool_bar_position},
 };
 
-#ifdef HAVE_NTGUI
-
-/* Calculate fullscreen size.  Return in *TOP_POS and *LEFT_POS the
-   wanted positions of the WM window (not Emacs window).
-   Return in *WIDTH and *HEIGHT the wanted width and height of Emacs
-   window (FRAME_X_WINDOW).
- */
-
-void
-x_fullscreen_adjust (struct frame *f, int *width, int *height, int *top_pos, int *left_pos)
-{
-  int newwidth = FRAME_COLS (f);
-  int newheight = FRAME_LINES (f);
-  Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
-
-  *top_pos = f->top_pos;
-  *left_pos = f->left_pos;
-
-  if (f->want_fullscreen & FULLSCREEN_HEIGHT)
-    {
-      int ph;
-
-      ph = x_display_pixel_height (dpyinfo);
-      newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph);
-      ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, newheight) - f->y_pixels_diff;
-      newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph);
-      *top_pos = 0;
-    }
-
-  if (f->want_fullscreen & FULLSCREEN_WIDTH)
-    {
-      int pw;
-
-      pw = x_display_pixel_width (dpyinfo);
-      newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw);
-      pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, newwidth) - f->x_pixels_diff;
-      newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw);
-      *left_pos = 0;
-    }
-
-  *width = newwidth;
-  *height = newheight;
-}
-
-#endif /* HAVE_NTGUI */
-
 #ifdef HAVE_WINDOW_SYSTEM
 
 /* Change the parameters of frame F as specified by ALIST.
@@ -2804,7 +3020,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
   /* If both of these parameters are present, it's more efficient to
      set them both at once.  So we wait until we've looked at the
      entire list before we set them.  */
-  int width = 0, height = 0;
+  int width, height;
   bool width_change = 0, height_change = 0;
 
   /* Same here.  */
@@ -2877,8 +3093,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
 
              param_index = Fget (prop, Qx_frame_parameter);
              if (NATNUMP (param_index)
-                 && (XFASTINT (param_index)
-                     < sizeof (frame_parms)/sizeof (frame_parms[0]))
+                 && XFASTINT (param_index) < ARRAYELTS (frame_parms)
                   && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
                 (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
            }
@@ -2926,8 +3141,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
 
          param_index = Fget (prop, Qx_frame_parameter);
          if (NATNUMP (param_index)
-             && (XFASTINT (param_index)
-                 < sizeof (frame_parms)/sizeof (frame_parms[0]))
+             && XFASTINT (param_index) < ARRAYELTS (frame_parms)
              && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
            (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
        }
@@ -2982,15 +3196,11 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
   {
     Lisp_Object frame;
 
-    /* Make this 1, eventually.  */
-    check_frame_size (f, &width, &height, 1);
-
     XSETFRAME (frame, f);
 
-    if ((width_change || height_change)
-        && (width != FRAME_TEXT_WIDTH (f)
-            || height != FRAME_TEXT_HEIGHT (f)
-            || f->new_height || f->new_width))
+    if ((width_change && width != FRAME_TEXT_WIDTH (f))
+       || (height_change && height != FRAME_TEXT_HEIGHT (f))
+       || f->new_height || f->new_width)
       {
        /* If necessary provide default values for HEIGHT and WIDTH.  Do
           that here since otherwise a size change implied by an
@@ -3135,6 +3345,14 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
                      for non-toolkit scroll bar.
                      ruler-mode.el depends on this.  */
                   : Qnil));
+  store_in_alist (alistptr, Qscroll_bar_height,
+                 (! FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)
+                  ? make_number (0)
+                  : FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) > 0
+                  ? make_number (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f))
+                  /* nil means "use default height"
+                     for non-toolkit scroll bar.  */
+                  : Qnil));
   /* FRAME_X_WINDOW is not guaranteed to return an integer.  E.g., on
      MS-Windows it returns a value whose type is HANDLE, which is
      actually a pointer.  Explicit casting avoids compiler
@@ -3164,7 +3382,7 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
     tem = make_natnum ((uintptr_t) FRAME_X_OUTPUT (f)->parent_desc);
   store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil));
   store_in_alist (alistptr, Qparent_id, tem);
-  store_in_alist (alistptr, Qtool_bar_position, f->tool_bar_position);
+  store_in_alist (alistptr, Qtool_bar_position, FRAME_TOOL_BAR_POSITION (f));
 }
 
 
@@ -3238,8 +3456,7 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
     {
       Lisp_Object parm_index = Fget (Qbackground_color, Qx_frame_parameter);
       if (NATNUMP (parm_index)
-         && (XFASTINT (parm_index)
-             < sizeof (frame_parms)/sizeof (frame_parms[0]))
+         && XFASTINT (parm_index) < ARRAYELTS (frame_parms)
          && FRAME_RIF (f)->frame_parm_handlers[XFASTINT (parm_index)])
          (*FRAME_RIF (f)->frame_parm_handlers[XFASTINT (parm_index)])
            (f, bgcolor, Qnil);
@@ -3412,58 +3629,66 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
     }
 }
 
-
 void
-x_set_fringe_width (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+x_set_left_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
 {
-  compute_fringe_widths (f, 1);
-#ifdef HAVE_X_WINDOWS
-  /* Must adjust this so window managers report correct number of columns.  */
-  if (FRAME_X_WINDOW (f) != 0)
-    x_wm_set_size_hint (f, 0, 0);
-#endif
+  int unit = FRAME_COLUMN_WIDTH (f);
+  int old_width = FRAME_LEFT_FRINGE_WIDTH (f);
+  int new_width;
+
+  new_width = (RANGED_INTEGERP (-INT_MAX, new_value, INT_MAX)
+              ? eabs (XINT (new_value)) : 8);
+
+  if (new_width != old_width)
+    {
+      FRAME_LEFT_FRINGE_WIDTH (f) = new_width;
+      FRAME_FRINGE_COLS (f) /* Round up.  */
+       = (new_width + FRAME_RIGHT_FRINGE_WIDTH (f) + unit - 1) / unit;
+
+      if (FRAME_X_WINDOW (f) != 0)
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
+    }
 }
 
+
 void
-x_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+x_set_right_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
 {
-  CHECK_TYPE_RANGED_INTEGER (int, arg);
+  int unit = FRAME_COLUMN_WIDTH (f);
+  int old_width = FRAME_RIGHT_FRINGE_WIDTH (f);
+  int new_width;
 
-  if (XINT (arg) == f->border_width)
-    return;
+  new_width = (RANGED_INTEGERP (-INT_MAX, new_value, INT_MAX)
+              ? eabs (XINT (new_value)) : 8);
 
-  if (FRAME_X_WINDOW (f) != 0)
-    error ("Cannot change the border width of a frame");
+  if (new_width != old_width)
+    {
+      FRAME_RIGHT_FRINGE_WIDTH (f) = new_width;
+      FRAME_FRINGE_COLS (f) /* Round up.  */
+       = (new_width + FRAME_LEFT_FRINGE_WIDTH (f) + unit - 1) / unit;
 
-  f->border_width = XINT (arg);
+      if (FRAME_X_WINDOW (f) != 0)
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
+    }
 }
 
+
 void
-x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+x_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
-  int old = FRAME_INTERNAL_BORDER_WIDTH (f);
-
   CHECK_TYPE_RANGED_INTEGER (int, arg);
-  FRAME_INTERNAL_BORDER_WIDTH (f) = XINT (arg);
-  if (FRAME_INTERNAL_BORDER_WIDTH (f) < 0)
-    FRAME_INTERNAL_BORDER_WIDTH (f) = 0;
-
-#ifdef USE_X_TOOLKIT
-  if (FRAME_X_OUTPUT (f)->edit_widget)
-    widget_store_internal_border (FRAME_X_OUTPUT (f)->edit_widget);
-#endif
 
-  if (FRAME_INTERNAL_BORDER_WIDTH (f) == old)
+  if (XINT (arg) == f->border_width)
     return;
 
   if (FRAME_X_WINDOW (f) != 0)
-    {
-      x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
-      SET_FRAME_GARBAGED (f);
-      do_pending_window_change (0);
-    }
-  else
-    SET_FRAME_GARBAGED (f);
+    error ("Cannot change the border width of a frame");
+
+  f->border_width = XINT (arg);
 }
 
 void
@@ -3475,18 +3700,13 @@ x_set_right_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
   FRAME_RIGHT_DIVIDER_WIDTH (f) = XINT (arg);
   if (FRAME_RIGHT_DIVIDER_WIDTH (f) < 0)
     FRAME_RIGHT_DIVIDER_WIDTH (f) = 0;
-
-  if (FRAME_RIGHT_DIVIDER_WIDTH (f) == old)
-    return;
-
-  if (FRAME_X_WINDOW (f) != 0)
+  if (FRAME_RIGHT_DIVIDER_WIDTH (f) != old)
     {
-      x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+      adjust_frame_size (f, -1, -1, 4, 0);
+      adjust_frame_glyphs (f);
       SET_FRAME_GARBAGED (f);
-      do_pending_window_change (0);
     }
-  else
-    SET_FRAME_GARBAGED (f);
+
 }
 
 void
@@ -3498,18 +3718,12 @@ x_set_bottom_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval
   FRAME_BOTTOM_DIVIDER_WIDTH (f) = XINT (arg);
   if (FRAME_BOTTOM_DIVIDER_WIDTH (f) < 0)
     FRAME_BOTTOM_DIVIDER_WIDTH (f) = 0;
-
-  if (FRAME_BOTTOM_DIVIDER_WIDTH (f) == old)
-    return;
-
-  if (FRAME_X_WINDOW (f) != 0)
+  if (FRAME_BOTTOM_DIVIDER_WIDTH (f) != old)
     {
-      x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+      adjust_frame_size (f, -1, -1, 4, 0);
+      adjust_frame_glyphs (f);
       SET_FRAME_GARBAGED (f);
-      do_pending_window_change (0);
     }
-  else
-    SET_FRAME_GARBAGED (f);
 }
 
 void
@@ -3550,7 +3764,7 @@ x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval
   if ((EQ (arg, Qleft) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
       || (EQ (arg, Qright) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
       || (NILP (arg) && FRAME_HAS_VERTICAL_SCROLL_BARS (f))
-      || (!NILP (arg) && ! FRAME_HAS_VERTICAL_SCROLL_BARS (f)))
+      || (!NILP (arg) && !FRAME_HAS_VERTICAL_SCROLL_BARS (f)))
     {
       FRAME_VERTICAL_SCROLL_BAR_TYPE (f)
        = (NILP (arg)
@@ -3570,10 +3784,32 @@ x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval
         However, if the window hasn't been created yet, we shouldn't
         call x_set_window_size.  */
       if (FRAME_X_WINDOW (f))
-       x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
-                          FRAME_TEXT_HEIGHT (f), 1);
-      do_pending_window_change (0);
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
+    }
+}
+
+void
+x_set_horizontal_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+  if ((NILP (arg) && FRAME_HAS_HORIZONTAL_SCROLL_BARS (f))
+      || (!NILP (arg) && !FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)))
+    {
+      FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)
+       = NILP (arg) ? false : true;
+
+      /* We set this parameter before creating the X window for the
+        frame, so we can get the geometry right from the start.
+        However, if the window hasn't been created yet, we shouldn't
+        call x_set_window_size.  */
+      if (FRAME_X_WINDOW (f))
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
     }
+#endif
 }
 
 void
@@ -3586,9 +3822,9 @@ x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
       x_set_scroll_bar_default_width (f);
 
       if (FRAME_X_WINDOW (f))
-        x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
-                          FRAME_TEXT_HEIGHT (f), 1);
-      do_pending_window_change (0);
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
     }
   else if (RANGED_INTEGERP (1, arg, INT_MAX)
           && XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_WIDTH (f))
@@ -3596,18 +3832,46 @@ x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
       FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = XFASTINT (arg);
       FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + unit - 1) / unit;
       if (FRAME_X_WINDOW (f))
-       x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
-                          FRAME_TEXT_HEIGHT (f), 1);
-      do_pending_window_change (0);
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
     }
 
-  /* Eventually remove the following call.  It should have been done by
-     x_set_window_size already.  */
-  change_frame_size (f, 0, 0, 0, 0, 0, 1);
   XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0;
   XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0;
 }
 
+void
+x_set_scroll_bar_height (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+  int unit = FRAME_LINE_HEIGHT (f);
+
+  if (NILP (arg))
+    {
+      x_set_scroll_bar_default_height (f);
+
+      if (FRAME_X_WINDOW (f))
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
+    }
+  else if (RANGED_INTEGERP (1, arg, INT_MAX)
+          && XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_HEIGHT (f))
+    {
+      FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = XFASTINT (arg);
+      FRAME_CONFIG_SCROLL_BAR_LINES (f) = (XFASTINT (arg) + unit - 1) / unit;
+      if (FRAME_X_WINDOW (f))
+       adjust_frame_size (f, -1, -1, 3, 0);
+
+      SET_FRAME_GARBAGED (f);
+    }
+
+  XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.vpos = 0;
+  XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.y = 0;
+#endif
+}
+
 void
 x_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
@@ -4209,7 +4473,7 @@ On Nextstep, this just calls `ns-parse-geometry'.  */)
 long
 x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
 {
-  register Lisp_Object tem0, tem1, tem2;
+  Lisp_Object height, width, user_size, top, left, user_position;
   long window_prompting = 0;
   Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
 
@@ -4219,58 +4483,54 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
   SET_FRAME_WIDTH (f, DEFAULT_COLS * FRAME_COLUMN_WIDTH (f));
   SET_FRAME_COLS (f, DEFAULT_COLS);
   SET_FRAME_HEIGHT (f, DEFAULT_ROWS * FRAME_LINE_HEIGHT (f));
-  FRAME_LINES (f) = DEFAULT_ROWS;
+  SET_FRAME_LINES (f, DEFAULT_ROWS);
 
   /* Window managers expect that if program-specified
      positions are not (0,0), they're intentional, not defaults.  */
   f->top_pos = 0;
   f->left_pos = 0;
 
-  /* Ensure that old new_width and new_height will not override the
-     values set here.  */
-  /* ++KFS: This was specific to W32, but seems ok for all platforms */
-  f->new_width = f->new_height = f->new_pixelwise = 0;
+  /* Ensure that earlier new_width and new_height settings won't
+     override what we specify below.  */
+  f->new_width = f->new_height = 0;
 
-  tem0 = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
-  tem1 = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
-  tem2 = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, RES_TYPE_NUMBER);
-  if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
+  height = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
+  width = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
+  if (!EQ (width, Qunbound) || !EQ (height, Qunbound))
     {
-      if (!EQ (tem0, Qunbound))
+      if (!EQ (width, Qunbound))
        {
-         CHECK_NUMBER (tem0);
-         if (! (0 <= XINT (tem0) && XINT (tem0) <= INT_MAX))
-           xsignal1 (Qargs_out_of_range, tem0);
-         FRAME_LINES (f) = XINT (tem0);
+         CHECK_NUMBER (width);
+         if (! (0 <= XINT (width) && XINT (width) <= INT_MAX))
+           xsignal1 (Qargs_out_of_range, width);
+
+         SET_FRAME_WIDTH (f, XINT (width) * FRAME_COLUMN_WIDTH (f));
        }
-      if (!EQ (tem1, Qunbound))
+
+      if (!EQ (height, Qunbound))
        {
-         CHECK_NUMBER (tem1);
-         if (! (0 <= XINT (tem1) && XINT (tem1) <= INT_MAX))
-           xsignal1 (Qargs_out_of_range, tem1);
-         SET_FRAME_COLS (f, XINT (tem1));
+         CHECK_NUMBER (height);
+         if (! (0 <= XINT (height) && XINT (height) <= INT_MAX))
+           xsignal1 (Qargs_out_of_range, height);
+
+         SET_FRAME_HEIGHT (f, XINT (height) * FRAME_LINE_HEIGHT (f));
        }
-      if (!NILP (tem2) && !EQ (tem2, Qunbound))
+
+      user_size = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, RES_TYPE_NUMBER);
+      if (!NILP (user_size) && !EQ (user_size, Qunbound))
        window_prompting |= USSize;
       else
        window_prompting |= PSize;
     }
 
-
-  /* This used to be done _before_ calling x_figure_window_size, but
-     since the height is reset here, this was really a no-op.  I
-     assume that moving it here does what Gerd intended (although he
-     no longer can remember what that was...  ++KFS, 2003-03-25.  */
-
-  /* Add the tool-bar height to the initial frame height so that the
-     user gets a text display area of the size he specified with -g or
-     via .Xdefaults.  Later changes of the tool-bar height don't
-     change the frame size.  This is done so that users can create
-     tall Emacs frames without having to guess how tall the tool-bar
-     will get.  */
-  if (toolbar_p && FRAME_TOOL_BAR_HEIGHT (f))
+  /* Add a tool bar height to the initial frame height so that the user
+     gets a text display area of the size he specified with -g or via
+     .Xdefaults.  Later changes of the tool bar height don't change the
+     frame size.  This is done so that users can create tall Emacs
+     frames without having to guess how tall the tool bar will get.  */
+  if (toolbar_p && FRAME_TOOL_BAR_LINES (f))
     {
-      int margin, relief, bar_height;
+      int margin, relief;
 
       relief = (tool_bar_button_relief >= 0
                ? tool_bar_button_relief
@@ -4284,78 +4544,73 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
       else
        margin = 0;
 
-      /* PXW: We should be able to not round here.  */
-      bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
-      FRAME_LINES (f) += (bar_height + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f);
+      FRAME_TOOL_BAR_HEIGHT (f)
+       = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
+      Vframe_initial_frame_tool_bar_height = make_number (FRAME_TOOL_BAR_HEIGHT (f));
     }
 
-  compute_fringe_widths (f, 0);
-
-  SET_FRAME_WIDTH (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f));
-  SET_FRAME_HEIGHT(f, FRAME_LINES (f) * FRAME_LINE_HEIGHT (f));
-
-  tem0 = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
-  tem1 = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
-  tem2 = x_get_arg (dpyinfo, parms, Quser_position, 0, 0, RES_TYPE_NUMBER);
-  if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
+  top = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
+  left = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
+  user_position = x_get_arg (dpyinfo, parms, Quser_position, 0, 0, RES_TYPE_NUMBER);
+  if (! EQ (top, Qunbound) || ! EQ (left, Qunbound))
     {
-      if (EQ (tem0, Qminus))
+      if (EQ (top, Qminus))
        {
          f->top_pos = 0;
          window_prompting |= YNegative;
        }
-      else if (CONSP (tem0) && EQ (XCAR (tem0), Qminus)
-              && CONSP (XCDR (tem0))
-              && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (tem0)), INT_MAX))
+      else if (CONSP (top) && EQ (XCAR (top), Qminus)
+              && CONSP (XCDR (top))
+              && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (top)), INT_MAX))
        {
-         f->top_pos = - XINT (XCAR (XCDR (tem0)));
+         f->top_pos = - XINT (XCAR (XCDR (top)));
          window_prompting |= YNegative;
        }
-      else if (CONSP (tem0) && EQ (XCAR (tem0), Qplus)
-              && CONSP (XCDR (tem0))
-              && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (tem0))))
+      else if (CONSP (top) && EQ (XCAR (top), Qplus)
+              && CONSP (XCDR (top))
+              && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (top))))
        {
-         f->top_pos = XINT (XCAR (XCDR (tem0)));
+         f->top_pos = XINT (XCAR (XCDR (top)));
        }
-      else if (EQ (tem0, Qunbound))
+      else if (EQ (top, Qunbound))
        f->top_pos = 0;
       else
        {
-         CHECK_TYPE_RANGED_INTEGER (int, tem0);
-         f->top_pos = XINT (tem0);
+         CHECK_TYPE_RANGED_INTEGER (int, top);
+         f->top_pos = XINT (top);
          if (f->top_pos < 0)
            window_prompting |= YNegative;
        }
 
-      if (EQ (tem1, Qminus))
+      if (EQ (left, Qminus))
        {
          f->left_pos = 0;
          window_prompting |= XNegative;
        }
-      else if (CONSP (tem1) && EQ (XCAR (tem1), Qminus)
-              && CONSP (XCDR (tem1))
-              && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (tem1)), INT_MAX))
+      else if (CONSP (left) && EQ (XCAR (left), Qminus)
+              && CONSP (XCDR (left))
+              && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (left)), INT_MAX))
        {
-         f->left_pos = - XINT (XCAR (XCDR (tem1)));
+         f->left_pos = - XINT (XCAR (XCDR (left)));
          window_prompting |= XNegative;
        }
-      else if (CONSP (tem1) && EQ (XCAR (tem1), Qplus)
-              && CONSP (XCDR (tem1))
-              && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (tem1))))
+      else if (CONSP (left) && EQ (XCAR (left), Qplus)
+              && CONSP (XCDR (left))
+              && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (left))))
        {
-         f->left_pos = XINT (XCAR (XCDR (tem1)));
+         f->left_pos = XINT (XCAR (XCDR (left)));
        }
-      else if (EQ (tem1, Qunbound))
+      else if (EQ (left, Qunbound))
        f->left_pos = 0;
       else
        {
-         CHECK_TYPE_RANGED_INTEGER (int, tem1);
-         f->left_pos = XINT (tem1);
+         CHECK_TYPE_RANGED_INTEGER (int, left);
+         f->left_pos = XINT (left);
          if (f->left_pos < 0)
            window_prompting |= XNegative;
        }
 
-      if (!NILP (tem2) && ! EQ (tem2, Qunbound))
+      if (!NILP (user_position) && ! EQ (user_position, Qunbound))
        window_prompting |= USPosition;
       else
        window_prompting |= PPosition;
@@ -4386,16 +4641,11 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
 #endif /* HAVE_WINDOW_SYSTEM */
 
 void
-frame_make_pointer_invisible (void)
+frame_make_pointer_invisible (struct frame *f)
 {
   if (! NILP (Vmake_pointer_invisible))
     {
-      struct frame *f;
-      if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
-        return;
-
-      f = SELECTED_FRAME ();
-      if (f && !f->pointer_invisible
+      if (f && FRAME_LIVE_P (f) && !f->pointer_invisible
           && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
         {
           f->mouse_moved = 0;
@@ -4406,17 +4656,11 @@ frame_make_pointer_invisible (void)
 }
 
 void
-frame_make_pointer_visible (void)
+frame_make_pointer_visible (struct frame *f)
 {
   /* We don't check Vmake_pointer_invisible here in case the
      pointer was invisible when Vmake_pointer_invisible was set to nil.  */
-  struct frame *f;
-
-  if (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
-    return;
-
-  f = SELECTED_FRAME ();
-  if (f && f->pointer_invisible && f->mouse_moved
+  if (f && FRAME_LIVE_P (f) && f->pointer_invisible && f->mouse_moved
       && FRAME_TERMINAL (f)->toggle_invisible_pointer_hook)
     {
       FRAME_TERMINAL (f)->toggle_invisible_pointer_hook (f, 0);
@@ -4513,6 +4757,7 @@ syms_of_frame (void)
 {
   DEFSYM (Qframep, "framep");
   DEFSYM (Qframe_live_p, "frame-live-p");
+  DEFSYM (Qframe_windows_min_size, "frame-windows-min-size");
   DEFSYM (Qexplicit_name, "explicit-name");
   DEFSYM (Qheight, "height");
   DEFSYM (Qicon, "icon");
@@ -4525,8 +4770,6 @@ syms_of_frame (void)
   DEFSYM (Qicon_left, "icon-left");
   DEFSYM (Qicon_top, "icon-top");
   DEFSYM (Qtooltip, "tooltip");
-  DEFSYM (Qleft, "left");
-  DEFSYM (Qright, "right");
   DEFSYM (Quser_position, "user-position");
   DEFSYM (Quser_size, "user-size");
   DEFSYM (Qwindow_id, "window-id");
@@ -4573,7 +4816,7 @@ syms_of_frame (void)
   {
     int i;
 
-    for (i = 0; i < sizeof (frame_parms) / sizeof (frame_parms[0]); i++)
+    for (i = 0; i < ARRAYELTS (frame_parms); i++)
       {
        Lisp_Object v = intern_c_string (frame_parms[i].name);
        if (frame_parms[i].variable)
@@ -4633,7 +4876,7 @@ Setting this variable does not affect existing frames, only new ones.  */);
   Vdefault_frame_alist = Qnil;
 
   DEFVAR_LISP ("default-frame-scroll-bars", Vdefault_frame_scroll_bars,
-              doc: /* Default position of scroll bars on this window-system.  */);
+              doc: /* Default position of vertical scroll bars on this window-system.  */);
 #ifdef HAVE_WINDOW_SYSTEM
 #if defined (HAVE_NTGUI) || defined (NS_IMPL_COCOA) || (defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS))
   /* MS-Windows, Mac OS X, and GTK have scroll bars on the right by
@@ -4646,6 +4889,14 @@ Setting this variable does not affect existing frames, only new ones.  */);
   Vdefault_frame_scroll_bars = Qnil;
 #endif
 
+  DEFVAR_LISP ("default-frame-horizontal-scroll-bars", Vdefault_frame_horizontal_scroll_bars,
+              doc: /* Default value for horizontal scroll bars on this window-system.  */);
+#ifdef HAVE_WINDOW_SYSTEM
+  Vdefault_frame_horizontal_scroll_bars = Qt;
+#else
+  Vdefault_frame_horizontal_scroll_bars = Qnil;
+#endif
+
   DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion",
                scroll_bar_adjust_thumb_portion_p,
                doc: /* Adjust thumb for overscrolling for Gtk+ and MOTIF.
@@ -4722,6 +4973,10 @@ or call the function `tool-bar-mode'.  */);
   Vtool_bar_mode = Qnil;
 #endif
 
+  DEFVAR_LISP ("frame-initial-frame-tool-bar-height", Vframe_initial_frame_tool_bar_height,
+               doc: /* Height of tool bar of initial frame.  */);
+  Vframe_initial_frame_tool_bar_height = make_number (0);
+
   DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
                 doc: /* Minibufferless frames use this frame's minibuffer.
 Emacs cannot create minibufferless frames unless this is set to an
@@ -4750,11 +5005,19 @@ current values of `frame-char-height' and `frame-char-width'.  If this
 is non-nil, no rounding occurs, hence frame sizes can increase/decrease
 by one pixel.
 
-With some window managers you have to set this to non-nil in order to
-fully maximize frames.  To resize your initial frame pixelwise,
-set this option to a non-nil value in your init file.  */);
+With some window managers you may have to set this to non-nil in order
+to fully maximize frames.  To resize your initial frame pixelwise, set
+this option to a non-nil value in your init file.  */);
   frame_resize_pixelwise = 0;
 
+  DEFVAR_BOOL ("frame-inhibit-implied-resize", frame_inhibit_implied_resize,
+              doc: /* Non-nil means do not resize frame implicitly.
+If this option is nil, setting default font, menubar mode, fringe width,
+or scroll bar mode of a specific frame may resize the frame in order to
+preserve the number of columns or lines it displays.  If this option is
+non-nil, no such resizing is done.  */);
+  frame_inhibit_implied_resize = 0;
+
   staticpro (&Vframe_list);
 
   defsubr (&Sframep);
@@ -4797,9 +5060,11 @@ set this option to a non-nil value in your init file.  */);
   defsubr (&Sframe_text_cols);
   defsubr (&Sframe_text_lines);
   defsubr (&Sframe_total_cols);
+  defsubr (&Sframe_total_lines);
   defsubr (&Sframe_text_width);
   defsubr (&Sframe_text_height);
   defsubr (&Sscroll_bar_width);
+  defsubr (&Sscroll_bar_height);
   defsubr (&Sfringe_width);
   defsubr (&Sborder_width);
   defsubr (&Sright_divider_width);
index ff696df9effdb10965988a64381981328ae6998a..51597c4bcdb88c515545438004a048073d6b9fe6 100644 (file)
@@ -36,16 +36,22 @@ enum vertical_scroll_bar_type
   vertical_scroll_bar_right
 };
 
+#ifdef HAVE_WINDOW_SYSTEM
+
 enum fullscreen_type
 {
   FULLSCREEN_NONE,
-  FULLSCREEN_WIDTH     = 0x001,
-  FULLSCREEN_HEIGHT    = 0x002,
-  FULLSCREEN_BOTH      = 0x003,
-  FULLSCREEN_MAXIMIZED = 0x013,
-  FULLSCREEN_WAIT      = 0x100
+  FULLSCREEN_WIDTH     = 0x1,
+  FULLSCREEN_HEIGHT    = 0x2,
+  FULLSCREEN_BOTH      = 0x3, /* Not a typo but means "width and height".  */
+  FULLSCREEN_MAXIMIZED = 0x4,
+#ifdef HAVE_NTGUI  
+  FULLSCREEN_WAIT      = 0x8
+#endif  
 };
 
+#endif /* HAVE_WINDOW_SYSTEM */
+
 /* The structure representing a frame.  */
 
 struct frame
@@ -155,21 +161,41 @@ struct frame
   /* Desired and current tool-bar items.  */
   Lisp_Object tool_bar_items;
 
-  /* Where tool bar is, can be left, right, top or bottom.  The native
-     tool bar only supports top.  */
+#ifdef USE_GTK  
+  /* Where tool bar is, can be left, right, top or bottom.
+     Except with GTK, the only supported position is `top'.  */
   Lisp_Object tool_bar_position;
+#endif
+
+#if defined (HAVE_XFT) || defined (HAVE_FREETYPE)
+  /* List of data specific to font-driver and frame, but common to faces.  */
+  Lisp_Object font_data;
+#endif
 
   /* Beyond here, there should be no more Lisp_Object components.  */
 
   /* Cache of realized faces.  */
   struct face_cache *face_cache;
 
+#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
+  /* Tool-bar item index of the item on which a mouse button was pressed.  */
+  int last_tool_bar_item;
+#endif
+
   /* Number of elements in `menu_bar_vector' that have meaningful data.  */
   int menu_bar_items_used;
 
-  /* A buffer to hold the frame's name.  We can't use the Lisp
-     string's pointer (`name', above) because it might get relocated.  */
+#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)  
+  /* A buffer to hold the frame's name.  Since this is used by the
+     window system toolkit, we can't use the Lisp string's pointer
+     (`name', above) because it might get relocated.  */
   char *namebuf;
+#endif
+
+#ifdef USE_X_TOOLKIT
+  /* Used to pass geometry parameters to toolkit functions.  */
+  char *shell_position;
+#endif
 
   /* Glyph pool and matrix.  */
   struct glyph_pool *current_pool;
@@ -177,6 +203,8 @@ struct frame
   struct glyph_matrix *desired_matrix;
   struct glyph_matrix *current_matrix;
 
+  /* Bitfield area begins here.  Keep them together to avoid extra padding.  */
+
   /* True means that glyphs on this frame have been initialized so it can
      be used for output.  */
   bool_bf glyphs_initialized_p : 1;
@@ -218,10 +246,100 @@ struct frame
   /* True if it needs to be redisplayed.  */
   bool_bf redisplay : 1;
 
-  /* Margin at the top of the frame.  Used to display the tool-bar.  */
+#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)    \
+    || defined (HAVE_NS) || defined (USE_GTK)
+  /* True means using a menu bar that comes from the X toolkit.  */
+  bool_bf external_menu_bar : 1;
+#endif
+
+  /* Next two bitfields are mutually exclusive.  They might both be
+     zero if the frame has been made invisible without an icon.  */
+
+  /* Nonzero if the frame is currently displayed; we check
+     it to see if we should bother updating the frame's contents.
+
+     On ttys and on Windows NT/9X, to avoid wasting effort updating
+     visible frames that are actually completely obscured by other
+     windows on the display, we bend the meaning of visible slightly:
+     if equal to 2, then the frame is obscured - we still consider
+     it to be "visible" as seen from lisp, but we don't bother
+     updating it.  */
+  unsigned visible : 2;
+
+  /* True if the frame is currently iconified.  Do not
+     set this directly, use SET_FRAME_ICONIFIED instead.  */
+  bool_bf iconified : 1;
+
+  /* True if this frame should be fully redisplayed.  Disables all
+     optimizations while rebuilding matrices and redrawing.  */
+  bool_bf garbaged : 1;
+
+  /* False means, if this frame has just one window,
+     show no modeline for that window.  */
+  bool_bf wants_modeline : 1;
+
+  /* True means raise this frame to the top of the heap when selected.  */
+  bool_bf auto_raise : 1;
+
+  /* True means lower this frame to the bottom of the stack when left.  */
+  bool_bf auto_lower : 1;
+
+  /* True if frame's root window can't be split.  */
+  bool_bf no_split : 1;
+
+  /* If this is set, then Emacs won't change the frame name to indicate
+     the current buffer, etcetera.  If the user explicitly sets the frame
+     name, this gets set.  If the user sets the name to Qnil, this is
+     cleared.  */
+  bool_bf explicit_name : 1;
+
+  /* True if size of some window on this frame has changed.  */
+  bool_bf window_sizes_changed : 1;
+
+  /* True if the mouse has moved on this display device
+     since the last time we checked.  */
+  bool_bf mouse_moved : 1;
+
+  /* True means that the pointer is invisible.  */
+  bool_bf pointer_invisible : 1;
+
+  /* True means that all windows except mini-window and
+     selected window on this frame have frozen window starts.  */
+  bool_bf frozen_window_starts : 1;
+
+  /* The output method says how the contents of this frame are
+     displayed.  It could be using termcap, or using an X window.
+     This must be the same as the terminal->type. */
+  ENUM_BF (output_method) output_method : 3;
+
+#ifdef HAVE_WINDOW_SYSTEM
+  /* See FULLSCREEN_ enum on top.  */
+  ENUM_BF (fullscreen_type) want_fullscreen : 4;
+
+  /* If not vertical_scroll_bar_none, we should actually
+     display the scroll bars of this type on this frame.  */
+  ENUM_BF (vertical_scroll_bar_type) vertical_scroll_bar_type : 2;
+
+  /* Nonzero if we should actually display horizontal scroll bars on this frame.  */
+  bool_bf horizontal_scroll_bars : 1;
+#endif /* HAVE_WINDOW_SYSTEM */
+
+  /* Whether new_height and new_width shall be interpreted
+     in pixels.  */
+  bool_bf new_pixelwise : 1;
+
+  /* True if frame has been added to Vframe_list and is henceforth
+     considered official.  For in-official frames we neither process
+     x_set_window_size requests nor do we allow running
+     window-configuration-change-hook when resizing windows.  */
+  bool_bf official : 1;
+
+  /* Bitfield area ends here.  */
+
+  /* Number of lines (rounded up) of tool bar.  REMOVE THIS  */
   int tool_bar_lines;
 
-  /* Pixel height of tool bar.  */
+  /* Height of frame internal tool bar in pixels.  */
   int tool_bar_height;
 
   int n_tool_bar_rows;
@@ -240,18 +358,22 @@ struct frame
   /* Cost of deleting n lines on this frame.  */
   int *delete_n_lines_cost;
 
-  /* Text width of this frame (excluding fringes, scroll bars and
-     internal border width) and text height (excluding internal border
-     width) in units of canonical characters.  */
+  /* Text width of this frame (excluding fringes, vertical scroll bar
+     and internal border widths) and text height (excluding menu bar,
+     tool bar, horizontal scroll bar and internal border widths) in
+     units of canonical characters.  */
   int text_cols, text_lines;
 
-  /* Total width of this frame (including fringes and scroll bars) in
+  /* Total width of this frame (including fringes, vertical scroll bar
+     and internal border widths) and total height (including menu bar,
+     tool bar, horizontal scroll bar and internal border widths) in
      units of canonical characters.  */
-  int total_cols;
+  int total_cols, total_lines;
 
-  /* Text width of this frame (excluding fringes, scroll bars and
-     internal border width) and text height (excluding internal border
-     width) in pixels.  */
+  /* Text width of this frame (excluding fringes, vertical scroll bar
+     and internal border widths) and text height (excluding menu bar,
+     tool bar, horizontal scroll bar and internal border widths) in
+     pixels.  */
   int text_width, text_height;
 
   /* New text height and width for pending size change.  0 if no change
@@ -260,14 +382,12 @@ struct frame
      text width/height of the frame.  */
   int new_width, new_height;
 
-  /* Whether new_height and new_width shall be interpreted
-     in pixels.  */
-  bool new_pixelwise;
-
   /* Pixel position of the frame window (x and y offsets in root window).  */
   int left_pos, top_pos;
 
-  /* Size of the frame window (including internal border widths) in
+  /* Total width of this frame (including fringes, vertical scroll bar
+     and internal border widths) and total height (including menu bar,
+     tool bar, horizontal scroll bar and internal border widths) in
      pixels.  */
   int pixel_width, pixel_height;
 
@@ -289,9 +409,21 @@ struct frame
      a highlighting is displayed inside the internal border.  */
   int internal_border_width;
 
-  /* Width of borders between this frame's windows.  */
-  int right_divider_width;
-  int bottom_divider_width;
+  /* Widths of dividers between this frame's windows in pixels.  */
+  int right_divider_width, bottom_divider_width;
+
+  /* Widths of fringes in pixels.  */
+  int left_fringe_width, right_fringe_width;
+
+  /* Total width of fringes reserved for drawing truncation bitmaps,
+     continuation bitmaps and alike - REMOVE THIS !!!!.    */
+  int fringe_cols;
+
+  /* Number of lines of menu bar.  */
+  int menu_bar_lines;
+
+  /* Pixel height of menubar.  */
+  int menu_bar_height;
 
   /* Canonical X unit.  Width of default font, in pixels.  */
   int column_width;
@@ -299,11 +431,6 @@ struct frame
   /* Canonical Y unit.  Height of a line, in pixels.  */
   int line_height;
 
-  /* The output method says how the contents of this frame are
-     displayed.  It could be using termcap, or using an X window.
-     This must be the same as the terminal->type. */
-  enum output_method output_method;
-
   /* The terminal device that this frame uses.  If this is NULL, then
      the frame has been deleted.  */
   struct terminal *terminal;
@@ -323,98 +450,12 @@ struct frame
 
   /* List of font-drivers available on the frame.  */
   struct font_driver_list *font_driver_list;
-  /* List of data specific to font-driver and frame, but common to
-     faces.  */
-  struct font_data_list *font_data_list;
-
-  /* Total width of fringes reserved for drawing truncation bitmaps,
-     continuation bitmaps and alike.  The width is in canonical char
-     units of the frame.  This must currently be the case because window
-     sizes aren't pixel values.  If it weren't the case, we wouldn't be
-     able to split windows horizontally nicely.  */
-  int fringe_cols;
-
-  /* The extra width (in pixels) currently allotted for fringes.  */
-  int left_fringe_width, right_fringe_width;
-
-  /* See FULLSCREEN_ enum below.  */
-  enum fullscreen_type want_fullscreen;
-
-  /* Number of lines of menu bar.  */
-  int menu_bar_lines;
-
-  /* Pixel height of menubar.  */
-  int menu_bar_height;
 
 #if defined (HAVE_X_WINDOWS)
   /* Used by x_wait_for_event when watching for an X event on this frame.  */
   int wait_event_type;
 #endif
 
-#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
-    || defined (HAVE_NS) || defined (USE_GTK)
-  /* True means using a menu bar that comes from the X toolkit.  */
-  bool_bf external_menu_bar : 1;
-#endif
-
-  /* Next two bitfields are mutually exclusive.  They might both be
-     zero if the frame has been made invisible without an icon.  */
-
-  /* Nonzero if the frame is currently displayed; we check
-     it to see if we should bother updating the frame's contents.
-
-     On ttys and on Windows NT/9X, to avoid wasting effort updating
-     visible frames that are actually completely obscured by other
-     windows on the display, we bend the meaning of visible slightly:
-     if equal to 2, then the frame is obscured - we still consider
-     it to be "visible" as seen from lisp, but we don't bother
-     updating it.  */
-  unsigned visible : 2;
-
-  /* True if the frame is currently iconified.  Do not
-     set this directly, use SET_FRAME_ICONIFIED instead.  */
-  bool_bf iconified : 1;
-
-  /* True if this frame should be fully redisplayed.  Disables all
-     optimizations while rebuilding matrices and redrawing.  */
-  bool_bf garbaged : 1;
-
-  /* False means, if this frame has just one window,
-     show no modeline for that window.  */
-  bool_bf wants_modeline : 1;
-
-  /* True means raise this frame to the top of the heap when selected.  */
-  bool_bf auto_raise : 1;
-
-  /* True means lower this frame to the bottom of the stack when left.  */
-  bool_bf auto_lower : 1;
-
-  /* True if frame's root window can't be split.  */
-  bool_bf no_split : 1;
-
-  /* If this is set, then Emacs won't change the frame name to indicate
-     the current buffer, etcetera.  If the user explicitly sets the frame
-     name, this gets set.  If the user sets the name to Qnil, this is
-     cleared.  */
-  bool_bf explicit_name : 1;
-
-  /* True if size of some window on this frame has changed.  */
-  bool_bf window_sizes_changed : 1;
-
-  /* True if the mouse has moved on this display device
-     since the last time we checked.  */
-  bool_bf mouse_moved : 1;
-
-  /* True means that the pointer is invisible.  */
-  bool_bf pointer_invisible : 1;
-
-  /* True means that all windows except mini-window and
-     selected window on this frame have frozen window starts.  */
-  bool_bf frozen_window_starts : 1;
-
-  /* Nonzero if we should actually display the scroll bars on this frame.  */
-  enum vertical_scroll_bar_type vertical_scroll_bar_type;
-
   /* What kind of text cursor should we draw in the future?
      This should always be filled_box_cursor or bar_cursor.  */
   enum text_cursor_kinds desired_cursor;
@@ -437,6 +478,14 @@ struct frame
   int config_scroll_bar_width;
   int config_scroll_bar_cols;
 
+  /* Configured height of the scroll bar, in pixels and in characters.
+     config_scroll_bar_lines tracks config_scroll_bar_height if the
+     latter is positive; a zero value in config_scroll_bar_height means
+     to compute the actual width on the fly, using
+     config_scroll_bar_lines and the current font width.  */
+  int config_scroll_bar_height;
+  int config_scroll_bar_lines;
+
   /* The baud rate that was used to calculate costs for this frame.  */
   int cost_calculation_baud_rate;
 
@@ -543,11 +592,13 @@ fset_tool_bar_items (struct frame *f, Lisp_Object val)
 {
   f->tool_bar_items = val;
 }
+#ifdef USE_GTK
 INLINE void
 fset_tool_bar_position (struct frame *f, Lisp_Object val)
 {
   f->tool_bar_position = val;
 }
+#endif /* USE_GTK */
 #if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
 INLINE void
 fset_tool_bar_window (struct frame *f, Lisp_Object val)
@@ -682,8 +733,7 @@ default_pixels_per_inch_y (void)
 /* Pixel width of frame F.  */
 #define FRAME_PIXEL_WIDTH(f) ((f)->pixel_width)
 
-/* Pixel height of frame F, including non-toolkit menu bar and
-   non-toolkit tool bar lines.  */
+/* Pixel height of frame F.  */
 #define FRAME_PIXEL_HEIGHT(f) ((f)->pixel_height)
 
 /* Width of frame F, measured in canonical character columns,
@@ -699,7 +749,7 @@ default_pixels_per_inch_y (void)
 #define FRAME_TEXT_WIDTH(f) (f)->text_width
 
 /* Height of frame F, measured in pixels not including the height
-   for internal borders.  */
+   for scroll bar and internal borders.  */
 #define FRAME_TEXT_HEIGHT(f) (f)->text_height
 
 /* Number of lines of frame F used for menu bar.
@@ -719,6 +769,13 @@ default_pixels_per_inch_y (void)
 #define FRAME_EXTERNAL_TOOL_BAR(f) false
 #endif
 
+/* This is really supported only with GTK.  */
+#ifdef USE_GTK
+#define FRAME_TOOL_BAR_POSITION(f) (f)->tool_bar_position
+#else
+#define FRAME_TOOL_BAR_POSITION(f) ((void) f, Qtop)
+#endif
+
 /* Number of lines of frame F used for the tool-bar.  */
 #define FRAME_TOOL_BAR_LINES(f) (f)->tool_bar_lines
 
@@ -741,6 +798,8 @@ default_pixels_per_inch_y (void)
 #else
 #define FRAME_EXTERNAL_MENU_BAR(f) false
 #endif
+
+/* True if frame F is currently visible.  */
 #define FRAME_VISIBLE_P(f) (f)->visible
 
 /* True if frame F is currently visible but hidden.  */
@@ -786,76 +845,115 @@ default_pixels_per_inch_y (void)
 #define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
 #define FRAME_FOCUS_FRAME(f) f->focus_frame
 
+#ifdef HAVE_WINDOW_SYSTEM
+
 /* This frame slot says whether scroll bars are currently enabled for frame F,
    and which side they are on.  */
 #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
   ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
+#define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) \
+  ((f)->horizontal_scroll_bars)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
   ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
   ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
 
+#else /* not HAVE_WINDOW_SYSTEM */
+
+/* If there is no window system, there are no scroll bars.  */
+#define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((void) f, vertical_scroll_bar_none)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((void) f, 0)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) ((void) f, 0)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) ((void) f, 0)
+#define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) ((void) f, 0)
+
+#endif /* HAVE_WINDOW_SYSTEM */
+
 /* Width that a scroll bar in frame F should have, if there is one.
    Measured in pixels.
    If scroll bars are turned off, this is still nonzero.  */
 #define FRAME_CONFIG_SCROLL_BAR_WIDTH(f) ((f)->config_scroll_bar_width)
 
+/* Height that a scroll bar in frame F should have, if there is one.
+   Measured in pixels.
+   If scroll bars are turned off, this is still nonzero.  */
+#define FRAME_CONFIG_SCROLL_BAR_HEIGHT(f) ((f)->config_scroll_bar_height)
+
 /* Width that a scroll bar in frame F should have, if there is one.
    Measured in columns (characters).
    If scroll bars are turned off, this is still nonzero.  */
 #define FRAME_CONFIG_SCROLL_BAR_COLS(f) ((f)->config_scroll_bar_cols)
 
-/* Width of a scroll bar in frame F, measured in columns (characters),
-   but only if scroll bars are on the left.  If scroll bars are on
-   the right in this frame, or there are no scroll bars, value is 0.  */
-
-#define FRAME_LEFT_SCROLL_BAR_COLS(f)                  \
-  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)          \
-   ? FRAME_CONFIG_SCROLL_BAR_COLS (f)                  \
-   : 0)
+/* Height that a scroll bar in frame F should have, if there is one.
+   Measured in lines (characters).
+   If scroll bars are turned off, this is still nonzero.  */
+#define FRAME_CONFIG_SCROLL_BAR_LINES(f) ((f)->config_scroll_bar_lines)
 
 /* Width of a left scroll bar in frame F, measured in pixels */
-
 #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f)                            \
   (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)                          \
    ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)                                 \
    : 0)
 
-/* Width of a scroll bar in frame F, measured in columns (characters),
-   but only if scroll bars are on the right.  If scroll bars are on
-   the left in this frame, or there are no scroll bars, value is 0.  */
-
-#define FRAME_RIGHT_SCROLL_BAR_COLS(f)                 \
-  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)         \
-   ? FRAME_CONFIG_SCROLL_BAR_COLS (f)                  \
-   : 0)
-
 /* Width of a right scroll bar area in frame F, measured in pixels */
-
 #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f)                           \
   (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)                         \
    ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)                                 \
    : 0)
 
-/* Actual width of a scroll bar in frame F, measured in columns.  */
+/* Width of a left scroll bar in frame F, measured in columns
+   (characters), but only if scroll bars are on the left.  If scroll
+   bars are on the right in this frame, or there are no scroll bars,
+   value is 0.  */
+#define FRAME_LEFT_SCROLL_BAR_COLS(f)                  \
+  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)          \
+   ? FRAME_CONFIG_SCROLL_BAR_COLS (f)                  \
+   : 0)
 
-#define FRAME_SCROLL_BAR_COLS(f)                       \
-  (FRAME_HAS_VERTICAL_SCROLL_BARS (f)                  \
+/* Width of a right scroll bar in frame F, measured in columns
+   (characters), but only if scroll bars are on the right.  If scroll
+   bars are on the left in this frame, or there are no scroll bars,
+   value is 0.  */
+#define FRAME_RIGHT_SCROLL_BAR_COLS(f)                 \
+  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)         \
    ? FRAME_CONFIG_SCROLL_BAR_COLS (f)                  \
    : 0)
 
-/* Actual width of a scroll bar area in frame F, measured in pixels.  */
+/* Width of a vertical scroll bar area in frame F, measured in
+   pixels.  */
+#define FRAME_SCROLL_BAR_AREA_WIDTH(f)         \
+  (FRAME_HAS_VERTICAL_SCROLL_BARS (f)          \
+   ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)         \
+   : 0)
 
-#define FRAME_SCROLL_BAR_AREA_WIDTH(f)                                 \
-  (FRAME_HAS_VERTICAL_SCROLL_BARS (f)                                  \
-   ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)                                 \
+/* Height of horizontal scroll bar area in frame F, measured in
+   pixels.  */
+#define FRAME_SCROLL_BAR_AREA_HEIGHT(f) \
+  (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) \
+   ? FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) \
+   : 0)
+
+/* Width of vertical scroll bar in frame F, measured in columns.  */
+#define FRAME_SCROLL_BAR_COLS(f)      \
+  (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
+   ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
+   : 0)
+
+/* Height of horizontal scroll bar in frame F, measured in lines.  */
+#define FRAME_SCROLL_BAR_LINES(f)      \
+  (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) \
+   ? FRAME_CONFIG_SCROLL_BAR_LINES (f) \
    : 0)
 
 /* Total width of frame F, in columns (characters),
    including the width used by scroll bars if any.  */
 #define FRAME_TOTAL_COLS(f) ((f)->total_cols)
 
+/* Total height of frame F, in lines (characters),
+   including the height used by scroll bars if any.  */
+#define FRAME_TOTAL_LINES(f) ((f)->total_lines)
+
 /* Set the character widths of frame F.  WIDTH specifies a nominal
    character text width.  */
 #define SET_FRAME_COLS(f, width)                                       \
@@ -864,8 +962,16 @@ default_pixels_per_inch_y (void)
                      + FRAME_SCROLL_BAR_COLS (f)                       \
                      + FRAME_FRINGE_COLS (f)))
 
-/* Set the pixel widths of frame F.  WIDTH specifies a nominal pixel
-   text width.  */
+/* Set the character heights of frame F.  HEIGHT specifies a nominal
+   character text height.  */
+#define SET_FRAME_LINES(f, height)                                     \
+  ((f)->text_lines = (height),                                         \
+   (f)->total_lines = ((height)                                                \
+                      + FRAME_TOP_MARGIN (f)                           \
+                      + FRAME_SCROLL_BAR_LINES (f)))
+
+/* Set the widths of frame F.  WIDTH specifies a nominal pixel text
+   width.  */
 #define SET_FRAME_WIDTH(f, width)                                      \
   ((f)->text_width = (width),                                          \
    (f)->pixel_width = ((width)                                         \
@@ -873,21 +979,23 @@ default_pixels_per_inch_y (void)
                       + FRAME_TOTAL_FRINGE_WIDTH (f)                   \
                       + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)))
 
-/* Set the pixel heights of frame F.  HEIGHT specifies a nominal pixel
-   text width.  */
+/* Set the heights of frame F.  HEIGHT specifies a nominal pixel text
+   height.  */
 #define SET_FRAME_HEIGHT(f, height)                                    \
   ((f)->text_height = (height),                                                \
    (f)->pixel_height = ((height)                                       \
-                      + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)))
+                       + FRAME_TOP_MARGIN_HEIGHT (f)                   \
+                       + FRAME_SCROLL_BAR_AREA_HEIGHT (f)              \
+                       + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)))
 
 /* Maximum + 1 legitimate value for FRAME_CURSOR_X.  */
-
 #define FRAME_CURSOR_X_LIMIT(f) \
   (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f))
 
+/* Nonzero if frame F has scroll bars.  */
 #define FRAME_SCROLL_BARS(f) (f->scroll_bars)
-
 #define FRAME_CONDEMNED_SCROLL_BARS(f) (f->condemned_scroll_bars)
+
 #define FRAME_MENU_BAR_ITEMS(f) (f->menu_bar_items)
 #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
 
@@ -992,12 +1100,16 @@ extern struct frame *make_minibuffer_frame (void);
 extern struct frame *make_frame_without_minibuffer (Lisp_Object,
                                                     struct kboard *,
                                                     Lisp_Object);
-#endif /* HAVE_WINDOW_SYSTEM */
 extern bool window_system_available (struct frame *);
+#else /* not HAVE_WINDOW_SYSTEM */
+#define window_system_available(f) ((void) (f), false)
+#endif /* HAVE_WINDOW_SYSTEM */
 extern void check_window_system (struct frame *);
-extern void frame_make_pointer_invisible (void);
-extern void frame_make_pointer_visible (void);
+extern void frame_make_pointer_invisible (struct frame *);
+extern void frame_make_pointer_visible (struct frame *);
 extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
+extern bool frame_inhibit_resize (struct frame *, bool); 
+extern void adjust_frame_size (struct frame *, int, int, int, bool);
 
 extern Lisp_Object Vframe_list;
 
@@ -1018,12 +1130,10 @@ extern Lisp_Object Vframe_list;
 /* Canonical y-unit on frame F.
    This value currently equals the line height of the frame (which is
    the height of the default font of F).  */
-
 #define FRAME_LINE_HEIGHT(F) ((F)->line_height)
 
 /* Canonical x-unit on frame F.
    This value currently equals the average width of the default font of F.  */
-
 #define FRAME_COLUMN_WIDTH(F) ((F)->column_width)
 
 /* Pixel width of areas used to display truncation marks, continuation
@@ -1036,7 +1146,6 @@ extern Lisp_Object Vframe_list;
    units of the frame.  This must currently be the case because window
    sizes aren't pixel values.  If it weren't the case, we wouldn't be
    able to split windows horizontally nicely.  */
-
 #define FRAME_FRINGE_COLS(F) ((F)->fringe_cols)
 
 /* Pixel-width of the left and right fringe.  */
@@ -1079,7 +1188,6 @@ extern Lisp_Object Vframe_list;
 /* Convert canonical value X to pixels.  F is the frame whose
    canonical char width is to be used.  X must be a Lisp integer or
    float.  Value is a C integer.  */
-
 #define FRAME_PIXEL_X_FROM_CANON_X(F, X)               \
   (INTEGERP (X)                                                \
    ? XINT (X) * FRAME_COLUMN_WIDTH (F)                 \
@@ -1088,7 +1196,6 @@ extern Lisp_Object Vframe_list;
 /* Convert canonical value Y to pixels.  F is the frame whose
    canonical character height is to be used.  X must be a Lisp integer
    or float.  Value is a C integer.  */
-
 #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y)               \
   (INTEGERP (Y)                                                \
    ? XINT (Y) * FRAME_LINE_HEIGHT (F)                  \
@@ -1098,7 +1205,6 @@ extern Lisp_Object Vframe_list;
    canonical character width is to be used.  X is a C integer.  Result
    is a Lisp float if X is not a multiple of the canon width,
    otherwise it's a Lisp integer.  */
-
 #define FRAME_CANON_X_FROM_PIXEL_X(F, X)                       \
   ((X) % FRAME_COLUMN_WIDTH (F) != 0                           \
    ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F))                \
@@ -1108,7 +1214,6 @@ extern Lisp_Object Vframe_list;
    canonical character height is to be used.  Y is a C integer.
    Result is a Lisp float if Y is not a multiple of the canon width,
    otherwise it's a Lisp integer.  */
-
 #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y)                       \
   ((Y) % FRAME_LINE_HEIGHT (F)                                 \
    ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F))         \
@@ -1122,7 +1227,6 @@ extern Lisp_Object Vframe_list;
 
    Return the upper/left pixel position of the character cell on frame F
    at ROW/COL.  */
-
 #define FRAME_LINE_TO_PIXEL_Y(f, row)                                  \
   (((row) < FRAME_TOP_MARGIN (f) ? 0 : FRAME_INTERNAL_BORDER_WIDTH (f))        \
    + (row) * FRAME_LINE_HEIGHT (f))
@@ -1133,25 +1237,27 @@ extern Lisp_Object Vframe_list;
 
 /* Return the pixel width/height of frame F if it has
    COLS columns/LINES rows.  */
-
 #define FRAME_TEXT_COLS_TO_PIXEL_WIDTH(f, cols) \
-  (FRAME_COL_TO_PIXEL_X (f, cols)              \
+  ((cols) * FRAME_COLUMN_WIDTH (f)             \
    + FRAME_SCROLL_BAR_AREA_WIDTH (f)           \
    + FRAME_TOTAL_FRINGE_WIDTH (f)              \
-   + FRAME_INTERNAL_BORDER_WIDTH (f))
+   + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
 
 #define FRAME_TEXT_LINES_TO_PIXEL_HEIGHT(f, lines) \
   ((lines) * FRAME_LINE_HEIGHT (f)                \
+   + FRAME_TOP_MARGIN_HEIGHT (f)                  \
+   + FRAME_SCROLL_BAR_AREA_HEIGHT (f)             \
    + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
 
 /* Return the row/column (zero-based) of the character cell containing
    the pixel on FRAME at Y/X.  */
-
 #define FRAME_PIXEL_Y_TO_LINE(f, y)                                    \
   (((y) < FRAME_TOP_MARGIN_HEIGHT (f)                                  \
     ? (y)                                                              \
-    : ((y) < FRAME_TOP_MARGIN_HEIGHT (f) + FRAME_INTERNAL_BORDER_WIDTH (f) \
-       ? (y) - (FRAME_TOP_MARGIN_HEIGHT (f) + FRAME_INTERNAL_BORDER_WIDTH (f) \
+    : ((y) < (FRAME_TOP_MARGIN_HEIGHT (f)                              \
+             + FRAME_INTERNAL_BORDER_WIDTH (f))                        \
+       ? (y) - (FRAME_TOP_MARGIN_HEIGHT (f)                            \
+               + FRAME_INTERNAL_BORDER_WIDTH (f)                       \
                /* Arrange for the division to round down.  */          \
                + FRAME_LINE_HEIGHT (f) - 1)                            \
        : (y) - FRAME_INTERNAL_BORDER_WIDTH (f)))                       \
@@ -1162,21 +1268,23 @@ extern Lisp_Object Vframe_list;
    / FRAME_COLUMN_WIDTH (f))
 
 /* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
-   frame F?  */
-
+   frame F (so we round down)?  */
 #define FRAME_PIXEL_WIDTH_TO_TEXT_COLS(f, width)                       \
-  (FRAME_PIXEL_X_TO_COL (f, ((width)                                   \
-                            - FRAME_INTERNAL_BORDER_WIDTH (f)          \
-                            - FRAME_TOTAL_FRINGE_WIDTH (f)             \
-                            - FRAME_SCROLL_BAR_AREA_WIDTH (f))))       \
+  (((width)                                                            \
+    - FRAME_TOTAL_FRINGE_WIDTH (f)                                     \
+    - FRAME_SCROLL_BAR_AREA_WIDTH (f)                                  \
+    - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))                             \
+   / FRAME_COLUMN_WIDTH (f))                                           \
 
 #define FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(f, height)                    \
-  (FRAME_PIXEL_Y_TO_LINE (f, ((height)                                 \
-                             - FRAME_INTERNAL_BORDER_WIDTH (f))))
+  (((height)                                                           \
+    - FRAME_TOP_MARGIN_HEIGHT (f)                                      \
+    - FRAME_SCROLL_BAR_AREA_HEIGHT (f)                                 \
+    - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))                             \
+   / FRAME_LINE_HEIGHT (f))
 
 /* Return the pixel width/height of frame F with a text size of
-   width/height.  */
-
+   width/heigh.  */
 #define FRAME_TEXT_TO_PIXEL_WIDTH(f, width)      \
   ((width)                                       \
    + FRAME_SCROLL_BAR_AREA_WIDTH (f)             \
@@ -1184,11 +1292,13 @@ extern Lisp_Object Vframe_list;
    + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
 
 #define FRAME_TEXT_TO_PIXEL_HEIGHT(f, height)       \
-  ((height) + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
+  ((height)                                         \
+   + FRAME_TOP_MARGIN_HEIGHT (f)                    \
+   + FRAME_SCROLL_BAR_AREA_HEIGHT (f)               \
+   + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
 
 /* Return the text width/height of frame F with a pixel size of
    width/height.  */
-
 #define FRAME_PIXEL_TO_TEXT_WIDTH(f, width)      \
   ((width)                                       \
    - FRAME_SCROLL_BAR_AREA_WIDTH (f)             \
@@ -1196,15 +1306,26 @@ extern Lisp_Object Vframe_list;
    - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
 
 #define FRAME_PIXEL_TO_TEXT_HEIGHT(f, height)          \
-  ((height) - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
+  ((height)                                            \
+   - FRAME_TOP_MARGIN_HEIGHT (f)                       \
+   - FRAME_SCROLL_BAR_AREA_HEIGHT (f)                  \
+   - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))              
+
+/* Return the width/height reserved for the windows of frame F.  */
+#define FRAME_WINDOWS_WIDTH(f)                 \
+  (FRAME_PIXEL_WIDTH (f)                       \
+   - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
 
-/* Value is the smallest width of any character in any font on frame F.  */
+#define FRAME_WINDOWS_HEIGHT(f)                        \
+  (FRAME_PIXEL_HEIGHT (f)                      \
+   - FRAME_TOP_MARGIN_HEIGHT (f)               \
+   - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
 
+/* Value is the smallest width of any character in any font on frame F.  */
 #define FRAME_SMALLEST_CHAR_WIDTH(f)           \
   FRAME_DISPLAY_INFO (f)->smallest_char_width
 
 /* Value is the smallest height of any font on frame F.  */
-
 #define FRAME_SMALLEST_FONT_HEIGHT(f)          \
   FRAME_DISPLAY_INFO (f)->smallest_font_height
 
@@ -1217,7 +1338,6 @@ extern Lisp_Object Qborder_color, Qborder_width;
 extern Lisp_Object Qbuffer_predicate;
 extern Lisp_Object Qcursor_color, Qcursor_type;
 extern Lisp_Object Qfont;
-extern Lisp_Object Qbackground_color, Qforeground_color;
 extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top;
 extern Lisp_Object Qinternal_border_width;
 extern Lisp_Object Qright_divider_width, Qbottom_divider_width;
@@ -1228,6 +1348,7 @@ extern Lisp_Object Qname, Qtitle;
 extern Lisp_Object Qparent_id;
 extern Lisp_Object Qunsplittable, Qvisibility;
 extern Lisp_Object Qscroll_bar_width, Qvertical_scroll_bars;
+extern Lisp_Object Qscroll_bar_height, Qhorizontal_scroll_bars;
 extern Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
 extern Lisp_Object Qscreen_gamma;
 extern Lisp_Object Qline_spacing;
@@ -1247,7 +1368,7 @@ extern Lisp_Object Qdisplay_type;
 
 extern Lisp_Object Qx_resource_name;
 
-extern Lisp_Object Qleft, Qright, Qtop, Qbox, Qbottom;
+extern Lisp_Object Qtop, Qbox, Qbottom;
 extern Lisp_Object Qdisplay;
 
 extern Lisp_Object Qrun_hook_with_args;
@@ -1257,30 +1378,20 @@ extern Lisp_Object Qrun_hook_with_args;
 /* The class of this X application.  */
 #define EMACS_CLASS "Emacs"
 
-/* These are in xterm.c, w32term.c, etc.  */
-
 extern void x_set_scroll_bar_default_width (struct frame *);
+extern void x_set_scroll_bar_default_height (struct frame *);
 extern void x_set_offset (struct frame *, int, int, int);
 extern void x_wm_set_size_hint (struct frame *f, long flags, bool user_position);
-
 extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
-
-
 extern Lisp_Object Qface_set_after_frame_default;
-
-#ifdef HAVE_NTGUI
-extern void x_fullscreen_adjust (struct frame *f, int *, int *,
-                                 int *, int *);
-#endif
-
 extern void x_set_frame_parameters (struct frame *, Lisp_Object);
-
 extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_screen_gamma (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_font (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_font_backend (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_fringe_width (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_left_fringe (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_right_fringe (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_border_width (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_internal_border_width (struct frame *, Lisp_Object,
                                          Lisp_Object);
@@ -1292,10 +1403,10 @@ extern void x_set_visibility (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_autoraise (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_autolower (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_unsplittable (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_vertical_scroll_bars (struct frame *, Lisp_Object,
-                                        Lisp_Object);
-extern void x_set_scroll_bar_width (struct frame *, Lisp_Object,
-                                    Lisp_Object);
+extern void x_set_vertical_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_horizontal_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_scroll_bar_width (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_scroll_bar_height (struct frame *, Lisp_Object, Lisp_Object);
 
 extern long x_figure_window_size (struct frame *, Lisp_Object, bool);
 
@@ -1313,13 +1424,11 @@ extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
 extern void x_set_window_size (struct frame *f, int change_grav,
                               int width, int height, bool pixelwise);
 extern Lisp_Object x_get_focus_frame (struct frame *);
-extern void x_set_mouse_position (struct frame *f, int h, int v);
-extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
+extern void frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
 extern void x_make_frame_visible (struct frame *f);
 extern void x_make_frame_invisible (struct frame *f);
 extern void x_iconify_frame (struct frame *f);
 extern void x_set_frame_alpha (struct frame *f);
-extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_activate_menubar (struct frame *);
 extern void x_real_positions (struct frame *, int *, int *);
@@ -1354,7 +1463,6 @@ x_set_bitmap_icon (struct frame *f)
 }
 
 #endif /* !HAVE_NS */
-
 #endif /* HAVE_WINDOW_SYSTEM */
 
 INLINE void
index 6325de4128ecedea90dd8c21b946c23661e00635..3c0e883b2e98f3f355720c6b3be95e1dd623c870 100644 (file)
@@ -474,15 +474,12 @@ static struct fringe_bitmap standard_bitmaps[] =
 
 #define NO_FRINGE_BITMAP 0
 #define UNDEF_FRINGE_BITMAP 1
-#define MAX_STANDARD_FRINGE_BITMAPS (sizeof (standard_bitmaps)/sizeof (standard_bitmaps[0]))
+#define MAX_STANDARD_FRINGE_BITMAPS ARRAYELTS (standard_bitmaps)
 
 static struct fringe_bitmap **fringe_bitmaps;
 static Lisp_Object *fringe_faces;
 static int max_fringe_bitmaps;
 
-#ifndef HAVE_NS
-static
-#endif
 int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
 
 
@@ -637,7 +634,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
       return;
     }
 
-  PREPARE_FACE_FOR_DISPLAY (f, p.face);
+  prepare_face_for_display (f, p.face);
 
   /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill
      the fringe.  */
@@ -1332,98 +1329,6 @@ update_window_fringes (struct window *w, bool keep_current_p)
 }
 
 
-/* Compute actual fringe widths for frame F.
-
-   If REDRAW is 1, redraw F if the fringe settings was actually
-   modified and F is visible.
-
-   Since the combined left and right fringe must occupy an integral
-   number of columns, we may need to add some pixels to each fringe.
-   Typically, we add an equal amount (+/- 1 pixel) to each fringe,
-   but a negative width value is taken literally (after negating it).
-
-   We never make the fringes narrower than specified.
-*/
-
-void
-compute_fringe_widths (struct frame *f, bool redraw_p)
-{
-  int o_left = FRAME_LEFT_FRINGE_WIDTH (f);
-  int o_right = FRAME_RIGHT_FRINGE_WIDTH (f);
-  int o_cols = FRAME_FRINGE_COLS (f);
-
-  Lisp_Object left_fringe = Fassq (Qleft_fringe, f->param_alist);
-  Lisp_Object right_fringe = Fassq (Qright_fringe, f->param_alist);
-  int left_fringe_width, right_fringe_width;
-
-  if (!NILP (left_fringe))
-    left_fringe = Fcdr (left_fringe);
-  if (!NILP (right_fringe))
-    right_fringe = Fcdr (right_fringe);
-
-  left_fringe_width = ((NILP (left_fringe) || !INTEGERP (left_fringe)) ? 8 :
-                      XINT (left_fringe));
-  right_fringe_width = ((NILP (right_fringe) || !INTEGERP (right_fringe)) ? 8 :
-                       XINT (right_fringe));
-
-  if (left_fringe_width || right_fringe_width)
-    {
-      int left_wid = eabs (left_fringe_width);
-      int right_wid = eabs (right_fringe_width);
-      int conf_wid = left_wid + right_wid;
-      int font_wid = FRAME_COLUMN_WIDTH (f);
-      int cols = (left_wid + right_wid + font_wid-1) / font_wid;
-      int real_wid = cols * font_wid;
-      if (left_wid && right_wid)
-       {
-         if (left_fringe_width < 0)
-           {
-             /* Left fringe width is fixed, adjust right fringe if necessary */
-             FRAME_LEFT_FRINGE_WIDTH (f) = left_wid;
-             FRAME_RIGHT_FRINGE_WIDTH (f) = real_wid - left_wid;
-           }
-         else if (right_fringe_width < 0)
-           {
-             /* Right fringe width is fixed, adjust left fringe if necessary */
-             FRAME_LEFT_FRINGE_WIDTH (f) = real_wid - right_wid;
-             FRAME_RIGHT_FRINGE_WIDTH (f) = right_wid;
-           }
-         else
-           {
-             /* Adjust both fringes with an equal amount.
-                Note that we are doing integer arithmetic here, so don't
-                lose a pixel if the total width is an odd number.  */
-             int fill = real_wid - conf_wid;
-             FRAME_LEFT_FRINGE_WIDTH (f) = left_wid + fill/2;
-             FRAME_RIGHT_FRINGE_WIDTH (f) = right_wid + fill - fill/2;
-           }
-       }
-      else if (left_fringe_width)
-       {
-         FRAME_LEFT_FRINGE_WIDTH (f) = real_wid;
-         FRAME_RIGHT_FRINGE_WIDTH (f) = 0;
-       }
-      else
-       {
-         FRAME_LEFT_FRINGE_WIDTH (f) = 0;
-         FRAME_RIGHT_FRINGE_WIDTH (f) = real_wid;
-       }
-      FRAME_FRINGE_COLS (f) = cols;
-    }
-  else
-    {
-      FRAME_LEFT_FRINGE_WIDTH (f) = 0;
-      FRAME_RIGHT_FRINGE_WIDTH (f) = 0;
-      FRAME_FRINGE_COLS (f) = 0;
-    }
-
-  if (redraw_p && FRAME_VISIBLE_P (f))
-    if (o_left != FRAME_LEFT_FRINGE_WIDTH (f) ||
-       o_right != FRAME_RIGHT_FRINGE_WIDTH (f) ||
-       o_cols != FRAME_FRINGE_COLS (f))
-      redraw_frame (f);
-}
-
 
 /* Free resources used by a user-defined bitmap.  */
 
@@ -1574,13 +1479,7 @@ If BITMAP already exists, the existing definition is replaced.  */)
   int fill1 = 0, fill2 = 0;
 
   CHECK_SYMBOL (bitmap);
-
-  if (STRINGP (bits))
-    h = SCHARS (bits);
-  else if (VECTORP (bits))
-    h = ASIZE (bits);
-  else
-    wrong_type_argument (Qsequencep, bits);
+  h = CHECK_VECTOR_OR_STRING (bits);
 
   if (NILP (height))
     fb.height = h;
index 112adad8a10dcf578e19447b57cff7d6d0eeb7be..419274a30aa4a5066615ab3f9284cdc200a40838 100644 (file)
@@ -87,8 +87,6 @@ static Lisp_Object ftfont_lookup_cache (Lisp_Object,
 
 static void ftfont_filter_properties (Lisp_Object font, Lisp_Object alist);
 
-Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object);
-
 #define SYMBOL_FcChar8(SYM) (FcChar8 *) SDATA (SYMBOL_NAME (SYM))
 
 static struct
@@ -540,8 +538,6 @@ struct font_driver ftfont_driver =
     NULL,                      /* draw */
     ftfont_get_bitmap,
     NULL,                      /* free_bitmap */
-    NULL,                      /* get_outline */
-    NULL,                      /* free_outline */
     ftfont_anchor_point,
 #ifdef HAVE_LIBOTF
     ftfont_otf_capability,
@@ -1187,8 +1183,7 @@ ftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
   Lisp_Object val, filename, idx, cache, font_object;
   bool scalable;
   int spacing;
-  char name[256];
-  int i, len;
+  int i;
   int upEM;
 
   val = assq_no_quit (QCfont_entity, AREF (entity, FONT_EXTRA_INDEX));
@@ -1225,19 +1220,9 @@ ftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
       return Qnil;
     }
 
-  font_object = font_make_object (VECSIZE (struct ftfont_info), entity, size);
-  ASET (font_object, FONT_TYPE_INDEX, Qfreetype);
-  len = font_unparse_xlfd (entity, size, name, 256);
-  if (len > 0)
-    ASET (font_object, FONT_NAME_INDEX, make_string (name, len));
-  len = font_unparse_fcname (entity, size, name, 256);
-  if (len > 0)
-    ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len));
-  else
-    ASET (font_object, FONT_FULLNAME_INDEX,
-         AREF (font_object, FONT_NAME_INDEX));
+  font_object = font_build_object (VECSIZE (struct ftfont_info),
+                                  Qfreetype, entity, size);
   ASET (font_object, FONT_FILE_INDEX, filename);
-  ASET (font_object, FONT_FORMAT_INDEX, ftfont_font_format (NULL, filename));
   font = XFONT_OBJECT (font_object);
   ftfont_info = (struct ftfont_info *) font;
   ftfont_info->ft_size = ft_face->size;
@@ -2601,46 +2586,6 @@ ftfont_variation_glyphs (struct font *font, int c, unsigned variations[256])
 #endif /* HAVE_OTF_GET_VARIATION_GLYPHS */
 #endif /* HAVE_LIBOTF */
 
-Lisp_Object
-ftfont_font_format (FcPattern *pattern, Lisp_Object filename)
-{
-  FcChar8 *str;
-
-#ifdef FC_FONTFORMAT
-  if (pattern)
-    {
-      if (FcPatternGetString (pattern, FC_FONTFORMAT, 0, &str) != FcResultMatch)
-       return Qnil;
-      if (strcmp ((char *) str, "TrueType") == 0)
-       return intern ("truetype");
-      if (strcmp ((char *) str, "Type 1") == 0)
-       return intern ("type1");
-      if (strcmp ((char *) str, "PCF") == 0)
-       return intern ("pcf");
-      if (strcmp ((char *) str, "BDF") == 0)
-       return intern ("bdf");
-    }
-#endif  /* FC_FONTFORMAT */
-  if (STRINGP (filename))
-    {
-      int len = SBYTES (filename);
-
-      if (len >= 4)
-       {
-         str = (FcChar8 *) (SDATA (filename) + len - 4);
-         if (xstrcasecmp ((char *) str, ".ttf") == 0)
-           return intern ("truetype");
-         if (xstrcasecmp ((char *) str, ".pfb") == 0)
-           return intern ("type1");
-         if (xstrcasecmp ((char *) str, ".pcf") == 0)
-           return intern ("pcf");
-         if (xstrcasecmp ((char *) str, ".bdf") == 0)
-           return intern ("bdf");
-       }
-    }
-  return intern ("unknown");
-}
-
 static const char *const ftfont_booleans [] = {
   ":antialias",
   ":hinting",
index 8c8674f3440a6b3eb524a2c20c92ca0caa4130c0..210b634c0942befd5872cbcffca2cc9785c0594c 100644 (file)
@@ -36,7 +36,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif /* HAVE_M17N_FLT */
 #endif /* HAVE_LIBOTF */
 
-extern Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object);
 extern FcCharSet *ftfont_get_fc_charset (Lisp_Object);
 
 #endif /* EMACS_FTFONT_H */
index 9db7cbceb66ae818828d6abb20755617d4692680..63e3477ebf4d00d87e50587696f197a85ebcc2cb 100644 (file)
@@ -37,9 +37,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 static Lisp_Object Qftx;
 
-#if defined HAVE_XFT || !defined HAVE_FREETYPE
-static
-#endif
 struct font_driver ftxfont_driver;
 
 struct ftxfont_frame_data
@@ -62,7 +59,7 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr
   XColor color;
   XGCValues xgcv;
   int i;
-  struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver);
+  struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx);
   struct ftxfont_frame_data *prev = NULL, *this = NULL, *new;
 
   if (data)
@@ -81,19 +78,11 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr
        }
     }
 
-  new = malloc (sizeof *new);
-  if (! new)
-    return NULL;
+  new = xmalloc (sizeof *new);
   new->next = this;
   if (prev)
-    {
       prev->next = new;
-    }
-  else if (font_put_frame_data (f, &ftxfont_driver, new) < 0)
-    {
-      free (new);
-      return NULL;
-    }
+  font_put_frame_data (f, Qftx, new);
 
   new->colors[0].pixel = background;
   new->colors[1].pixel = foreground;
@@ -126,8 +115,8 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr
       if (prev)
        prev->next = new->next;
       else if (data)
-       font_put_frame_data (f, &ftxfont_driver, new->next);
-      free (new);
+       font_put_frame_data (f, Qftx, new->next);
+      xfree (new);
       return NULL;
     }
   return new->gcs;
@@ -340,7 +329,7 @@ ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y,
 static int
 ftxfont_end_for_frame (struct frame *f)
 {
-  struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver);
+  struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx);
 
   block_input ();
   while (data)
@@ -350,11 +339,11 @@ ftxfont_end_for_frame (struct frame *f)
 
       for (i = 0; i < 6; i++)
        XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]);
-      free (data);
+      xfree (data);
       data = next;
     }
   unblock_input ();
-  font_put_frame_data (f, &ftxfont_driver, NULL);
+  font_put_frame_data (f, Qftx, NULL);
   return 0;
 }
 
index 977abbdbbbd2b664310434f96b25007fbdc4227d..ab1dfd07db2ac25a12b7371be730902cb3775398 100644 (file)
@@ -51,12 +51,12 @@ extern "C"
 
 
 /* Allocate SIZE bytes of memory.  */
-extern void *malloc (size_t size);
+extern void *malloc (size_t size) ATTRIBUTE_MALLOC_SIZE ((1));
 /* Re-allocate the previously allocated block
    in ptr, making the new block SIZE bytes long.  */
-extern void *realloc (void *ptr, size_t size);
+extern void *realloc (void *ptr, size_t size) ATTRIBUTE_ALLOC_SIZE ((2));
 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0.  */
-extern void *calloc (size_t nmemb, size_t size);
+extern void *calloc (size_t nmemb, size_t size) ATTRIBUTE_MALLOC_SIZE ((1,2));
 /* Free a block allocated by `malloc', `realloc' or `calloc'.  */
 extern void free (void *ptr);
 
index 03c29d03014646286896b38e98606bdfe0eaf720..5d48f78a6d4c53d9d7d7bda443f6072cf441c50e 100644 (file)
@@ -56,7 +56,7 @@ static Lisp_Object QCgnutls_bootprop_verify_error;
 static Lisp_Object QCgnutls_bootprop_callbacks_verify;
 
 static void gnutls_log_function (int, const char *);
-static void gnutls_log_function2 (int, const char*, const char*);
+static void gnutls_log_function2 (int, const char *, const char *);
 #ifdef HAVE_GNUTLS3
 static void gnutls_audit_log_function (gnutls_session_t, const char *);
 #endif
@@ -267,7 +267,7 @@ init_gnutls_functions (void)
 #ifdef HAVE_GNUTLS3
 /* Function to log a simple audit message.  */
 static void
-gnutls_audit_log_function (gnutls_session_t session, const charstring)
+gnutls_audit_log_function (gnutls_session_t session, const char *string)
 {
   if (global_gnutls_log_level >= 1)
     {
@@ -278,21 +278,21 @@ gnutls_audit_log_function (gnutls_session_t session, const char* string)
 
 /* Function to log a simple message.  */
 static void
-gnutls_log_function (int level, const charstring)
+gnutls_log_function (int level, const char *string)
 {
   message ("gnutls.c: [%d] %s", level, string);
 }
 
 /* Function to log a message and a string.  */
 static void
-gnutls_log_function2 (int level, const char* string, const char* extra)
+gnutls_log_function2 (int level, const char *string, const char *extra)
 {
   message ("gnutls.c: [%d] %s %s", level, string, extra);
 }
 
 /* Function to log a message and an integer.  */
 static void
-gnutls_log_function2i (int level, const charstring, int extra)
+gnutls_log_function2i (int level, const char *string, int extra)
 {
   message ("gnutls.c: [%d] %s %d", level, string, extra);
 }
@@ -336,8 +336,8 @@ emacs_gnutls_handshake (struct Lisp_Process *proc)
         in.  For an Emacs process socket, infd and outfd are the
         same but we use this two-argument version for clarity.  */
       fn_gnutls_transport_set_ptr2 (state,
-                                   (gnutls_transport_ptr_t) (long) proc->infd,
-                                   (gnutls_transport_ptr_t) (long) proc->outfd);
+                                   (void *) (intptr_t) proc->infd,
+                                   (void *) (intptr_t) proc->outfd);
 #endif
 
       proc->gnutls_initstage = GNUTLS_STAGE_TRANSPORT_POINTERS_SET;
@@ -794,7 +794,7 @@ one trustfile (usually a CA bundle).  */)
   Lisp_Object global_init;
   char const *priority_string_ptr = "NORMAL"; /* default priority string.  */
   unsigned int peer_verification;
-  charc_hostname;
+  char *c_hostname;
 
   /* Placeholders for the property list elements.  */
   Lisp_Object priority_string;
index cebff68614ff7a8cfbfd2e97294a5d2720bc4301..b18e5f325e1d86b573c82a4a05de2f1e7d1b8bd0 100644 (file)
@@ -30,6 +30,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "blockinput.h"
 #include "syssignal.h"
 #include "window.h"
+#include "buffer.h"
 #include "gtkutil.h"
 #include "termhooks.h"
 #include "keyboard.h"
@@ -114,6 +115,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define XG_BIN_CHILD(x) gtk_bin_get_child (GTK_BIN (x))
 
 static void update_theme_scrollbar_width (void);
+static void update_theme_scrollbar_height (void);
 
 #define TB_INFO_KEY "xg_frame_tb_info"
 struct xg_frame_tb_info
@@ -221,57 +223,6 @@ xg_display_close (Display *dpy)
 /***********************************************************************
                       Utility functions
  ***********************************************************************/
-/* The next two variables and functions are taken from lwlib.  */
-static widget_value *widget_value_free_list;
-static int malloc_cpt;
-
-/* Allocate a widget_value structure, either by taking one from the
-   widget_value_free_list or by malloc:ing a new one.
-
-   Return a pointer to the allocated structure.  */
-
-widget_value *
-malloc_widget_value (void)
-{
-  widget_value *wv;
-  if (widget_value_free_list)
-    {
-      wv = widget_value_free_list;
-      widget_value_free_list = wv->free_list;
-      wv->free_list = 0;
-    }
-  else
-    {
-      wv = xmalloc (sizeof *wv);
-      malloc_cpt++;
-    }
-  memset (wv, 0, sizeof (widget_value));
-  return wv;
-}
-
-/* This is analogous to free.  It frees only what was allocated
-   by malloc_widget_value, and no substructures.  */
-
-void
-free_widget_value (widget_value *wv)
-{
-  if (wv->free_list)
-    emacs_abort ();
-
-  if (malloc_cpt > 25)
-    {
-      /* When the number of already allocated cells is too big,
-        We free it.  */
-      xfree (wv);
-      malloc_cpt--;
-    }
-  else
-    {
-      wv->free_list = widget_value_free_list;
-      widget_value_free_list = wv;
-    }
-}
-
 
 /* Create and return the cursor to be used for popup menus and
    scroll bars on display DPY.  */
@@ -871,7 +822,7 @@ xg_set_geometry (struct frame *f)
 /* Clear under internal border if any.  As we use a mix of Gtk+ and X calls
    and use a GtkFixed widget, this doesn't happen automatically.  */
 
-static void
+void
 xg_clear_under_internal_border (struct frame *f)
 {
   if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
@@ -933,6 +884,8 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
       change_frame_size (f, width, height, 0, 1, 0, 1);
       SET_FRAME_GARBAGED (f);
       cancel_mouse_face (f);
+
+      do_pending_window_change (0);
     }
 }
 
@@ -977,7 +930,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
       x_wait_for_event (f, ConfigureNotify);
     }
   else
-    change_frame_size (f, width, height, 0, 1, 0, 1);
+    adjust_frame_size (f, -1, -1, 5, 0);
 }
 
 /* Handle height/width changes (i.e. add/remove/move menu/toolbar).
@@ -1067,6 +1020,7 @@ style_changed_cb (GObject *go,
   kbd_buffer_store_event (&event);
 
   update_theme_scrollbar_width ();
+  update_theme_scrollbar_height ();
 
   /* If scroll bar width changed, we need set the new size on all frames
      on this display.  */
@@ -1081,6 +1035,7 @@ style_changed_cb (GObject *go,
               && FRAME_X_DISPLAY (f) == dpy)
             {
               x_set_scroll_bar_default_width (f);
+              x_set_scroll_bar_default_height (f);
               xg_frame_set_char_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f));
             }
         }
@@ -1364,7 +1319,6 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
   base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1)
     + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
 
-  check_frame_size (f, &min_cols, &min_rows, 0);
   if (min_cols > 0) --min_cols; /* We used one col in base_width = ... 1); */
   if (min_rows > 0) --min_rows; /* We used one row in base_height = ... 1); */
 
@@ -3424,7 +3378,7 @@ xg_event_is_for_menubar (struct frame *f, const XEvent *event)
   if (! (event->xbutton.x >= 0
          && event->xbutton.x < FRAME_PIXEL_WIDTH (f)
          && event->xbutton.y >= 0
-         && event->xbutton.y < f->output_data.x->menubar_height
+         && event->xbutton.y < FRAME_MENUBAR_HEIGHT (f)
          && event->xbutton.same_screen))
     return 0;
 
@@ -3469,9 +3423,9 @@ xg_event_is_for_menubar (struct frame *f, const XEvent *event)
 
 bool xg_ignore_gtk_scrollbar;
 
-/* The width of the scroll bar for the current theme.  */
-
+/* Width and height of scroll bars for the current theme.  */
 static int scroll_bar_width_for_theme;
+static int scroll_bar_height_for_theme;
 
 /* Xlib's `Window' fits in 32 bits.  But we want to store pointers, and they
    may be larger than 32 bits.  Keep a mapping from integer index to widget
@@ -3574,12 +3528,41 @@ update_theme_scrollbar_width (void)
   scroll_bar_width_for_theme = w;
 }
 
+static void
+update_theme_scrollbar_height (void)
+{
+#ifdef HAVE_GTK3
+  GtkAdjustment *hadj;
+#else
+  GtkObject *hadj;
+#endif
+  GtkWidget *wscroll;
+  int w = 0, b = 0;
+
+  hadj = gtk_adjustment_new (YG_SB_MIN, YG_SB_MIN, YG_SB_MAX, 0.1, 0.1, 0.1);
+  wscroll = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (hadj));
+  g_object_ref_sink (G_OBJECT (wscroll));
+  gtk_widget_style_get (wscroll, "slider-width", &w, "trough-border", &b, NULL);
+  gtk_widget_destroy (wscroll);
+  g_object_unref (G_OBJECT (wscroll));
+  w += 2*b;
+  if (w < 12) w = 12;
+  scroll_bar_height_for_theme = w;
+}
+
 int
 xg_get_default_scrollbar_width (void)
 {
   return scroll_bar_width_for_theme;
 }
 
+int
+xg_get_default_scrollbar_height (void)
+{
+  /* Apparently there's no default height for themes.  */
+  return scroll_bar_width_for_theme;
+}
+
 /* Return the scrollbar id for X Window WID on display DPY.
    Return -1 if WID not in id_to_widget.  */
 
@@ -3678,6 +3661,74 @@ xg_create_scroll_bar (struct frame *f,
   xg_set_cursor (webox, FRAME_DISPLAY_INFO (f)->xg_cursor);
 
   bar->x_window = scroll_id;
+  bar->horizontal = 0;
+}
+
+/* Create a horizontal scroll bar widget for frame F.  Store the scroll
+   bar in BAR.  SCROLL_CALLBACK is the callback to invoke when the value
+   of the bar changes.  END_CALLBACK is the callback to invoke when
+   scrolling ends.  SCROLL_BAR_NAME is the name we use for the scroll
+   bar.  Can be used to set resources for the widget.  */
+
+void
+xg_create_horizontal_scroll_bar (struct frame *f,
+                                struct scroll_bar *bar,
+                                GCallback scroll_callback,
+                                GCallback end_callback,
+                                const char *scroll_bar_name)
+{
+  GtkWidget *wscroll;
+  GtkWidget *webox;
+  intptr_t scroll_id;
+#ifdef HAVE_GTK3
+  GtkAdjustment *hadj;
+#else
+  GtkObject *hadj;
+#endif
+
+  /* Page, step increment values are not so important here, they
+     will be corrected in x_set_toolkit_scroll_bar_thumb. */
+  hadj = gtk_adjustment_new (YG_SB_MIN, YG_SB_MIN, YG_SB_MAX,
+                             0.1, 0.1, 0.1);
+
+  wscroll = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (hadj));
+  webox = gtk_event_box_new ();
+  gtk_widget_set_name (wscroll, scroll_bar_name);
+#ifndef HAVE_GTK3
+  gtk_range_set_update_policy (GTK_RANGE (wscroll), GTK_UPDATE_CONTINUOUS);
+#endif
+  g_object_set_data (G_OBJECT (wscroll), XG_FRAME_DATA, (gpointer)f);
+
+  scroll_id = xg_store_widget_in_map (wscroll);
+
+  g_signal_connect (G_OBJECT (wscroll),
+                    "destroy",
+                    G_CALLBACK (xg_gtk_scroll_destroy),
+                    (gpointer) scroll_id);
+  g_signal_connect (G_OBJECT (wscroll),
+                    "change-value",
+                    scroll_callback,
+                    (gpointer) bar);
+  g_signal_connect (G_OBJECT (wscroll),
+                    "button-release-event",
+                    end_callback,
+                    (gpointer) bar);
+
+  /* The scroll bar widget does not draw on a window of its own.  Instead
+     it draws on the parent window, in this case the edit widget.  So
+     whenever the edit widget is cleared, the scroll bar needs to redraw
+     also, which causes flicker.  Put an event box between the edit widget
+     and the scroll bar, so the scroll bar instead draws itself on the
+     event box window.  */
+  gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), webox, -1, -1);
+  gtk_container_add (GTK_CONTAINER (webox), wscroll);
+
+
+  /* Set the cursor to an arrow.  */
+  xg_set_cursor (webox, FRAME_DISPLAY_INFO (f)->xg_cursor);
+
+  bar->x_window = scroll_id;
+  bar->horizontal = 1;
 }
 
 /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F.  */
@@ -3760,6 +3811,73 @@ xg_update_scrollbar_pos (struct frame *f,
     }
 }
 
+
+/* Update the position of the horizontal scroll bar represented by SCROLLBAR_ID
+   in frame F.
+   TOP/LEFT are the new pixel positions where the bar shall appear.
+   WIDTH, HEIGHT is the size in pixels the bar shall have.  */
+
+void
+xg_update_horizontal_scrollbar_pos (struct frame *f,
+                                   ptrdiff_t scrollbar_id,
+                                   int top,
+                                   int left,
+                                   int width,
+                                   int height)
+{
+
+  GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id);
+
+  if (wscroll)
+    {
+      GtkWidget *wfixed = f->output_data.x->edit_widget;
+      GtkWidget *wparent = gtk_widget_get_parent (wscroll);
+      gint msl;
+
+      /* Clear out old position.  */
+      int oldx = -1, oldy = -1, oldw, oldh;
+      if (gtk_widget_get_parent (wparent) == wfixed)
+        {
+          gtk_container_child_get (GTK_CONTAINER (wfixed), wparent,
+                                   "x", &oldx, "y", &oldy, NULL);
+          gtk_widget_get_size_request (wscroll, &oldw, &oldh);
+        }
+
+      /* Move and resize to new values.  */
+      gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top);
+      gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL);
+      if (msl > width)
+        {
+          /* No room.  Hide scroll bar as some themes output a warning if
+             the width is less than the min size.  */
+          gtk_widget_hide (wparent);
+          gtk_widget_hide (wscroll);
+        }
+      else
+        {
+          gtk_widget_show_all (wparent);
+          gtk_widget_set_size_request (wscroll, width, height);
+        }
+      gtk_widget_queue_draw (wfixed);
+      gdk_window_process_all_updates ();
+      if (oldx != -1 && oldw > 0 && oldh > 0)
+       /* Clear under old scroll bar position.  This must be done after
+          the gtk_widget_queue_draw and gdk_window_process_all_updates
+          above.  */
+       x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                     oldx, oldy, oldw, oldh);
+
+      /* GTK does not redraw until the main loop is entered again, but
+         if there are no X events pending we will not enter it.  So we sync
+         here to get some events.  */
+
+      x_sync (f);
+      SET_FRAME_GARBAGED (f);
+      cancel_mouse_face (f);
+    }
+}
+
+
 /* Get the current value of the range, truncated to an integer.  */
 
 static int
@@ -3854,6 +3972,47 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
     }
 }
 
+/* Set the thumb size and position of horizontal scroll bar BAR.  We are
+   currently displaying PORTION out of a whole WHOLE, and our position
+   POSITION.  */
+void
+xg_set_toolkit_horizontal_scroll_bar_thumb (struct scroll_bar *bar,
+                                           int portion,
+                                           int position,
+                                           int whole)
+{
+  GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window);
+
+  if (wscroll && bar->dragging == -1)
+    {
+      GtkAdjustment *adj;
+      int lower = 0;
+      int upper = max (whole - 1, 0);
+      int pagesize = min (upper, max (portion, 0));
+      int value = max (0, min (position, upper - pagesize));
+      /* These should be set to something more <portion, whole>
+        related.  */
+      int page_increment = 4;
+      int step_increment = 1;
+
+      block_input ();
+      adj = gtk_range_get_adjustment (GTK_RANGE (wscroll));
+
+      /*      gtk_adjustment_set_lower (adj, (gdouble) lower);
+      gtk_adjustment_set_upper (adj, (gdouble) upper);
+      gtk_adjustment_set_page_size (adj, (gdouble) pagesize);
+      gtk_adjustment_set_value (adj, (gdouble) value);
+      gtk_adjustment_set_page_increment (adj, (gdouble) page_increment);
+      gtk_adjustment_set_step_increment (adj, (gdouble)
+      step_increment); */
+      gtk_adjustment_configure (adj, (gdouble) value, (gdouble) lower,
+                               (gdouble) upper, (gdouble) step_increment,
+                               (gdouble) page_increment, (gdouble) pagesize);
+      gtk_adjustment_changed (adj);
+      unblock_input ();
+    }
+}
+
 /* Return true if EVENT is for a scroll bar in frame F.
    When the same X window is used for several Gtk+ widgets, we cannot
    say for sure based on the X window alone if an event is for the
@@ -4915,7 +5074,7 @@ update_frame_tool_bar (struct frame *f)
   if (f->n_tool_bar_items != 0)
     {
       if (! x->toolbar_is_packed)
-        xg_pack_tool_bar (f, f->tool_bar_position);
+        xg_pack_tool_bar (f, FRAME_TOOL_BAR_POSITION (f));
       gtk_widget_show_all (TOOLBAR_TOP_WIDGET (x));
       if (xg_update_tool_bar_sizes (f))
         xg_height_or_width_changed (f);
@@ -5060,6 +5219,7 @@ xg_initialize (void)
   gtk_binding_entry_add_signal (binding_set, GDK_KEY_g, GDK_CONTROL_MASK,
                                 "cancel", 0);
   update_theme_scrollbar_width ();
+  update_theme_scrollbar_height ();
 
 #ifdef HAVE_FREETYPE
   x_last_font_name = NULL;
index 12bf461fd69f19e04e1a0faacce239e129c690cf..5c7d8b0337984cc2418481db607f989ddac627ef 100644 (file)
@@ -24,6 +24,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #ifdef USE_GTK
 
 #include <gtk/gtk.h>
+#include "../lwlib/lwlib-widget.h"
 #include "frame.h"
 #include "xterm.h"
 
@@ -32,6 +33,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define XG_SB_MIN 1
 #define XG_SB_MAX 10000000
 #define XG_SB_RANGE (XG_SB_MAX-XG_SB_MIN)
+#define YG_SB_MIN 1
+#define YG_SB_MAX 10000000
+#define YG_SB_RANGE (YG_SB_MAX-YG_SB_MIN)
 
 /* Key for data that is valid for menus and scroll bars in a frame  */
 #define XG_FRAME_DATA "emacs_frame"
@@ -74,9 +78,6 @@ typedef struct xg_menu_item_cb_data_
 
 } xg_menu_item_cb_data;
 
-extern struct _widget_value *malloc_widget_value (void);
-extern void free_widget_value (struct _widget_value *);
-
 extern bool xg_uses_old_file_dialog (void) ATTRIBUTE_CONST;
 
 extern char *xg_get_file_name (struct frame *f,
@@ -116,6 +117,11 @@ extern void xg_create_scroll_bar (struct frame *f,
                                   GCallback scroll_callback,
                                   GCallback end_callback,
                                   const char *scroll_bar_name);
+extern void xg_create_horizontal_scroll_bar (struct frame *f,
+                                            struct scroll_bar *bar,
+                                            GCallback scroll_callback,
+                                            GCallback end_callback,
+                                            const char *scroll_bar_name);
 extern void xg_remove_scroll_bar (struct frame *f, ptrdiff_t scrollbar_id);
 
 extern void xg_update_scrollbar_pos (struct frame *f,
@@ -124,18 +130,30 @@ extern void xg_update_scrollbar_pos (struct frame *f,
                                      int left,
                                      int width,
                                      int height);
+extern void xg_update_horizontal_scrollbar_pos (struct frame *f,
+                                               ptrdiff_t scrollbar_id,
+                                               int top,
+                                               int left,
+                                               int width,
+                                               int height);
 
 extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
                                              int portion,
                                              int position,
                                              int whole);
+extern void xg_set_toolkit_horizontal_scroll_bar_thumb (struct scroll_bar *bar,
+                                                       int portion,
+                                                       int position,
+                                                       int whole);
 extern bool xg_event_is_for_scrollbar (struct frame *, const XEvent *);
 extern int xg_get_default_scrollbar_width (void);
+extern int xg_get_default_scrollbar_height (void);
 
 extern void update_frame_tool_bar (struct frame *f);
 extern void free_frame_tool_bar (struct frame *f);
 extern void xg_change_toolbar_position (struct frame *f, Lisp_Object pos);
 
+extern void xg_clear_under_internal_border (struct frame *f);
 extern void xg_frame_resized (struct frame *f,
                               int pixelwidth,
                               int pixelheight);
@@ -164,7 +182,6 @@ extern bool xg_prepare_tooltip (struct frame *f,
 extern void xg_show_tooltip (struct frame *f, int root_x, int root_y);
 extern bool xg_hide_tooltip (struct frame *f);
 
-
 /* Mark all callback data that are Lisp_object:s during GC.  */
 extern void xg_mark_data (void);
 
index 13efc80ab2632efca168fe2582f2313283f6fab7..804da436ee9c56c24805c2a746182f5308ee6f1f 100644 (file)
@@ -21,13 +21,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "sysstdio.h"
 #include <unistd.h>
 
-#ifdef HAVE_PNG
-#if defined HAVE_LIBPNG_PNG_H
-# include <libpng/png.h>
-#else
+/* Include this before including <setjmp.h> to work around bugs with
+   older libpng; see Bug#17429.  */
+#if defined HAVE_PNG && !defined HAVE_NS
 # include <png.h>
 #endif
-#endif
 
 #include <setjmp.h>
 #include <c-ctype.h>
@@ -160,6 +158,7 @@ XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
 
 /* Functions to access the contents of a bitmap, given an id.  */
 
+#ifdef HAVE_X_WINDOWS
 static int
 x_bitmap_height (struct frame *f, ptrdiff_t id)
 {
@@ -171,6 +170,7 @@ x_bitmap_width (struct frame *f, ptrdiff_t id)
 {
   return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].width;
 }
+#endif
 
 #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
 ptrdiff_t
@@ -998,6 +998,11 @@ free_image (struct frame *f, struct image *img)
 
       c->images[img->id] = NULL;
 
+      /* Windows NT redefines 'free', but in this file, we need to
+         avoid the redefinition.  */
+#ifdef WINDOWSNT
+#undef free
+#endif
       /* Free resources, then free IMG.  */
       img->type->free (f, img);
       xfree (img);
@@ -1231,7 +1236,23 @@ image_background_transparent (struct image *img, struct frame *f, XImagePtr_or_D
   return img->background_transparent;
 }
 
-\f
+#if defined (HAVE_PNG) || defined (HAVE_NS) \
+  || defined (HAVE_IMAGEMAGICK) || defined (HAVE_RSVG)
+
+/* Store F's background color into *BGCOLOR.  */
+static void
+x_query_frame_background_color (struct frame *f, XColor *bgcolor)
+{
+#ifndef HAVE_NS
+  bgcolor->pixel = FRAME_BACKGROUND_PIXEL (f);
+  x_query_color (f, bgcolor);
+#else
+  ns_query_color (FRAME_BACKGROUND_COLOR (f), bgcolor, 1);
+#endif
+}
+
+#endif /* HAVE_PNG || HAVE_NS || HAVE_IMAGEMAGICK || HAVE_RSVG */
+
 /***********************************************************************
                  Helper functions for X image types
  ***********************************************************************/
@@ -3953,9 +3974,7 @@ xpm_str_to_color_key (const char *s)
 {
   int i;
 
-  for (i = 0;
-       i < sizeof xpm_color_key_strings / sizeof xpm_color_key_strings[0];
-       i++)
+  for (i = 0; i < ARRAYELTS (xpm_color_key_strings); i++)
     if (strcmp (xpm_color_key_strings[i], s) == 0)
       return i;
   return -1;
@@ -5506,7 +5525,7 @@ png_image_p (Lisp_Object object)
 #endif /* HAVE_PNG || HAVE_NS */
 
 
-#ifdef HAVE_PNG
+#if defined HAVE_PNG && !defined HAVE_NS
 
 #ifdef WINDOWSNT
 /* PNG library details.  */
@@ -5884,43 +5903,23 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c)
       /* png_color_16 *image_bg; */
       Lisp_Object specified_bg
        = image_spec_value (img->spec, QCbackground, NULL);
-      int shift = (bit_depth == 16) ? 0 : 8;
+      XColor color;
 
-      if (STRINGP (specified_bg))
+      /* If the user specified a color, try to use it; if not, use the
+        current frame background, ignoring any default background
+        color set by the image.  */
+      if (STRINGP (specified_bg)
+         ? x_defined_color (f, SSDATA (specified_bg), &color, false)
+         : (x_query_frame_background_color (f, &color), true))
        /* The user specified `:background', use that.  */
        {
-         XColor color;
-         if (x_defined_color (f, SSDATA (specified_bg), &color, 0))
-           {
-             png_color_16 user_bg;
-
-             memset (&user_bg, 0, sizeof user_bg);
-             user_bg.red = color.red >> shift;
-             user_bg.green = color.green >> shift;
-             user_bg.blue = color.blue >> shift;
-
-             fn_png_set_background (png_ptr, &user_bg,
-                                    PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
-           }
-       }
-      else
-       {
-         /* We use the current frame background, ignoring any default
-            background color set by the image.  */
-#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
-         XColor color;
-         png_color_16 frame_background;
+         int shift = bit_depth == 16 ? 0 : 8;
+         png_color_16 bg = { 0 };
+         bg.red = color.red >> shift;
+         bg.green = color.green >> shift;
+         bg.blue = color.blue >> shift;
 
-         color.pixel = FRAME_BACKGROUND_PIXEL (f);
-         x_query_color (f, &color);
-
-         memset (&frame_background, 0, sizeof frame_background);
-         frame_background.red = color.red >> shift;
-         frame_background.green = color.green >> shift;
-         frame_background.blue = color.blue >> shift;
-#endif /* HAVE_X_WINDOWS */
-
-         fn_png_set_background (png_ptr, &frame_background,
+         fn_png_set_background (png_ptr, &bg,
                                 PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
        }
     }
@@ -6062,9 +6061,8 @@ png_load (struct frame *f, struct image *img)
   return png_load_body (f, img, &c);
 }
 
-#else /* HAVE_PNG */
+#elif defined HAVE_NS
 
-#ifdef HAVE_NS
 static bool
 png_load (struct frame *f, struct image *img)
 {
@@ -6072,10 +6070,8 @@ png_load (struct frame *f, struct image *img)
                         image_spec_value (img->spec, QCfile, NULL),
                         image_spec_value (img->spec, QCdata, NULL));
 }
-#endif  /* HAVE_NS */
-
 
-#endif /* !HAVE_PNG */
+#endif /* HAVE_NS */
 
 
 \f
@@ -6466,7 +6462,6 @@ jpeg_file_src (j_decompress_ptr cinfo, FILE *fp)
   src->mgr.next_input_byte = NULL;
 }
 
-
 /* Load image IMG for use on frame F.  Patterned after example.c
    from the JPEG lib.  */
 
@@ -8064,7 +8059,6 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
   else
     composite_wand = cache->wand;
 
-  dest_width = MagickGetImageWidth (composite_wand);
   dest_height = MagickGetImageHeight (composite_wand);
 
   for (i = max (1, cache->index + 1); i <= ino; i++)
@@ -8133,13 +8127,12 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
            {
              /* Sanity check.  This shouldn't happen, but apparently
                 also does in some pictures.  */
-             if (x + source_left > dest_width - 1)
+             if (x + source_left >= dest_width)
                break;
              /* Normally we only copy over non-transparent pixels,
                 but if the disposal method is "Background", then we
                 copy over all pixels.  */
-             if (dispose == BackgroundDispose ||
-                 PixelGetAlpha (source[x]))
+             if (dispose == BackgroundDispose || PixelGetAlpha (source[x]))
                {
                  PixelGetMagickColor (source[x], &pixel);
                  PixelSetMagickColor (dest[x + source_left], &pixel);
@@ -8179,7 +8172,8 @@ imagemagick_load_image (struct frame *f, struct image *img,
                        unsigned char *contents, unsigned int size,
                        char *filename)
 {
-  size_t width, height;
+  int width, height;
+  size_t image_width, image_height;
   MagickBooleanType status;
   XImagePtr ximg;
   int x, y;
@@ -8258,14 +8252,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
     specified_bg = image_spec_value (img->spec, QCbackground, NULL);
     if (!STRINGP (specified_bg)
        || !x_defined_color (f, SSDATA (specified_bg), &bgcolor, 0))
-      {
-#ifndef HAVE_NS
-       bgcolor.pixel = FRAME_BACKGROUND_PIXEL (f);
-       x_query_color (f, &bgcolor);
-#else
-       ns_query_color (FRAME_BACKGROUND_COLOR (f), &bgcolor, 1);
-#endif
-      }
+      x_query_frame_background_color (f, &bgcolor);
 
     bg_wand = NewPixelWand ();
     PixelSetRed   (bg_wand, (double) bgcolor.red   / 65535);
@@ -8356,16 +8343,19 @@ imagemagick_load_image (struct frame *f, struct image *img,
 
   /* Finally we are done manipulating the image.  Figure out the
      resulting width/height and transfer ownership to Emacs.  */
-  height = MagickGetImageHeight (image_wand);
-  width = MagickGetImageWidth (image_wand);
+  image_height = MagickGetImageHeight (image_wand);
+  image_width = MagickGetImageWidth (image_wand);
 
-  if (! (width <= INT_MAX && height <= INT_MAX
-        && check_image_size (f, width, height)))
+  if (! (image_width <= INT_MAX && image_height <= INT_MAX
+        && check_image_size (f, image_width, image_height)))
     {
       image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
       goto imagemagick_error;
     }
 
+  width = image_width;
+  height = image_height;
+
   /* We can now get a valid pixel buffer from the imagemagick file, if all
      went ok.  */
 
@@ -8417,6 +8407,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
 #endif /* HAVE_MAGICKEXPORTIMAGEPIXELS */
     {
       size_t image_height;
+      MagickRealType color_scale = 65535.0 / QuantumRange;
 
       /* Try to create a x pixmap to hold the imagemagick pixmap.  */
       if (!image_create_x_image_and_pixmap (f, img, width, height, 0,
@@ -8449,17 +8440,19 @@ imagemagick_load_image (struct frame *f, struct image *img,
       image_height = MagickGetImageHeight (image_wand);
       for (y = 0; y < image_height; y++)
         {
-          pixels = PixelGetNextIteratorRow (iterator, &width);
+         size_t row_width;
+         pixels = PixelGetNextIteratorRow (iterator, &row_width);
           if (! pixels)
             break;
-          for (x = 0; x < (long) width; x++)
+         int xlim = min (row_width, width);
+         for (x = 0; x < xlim; x++)
             {
               PixelGetMagickColor (pixels[x], &pixel);
               XPutPixel (ximg, x, y,
                          lookup_rgb_color (f,
-                                           pixel.red,
-                                           pixel.green,
-                                           pixel.blue));
+                                          color_scale * pixel.red,
+                                          color_scale * pixel.green,
+                                          color_scale * pixel.blue));
             }
         }
       DestroyPixelIterator (iterator);
@@ -8560,7 +8553,6 @@ and `imagemagick-types-inhibit'.  */)
   ExceptionInfo ex;
   char **imtypes;
   size_t i;
-  Lisp_Object Qimagemagicktype;
 
   GetExceptionInfo(&ex);
   imtypes = GetMagickList ("*", &numf, &ex);
@@ -8568,8 +8560,8 @@ and `imagemagick-types-inhibit'.  */)
 
   for (i = 0; i < numf; i++)
     {
-      Qimagemagicktype = intern (imtypes[i]);
-      typelist = Fcons (Qimagemagicktype, typelist);
+      Lisp_Object imagemagicktype = intern (imtypes[i]);
+      typelist = Fcons (imagemagicktype, typelist);
       imtypes[i] = MagickRelinquishMemory (imtypes[i]);
     }
 
@@ -8681,7 +8673,6 @@ DEF_IMGLIB_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionDat
 DEF_IMGLIB_FN (gboolean, rsvg_handle_write, (RsvgHandle *, const guchar *, gsize, GError **));
 DEF_IMGLIB_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **));
 DEF_IMGLIB_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *));
-DEF_IMGLIB_FN (void *, rsvg_handle_set_size_callback, (RsvgHandle *, RsvgSizeFunc, gpointer, GDestroyNotify));
 
 DEF_IMGLIB_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *));
 DEF_IMGLIB_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *));
@@ -8703,13 +8694,18 @@ Lisp_Object Qgdk_pixbuf, Qglib, Qgobject;
 static bool
 init_svg_functions (void)
 {
-  HMODULE library, gdklib, glib, gobject;
+  HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL;
 
   if (!(glib = w32_delayed_load (Qglib))
       || !(gobject = w32_delayed_load (Qgobject))
       || !(gdklib = w32_delayed_load (Qgdk_pixbuf))
       || !(library = w32_delayed_load (Qsvg)))
-    return 0;
+    {
+      if (gdklib)  FreeLibrary (gdklib);
+      if (gobject) FreeLibrary (gobject);
+      if (glib)    FreeLibrary (glib);
+      return 0;
+    }
 
   LOAD_IMGLIB_FN (library, rsvg_handle_new);
   LOAD_IMGLIB_FN (library, rsvg_handle_get_dimensions);
@@ -8897,14 +8893,7 @@ svg_load_image (struct frame *f,         /* Pointer to emacs frame structure.  *
   specified_bg = image_spec_value (img->spec, QCbackground, NULL);
   if (!STRINGP (specified_bg)
       || !x_defined_color (f, SSDATA (specified_bg), &background, 0))
-    {
-#ifndef HAVE_NS
-      background.pixel = FRAME_BACKGROUND_PIXEL (f);
-      x_query_color (f, &background);
-#else
-      ns_query_color (FRAME_BACKGROUND_COLOR (f), &background, 1);
-#endif
-    }
+    x_query_frame_background_color (f, &background);
 
   /* SVG pixmaps specify transparency in the last byte, so right
      shift 8 bits to get rid of it, since emacs doesn't support
index 711792f75cd9c5d3520823888cb8114e082ad2a7..79af42c5f7efe03427ce636f93f2958af95140ba 100644 (file)
@@ -920,7 +920,7 @@ position_indentation (ptrdiff_t pos_byte)
          column += tab_width - column % tab_width;
          break;
        default:
-         if (ASCII_BYTE_P (p[-1])
+         if (ASCII_CHAR_P (p[-1])
              || NILP (BVAR (current_buffer, enable_multibyte_characters)))
            return column;
          {
index 85526d46db1e240b9ac6976fbbd573b270581567..463392dcada70f31b269240ed22010218b8c2439 100644 (file)
@@ -1,6 +1,6 @@
 /* Buffer insertion/deletion and gap motion for GNU Emacs.
-   Copyright (C) 1985-1986, 1993-1995, 1997-2014 Free Software
-   Foundation, Inc.
+
+Copyright (C) 1985-1986, 1993-1995, 1997-2014 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -203,6 +203,25 @@ gap_right (ptrdiff_t charpos, ptrdiff_t bytepos)
   QUIT;
 }
 \f
+/* If the selected window's old pointm is adjacent or covered by the
+   region from FROM to TO, unsuspend auto hscroll in that window.  */
+
+static void
+adjust_suspend_auto_hscroll (ptrdiff_t from, ptrdiff_t to)
+{
+  if (WINDOWP (selected_window))
+    {
+      struct window *w = XWINDOW (selected_window);
+
+      if (BUFFERP (w->contents)
+         && XBUFFER (w->contents) == current_buffer
+         && XMARKER (w->old_pointm)->charpos >= from
+         && XMARKER (w->old_pointm)->charpos <= to)
+       w->suspend_auto_hscroll = 0;
+    }
+}
+
+
 /* Adjust all markers for a deletion
    whose range in bytes is FROM_BYTE to TO_BYTE.
    The range in charpos is FROM to TO.
@@ -217,6 +236,7 @@ adjust_markers_for_delete (ptrdiff_t from, ptrdiff_t from_byte,
   struct Lisp_Marker *m;
   ptrdiff_t charpos;
 
+  adjust_suspend_auto_hscroll (from, to);
   for (m = BUF_MARKERS (current_buffer); m; m = m->next)
     {
       charpos = m->charpos;
@@ -256,6 +276,7 @@ adjust_markers_for_insert (ptrdiff_t from, ptrdiff_t from_byte,
   ptrdiff_t nchars = to - from;
   ptrdiff_t nbytes = to_byte - from_byte;
 
+  adjust_suspend_auto_hscroll (from, to);
   for (m = BUF_MARKERS (current_buffer); m; m = m->next)
     {
       eassert (m->bytepos >= m->charpos
@@ -321,6 +342,7 @@ adjust_markers_for_replace (ptrdiff_t from, ptrdiff_t from_byte,
   ptrdiff_t diff_chars = new_chars - old_chars;
   ptrdiff_t diff_bytes = new_bytes - old_bytes;
 
+  adjust_suspend_auto_hscroll (from, from + old_chars);
   for (m = BUF_MARKERS (current_buffer); m; m = m->next)
     {
       if (m->bytepos >= prev_to_byte)
@@ -701,7 +723,7 @@ count_combining_after (const unsigned char *string,
        (2) POS is the last of the current buffer.
        (3) A character at POS can't be a following byte of multibyte
            character.  */
-  if (length > 0 && ASCII_BYTE_P (string[length - 1])) /* case (1) */
+  if (length > 0 && ASCII_CHAR_P (string[length - 1])) /* case (1) */
     return 0;
   if (pos_byte == Z_BYTE)      /* case (2) */
     return 0;
@@ -1804,26 +1826,18 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end,
   else
     base_buffer = current_buffer;
 
-#ifdef CLASH_DETECTION
+  if (inhibit_modification_hooks)
+    return;
+
   if (!NILP (BVAR (base_buffer, file_truename))
       /* Make binding buffer-file-name to nil effective.  */
       && !NILP (BVAR (base_buffer, filename))
       && SAVE_MODIFF >= MODIFF)
     lock_file (BVAR (base_buffer, file_truename));
-#else
-  /* At least warn if this file has changed on disk since it was visited.  */
-  if (!NILP (BVAR (base_buffer, filename))
-      && SAVE_MODIFF >= MODIFF
-      && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ()))
-      && !NILP (Ffile_exists_p (BVAR (base_buffer, filename))))
-    call1 (intern ("ask-user-about-supersession-threat"),
-          BVAR (base_buffer,filename));
-#endif /* not CLASH_DETECTION */
 
   /* If `select-active-regions' is non-nil, save the region text.  */
   /* FIXME: Move this to Elisp (via before-change-functions).  */
   if (!NILP (BVAR (current_buffer, mark_active))
-      && !inhibit_modification_hooks
       && XMARKER (BVAR (current_buffer, mark))->buffer
       && NILP (Vsaved_region_selection)
       && (EQ (Vselect_active_regions, Qonly)
@@ -1962,9 +1976,6 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
   ptrdiff_t count = SPECPDL_INDEX ();
   struct rvoe_arg rvoe_arg;
 
-  if (inhibit_modification_hooks)
-    return;
-
   start = make_number (start_int);
   end = make_number (end_int);
   preserve_marker = Qnil;
@@ -1975,7 +1986,7 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
   specbind (Qinhibit_modification_hooks, Qt);
 
   /* If buffer is unmodified, run a special hook for that case.  The
-   check for Vfirst_change_hook is just a minor optimization. */
+   check for Vfirst_change_hook is just a minor optimization.  */
   if (SAVE_MODIFF >= MODIFF
       && !NILP (Vfirst_change_hook))
     {
index e901f99747db0b111bfa5cb70ce589edde9bf3fc..4e7a177140eb14b7f1e7d3352c68ae1fed34efc0 100644 (file)
@@ -278,10 +278,8 @@ extern Lisp_Object Qpoint_entered;
 extern Lisp_Object Qmodification_hooks;
 extern Lisp_Object Qcategory;
 extern Lisp_Object Qlocal_map;
-extern Lisp_Object Qkeymap;
 
 /* Visual properties text (including strings) may have.  */
-extern Lisp_Object Qfont;
 extern Lisp_Object Qinvisible, Qintangible;
 
 /* Sticky properties.  */
index eb27d6fefaba06be848f316f204e457bbd416990..a684f18c75686de85ebac21ac7bc6f47b79eacd0 100644 (file)
@@ -228,7 +228,7 @@ static Lisp_Object Qbackward_char;
 Lisp_Object Qundefined;
 static Lisp_Object Qtimer_event_handler;
 
-/* read_key_sequence stores here the command definition of the
+/* `read_key_sequence' stores here the command definition of the
    key sequence that it reads.  */
 static Lisp_Object read_key_sequence_cmd;
 static Lisp_Object read_key_sequence_remapped;
@@ -348,7 +348,6 @@ static Lisp_Object Qmodifier_cache;
 Lisp_Object Qmode_line;
 Lisp_Object Qvertical_line;
 Lisp_Object Qright_divider, Qbottom_divider;
-static Lisp_Object Qvertical_scroll_bar;
 Lisp_Object Qmenu_bar;
 
 static Lisp_Object Qecho_keystrokes;
@@ -356,7 +355,6 @@ static Lisp_Object Qecho_keystrokes;
 static void recursive_edit_unwind (Lisp_Object buffer);
 static Lisp_Object command_loop (void);
 static Lisp_Object Qcommand_execute;
-struct timespec timer_check (void);
 
 static void echo_now (void);
 static ptrdiff_t echo_length (void);
@@ -377,12 +375,6 @@ bool interrupt_input;
 /* Nonzero while interrupts are temporarily deferred during redisplay.  */
 bool interrupts_deferred;
 
-/* If we support a window system, turn on the code to poll periodically
-   to detect C-g.  It isn't actually used when doing interrupt input.  */
-#ifdef HAVE_WINDOW_SYSTEM
-#define POLL_FOR_INPUT
-#endif
-
 /* The time when Emacs started being idle.  */
 
 static struct timespec timer_idleness_start_time;
@@ -1222,7 +1214,7 @@ user_error (const char *msg)
   xsignal1 (Quser_error, build_string (msg));
 }
 
-_Noreturn
+/* _Noreturn will be added to prototype by make-docfile.  */
 DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
        doc: /* Exit from the innermost recursive edit or minibuffer.  */)
   (void)
@@ -1233,7 +1225,7 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0,
   user_error ("No recursive edit is in progress");
 }
 
-_Noreturn
+/* _Noreturn will be added to prototype by make-docfile.  */
 DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
        doc: /* Abort the command that requested this recursive edit or minibuffer input.  */)
   (void)
@@ -1292,9 +1284,6 @@ usage: (track-mouse BODY...)  */)
    If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
    after resizing the tool-bar window.  */
 
-#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
-static
-#endif
 bool ignore_mouse_drag_p;
 
 static struct frame *
@@ -1323,14 +1312,11 @@ some_mouse_moved (void)
 
 static int read_key_sequence (Lisp_Object *, int, Lisp_Object,
                               bool, bool, bool, bool);
-void safe_run_hooks (Lisp_Object);
 static void adjust_point_for_property (ptrdiff_t, bool);
 
 /* The last boundary auto-added to buffer-undo-list.  */
 Lisp_Object last_undo_boundary;
 
-extern Lisp_Object Qregion_extract_function;
-
 /* FIXME: This is wrong rather than test window-system, we should call
    a new set-selection, which will then dispatch to x-set-selection, or
    tty-set-selection, or w32-set-selection, ...  */
@@ -1449,7 +1435,7 @@ command_loop_1 (void)
       Vthis_command_keys_shift_translated = Qnil;
 
       /* Read next key sequence; i gets its length.  */
-      i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0],
+      i = read_key_sequence (keybuf, ARRAYELTS (keybuf),
                             Qnil, 0, 1, 1, 0);
 
       /* A filter may have run while we were reading the input.  */
@@ -1697,7 +1683,7 @@ read_menu_command (void)
      menus.  */
   specbind (Qecho_keystrokes, make_number (0));
 
-  i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0],
+  i = read_key_sequence (keybuf, ARRAYELTS (keybuf),
                         Qnil, 0, 1, 1, 1);
 
   unbind_to (count, Qnil);
@@ -2091,16 +2077,13 @@ bind_polling_period (int n)
 \f
 /* Apply the control modifier to CHARACTER.  */
 
-#ifndef HAVE_NTGUI
-static
-#endif
 int
 make_ctrl_char (int c)
 {
   /* Save the upper bits here.  */
   int upper = c & ~0177;
 
-  if (! ASCII_BYTE_P (c))
+  if (! ASCII_CHAR_P (c))
     return c |= ctrl_modifier;
 
   c &= 0177;
@@ -2302,8 +2285,10 @@ read_decoded_event_from_main_queue (struct timespec *end_time,
                                     bool *used_mouse_menu)
 {
 #define MAX_ENCODED_BYTES 16
+#ifndef WINDOWSNT
   Lisp_Object events[MAX_ENCODED_BYTES];
   int n = 0;
+#endif
   while (true)
     {
       Lisp_Object nextevt
@@ -2374,6 +2359,13 @@ read_decoded_event_from_main_queue (struct timespec *end_time,
     }
 }
 
+static bool
+echo_keystrokes_p (void)
+{
+  return (FLOATP (Vecho_keystrokes) ? XFLOAT_DATA (Vecho_keystrokes) > 0.0
+         : INTEGERP (Vecho_keystrokes) ? XINT (Vecho_keystrokes) > 0 : false);
+}
+
 /* Read a character from the keyboard; call the redisplay if needed.  */
 /* commandflag 0 means do not autosave, but do redisplay.
    -1 means do not redisplay, but do autosave.
@@ -2431,7 +2423,6 @@ read_char (int commandflag, Lisp_Object map,
 
  retry:
 
-  reread = 0;
   if (CONSP (Vunread_post_input_method_events))
     {
       c = XCAR (Vunread_post_input_method_events);
@@ -2445,9 +2436,12 @@ read_char (int commandflag, Lisp_Object map,
          && NILP (XCDR (c)))
        c = XCAR (c);
 
-      reread = 1;
+      reread = true;
       goto reread_first;
     }
+  else
+    reread = false;
+
 
   if (CONSP (Vunread_command_events))
     {
@@ -2456,17 +2450,13 @@ read_char (int commandflag, Lisp_Object map,
       c = XCAR (Vunread_command_events);
       Vunread_command_events = XCDR (Vunread_command_events);
 
-      reread = 1;
-
       /* Undo what sit-for did when it unread additional keys
         inside universal-argument.  */
 
-      if (CONSP (c)
-         && EQ (XCAR (c), Qt))
-       {
-         reread = 0;
-         c = XCDR (c);
-       }
+      if (CONSP (c) && EQ (XCAR (c), Qt))
+       c = XCDR (c);
+      else
+       reread = true;
 
       /* Undo what read_char_x_menu_prompt did when it unread
         additional keys returned by Fx_popup_menu.  */
@@ -2500,7 +2490,7 @@ read_char (int commandflag, Lisp_Object map,
          && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c)))
          && NILP (XCDR (c)))
        c = XCAR (c);
-      reread = 1;
+      reread = true;
       goto reread_for_input_method;
     }
 
@@ -2655,6 +2645,7 @@ read_char (int commandflag, Lisp_Object map,
       /* We must have saved the outer value of getcjmp here,
         so restore it now.  */
       restore_getcjmp (save_jump);
+      pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
       unbind_to (jmpcount, Qnil);
       XSETINT (c, quit_char);
       internal_last_event_frame = selected_frame;
@@ -2709,8 +2700,7 @@ read_char (int commandflag, Lisp_Object map,
       && !current_kboard->immediate_echo
       && this_command_key_count > 0
       && ! noninteractive
-      && (FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
-      && NILP (Fzerop (Vecho_keystrokes))
+      && echo_keystrokes_p ()
       && (/* No message.  */
          NILP (echo_area_buffer[0])
          /* Or empty message.  */
@@ -2841,6 +2831,11 @@ read_char (int commandflag, Lisp_Object map,
     {
       c = XCAR (Vunread_command_events);
       Vunread_command_events = XCDR (Vunread_command_events);
+
+      if (CONSP (c) && EQ (XCAR (c), Qt))
+       c = XCDR (c);
+      else
+       reread = true;
     }
 
   /* Read something from current KBOARD's side queue, if possible.  */
@@ -2894,8 +2889,8 @@ read_char (int commandflag, Lisp_Object map,
     {
       c = read_decoded_event_from_main_queue (end_time, local_getcjmp,
                                               prev_event, used_mouse_menu);
-      if (NILP(c) && end_time &&
-          timespec_cmp (*end_time, current_timespec ()) <= 0)
+      if (NILP (c) && end_time
+         && timespec_cmp (*end_time, current_timespec ()) <= 0)
         {
           goto exit;
         }
@@ -3171,8 +3166,7 @@ read_char (int commandflag, Lisp_Object map,
     {
 
       /* Don't echo mouse motion events.  */
-      if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
-         && NILP (Fzerop (Vecho_keystrokes))
+      if (echo_keystrokes_p ()
          && ! (EVENT_HAS_PARAMETERS (c)
                && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement)))
        {
@@ -3248,8 +3242,7 @@ record_menu_key (Lisp_Object c)
 #endif
 
   /* Don't echo mouse motion events.  */
-  if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
-      && NILP (Fzerop (Vecho_keystrokes)))
+  if (echo_keystrokes_p ())
     {
       echo_char (c);
 
@@ -3471,7 +3464,8 @@ readable_events (int flags)
                    event->kind == FOCUS_IN_EVENT)
 #ifdef USE_TOOLKIT_SCROLL_BARS
                  && !((flags & READABLE_EVENTS_IGNORE_SQUEEZABLES)
-                      && event->kind == SCROLL_BAR_CLICK_EVENT
+                      && (event->kind == SCROLL_BAR_CLICK_EVENT
+                          || event->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT)
                       && event->part == scroll_bar_handle
                       && event->modifiers == 0)
 #endif
@@ -3768,7 +3762,8 @@ discard_mouse_events (void)
 #ifdef HAVE_GPM
          || sp->kind == GPM_CLICK_EVENT
 #endif
-         || sp->kind == SCROLL_BAR_CLICK_EVENT)
+         || sp->kind == SCROLL_BAR_CLICK_EVENT
+         || sp->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT)
        {
          sp->kind = NO_EVENT;
        }
@@ -5167,15 +5162,18 @@ static const char *const lispy_drag_n_drop_names[] =
 
 /* Scroll bar parts.  */
 static Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
-Lisp_Object Qup, Qdown, Qbottom;
+static Lisp_Object Qbefore_handle, Qhorizontal_handle, Qafter_handle;
+Lisp_Object Qup, Qdown, Qtop, Qbottom;
+Lisp_Object Qleft, Qright, Qleftmost, Qrightmost;
 static Lisp_Object Qend_scroll;
-Lisp_Object Qtop;
 static Lisp_Object Qratio;
 
 /* An array of scroll bar parts, indexed by an enum scroll_bar_part value.  */
 static Lisp_Object *const scroll_bar_parts[] = {
   &Qabove_handle, &Qhandle, &Qbelow_handle,
-  &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio
+  &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio,
+  &Qbefore_handle, &Qhorizontal_handle, &Qafter_handle,
+  &Qleft, &Qright, &Qleftmost, &Qrightmost, &Qend_scroll, &Qratio
 };
 
 /* A vector, indexed by button number, giving the down-going location
@@ -5225,7 +5223,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
       /* It's a click in window WINDOW at frame coordinates (X,Y)  */
       struct window *w = XWINDOW (window);
       Lisp_Object string_info = Qnil;
-      ptrdiff_t textpos = -1;
+      ptrdiff_t textpos = 0;
       int col = -1, row = -1;
       int dx  = -1, dy  = -1;
       int width = -1, height = -1;
@@ -5260,9 +5258,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
                                     &object, &dx, &dy, &width, &height);
          if (STRINGP (string))
            string_info = Fcons (string, make_number (charpos));
-         textpos = (w == XWINDOW (selected_window)
-                    && current_buffer == XBUFFER (w->contents))
-           ? PT : marker_position (w->pointm);
+         textpos = -1;
 
          xret = wx;
          yret = wy;
@@ -5330,7 +5326,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
       /* For clicks in the text area, fringes, or margins, call
         buffer_posn_from_coords to extract TEXTPOS, the buffer
         position nearest to the click.  */
-      if (textpos < 0)
+      if (!textpos)
        {
          Lisp_Object string2, object2 = Qnil;
          struct display_pos p;
@@ -5381,15 +5377,15 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
        }
 #endif
 
-      /* Object info */
+      /* Object info */
       extra_info
        = list3 (object,
                 Fcons (make_number (dx), make_number (dy)),
                 Fcons (make_number (width), make_number (height)));
 
-      /* String info */
+      /* String info */
       extra_info = Fcons (string_info,
-                         Fcons (make_number (textpos),
+                         Fcons (textpos < 0 ? Qnil : make_number (textpos),
                                 Fcons (Fcons (make_number (col),
                                               make_number (row)),
                                        extra_info)));
@@ -5480,14 +5476,13 @@ make_lispy_event (struct input_event *event)
     case NON_ASCII_KEYSTROKE_EVENT:
       button_down_time = 0;
 
-      for (i = 0; i < sizeof (lispy_accent_codes) / sizeof (int); i++)
+      for (i = 0; i < ARRAYELTS (lispy_accent_codes); i++)
        if (event->code == lispy_accent_codes[i])
          return modify_event_symbol (i,
                                      event->modifiers,
                                      Qfunction_key, Qnil,
                                      lispy_accent_keys, &accent_key_syms,
-                                     (sizeof (lispy_accent_keys)
-                                      / sizeof (lispy_accent_keys[0])));
+                                      ARRAYELTS (lispy_accent_keys));
 
 #if 0
 #ifdef XK_kana_A
@@ -5496,8 +5491,7 @@ make_lispy_event (struct input_event *event)
                                    event->modifiers & ~shift_modifier,
                                    Qfunction_key, Qnil,
                                    lispy_kana_keys, &func_key_syms,
-                                   (sizeof (lispy_kana_keys)
-                                    / sizeof (lispy_kana_keys[0])));
+                                    ARRAYELTS (lispy_kana_keys));
 #endif /* XK_kana_A */
 #endif /* 0 */
 
@@ -5508,15 +5502,14 @@ make_lispy_event (struct input_event *event)
                                    event->modifiers,
                                    Qfunction_key, Qnil,
                                    iso_lispy_function_keys, &func_key_syms,
-                                   (sizeof (iso_lispy_function_keys)
-                                    / sizeof (iso_lispy_function_keys[0])));
+                                    ARRAYELTS (iso_lispy_function_keys));
 #endif
 
       /* Handle system-specific or unknown keysyms.  */
       if (event->code & (1 << 28)
          || event->code - FUNCTION_KEY_OFFSET < 0
          || (event->code - FUNCTION_KEY_OFFSET
-             >= sizeof lispy_function_keys / sizeof *lispy_function_keys)
+             >= ARRAYELTS (lispy_function_keys))
          || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET])
        {
          /* We need to use an alist rather than a vector as the cache
@@ -5535,20 +5528,17 @@ make_lispy_event (struct input_event *event)
                                  event->modifiers,
                                  Qfunction_key, Qnil,
                                  lispy_function_keys, &func_key_syms,
-                                 (sizeof (lispy_function_keys)
-                                  / sizeof (lispy_function_keys[0])));
+                                  ARRAYELTS (lispy_function_keys));
 
 #ifdef HAVE_NTGUI
     case MULTIMEDIA_KEY_EVENT:
-      if (event->code < (sizeof (lispy_multimedia_keys)
-                         / sizeof (lispy_multimedia_keys[0]))
+      if (event->code < ARRAYELTS (lispy_multimedia_keys)
           && event->code > 0 && lispy_multimedia_keys[event->code])
         {
           return modify_event_symbol (event->code, event->modifiers,
                                       Qfunction_key, Qnil,
                                       lispy_multimedia_keys, &func_key_syms,
-                                      (sizeof (lispy_multimedia_keys)
-                                       / sizeof (lispy_multimedia_keys[0])));
+                                      ARRAYELTS (lispy_multimedia_keys));
         }
       return Qnil;
 #endif
@@ -5561,6 +5551,7 @@ make_lispy_event (struct input_event *event)
 #endif
 #ifndef USE_TOOLKIT_SCROLL_BARS
     case SCROLL_BAR_CLICK_EVENT:
+    case HORIZONTAL_SCROLL_BAR_CLICK_EVENT:
 #endif
       {
        int button = event->code;
@@ -5961,6 +5952,36 @@ make_lispy_event (struct input_event *event)
        return list2 (head, position);
       }
 
+    case HORIZONTAL_SCROLL_BAR_CLICK_EVENT:
+      {
+       Lisp_Object position, head, window, portion_whole, part;
+
+       window = event->frame_or_window;
+       portion_whole = Fcons (event->x, event->y);
+       part = *scroll_bar_parts[(int) event->part];
+
+       position = list5 (window, Qhorizontal_scroll_bar, portion_whole,
+                         make_number (event->timestamp), part);
+
+       /* Always treat scroll bar events as clicks.  */
+       event->modifiers |= click_modifier;
+       event->modifiers &= ~up_modifier;
+
+       if (event->code >= ASIZE (mouse_syms))
+          mouse_syms = larger_vector (mouse_syms,
+                                     event->code - ASIZE (mouse_syms) + 1,
+                                     -1);
+
+       /* Get the symbol we should use for the mouse click.  */
+       head = modify_event_symbol (event->code,
+                                   event->modifiers,
+                                   Qmouse_click,
+                                   Vlispy_mouse_stem,
+                                   NULL, &mouse_syms,
+                                   ASIZE (mouse_syms));
+       return list2 (head, position);
+      }
+
 #endif /* USE_TOOLKIT_SCROLL_BARS */
 
     case DRAG_N_DROP_EVENT:
@@ -6270,7 +6291,7 @@ static const char *const modifier_names[] =
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, "alt", "super", "hyper", "shift", "control", "meta"
 };
-#define NUM_MOD_NAMES (sizeof (modifier_names) / sizeof (modifier_names[0]))
+#define NUM_MOD_NAMES ARRAYELTS (modifier_names)
 
 static Lisp_Object modifier_symbols;
 
@@ -6878,6 +6899,20 @@ gobble_input (void)
              }
             }
 
+         /* If there was no error, make sure the pointer
+            is visible for all frames on this terminal.  */
+         if (nr >= 0)
+           {
+             Lisp_Object tail, frame;
+
+             FOR_EACH_FRAME (tail, frame)
+               {
+                 struct frame *f = XFRAME (frame);
+                 if (FRAME_TERMINAL (f) == t)
+                   frame_make_pointer_visible (f);
+               }
+           }
+
           if (hold_quit.kind != NO_EVENT)
             kbd_buffer_store_event (&hold_quit);
         }
@@ -6888,8 +6923,6 @@ gobble_input (void)
   if (err && !nread)
     nread = -1;
 
-  frame_make_pointer_visible ();
-
   return nread;
 }
 
@@ -7295,7 +7328,7 @@ store_user_signal_events (void)
 }
 
 \f
-static void menu_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*);
+static void menu_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void *);
 static Lisp_Object menu_bar_one_keymap_changed_items;
 
 /* These variables hold the vector under construction within
@@ -7305,7 +7338,7 @@ static Lisp_Object menu_bar_items_vector;
 static int menu_bar_items_index;
 
 
-static const charseparator_names[] = {
+static const char *separator_names[] = {
   "space",
   "no-line",
   "single-line",
@@ -7480,8 +7513,8 @@ menu_bar_items (Lisp_Object old)
   {
     int i = menu_bar_items_index;
     if (i + 4 > ASIZE (menu_bar_items_vector))
-      menu_bar_items_vector =
-       larger_vector (menu_bar_items_vector, 4, -1);
+      menu_bar_items_vector
+       larger_vector (menu_bar_items_vector, 4, -1);
     /* Add this item.  */
     ASET (menu_bar_items_vector, i, Qnil); i++;
     ASET (menu_bar_items_vector, i, Qnil); i++;
@@ -7913,7 +7946,8 @@ static Lisp_Object QCrtl;
 /* Function prototypes.  */
 
 static void init_tool_bar_items (Lisp_Object);
-static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*);
+static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object,
+                                  void *);
 static bool parse_tool_bar_item (Lisp_Object, Lisp_Object);
 static void append_tool_bar_item (void);
 
@@ -8935,8 +8969,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
          echo_now ();
        }
       else if (cursor_in_echo_area
-              && (FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
-              && NILP (Fzerop (Vecho_keystrokes)))
+              && echo_keystrokes_p ())
        /* This doesn't put in a dash if the echo buffer is empty, so
           you don't always see a dash hanging out in the minibuffer.  */
        echo_dash ();
@@ -9068,8 +9101,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
        {
          key = keybuf[t];
          add_command_key (key);
-         if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
-             && NILP (Fzerop (Vecho_keystrokes))
+         if (echo_keystrokes_p ()
              && current_kboard->immediate_echo)
            {
              echo_add_key (key);
@@ -9734,8 +9766,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
      Better ideas?  */
   for (; t < mock_input; t++)
     {
-      if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
-         && NILP (Fzerop (Vecho_keystrokes)))
+      if (echo_keystrokes_p ())
        echo_char (keybuf[t]);
       add_command_key (keybuf[t]);
     }
@@ -9766,7 +9797,7 @@ read_key_sequence_vs (Lisp_Object prompt, Lisp_Object continue_echo,
 
   memset (keybuf, 0, sizeof keybuf);
   GCPRO1 (keybuf[0]);
-  gcpro1.nvars = (sizeof keybuf / sizeof (keybuf[0]));
+  gcpro1.nvars = ARRAYELTS (keybuf);
 
   if (NILP (continue_echo))
     {
@@ -9780,7 +9811,7 @@ read_key_sequence_vs (Lisp_Object prompt, Lisp_Object continue_echo,
     cancel_hourglass ();
 #endif
 
-  i = read_key_sequence (keybuf, (sizeof keybuf / sizeof (keybuf[0])),
+  i = read_key_sequence (keybuf, ARRAYELTS (keybuf),
                         prompt, ! NILP (dont_downcase_last),
                         ! NILP (can_return_switch_frame), 0, 0);
 
@@ -10182,7 +10213,8 @@ On such systems, Emacs starts a subshell instead of suspending.  */)
      with a window system; but suspend should be disabled in that case.  */
   get_tty_size (fileno (CURTTY ()->input), &width, &height);
   if (width != old_width || height != old_height)
-    change_frame_size (SELECTED_FRAME (), width, height, 0, 0, 0, 0);
+    change_frame_size (SELECTED_FRAME (), width, height
+                      - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), 0, 0, 0, 0);
 
   /* Run suspend-resume-hook.  */
   hook = intern ("suspend-resume-hook");
@@ -10693,7 +10725,7 @@ The elements of this list correspond to the arguments of
     }
   XSETFASTINT (val[3], quit_char);
 
-  return Flist (sizeof (val) / sizeof (val[0]), val);
+  return Flist (ARRAYELTS (val), val);
 }
 
 DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0,
@@ -11016,7 +11048,6 @@ syms_of_keyboard (void)
 
   DEFSYM (Qmode_line, "mode-line");
   DEFSYM (Qvertical_line, "vertical-line");
-  DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar");
   DEFSYM (Qmenu_bar, "menu-bar");
   DEFSYM (Qright_divider, "right-divider");
   DEFSYM (Qbottom_divider, "bottom-divider");
@@ -11032,6 +11063,13 @@ syms_of_keyboard (void)
   DEFSYM (Qbottom, "bottom");
   DEFSYM (Qend_scroll, "end-scroll");
   DEFSYM (Qratio, "ratio");
+  DEFSYM (Qbefore_handle, "before-handle");
+  DEFSYM (Qhorizontal_handle, "horizontal-handle");
+  DEFSYM (Qafter_handle, "after-handle");
+  DEFSYM (Qleft, "left");
+  DEFSYM (Qright, "right");
+  DEFSYM (Qleftmost, "leftmost");
+  DEFSYM (Qrightmost, "rightmost");
 
   DEFSYM (Qevent_kind, "event-kind");
   DEFSYM (Qevent_symbol_elements, "event-symbol-elements");
@@ -11061,7 +11099,7 @@ syms_of_keyboard (void)
 
   {
     int i;
-    int len = sizeof (head_table) / sizeof (head_table[0]);
+    int len = ARRAYELTS (head_table);
 
     for (i = 0; i < len; i++)
       {
@@ -11077,14 +11115,13 @@ syms_of_keyboard (void)
   staticpro (&button_down_location);
   mouse_syms = Fmake_vector (make_number (5), Qnil);
   staticpro (&mouse_syms);
-  wheel_syms = Fmake_vector (make_number (sizeof (lispy_wheel_names)
-                                         / sizeof (lispy_wheel_names[0])),
+  wheel_syms = Fmake_vector (make_number (ARRAYELTS (lispy_wheel_names)),
                             Qnil);
   staticpro (&wheel_syms);
 
   {
     int i;
-    int len = sizeof (modifier_names) / sizeof (modifier_names[0]);
+    int len = ARRAYELTS (modifier_names);
 
     modifier_symbols = Fmake_vector (make_number (len), Qnil);
     for (i = 0; i < len; i++)
@@ -11403,6 +11440,7 @@ and tests the value when the command returns.
 Buffer modification stores t in this variable.  */);
   Vdeactivate_mark = Qnil;
   DEFSYM (Qdeactivate_mark, "deactivate-mark");
+  Fmake_variable_buffer_local (Qdeactivate_mark);
 
   DEFVAR_LISP ("pre-command-hook", Vpre_command_hook,
               doc: /* Normal hook run before each command is executed.
index 8bb54dd86e03ee99a72768541307b9a256c6abde..da83b9b01ed9d8d5f2e36dd7733ab15969885642 100644 (file)
@@ -305,9 +305,7 @@ extern Lisp_Object menu_items;
 
 /* If non-nil, means that the global vars defined here are already in use.
    Used to detect cases where we try to re-enter this non-reentrant code.  */
-#if defined USE_GTK || defined USE_MOTIF
 extern Lisp_Object menu_items_inuse;
-#endif
 
 /* Number of slots currently allocated in menu_items.  */
 extern int menu_items_allocated;
@@ -354,57 +352,6 @@ extern void unuse_menu_items (void);
 #define ENCODE_MENU_STRING(str) (str)
 #endif
 
-#if defined (HAVE_NS) || defined (HAVE_NTGUI) || defined (USE_GTK)
-
-/* Definitions copied from lwlib.h */
-
-enum button_type
-{
-  BUTTON_TYPE_NONE,
-  BUTTON_TYPE_TOGGLE,
-  BUTTON_TYPE_RADIO
-};
-
-/* This structure is based on the one in ../lwlib/lwlib.h, with unused portions
-   removed.  No term uses these. */
-typedef struct _widget_value
-{
-  /* name of widget */
-  Lisp_Object   lname;
-  const char*  name;
-  /* value (meaning depend on widget type) */
-  const char*  value;
-  /* keyboard equivalent. no implications for XtTranslations */
-  Lisp_Object   lkey;
-  const char*  key;
-  /* Help string or nil if none.
-     GC finds this string through the frame's menu_bar_vector
-     or through menu_items.  */
-  Lisp_Object  help;
-  /* true if enabled */
-  unsigned char        enabled;
-  /* true if selected */
-  unsigned char selected;
-  /* The type of a button.  */
-  enum button_type button_type;
-#if defined (HAVE_NTGUI)
-  /* true if menu title */
-  unsigned char title;
-#endif
-  /* Contents of the sub-widgets, also selected slot for checkbox */
-  struct _widget_value*        contents;
-  /* data passed to callback */
-  void *call_data;
-  /* next one in the list */
-  struct _widget_value*        next;
-#ifdef USE_GTK
-  struct _widget_value *free_list;
-#endif
-} widget_value;
-
-#endif /* HAVE_NS || HAVE_NTGUI */
-
-\f
 /* Macros for dealing with lispy events.  */
 
 /* True if EVENT has data fields describing it (i.e. a mouse click).  */
@@ -466,9 +413,7 @@ extern bool waiting_for_input;
    happens.  */
 extern struct timespec *input_available_clear_time;
 
-#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
 extern bool ignore_mouse_drag_p;
-#endif
 
 /* The primary selection.  */
 extern Lisp_Object QPRIMARY;
@@ -518,9 +463,7 @@ extern bool input_polling_used (void);
 extern void clear_input_pending (void);
 extern bool requeued_events_pending_p (void);
 extern void bind_polling_period (int);
-#if HAVE_NTGUI
 extern int make_ctrl_char (int) ATTRIBUTE_CONST;
-#endif
 extern void stuff_buffered_input (Lisp_Object);
 extern void clear_waiting_for_input (void);
 extern void swallow_events (bool);
index c1416f8a7807a3f054ff6b4e9a46ff084bb463b2..f4dd644aebd3f246834f111cfe63b1429537a529 100644 (file)
@@ -727,11 +727,6 @@ get_keyelt (Lisp_Object object, bool autoload)
        /* This is really the value.  */
        return object;
 
-      /* If the keymap contents looks like (keymap ...) or (lambda ...)
-        then use itself. */
-      else if (EQ (XCAR (object), Qkeymap) || EQ (XCAR (object), Qlambda))
-       return object;
-
       /* If the keymap contents looks like (menu-item name . DEFN)
         or (menu-item name DEFN ...) then use DEFN.
         This is a new format menu item.  */
@@ -768,25 +763,8 @@ get_keyelt (Lisp_Object object, bool autoload)
         Keymap alist elements like (CHAR MENUSTRING . DEFN)
         will be used by HierarKey menus.  */
       else if (STRINGP (XCAR (object)))
-       {
-         object = XCDR (object);
-         /* Also remove a menu help string, if any,
-            following the menu item name.  */
-         if (CONSP (object) && STRINGP (XCAR (object)))
-           object = XCDR (object);
-         /* Also remove the sublist that caches key equivalences, if any.  */
-         if (CONSP (object) && CONSP (XCAR (object)))
-           {
-             Lisp_Object carcar;
-             carcar = XCAR (XCAR (object));
-             if (NILP (carcar) || VECTORP (carcar))
-               object = XCDR (object);
-           }
-       }
+       object = XCDR (object);
 
-      /* If the contents are (KEYMAP . ELEMENT), go indirect.  */
-      else if (KEYMAPP (XCAR (object)))
-       error ("Wow, indirect keymap entry!!");
       else
        return object;
     }
@@ -990,9 +968,6 @@ copy_keymap_item (Lisp_Object elt)
          if (CONSP (tem) && EQ (XCAR (tem), Qkeymap))
            XSETCAR (elt, Fcopy_keymap (tem));
          tem = XCDR (elt);
-         if (CONSP (tem) && CONSP (XCAR (tem)))
-           /* Delete cache for key equivalences.  */
-           XSETCDR (elt, XCDR (tem));
        }
     }
   else
@@ -1011,16 +986,6 @@ copy_keymap_item (Lisp_Object elt)
              elt = XCDR (elt);
              tem = XCDR (elt);
            }
-         /* There may also be a list that caches key equivalences.
-            Just delete it for the new keymap.  */
-         if (CONSP (tem)
-             && CONSP (XCAR (tem))
-             && (NILP (XCAR (XCAR (tem)))
-                 || VECTORP (XCAR (XCAR (tem)))))
-           {
-             XSETCDR (elt, XCDR (tem));
-             tem = XCDR (tem);
-           }
          if (CONSP (tem) && EQ (XCAR (tem), Qkeymap))
            XSETCDR (elt, Fcopy_keymap (tem));
        }
@@ -1127,9 +1092,7 @@ binding KEY to DEF is added at the front of KEYMAP.  */)
   GCPRO3 (keymap, key, def);
   keymap = get_keymap (keymap, 1, 1);
 
-  CHECK_VECTOR_OR_STRING (key);
-
-  length = XFASTINT (Flength (key));
+  length = CHECK_VECTOR_OR_STRING (key);
   if (length == 0)
     RETURN_UNGCPRO (Qnil);
 
@@ -1283,9 +1246,7 @@ recognize the default bindings, just as `read-key-sequence' does.  */)
   GCPRO2 (keymap, key);
   keymap = get_keymap (keymap, 1, 1);
 
-  CHECK_VECTOR_OR_STRING (key);
-
-  length = XFASTINT (Flength (key));
+  length = CHECK_VECTOR_OR_STRING (key);
   if (length == 0)
     RETURN_UNGCPRO (keymap);
 
@@ -1383,9 +1344,7 @@ silly_event_symbol_error (Lisp_Object c)
       c = reorder_modifiers (c);
       keystring = concat2 (build_string (new_mods), XCDR (assoc));
 
-      error ((modifiers & ~meta_modifier
-             ? "To bind the key %s, use [?%s], not [%s]"
-             : "To bind the key %s, use \"%s\", not [%s]"),
+      error ("To bind the key %s, use [?%s], not [%s]",
             SDATA (SYMBOL_NAME (c)), SDATA (keystring),
             SDATA (SYMBOL_NAME (c)));
     }
@@ -1894,7 +1853,7 @@ struct accessible_keymaps_data {
 
 static void
 accessible_keymaps_1 (Lisp_Object key, Lisp_Object cmd, Lisp_Object args, void *data)
-/* Use void* data to be compatible with map_keymap_function_t.  */
+/* Use void * data to be compatible with map_keymap_function_t.  */
 {
   struct accessible_keymaps_data *d = data; /* Cast! */
   Lisp_Object maps = d->maps;
@@ -2574,9 +2533,8 @@ If FIRSTONLY has another non-nil value, prefer bindings
 that use the modifier key specified in `where-is-preferred-modifier'
 \(or their meta variants) and entirely reject menu bindings.
 
-If optional 4th arg NOINDIRECT is non-nil, don't follow indirections
-to other keymaps or slots.  This makes it possible to search for an
-indirect definition itself.
+If optional 4th arg NOINDIRECT is non-nil, don't extract the commands inside
+menu-items.  This makes it possible to search for a menu-item itself.
 
 The optional 5th arg NO-REMAP alters how command remapping is handled:
 
index 4a408c6a2a0f68e3acbbe136107eee9f6b0a26b0..b01886dfa619edfa38a286413ff7ff6d9bab27d9 100644 (file)
@@ -46,7 +46,7 @@ extern void syms_of_keymap (void);
 extern void keys_of_keymap (void);
 
 typedef void (*map_keymap_function_t)
-     (Lisp_Object key, Lisp_Object val, Lisp_Object args, voiddata);
+     (Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data);
 extern void map_keymap (Lisp_Object, map_keymap_function_t, Lisp_Object,
                        void *, bool);
 extern void map_keymap_canonical (Lisp_Object map,
index 2b632ad19f1ef7256c812c4a25b83c32ff24abe1..67299706c6b3aee40e8631271b3956add0f42914 100644 (file)
@@ -59,16 +59,6 @@ INLINE_HEADER_BEGIN
 # define ENUMABLE(val) 0
 #endif
 
-/* On AIX 7.1 ENUMABLE should return true when possible, otherwise the
-   linker can optimize the symbols away, making it harder to debug.
-   This was discovered only late in the release process, so to play it
-   safe for now, non-AIX platforms do not use enums for debugging symbols.
-   FIXME: remove this comment and the following four lines of code.  */
-#ifndef _AIX
-# undef ENUMABLE
-# define ENUMABLE(val) 0
-#endif
-
 #define DEFINE_GDB_SYMBOL_ENUM(id) enum { id = id##_val };
 #if defined MAIN_PROGRAM
 # define DEFINE_GDB_SYMBOL_BEGIN(type, id) type const id EXTERNALLY_VISIBLE
@@ -84,6 +74,26 @@ INLINE_HEADER_BEGIN
 #define max(a, b) ((a) > (b) ? (a) : (b))
 #define min(a, b) ((a) < (b) ? (a) : (b))
 
+/* Number of elements in an array.  */
+#define ARRAYELTS(arr) (sizeof (arr) / sizeof (arr)[0])
+
+/* Number of bits in a Lisp_Object tag.  */
+DEFINE_GDB_SYMBOL_BEGIN (int, GCTYPEBITS)
+#define GCTYPEBITS 3
+DEFINE_GDB_SYMBOL_END (GCTYPEBITS)
+
+/* The number of bits needed in an EMACS_INT over and above the number
+   of bits in a pointer.  This is 0 on systems where:
+   1.  We can specify multiple-of-8 alignment on static variables.
+   2.  We know malloc returns a multiple of 8.  */
+#if (defined alignas \
+     && (defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ \
+        || defined DARWIN_OS || defined __sun || defined __MINGW32__))
+# define NONPOINTER_BITS 0
+#else
+# define NONPOINTER_BITS GCTYPEBITS
+#endif
+
 /* EMACS_INT - signed integer wide enough to hold an Emacs value
    EMACS_INT_MAX - maximum value of EMACS_INT; can be used in #if
    pI - printf length modifier for EMACS_INT
@@ -91,16 +101,18 @@ INLINE_HEADER_BEGIN
 #ifndef EMACS_INT_MAX
 # if INTPTR_MAX <= 0
 #  error "INTPTR_MAX misconfigured"
-# elif INTPTR_MAX <= INT_MAX && !defined WIDE_EMACS_INT
+# elif INTPTR_MAX <= INT_MAX >> NONPOINTER_BITS && !defined WIDE_EMACS_INT
 typedef int EMACS_INT;
 typedef unsigned int EMACS_UINT;
 #  define EMACS_INT_MAX INT_MAX
 #  define pI ""
-# elif INTPTR_MAX <= LONG_MAX && !defined WIDE_EMACS_INT
+# elif INTPTR_MAX <= LONG_MAX >> NONPOINTER_BITS && !defined WIDE_EMACS_INT
 typedef long int EMACS_INT;
 typedef unsigned long EMACS_UINT;
 #  define EMACS_INT_MAX LONG_MAX
 #  define pI "l"
+/* Check versus LLONG_MAX, not LLONG_MAX >> NONPOINTER_BITS.
+   In theory this is not safe, but in practice it seems to be OK.  */
 # elif INTPTR_MAX <= LLONG_MAX
 typedef long long int EMACS_INT;
 typedef unsigned long long int EMACS_UINT;
@@ -119,7 +131,7 @@ enum {  BOOL_VECTOR_BITS_PER_CHAR =
 };
 
 /* An unsigned integer type representing a fixed-length bit sequence,
-   suitable for words in a Lisp bool vector.  Normally it is size_t
+   suitable for bool vector words, GC mark bits, etc.  Normally it is size_t
    for speed, but it is unsigned char on weird platforms.  */
 #if BOOL_VECTOR_BITS_PER_CHAR == CHAR_BIT
 typedef size_t bits_word;
@@ -137,7 +149,6 @@ enum
   {
     BITS_PER_CHAR      = CHAR_BIT,
     BITS_PER_SHORT     = CHAR_BIT * sizeof (short),
-    BITS_PER_INT       = CHAR_BIT * sizeof (int),
     BITS_PER_LONG      = CHAR_BIT * sizeof (long int),
     BITS_PER_EMACS_INT = CHAR_BIT * sizeof (EMACS_INT)
   };
@@ -241,12 +252,6 @@ extern bool suppress_checking EXTERNALLY_VISIBLE;
 
 enum Lisp_Bits
   {
-    /* Number of bits in a Lisp_Object tag.  This can be used in #if,
-       and for GDB's sake also as a regular symbol.  */
-    GCTYPEBITS =
-#define GCTYPEBITS 3
-       GCTYPEBITS,
-
     /* 2**GCTYPEBITS.  This must be a macro that expands to a literal
        integer constant, for MSVC.  */
 #define GCALIGNMENT 8
@@ -270,31 +275,19 @@ enum Lisp_Bits
    This can be used in #if, e.g., '#if VAL_MAX < UINTPTR_MAX' below.  */
 #define VAL_MAX (EMACS_INT_MAX >> (GCTYPEBITS - 1))
 
-/* Unless otherwise specified, use USE_LSB_TAG on systems where:  */
-#ifndef USE_LSB_TAG
-/* 1.  We know malloc returns a multiple of 8.  */
-# if (defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ \
-      || defined DARWIN_OS || defined __sun)
-/* 2.  We can specify multiple-of-8 alignment on static variables.  */
-#  ifdef alignas
-/* 3.  Pointers-as-ints exceed VAL_MAX.
+/* Whether the least-significant bits of an EMACS_INT contain the tag.
    On hosts where pointers-as-ints do not exceed VAL_MAX, USE_LSB_TAG is:
     a. unnecessary, because the top bits of an EMACS_INT are unused, and
     b. slower, because it typically requires extra masking.
-   So, default USE_LSB_TAG to true only on hosts where it might be useful.  */
-#   if VAL_MAX < UINTPTR_MAX
-#    define USE_LSB_TAG true
-#   endif
-#  endif
-# endif
-#endif
-#ifdef USE_LSB_TAG
-# undef USE_LSB_TAG
-enum enum_USE_LSB_TAG { USE_LSB_TAG = true };
-# define USE_LSB_TAG true
-#else
-enum enum_USE_LSB_TAG { USE_LSB_TAG = false };
-# define USE_LSB_TAG false
+   So, USE_LSB_TAG is true only on hosts where it might be useful.  */
+DEFINE_GDB_SYMBOL_BEGIN (bool, USE_LSB_TAG)
+#define USE_LSB_TAG (EMACS_INT_MAX >> GCTYPEBITS < INTPTR_MAX)
+DEFINE_GDB_SYMBOL_END (USE_LSB_TAG)
+
+#if !USE_LSB_TAG && !defined WIDE_EMACS_INT
+# error "USE_LSB_TAG not supported on this platform; please report this." \
+       "Try 'configure --with-wide-int' to work around the problem."
+error !;
 #endif
 
 #ifndef alignas
@@ -348,8 +341,8 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = false };
 #define lisp_h_CHECK_LIST_CONS(x, y) CHECK_TYPE (CONSP (x), Qlistp, y)
 #define lisp_h_CHECK_NUMBER(x) CHECK_TYPE (INTEGERP (x), Qintegerp, x)
 #define lisp_h_CHECK_SYMBOL(x) CHECK_TYPE (SYMBOLP (x), Qsymbolp, x)
-#define lisp_h_CHECK_TYPE(ok, Qxxxp, x) \
-   ((ok) ? (void) 0 : (void) wrong_type_argument (Qxxxp, x))
+#define lisp_h_CHECK_TYPE(ok, predicate, x) \
+   ((ok) ? (void) 0 : (void) wrong_type_argument (predicate, x))
 #define lisp_h_CONSP(x) (XTYPE (x) == Lisp_Cons)
 #define lisp_h_EQ(x, y) (XLI (x) == XLI (y))
 #define lisp_h_FLOATP(x) (XTYPE (x) == Lisp_Float)
@@ -369,15 +362,15 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = false };
 #define lisp_h_XCONS(a) \
    (eassert (CONSP (a)), (struct Lisp_Cons *) XUNTAG (a, Lisp_Cons))
 #define lisp_h_XHASH(a) XUINT (a)
-#define lisp_h_XPNTR(a) \
-   ((void *) (intptr_t) ((XLI (a) & VALMASK) | (DATA_SEG_BITS & ~VALMASK)))
+#define lisp_h_XPNTR(a) ((void *) (intptr_t) (XLI (a) & VALMASK))
 #define lisp_h_XSYMBOL(a) \
    (eassert (SYMBOLP (a)), (struct Lisp_Symbol *) XUNTAG (a, Lisp_Symbol))
 #ifndef GC_CHECK_CONS_LIST
 # define lisp_h_check_cons_list() ((void) 0)
 #endif
 #if USE_LSB_TAG
-# define lisp_h_make_number(n) XIL ((EMACS_INT) (n) << INTTYPEBITS)
+# define lisp_h_make_number(n) \
+    XIL ((EMACS_INT) ((EMACS_UINT) (n) << INTTYPEBITS))
 # define lisp_h_XFASTINT(a) XINT (a)
 # define lisp_h_XINT(a) (XLI (a) >> INTTYPEBITS)
 # define lisp_h_XTYPE(a) ((enum Lisp_Type) (XLI (a) & ~VALMASK))
@@ -395,7 +388,7 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = false };
 # define CHECK_LIST_CONS(x, y) lisp_h_CHECK_LIST_CONS (x, y)
 # define CHECK_NUMBER(x) lisp_h_CHECK_NUMBER (x)
 # define CHECK_SYMBOL(x) lisp_h_CHECK_SYMBOL (x)
-# define CHECK_TYPE(ok, Qxxxp, x) lisp_h_CHECK_TYPE (ok, Qxxxp, x)
+# define CHECK_TYPE(ok, predicate, x) lisp_h_CHECK_TYPE (ok, predicate, x)
 # define CONSP(x) lisp_h_CONSP (x)
 # define EQ(x, y) lisp_h_EQ (x, y)
 # define FLOATP(x) lisp_h_FLOATP (x)
@@ -641,18 +634,8 @@ enum pvec_type
   PVEC_FONT /* Should be last because it's used for range checking.  */
 };
 
-/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
-   which were stored in a Lisp_Object.  */
-#ifndef DATA_SEG_BITS
-# define DATA_SEG_BITS 0
-#endif
-enum { gdb_DATA_SEG_BITS = DATA_SEG_BITS };
-#undef DATA_SEG_BITS
-
 enum More_Lisp_Bits
   {
-    DATA_SEG_BITS = gdb_DATA_SEG_BITS,
-
     /* For convenience, we also store the number of elements in these bits.
        Note that this size is not necessarily the memory-footprint size, but
        only the number of Lisp_Object fields (that need to be traced by GC).
@@ -714,7 +697,14 @@ LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type))
 INLINE Lisp_Object
 make_number (EMACS_INT n)
 {
-  return XIL (USE_LSB_TAG ? n << INTTYPEBITS : n & INTMASK);
+  if (USE_LSB_TAG)
+    {
+      EMACS_UINT u = n;
+      n = u << INTTYPEBITS;
+    }
+  else
+    n &= INTMASK;
+  return XIL (n);
 }
 
 /* Extract A's value as a signed integer.  */
@@ -722,7 +712,12 @@ INLINE EMACS_INT
 XINT (Lisp_Object a)
 {
   EMACS_INT i = XLI (a);
-  return (USE_LSB_TAG ? i : i << INTTYPEBITS) >> INTTYPEBITS;
+  if (! USE_LSB_TAG)
+    {
+      EMACS_UINT u = i;
+      i = u << INTTYPEBITS;
+    }
+  return i >> INTTYPEBITS;
 }
 
 /* Like XINT (A), but may be faster.  A must be nonnegative.
@@ -828,7 +823,6 @@ INLINE struct Lisp_Save_Value *XSAVE_VALUE (Lisp_Object);
 /* Defined in chartab.c.  */
 extern Lisp_Object char_table_ref (Lisp_Object, int);
 extern void char_table_set (Lisp_Object, int, Lisp_Object);
-extern int char_table_translate (Lisp_Object, int);
 
 /* Defined in data.c.  */
 extern Lisp_Object Qarrayp, Qbufferp, Qbuffer_or_string_p, Qchar_table_p;
@@ -837,10 +831,13 @@ extern Lisp_Object Qnumberp, Qstringp, Qsymbolp, Qt, Qvectorp;
 extern Lisp_Object Qbool_vector_p;
 extern Lisp_Object Qvector_or_char_table_p, Qwholenump;
 extern Lisp_Object Qwindow;
-extern Lisp_Object Ffboundp (Lisp_Object);
 extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object);
+extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object);
 
 /* Defined in emacs.c.  */
+extern bool might_dump;
+/* True means Emacs has already been initialized.
+   Used during startup to detect startup of dumped Emacs.  */
 extern bool initialized;
 
 /* Defined in eval.c.  */
@@ -1006,8 +1003,9 @@ make_lisp_proc (struct Lisp_Process *p)
 
 /* Type checking.  */
 
-LISP_MACRO_DEFUN_VOID (CHECK_TYPE, (int ok, Lisp_Object Qxxxp, Lisp_Object x),
-                      (ok, Qxxxp, x))
+LISP_MACRO_DEFUN_VOID (CHECK_TYPE,
+                      (int ok, Lisp_Object predicate, Lisp_Object x),
+                      (ok, predicate, x))
 
 /* Deprecated and will be removed soon.  */
 
@@ -1201,12 +1199,6 @@ STRING_SET_CHARS (Lisp_Object string, ptrdiff_t newsize)
 {
   XSTRING (string)->size = newsize;
 }
-INLINE void
-STRING_COPYIN (Lisp_Object string, ptrdiff_t index, char const *new,
-              ptrdiff_t count)
-{
-  memcpy (SDATA (string) + index, new, count);
-}
 
 /* Header of vector-like objects.  This documents the layout constraints on
    vectors and pseudovectors (objects of PVEC_xxx subtype).  It also prevents
@@ -1415,10 +1407,11 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
    sense to handle a char-table with type struct Lisp_Vector.  An
    element of a char table can be any Lisp objects, but if it is a sub
    char-table, we treat it a table that contains information of a
-   specific range of characters.  A sub char-table has the same
-   structure as a vector.  A sub char table appears only in an element
-   of a char-table, and there's no way to access it directly from
-   Emacs Lisp program.  */
+   specific range of characters.  A sub char-table is like a vector but
+   with two integer fields between the header and Lisp data, which means
+   that it has to be marked with some precautions (see mark_char_table
+   in alloc.c).  A sub char-table appears only in an element of a char-table,
+   and there's no way to access it directly from Emacs Lisp program.  */
 
 enum CHARTAB_SIZE_BITS
   {
@@ -1473,10 +1466,10 @@ struct Lisp_Sub_Char_Table
        contains 32 elements, and each element covers 128 characters.  A
        sub char-table of depth 3 contains 128 elements, and each element
        is for one character.  */
-    Lisp_Object depth;
+    int depth;
 
     /* Minimum character covered by the sub char-table.  */
-    Lisp_Object min_char;
+    int min_char;
 
     /* Use set_sub_char_table_contents to set this.  */
     Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER];
@@ -1547,12 +1540,16 @@ struct Lisp_Subr
     const char *doc;
   };
 
-/* This is the number of slots that every char table must have.  This
-   counts the ordinary slots and the top, defalt, parent, and purpose
-   slots.  */
-enum CHAR_TABLE_STANDARD_SLOTS
+enum char_table_specials
   {
-    CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras)
+    /* This is the number of slots that every char table must have.  This
+       counts the ordinary slots and the top, defalt, parent, and purpose
+       slots.  */
+    CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras),
+
+    /* This is an index of first Lisp_Object field in Lisp_Sub_Char_Table
+       when the latter is treated as an ordinary Lisp_Vector.  */
+    SUB_CHAR_TABLE_OFFSET = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents)
   };
 
 /* Return the number of "extra" slots in the char table CT.  */
@@ -1564,7 +1561,11 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct)
          - CHAR_TABLE_STANDARD_SLOTS);
 }
 
-\f
+/* Make sure that sub char-table contents slot
+   is aligned on a multiple of Lisp_Objects.  */
+verify ((offsetof (struct Lisp_Sub_Char_Table, contents)
+        - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0);
+
 /***********************************************************************
                               Symbols
  ***********************************************************************/
@@ -2555,15 +2556,20 @@ CHECK_BOOL_VECTOR (Lisp_Object x)
 {
   CHECK_TYPE (BOOL_VECTOR_P (x), Qbool_vector_p, x);
 }
-INLINE void
+/* This is a bit special because we always need size afterwards.  */
+INLINE ptrdiff_t
 CHECK_VECTOR_OR_STRING (Lisp_Object x)
 {
-  CHECK_TYPE (VECTORP (x) || STRINGP (x), Qarrayp, x);
+  if (VECTORP (x))
+    return ASIZE (x);
+  if (STRINGP (x))
+    return SCHARS (x);
+  wrong_type_argument (Qarrayp, x);
 }
 INLINE void
-CHECK_ARRAY (Lisp_Object x, Lisp_Object Qxxxp)
+CHECK_ARRAY (Lisp_Object x, Lisp_Object predicate)
 {
-  CHECK_TYPE (ARRAYP (x), Qxxxp, x);
+  CHECK_TYPE (ARRAYP (x), predicate, x);
 }
 INLINE void
 CHECK_BUFFER (Lisp_Object x)
@@ -2690,16 +2696,10 @@ CHECK_NUMBER_CDR (Lisp_Object x)
        minargs, maxargs, lname, intspec, 0};                           \
    Lisp_Object fnname
 #else  /* not _MSC_VER */
-# if __STDC_VERSION__ < 199901
-#  define DEFUN_FUNCTION_INIT(fnname, maxargs) (Lisp_Object (*) (void)) fnname
-# else
-#  define DEFUN_FUNCTION_INIT(fnname, maxargs) .a ## maxargs = fnname
-# endif
 #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)    \
-   Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                         \
    static struct Lisp_Subr alignas (GCALIGNMENT) sname =               \
      { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS },                                \
-       { DEFUN_FUNCTION_INIT (fnname, maxargs) },                      \
+       { .a ## maxargs = fnname },                                     \
        minargs, maxargs, lname, intspec, 0};                           \
    Lisp_Object fnname
 #endif
@@ -3359,7 +3359,7 @@ set_sub_char_table_contents (Lisp_Object table, ptrdiff_t idx, Lisp_Object val)
 }
 
 /* Defined in data.c.  */
-extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
+extern Lisp_Object Qquote, Qunbound;
 extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
 extern Lisp_Object Qerror, Qquit, Qargs_out_of_range;
 extern Lisp_Object Qvoid_variable, Qvoid_function;
@@ -3370,26 +3370,18 @@ extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 extern Lisp_Object Qtext_read_only;
 extern Lisp_Object Qinteractive_form;
 extern Lisp_Object Qcircular_list;
-extern Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp;
-extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
-extern Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp;
-extern Lisp_Object Qbuffer_or_string_p;
+extern Lisp_Object Qsequencep;
+extern Lisp_Object Qchar_or_string_p, Qinteger_or_marker_p;
 extern Lisp_Object Qfboundp;
-extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
 
 extern Lisp_Object Qcdr;
 
 extern Lisp_Object Qrange_error, Qoverflow_error;
 
-extern Lisp_Object Qfloatp;
-extern Lisp_Object Qnumberp, Qnumber_or_marker_p;
+extern Lisp_Object Qnumber_or_marker_p;
 
 extern Lisp_Object Qbuffer, Qinteger, Qsymbol;
 
-extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
-
-EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST;
-
 /* Defined in data.c.  */
 extern Lisp_Object indirect_function (Lisp_Object);
 extern Lisp_Object find_symbol_value (Lisp_Object);
@@ -3436,7 +3428,6 @@ extern struct Lisp_Symbol *indirect_variable (struct Lisp_Symbol *);
 extern _Noreturn void args_out_of_range (Lisp_Object, Lisp_Object);
 extern _Noreturn void args_out_of_range_3 (Lisp_Object, Lisp_Object,
                                           Lisp_Object);
-extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object);
 extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *);
 extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, bool);
 extern void syms_of_data (void);
@@ -3455,11 +3446,8 @@ extern void init_coding_once (void);
 extern void syms_of_coding (void);
 
 /* Defined in character.c.  */
-EXFUN (Fmax_char, 0) ATTRIBUTE_CONST;
 extern ptrdiff_t chars_in_text (const unsigned char *, ptrdiff_t);
 extern ptrdiff_t multibyte_chars_in_text (const unsigned char *, ptrdiff_t);
-extern int multibyte_char_to_unibyte (int) ATTRIBUTE_CONST;
-extern int multibyte_char_to_unibyte_safe (int) ATTRIBUTE_CONST;
 extern void syms_of_character (void);
 
 /* Defined in charset.c.  */
@@ -3469,9 +3457,6 @@ extern void syms_of_charset (void);
 /* Structure forward declarations.  */
 struct charset;
 
-/* Defined in composite.c.  */
-extern void syms_of_composite (void);
-
 /* Defined in syntax.c.  */
 extern void init_syntax_once (void);
 extern void syms_of_syntax (void);
@@ -3479,7 +3464,6 @@ extern void syms_of_syntax (void);
 /* Defined in fns.c.  */
 extern Lisp_Object QCrehash_size, QCrehash_threshold;
 enum { NEXT_ALMOST_PRIME_LIMIT = 11 };
-EXFUN (Fidentity, 1) ATTRIBUTE_CONST;
 extern EMACS_INT next_almost_prime (EMACS_INT) ATTRIBUTE_CONST;
 extern Lisp_Object larger_vector (Lisp_Object, ptrdiff_t, ptrdiff_t);
 extern void sweep_weak_hash_tables (void);
@@ -3494,7 +3478,8 @@ ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *);
 ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
                    EMACS_UINT);
 extern struct hash_table_test hashtest_eql, hashtest_equal;
-
+extern void validate_subarray (Lisp_Object, Lisp_Object, Lisp_Object,
+                              ptrdiff_t, ptrdiff_t *, ptrdiff_t *);
 extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t,
                                   ptrdiff_t, ptrdiff_t);
 extern Lisp_Object merge (Lisp_Object, Lisp_Object, Lisp_Object);
@@ -3512,7 +3497,6 @@ extern Lisp_Object string_make_unibyte (Lisp_Object);
 extern void syms_of_fns (void);
 
 /* Defined in floatfns.c.  */
-extern double extract_float (Lisp_Object);
 extern void syms_of_floatfns (void);
 extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y);
 
@@ -3533,6 +3517,7 @@ extern void syms_of_image (void);
 
 /* Defined in insdel.c.  */
 extern Lisp_Object Qinhibit_modification_hooks;
+extern Lisp_Object Qregion_extract_function;
 extern void move_gap_both (ptrdiff_t, ptrdiff_t);
 extern _Noreturn void buffer_overflow (void);
 extern void make_gap (ptrdiff_t);
@@ -3585,18 +3570,16 @@ _Noreturn void __executable_start (void);
 #endif
 extern Lisp_Object Vwindow_system;
 extern Lisp_Object sit_for (Lisp_Object, bool, int);
-extern void init_display (void);
-extern void syms_of_display (void);
 
 /* Defined in xdisp.c.  */
 extern Lisp_Object Qinhibit_point_motion_hooks;
-extern Lisp_Object Qinhibit_redisplay, Qdisplay;
+extern Lisp_Object Qinhibit_redisplay;
 extern Lisp_Object Qmenu_bar_update_hook;
 extern Lisp_Object Qwindow_scroll_functions;
 extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
-extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz, Qtext_image_horiz;
+extern Lisp_Object Qtext, Qboth, Qboth_horiz, Qtext_image_horiz;
 extern Lisp_Object Qspace, Qcenter, QCalign_to;
-extern Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
+extern Lisp_Object Qbar, Qhbar, Qhollow;
 extern Lisp_Object Qleft_margin, Qright_margin;
 extern Lisp_Object QCdata, QCfile;
 extern Lisp_Object QCmap;
@@ -3623,7 +3606,6 @@ extern void message_log_maybe_newline (void);
 extern void update_echo_area (void);
 extern void truncate_echo_area (ptrdiff_t);
 extern void redisplay (void);
-extern void redisplay_preserve_echo_area (int);
 
 void set_frame_cursor_types (struct frame *, Lisp_Object);
 extern void syms_of_xdisp (void);
@@ -3755,6 +3737,20 @@ make_uninit_vector (ptrdiff_t size)
   return v;
 }
 
+/* Like above, but special for sub char-tables.  */
+
+INLINE Lisp_Object
+make_uninit_sub_char_table (int depth, int min_char)
+{
+  int slots = SUB_CHAR_TABLE_OFFSET + chartab_size[depth];
+  Lisp_Object v = make_uninit_vector (slots);
+
+  XSETPVECTYPE (XVECTOR (v), PVEC_SUB_CHAR_TABLE);
+  XSUB_CHAR_TABLE (v)->depth = depth;
+  XSUB_CHAR_TABLE (v)->min_char = min_char;
+  return v;
+}
+
 extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
 #define ALLOCATE_PSEUDOVECTOR(typ,field,tag)                           \
   ((typ*)                                                              \
@@ -3788,6 +3784,7 @@ extern void init_alloc (void);
 extern void syms_of_alloc (void);
 extern struct buffer * allocate_buffer (void);
 extern int valid_lisp_object_p (Lisp_Object);
+extern int relocatable_string_data_p (const char *);
 #ifdef GC_CHECK_CONS_LIST
 extern void check_cons_list (void);
 #else
@@ -3796,21 +3793,18 @@ INLINE void (check_cons_list) (void) { lisp_h_check_cons_list (); }
 
 #ifdef REL_ALLOC
 /* Defined in ralloc.c.  */
-extern void *r_alloc (void **, size_t);
+extern void *r_alloc (void **, size_t) ATTRIBUTE_ALLOC_SIZE ((2));
 extern void r_alloc_free (void **);
-extern void *r_re_alloc (void **, size_t);
+extern void *r_re_alloc (void **, size_t) ATTRIBUTE_ALLOC_SIZE ((2));
 extern void r_alloc_reset_variable (void **, void **);
 extern void r_alloc_inhibit_buffer_relocation (int);
 #endif
 
 /* Defined in chartab.c.  */
 extern Lisp_Object copy_char_table (Lisp_Object);
-extern Lisp_Object char_table_ref (Lisp_Object, int);
 extern Lisp_Object char_table_ref_and_range (Lisp_Object, int,
                                              int *, int *);
-extern void char_table_set (Lisp_Object, int, Lisp_Object);
 extern void char_table_set_range (Lisp_Object, int, int, Lisp_Object);
-extern int char_table_translate (Lisp_Object, int);
 extern void map_char_table (void (*) (Lisp_Object, Lisp_Object,
                             Lisp_Object),
                             Lisp_Object, Lisp_Object, Lisp_Object);
@@ -3888,7 +3882,7 @@ intern_c_string (const char *str)
 }
 
 /* Defined in eval.c.  */
-extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qmacro;
+extern Lisp_Object Qexit, Qinteractive, Qcommandp, Qmacro;
 extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure;
 extern Lisp_Object Qand_rest;
 extern Lisp_Object Vautoload_queue;
@@ -3992,7 +3986,7 @@ extern bool overlay_touches_p (ptrdiff_t);
 extern Lisp_Object other_buffer_safely (Lisp_Object);
 extern Lisp_Object get_truename_buffer (Lisp_Object);
 extern void init_buffer_once (void);
-extern void init_buffer (void);
+extern void init_buffer (int);
 extern void syms_of_buffer (void);
 extern void keys_of_buffer (void);
 
@@ -4023,7 +4017,6 @@ extern Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object);
 extern Lisp_Object write_region (Lisp_Object, Lisp_Object, Lisp_Object,
                                 Lisp_Object, Lisp_Object, Lisp_Object,
                                 Lisp_Object, int);
-EXFUN (Fread_file_name, 6);     /* Not a normal DEFUN.  */
 extern void close_file_unwind (int);
 extern void fclose_unwind (void *);
 extern void restore_point_unwind (Lisp_Object);
@@ -4075,6 +4068,7 @@ extern void syms_of_minibuf (void);
 /* Defined in callint.c.  */
 
 extern Lisp_Object Qminus, Qplus;
+extern Lisp_Object Qprogn;
 extern Lisp_Object Qwhen;
 extern Lisp_Object Qmouse_leave_buffer_hook;
 extern void syms_of_callint (void);
@@ -4096,8 +4090,7 @@ extern Lisp_Object echo_message_buffer;
 extern struct kboard *echo_kboard;
 extern void cancel_echoing (void);
 extern Lisp_Object Qdisabled, QCfilter;
-extern Lisp_Object Qup, Qdown, Qbottom;
-extern Lisp_Object Qtop;
+extern Lisp_Object Qup, Qdown;
 extern Lisp_Object last_undo_boundary;
 extern bool input_pending;
 extern Lisp_Object menu_bar_items (Lisp_Object);
@@ -4129,14 +4122,10 @@ extern void syms_of_indent (void);
 
 /* Defined in frame.c.  */
 extern Lisp_Object Qonly, Qnone;
-extern Lisp_Object Qvisible;
-extern void set_frame_param (struct frame *, Lisp_Object, Lisp_Object);
 extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
 extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object);
 extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
-#if HAVE_NS || HAVE_NTGUI
 extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
-#endif
 extern void frames_discard_buffer (Lisp_Object);
 extern void syms_of_frame (void);
 
@@ -4187,10 +4176,8 @@ extern bool running_asynch_code;
 /* Defined in process.c.  */
 extern Lisp_Object QCtype, Qlocal;
 extern void kill_buffer_processes (Lisp_Object);
-extern bool wait_reading_process_output (intmax_t, int, int, bool,
-                                        Lisp_Object,
-                                        struct Lisp_Process *,
-                                        int);
+extern int wait_reading_process_output (intmax_t, int, int, bool, Lisp_Object,
+                                       struct Lisp_Process *, int);
 /* Max value for the first argument of wait_reading_process_output.  */
 #if __GNUC__ == 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5)
 /* Work around a bug in GCC 3.4.2, known to be fixed in GCC 4.6.3.
@@ -4199,6 +4186,9 @@ extern bool wait_reading_process_output (intmax_t, int, int, bool,
 #else
 # define WAIT_READING_MAX INTMAX_MAX
 #endif
+#ifdef HAVE_TIMERFD
+extern void add_timer_wait_descriptor (int);
+#endif
 extern void add_keyboard_wait_descriptor (int);
 extern void delete_keyboard_wait_descriptor (int);
 #ifdef HAVE_GPM
@@ -4253,9 +4243,8 @@ extern void record_property_change (ptrdiff_t, ptrdiff_t,
                                     Lisp_Object);
 extern void syms_of_undo (void);
 /* Defined in textprop.c.  */
-extern Lisp_Object Qfont, Qmouse_face;
+extern Lisp_Object Qmouse_face;
 extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks;
-extern Lisp_Object Qfront_sticky, Qrear_nonsticky;
 extern Lisp_Object Qminibuffer_prompt;
 
 extern void report_interval_modification (Lisp_Object, Lisp_Object);
@@ -4278,12 +4267,9 @@ extern char *get_current_dir_name (void);
 #endif
 extern void stuff_char (char c);
 extern void init_foreground_group (void);
-extern void init_sigio (int);
 extern void sys_subshell (void);
 extern void sys_suspend (void);
 extern void discard_tty_input (void);
-extern void block_tty_out_signal (void);
-extern void unblock_tty_out_signal (void);
 extern void init_sys_modes (struct tty_display_info *);
 extern void reset_sys_modes (struct tty_display_info *);
 extern void init_all_sys_modes (void);
@@ -4365,8 +4351,8 @@ extern void syms_of_w32notify (void);
 #endif
 
 /* Defined in xfaces.c.  */
-extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
-extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
+extern Lisp_Object Qdefault, Qfringe;
+extern Lisp_Object Qscroll_bar, Qcursor;
 extern Lisp_Object Qmode_line_inactive;
 extern Lisp_Object Qface;
 extern Lisp_Object Qnormal;
@@ -4425,24 +4411,21 @@ extern void syms_of_profiler (void);
 /* Defined in msdos.c, w32.c.  */
 extern char *emacs_root_dir (void);
 #endif /* DOS_NT */
-\f
-/* True means Emacs has already been initialized.
-   Used during startup to detect startup of dumped Emacs.  */
-extern bool initialized;
 
 /* True means ^G can quit instantly.  */
 extern bool immediate_quit;
 
-extern void *xmalloc (size_t);
-extern void *xzalloc (size_t);
-extern void *xrealloc (void *, size_t);
+extern void *xmalloc (size_t) ATTRIBUTE_MALLOC_SIZE ((1));
+extern void *xzalloc (size_t) ATTRIBUTE_MALLOC_SIZE ((1));
+extern void *xrealloc (void *, size_t) ATTRIBUTE_ALLOC_SIZE ((2));
 extern void xfree (void *);
-extern void *xnmalloc (ptrdiff_t, ptrdiff_t);
-extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t);
+extern void *xnmalloc (ptrdiff_t, ptrdiff_t) ATTRIBUTE_MALLOC_SIZE ((1,2));
+extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t)
+  ATTRIBUTE_ALLOC_SIZE ((2,3));
 extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t);
 
-extern char *xstrdup (const char *);
-extern char *xlispstrdup (Lisp_Object);
+extern char *xstrdup (const char *) ATTRIBUTE_MALLOC;
+extern char *xlispstrdup (Lisp_Object) ATTRIBUTE_MALLOC;
 extern void dupstring (char **, char const *);
 extern void xputenv (const char *);
 
@@ -4474,7 +4457,7 @@ extern void init_system_name (void);
 
 enum MAX_ALLOCA { MAX_ALLOCA = 16 * 1024 };
 
-extern void *record_xmalloc (size_t);
+extern void *record_xmalloc (size_t) ATTRIBUTE_ALLOC_SIZE ((1));
 
 #define USE_SAFE_ALLOCA                        \
   ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = false
index 4990d25eda1a3f86a61ecc04896951bd97ced252..639d574ac6b757992ea0da86289e60f2258cfa51 100644 (file)
@@ -213,7 +213,7 @@ readchar (Lisp_Object readcharfun, bool *multibyte)
       else
        {
          c = BUF_FETCH_BYTE (inbuffer, pt_byte);
-         if (! ASCII_BYTE_P (c))
+         if (! ASCII_CHAR_P (c))
            c = BYTE8_TO_CHAR (c);
          pt_byte++;
        }
@@ -242,7 +242,7 @@ readchar (Lisp_Object readcharfun, bool *multibyte)
       else
        {
          c = BUF_FETCH_BYTE (inbuffer, bytepos);
-         if (! ASCII_BYTE_P (c))
+         if (! ASCII_CHAR_P (c))
            c = BYTE8_TO_CHAR (c);
          bytepos++;
        }
@@ -324,7 +324,7 @@ readchar (Lisp_Object readcharfun, bool *multibyte)
     return c;
   if (multibyte)
     *multibyte = 1;
-  if (ASCII_BYTE_P (c))
+  if (ASCII_CHAR_P (c))
     return c;
   if (emacs_mule_encoding)
     return read_emacs_mule_char (c, readbyte, readcharfun);
@@ -1763,6 +1763,29 @@ end_of_file_error (void)
   xsignal0 (Qend_of_file);
 }
 
+static Lisp_Object
+readevalloop_eager_expand_eval (Lisp_Object val, Lisp_Object macroexpand)
+{
+  /* If we macroexpand the toplevel form non-recursively and it ends
+     up being a `progn' (or if it was a progn to start), treat each
+     form in the progn as a top-level form.  This way, if one form in
+     the progn defines a macro, that macro is in effect when we expand
+     the remaining forms.  See similar code in bytecomp.el.  */
+  val = call2 (macroexpand, val, Qnil);
+  if (EQ (CAR_SAFE (val), Qprogn))
+    {
+      Lisp_Object subforms = XCDR (val);
+      val = Qnil;
+      for (; CONSP (subforms); subforms = XCDR (subforms))
+          val = readevalloop_eager_expand_eval (XCAR (subforms),
+                                                macroexpand);
+    }
+  else
+      val = eval_sub (call2 (macroexpand, val, Qt));
+
+  return val;
+}
+
 /* UNIBYTE specifies how to set load_convert_to_unibyte
    for this invocation.
    READFUN, if non-nil, is used instead of `read'.
@@ -1930,8 +1953,9 @@ readevalloop (Lisp_Object readcharfun,
 
       /* Now eval what we just read.  */
       if (!NILP (macroexpand))
-       val = call1 (macroexpand, val);
-      val = eval_sub (val);
+        val = readevalloop_eager_expand_eval (val, macroexpand);
+      else
+        val = eval_sub (val);
 
       if (printflag)
        {
@@ -2595,21 +2619,38 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
              c = READCHAR;
              if (c == '[')
                {
-                 Lisp_Object tmp;
-                 int depth;
-                 ptrdiff_t size;
+                 /* Sub char-table can't be read as a regular
+                    vector because of a two C integer fields.  */
+                 Lisp_Object tbl, tmp = read_list (1, readcharfun);
+                 ptrdiff_t size = XINT (Flength (tmp));
+                 int i, depth, min_char;
+                 struct Lisp_Cons *cell;
 
-                 tmp = read_vector (readcharfun, 0);
-                 size = ASIZE (tmp);
                  if (size == 0)
-                   error ("Invalid size char-table");
-                 if (! RANGED_INTEGERP (1, AREF (tmp, 0), 3))
-                   error ("Invalid depth in char-table");
-                 depth = XINT (AREF (tmp, 0));
+                   error ("Zero-sized sub char-table");
+
+                 if (! RANGED_INTEGERP (1, XCAR (tmp), 3))
+                   error ("Invalid depth in sub char-table");
+                 depth = XINT (XCAR (tmp));
                  if (chartab_size[depth] != size - 2)
-                   error ("Invalid size char-table");
-                 XSETPVECTYPE (XVECTOR (tmp), PVEC_SUB_CHAR_TABLE);
-                 return tmp;
+                   error ("Invalid size in sub char-table");
+                 cell = XCONS (tmp), tmp = XCDR (tmp), size--;
+                 free_cons (cell);
+
+                 if (! RANGED_INTEGERP (0, XCAR (tmp), MAX_CHAR))
+                   error ("Invalid minimum character in sub-char-table");
+                 min_char = XINT (XCAR (tmp));
+                 cell = XCONS (tmp), tmp = XCDR (tmp), size--;
+                 free_cons (cell);
+
+                 tbl = make_uninit_sub_char_table (depth, min_char);
+                 for (i = 0; i < size; i++)
+                   {
+                     XSUB_CHAR_TABLE (tbl)->contents[i] = XCAR (tmp);
+                     cell = XCONS (tmp), tmp = XCDR (tmp);
+                     free_cons (cell);
+                   }
+                 return tbl;
                }
              invalid_syntax ("#^^");
            }
@@ -3826,7 +3867,7 @@ it defaults to the value of `obarray'.  */)
       SET_SYMBOL_VAL (XSYMBOL (sym), sym);
     }
 
-  ptr = aref_addr (obarray, XINT(tem));
+  ptr = aref_addr (obarray, XINT (tem));
   if (SYMBOLP (*ptr))
     set_symbol_next (sym, XSYMBOL (*ptr));
   else
index 1bb3fb141349b184045832225cf6f9920beb0d26..0d702873220f5e9bf5806d60123b84293997ad4b 100644 (file)
@@ -237,8 +237,7 @@ mac_font_get_glyph_for_cid (FontRef font, CharacterCollection collection,
     unichar characters[] = {0xfffd};
     NSString *string =
       [NSString stringWithCharacters:characters
-                             length:(sizeof (characters)
-                                     / sizeof (characters[0]))];
+                             length:ARRAYELTS (characters)];
     NSGlyphInfo *glyphInfo =
       [NSGlyphInfo glyphInfoWithCharacterIdentifier:cid
                                         collection:collection
@@ -777,7 +776,7 @@ cfnumber_get_font_symbolic_traits_value (CFNumberRef number,
   SInt64 sint64_value;
 
   /* Getting symbolic traits with kCFNumberSInt32Type is lossy on Mac
-     OS 10.6 when the value is greater than or equal to 1 << 31.  */
+     OS 10.6 when the value is greater than or equal to 1 << 31.  */
   if (CFNumberGetValue (number, kCFNumberSInt64Type, &sint64_value))
     {
       *sym_traits = (FontSymbolicTraits) sint64_value;
@@ -826,7 +825,7 @@ macfont_store_descriptor_attributes (FontDescriptorRef desc,
            {{0, 100}, {1, 200}, {CGFLOAT_MAX, CGFLOAT_MAX}}}};
       int i;
 
-      for (i = 0; i < sizeof (numeric_traits) / sizeof (numeric_traits[0]); i++)
+      for (i = 0; i < ARRAYELTS (numeric_traits); i++)
        {
          num = CFDictionaryGetValue (dict, numeric_traits[i].trait);
          if (num && CFNumberGetValue (num, kCFNumberCGFloatType, &floatval))
@@ -1252,8 +1251,7 @@ macfont_lookup_cache (CFStringRef key)
             CTFontCopyCharacterSet nor -[NSFont coveredCharacterSet]
             for this font is correct for non-BMP characters on Mac OS
             X 10.5, anyway.  */
-         if (CFStringCompare (key, CFSTR ("LastResort"), 0)
-             == kCFCompareEqualTo)
+         if (CFEqual (key, CFSTR ("LastResort")))
            {
              CFRange range = CFRangeMake (0, MAX_UNICODE_CHAR + 1);
 
@@ -1582,8 +1580,6 @@ static struct font_driver macfont_driver =
     macfont_draw,
     NULL,                      /* get_bitmap */
     NULL,                      /* free_bitmap */
-    NULL,                      /* get_outline */
-    NULL,                      /* free_outline */
     NULL,                      /* anchor_point */
     NULL,                      /* otf_capability */
     NULL,                      /* otf_drive */
@@ -1908,7 +1904,7 @@ macfont_create_attributes_with_spec (Lisp_Object spec)
   if (! traits)
     goto err;
 
-  for (i = 0; i < sizeof (numeric_traits) / sizeof (numeric_traits[0]); i++)
+  for (i = 0; i < ARRAYELTS (numeric_traits); i++)
     {
       tmp = AREF (spec, numeric_traits[i].index);
       if (INTEGERP (tmp))
@@ -2211,27 +2207,26 @@ macfont_list (struct frame *f, Lisp_Object spec)
         10.7 returns NULL if pat_desc represents the LastResort font.
         So we use CTFontDescriptorCreateMatchingFontDescriptor (no
         trailing "s") for such a font.  */
-      if (CFStringCompare (family_name, CFSTR ("LastResort"), 0)
-         != kCFCompareEqualTo)
-       descs = mac_font_descriptor_create_matching_font_descriptors (pat_desc,
-                                                                     NULL);
+      if (!CFEqual (family_name, CFSTR ("LastResort")))
+       descs = mac_font_descriptor_create_matching_font_descriptors (pat_desc,
+                                                                     NULL);
       else
-       {
-         FontDescriptorRef lr_desc =
-           mac_font_descriptor_create_matching_font_descriptor (pat_desc,
-                                                                NULL);
-         if (lr_desc)
-           {
-             descs = CFArrayCreate (NULL, (const void **) &lr_desc, 1,
-                                    &kCFTypeArrayCallBacks);
-             CFRelease (lr_desc);
-           }
-         else
-           descs = NULL;
-       }
+       {
+         FontDescriptorRef lr_desc =
+           mac_font_descriptor_create_matching_font_descriptor (pat_desc,
+                                                                NULL);
+         if (lr_desc)
+           {
+             descs = CFArrayCreate (NULL, (const void **) &lr_desc, 1,
+                                    &kCFTypeArrayCallBacks);
+             CFRelease (lr_desc);
+           }
+         else
+           descs = NULL;
+       }
       CFRelease (pat_desc);
       if (! descs)
-       goto err;
+       goto err;
 
       descs_count = CFArrayGetCount (descs);
       if (descs_count == 0
@@ -2449,8 +2444,7 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size)
   int size;
   FontRef macfont;
   FontSymbolicTraits sym_traits;
-  char name[256];
-  int len, i, total_width;
+  int i, total_width;
   CGGlyph glyph;
   CGFloat ascent, descent, leading;
 
@@ -2477,17 +2471,8 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size)
   if (! macfont)
     return Qnil;
 
-  font_object = font_make_object (VECSIZE (struct macfont_info), entity, size);
-  ASET (font_object, FONT_TYPE_INDEX, macfont_driver.type);
-  len = font_unparse_xlfd (entity, size, name, 256);
-  if (len > 0)
-    ASET (font_object, FONT_NAME_INDEX, make_string (name, len));
-  len = font_unparse_fcname (entity, size, name, 256);
-  if (len > 0)
-    ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len));
-  else
-    ASET (font_object, FONT_FULLNAME_INDEX,
-         AREF (font_object, FONT_NAME_INDEX));
+  font_object = font_build_object (VECSIZE (struct macfont_info),
+                                  Qmac_ct, entity, size);
   font = XFONT_OBJECT (font_object);
   font->pixel_size = size;
   font->driver = &macfont_driver;
@@ -2572,12 +2557,9 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size)
       family_name = mac_font_copy_family_name (macfont);
       if (family_name)
        {
-         if ((CFStringCompare (family_name, CFSTR ("Courier"), 0)
-              == kCFCompareEqualTo)
-             || (CFStringCompare (family_name, CFSTR ("Helvetica"), 0)
-                 == kCFCompareEqualTo)
-             || (CFStringCompare (family_name, CFSTR ("Times"), 0)
-                 == kCFCompareEqualTo))
+         if (CFEqual (family_name, CFSTR ("Courier"))
+             || CFEqual (family_name, CFSTR ("Helvetica"))
+             || CFEqual (family_name, CFSTR ("Times")))
            ascent += (ascent + descent) * .15f;
          else if (CFStringHasPrefix (family_name, CFSTR ("Hiragino")))
            {
@@ -2712,33 +2694,54 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
 {
   struct frame * f = s->f;
   struct macfont_info *macfont_info = (struct macfont_info *) s->font;
-  FontRef macfont = macfont_info->macfont;
-  CGContextRef context;
-  BOOL isComposite = s->first_glyph->type == COMPOSITE_GLYPH;
-  int end = isComposite ? s->cmp_to : s->nchars;
-  int len = end - s->cmp_from;
+  CGRect background_rect;
+  CGPoint text_position;
+  CGGlyph *glyphs;
+  CGPoint *positions;
+  CGFloat font_size = mac_font_get_size (macfont_info->macfont);
+  bool no_antialias_p =
+    (macfont_info->antialias == MACFONT_ANTIALIAS_OFF
+     || (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT
+        && font_size <= macfont_antialias_threshold));
+  int len = to - from;
   struct face *face = s->face;
-  int i;
+  CGContextRef context;
 
   block_input ();
 
-  context = [[NSGraphicsContext currentContext] graphicsPort];
-  CGContextSaveGState (context);
+  if (with_background)
+    background_rect = CGRectMake (x, y - FONT_BASE (s->font),
+                                  s->width, FONT_HEIGHT (s->font));
+ else
+    background_rect = CGRectNull;
+  
+  text_position = CGPointMake (x, -y);
+  glyphs = xmalloc (sizeof (CGGlyph) * len);
+  {
+    CGFloat advance_delta;
+    int i;
+    CGFloat total_width = 0;
 
-#if 0
-  if (s->num_clips > 0)
-    {
-      CGRect clips[2];
+    positions = xmalloc (sizeof (CGPoint) * len);
+    for (i = 0; i < len; i++)
+      {
+       int width;
+
+       glyphs[i] = s->char2b[from + i];
+       width = (s->padding_p ? 1
+                : macfont_glyph_extents (s->font, glyphs[i],
+                                         NULL, &advance_delta,
+                                         no_antialias_p));
+       positions[i].x = total_width + advance_delta;
+       positions[i].y = 0;
+       total_width += width;
+      }
+  }
 
-      for (i = 0; i < s->num_clips; i++)
-       clips[i] = mac_rect_make (f, s->clip[i].left, s->clip[i].top,
-                                 s->clip[i].right - s->clip[i].left,
-                                 s->clip[i].bottom - s->clip[i].top);
-      CGContextClipToRects (context, clips, s->num_clips);
-    }
-#endif
+  context = [[NSGraphicsContext currentContext] graphicsPort];
+  CGContextSaveGState (context);
 
-  if (with_background)
+  if (!CGRectIsNull (background_rect))
     {
       if (s->hl == DRAW_MOUSE_FACE) 
         {
@@ -2746,41 +2749,13 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
           if (!face)
             face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
         }
-
       CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face, f);
-      CGContextFillRect (context,
-                        CGRectMake (x, y,
-                                     s->width, FONT_HEIGHT (s->font)));
+      CGContextFillRects (context, &background_rect, 1);
     }
 
   if (macfont_info->cgfont)
     {
-      CGGlyph *glyphs = alloca (sizeof (CGGlyph) * len);
-      CGPoint *positions = alloca (sizeof (CGPoint) * len);
-      CGFloat total_width = 0;
-      CGFloat font_size = mac_font_get_size (macfont);
       CGAffineTransform atfm;
-      CGFloat advance_delta = 0;
-      int y_draw = -s->ybase;
-      int no_antialias_p =
-       (macfont_info->antialias == MACFONT_ANTIALIAS_OFF
-        || (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT
-            && font_size <= macfont_antialias_threshold));
-
-      for (i = 0; i < len; i++)
-       {
-         int width;
-
-         glyphs[i] = *(s->char2b + s->cmp_from + i);
-         width = (s->padding_p ? 1
-                  : macfont_glyph_extents (s->font, glyphs[i],
-                                           NULL, &advance_delta,
-                                           no_antialias_p));
-         positions[i].x = total_width + advance_delta;
-         positions[i].y = 0;
-         total_width += width;
-       }
-
       CGContextScaleCTM (context, 1, -1);
       CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face, s->f);
       if (macfont_info->synthetic_italic_p)
@@ -2797,7 +2772,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
        CGContextSetShouldAntialias (context, false);
 
       CGContextSetTextMatrix (context, atfm);
-      CGContextSetTextPosition (context, x, y_draw);
+      CGContextSetTextPosition (context, text_position.x, text_position.y);
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
       if (macfont_info->color_bitmap_p
@@ -2808,7 +2783,8 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
        {
          if (len > 0)
            {
-             CTFontDrawGlyphs (macfont, glyphs, positions, len, context);
+             CTFontDrawGlyphs (macfont_info->macfont, glyphs, positions, len,
+                                context);
            }
        }
       else
@@ -2820,6 +2796,9 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
        }
     }
 
+
+  xfree (glyphs);
+  xfree (positions);
   CGContextRestoreGState (context);
 
   unblock_input ();
@@ -3558,7 +3537,7 @@ mac_ctfont_equal_in_postscript_name (CTFontRef font1, CTFontRef font2)
       name2 = CTFontCopyPostScriptName (font2);
       if (name2)
        {
-         result = (CFStringCompare (name1, name2, 0) == kCFCompareEqualTo);
+         result = CFEqual (name1, name2);
          CFRelease (name2);
        }
       CFRelease (name1);
@@ -3584,7 +3563,7 @@ mac_ctfont_create_line_with_string_and_font (CFStringRef string,
     {
       attributes = CFDictionaryCreate (NULL, (const void **) keys,
                                       (const void **) values,
-                                      sizeof (keys) / sizeof (keys[0]),
+                                       ARRAYELTS (keys),
                                       &kCFTypeDictionaryKeyCallBacks,
                                       &kCFTypeDictionaryValueCallBacks);
       CFRelease (values[1]);
@@ -3795,8 +3774,8 @@ mac_ctfont_get_glyph_for_cid (CTFontRef font, CTCharacterCollection collection,
   CTLineRef ctline = NULL;
 
   string = CFStringCreateWithCharacters (NULL, characters,
-                                        sizeof (characters)
-                                        / sizeof (characters[0]));
+                                         ARRAYELTS (characters));
+
   if (string)
     {
       CTGlyphInfoRef glyph_info =
@@ -3811,7 +3790,7 @@ mac_ctfont_get_glyph_for_cid (CTFontRef font, CTCharacterCollection collection,
 
          attributes = CFDictionaryCreate (NULL, (const void **) keys,
                                           (const void **) values,
-                                          sizeof (keys) / sizeof (keys[0]),
+                                           ARRAYELTS (keys),
                                           &kCFTypeDictionaryKeyCallBacks,
                                           &kCFTypeDictionaryValueCallBacks);
          CFRelease (glyph_info);
@@ -3931,8 +3910,8 @@ mac_font_copy_default_descriptors_for_language (CFStringRef language)
 
       for (i = 0; macfont_language_default_font_names[i].language; i++)
        {
-         if (CFStringCompare (macfont_language_default_font_names[i].language,
-                              language, 0) == kCFCompareEqualTo)
+         if (CFEqual (macfont_language_default_font_names[i].language,
+                       language))
            {
              CFMutableArrayRef descriptors =
                CFArrayCreateMutable (NULL, 0, &kCFTypeArrayCallBacks);
@@ -4012,9 +3991,8 @@ mac_font_copy_default_name_for_charset_and_languages (CFCharacterSetRef charset,
              if (family)
                {
                  if (!CFStringHasPrefix (family, CFSTR ("."))
-                     && (CFStringCompare (family, CFSTR ("LastResort"), 0)
-                         != kCFCompareEqualTo))
-                   {
+                     && !CFEqual (family, CFSTR ("LastResort")))
+                    {
                      result = family;
                      break;
                    }
index 5bed625ff41b1db0aa5dd9b1a8bd0abb4d33bf79..c3d26d0d5c2d8058e6b1dcb18d5220707c5fb518 100644 (file)
@@ -45,8 +45,6 @@ EMACS_INT executing_kbd_macro_iterations;
 
 Lisp_Object executing_kbd_macro;
 
-Lisp_Object Fexecute_kbd_macro (Lisp_Object macro, Lisp_Object count, Lisp_Object loopfunc);
-\f
 DEFUN ("start-kbd-macro", Fstart_kbd_macro, Sstart_kbd_macro, 1, 2, "P",
        doc: /* Record subsequent keyboard input, defining a keyboard macro.
 The commands are recorded even as they are executed.
@@ -84,28 +82,21 @@ macro before appending to it.  */)
     }
   else
     {
-      ptrdiff_t i;
-      EMACS_INT len;
+      int incr = 30;
+      ptrdiff_t i, len;
       bool cvt;
 
       /* Check the type of last-kbd-macro in case Lisp code changed it.  */
-      CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
-
-      len = XINT (Flength (KVAR (current_kboard, Vlast_kbd_macro)));
+      len = CHECK_VECTOR_OR_STRING (KVAR (current_kboard, Vlast_kbd_macro));
 
       /* Copy last-kbd-macro into the buffer, in case the Lisp code
         has put another macro there.  */
-      if (current_kboard->kbd_macro_bufsize < len + 30)
-       {
-         if (PTRDIFF_MAX < MOST_POSITIVE_FIXNUM + 30
-             && PTRDIFF_MAX < len + 30)
-           memory_full (SIZE_MAX);
-         current_kboard->kbd_macro_buffer =
-           xpalloc (current_kboard->kbd_macro_buffer,
-                    &current_kboard->kbd_macro_bufsize,
-                    len + 30 - current_kboard->kbd_macro_bufsize, -1,
-                    sizeof *current_kboard->kbd_macro_buffer);
-       }
+      if (current_kboard->kbd_macro_bufsize - incr < len)
+       current_kboard->kbd_macro_buffer =
+         xpalloc (current_kboard->kbd_macro_buffer,
+                  &current_kboard->kbd_macro_bufsize,
+                  len - current_kboard->kbd_macro_bufsize + incr, -1,
+                  sizeof *current_kboard->kbd_macro_buffer);
 
       /* Must convert meta modifier when copying string to vector.  */
       cvt = STRINGP (KVAR (current_kboard, Vlast_kbd_macro));
index 654be0db9c7cbbdbe9f98ae9100f8016f06e2616..e0f226562f8423b413b8b9b5433409ae03feb273 100644 (file)
@@ -66,9 +66,6 @@ Lisp_Object menu_items;
 
 /* If non-nil, means that the global vars defined here are already in use.
    Used to detect cases where we try to re-enter this non-reentrant code.  */
-#if ! (defined USE_GTK || defined USE_MOTIF)
-static
-#endif
 Lisp_Object menu_items_inuse;
 
 /* Number of slots currently allocated in menu_items.  */
@@ -576,21 +573,26 @@ parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name,
 \f
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS) || defined (HAVE_NTGUI)
 
-/* Allocate a widget_value, blocking input.  */
+/* Allocate and basically initialize widget_value, blocking input.  */
 
 widget_value *
-xmalloc_widget_value (void)
+make_widget_value (const char *name, char *value,
+                  bool enabled, Lisp_Object help)
 {
-  widget_value *value;
+  widget_value *wv;
 
   block_input ();
-  value = malloc_widget_value ();
+  wv = xzalloc (sizeof (widget_value));
   unblock_input ();
 
-  return value;
+  wv->name = (char *) name;
+  wv->value = value;
+  wv->enabled = enabled;
+  wv->help = help;
+  return wv;
 }
 
-/* This recursively calls free_widget_value on the tree of widgets.
+/* This recursively calls xfree on the tree of widgets.
    It must free all data that was malloc'ed for these widget_values.
    In Emacs, many slots are pointers into the data of Lisp_Strings, and
    must be left alone.  */
@@ -613,7 +615,7 @@ free_menubar_widget_value_tree (widget_value *wv)
       wv->next = (widget_value *) 0xDEADBEEF;
     }
   block_input ();
-  free_widget_value (wv);
+  xfree (wv);
   unblock_input ();
 }
 
@@ -632,12 +634,8 @@ digest_single_submenu (int start, int end, bool top_level_items)
   struct frame *f = XFRAME (Vmenu_updating_frame);
 
   submenu_stack = alloca (menu_items_used * sizeof *submenu_stack);
-  wv = xmalloc_widget_value ();
-  wv->name = "menu";
-  wv->value = 0;
-  wv->enabled = 1;
+  wv = make_widget_value ("menu", NULL, true, Qnil);
   wv->button_type = BUTTON_TYPE_NONE;
-  wv->help = Qnil;
   first_wv = wv;
   save_wv = 0;
   prev_wv = 0;
@@ -721,17 +719,14 @@ digest_single_submenu (int start, int end, bool top_level_items)
             with its items as a submenu beneath it.  */
          if (strcmp (pane_string, ""))
            {
-             wv = xmalloc_widget_value ();
+             /* Set value to 1 so update_submenu_strings can handle '@'.  */
+             wv = make_widget_value (NULL, (char *) 1, true, Qnil);
              if (save_wv)
                save_wv->next = wv;
              else
                first_wv->contents = wv;
              wv->lname = pane_name;
-              /* Set value to 1 so update_submenu_strings can handle '@'  */
-             wv->value = (char *)1;
-             wv->enabled = 1;
              wv->button_type = BUTTON_TYPE_NONE;
-             wv->help = Qnil;
              save_wv = wv;
            }
          else
@@ -805,7 +800,8 @@ digest_single_submenu (int start, int end, bool top_level_items)
 #endif
            }
 
-         wv = xmalloc_widget_value ();
+         wv = make_widget_value (NULL, NULL, !NILP (enable),
+                                 STRINGP (help) ? help : Qnil);
          if (prev_wv)
            prev_wv->next = wv;
          else
@@ -814,11 +810,9 @@ digest_single_submenu (int start, int end, bool top_level_items)
          wv->lname = item_name;
          if (!NILP (descrip))
            wv->lkey = descrip;
-         wv->value = 0;
          /* The intptr_t cast avoids a warning.  There's no problem
             as long as pointers have enough bits to hold small integers.  */
          wv->call_data = (!NILP (def) ? (void *) (intptr_t) i : 0);
-         wv->enabled = !NILP (enable);
 
          if (NILP (type))
            wv->button_type = BUTTON_TYPE_NONE;
@@ -830,10 +824,6 @@ digest_single_submenu (int start, int end, bool top_level_items)
            emacs_abort ();
 
          wv->selected = !NILP (selected);
-         if (! STRINGP (help))
-           help = Qnil;
-
-         wv->help = help;
 
          prev_wv = wv;
 
@@ -846,7 +836,7 @@ digest_single_submenu (int start, int end, bool top_level_items)
   if (top_level_items && first_wv->contents && first_wv->contents->next == 0)
     {
       wv = first_wv->contents;
-      free_widget_value (first_wv);
+      xfree (first_wv);
       return wv;
     }
 
@@ -1168,9 +1158,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
   Lisp_Object selection = Qnil;
   struct frame *f = NULL;
   Lisp_Object x, y, window;
-  bool keymaps = 0;
-  bool for_click = 0;
-  bool kbd_menu_navigation = 0;
+  int menuflags = 0;
   ptrdiff_t specpdl_count = SPECPDL_INDEX ();
   struct gcpro gcpro1;
 
@@ -1200,12 +1188,12 @@ no quit occurs and `x-popup-menu' returns nil.  */)
          }
        else
          {
-           for_click = 1;
+           menuflags |= MENU_FOR_CLICK;
            tem = Fcar (Fcdr (position));  /* EVENT_START (position) */
            window = Fcar (tem);             /* POSN_WINDOW (tem) */
            tem2 = Fcar (Fcdr (tem));        /* POSN_POSN (tem) */
-           /* The kbd_menu_navigation flag is set when the menu was
-              invoked by F10, which probably means they have no
+           /* The MENU_KBD_NAVIGATION field is set when the menu
+              was invoked by F10, which probably means they have no
               mouse.  In that case, we let them switch between
               top-level menu-bar menus by using C-f/C-b and
               horizontal arrow keys, since they cannot click the
@@ -1218,7 +1206,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
            if (!EQ (POSN_POSN (last_nonmenu_event),
                     POSN_POSN (position))
                && CONSP (tem2) && EQ (Fcar (tem2), Qmenu_bar))
-             kbd_menu_navigation = 1;
+             menuflags |= MENU_KBD_NAVIGATION;
            tem = Fcar (Fcdr (Fcdr (tem))); /* POSN_WINDOW_POSN (tem) */
            x = Fcar (tem);
            y = Fcdr (tem);
@@ -1245,7 +1233,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
          {
            int cur_x, cur_y;
 
-           mouse_position_for_popup (new_f, &cur_x, &cur_y);
+           x_relative_mouse_position (new_f, &cur_x, &cur_y);
            /* cur_x/y may be negative, so use make_number.  */
            x = make_number (cur_x);
            y = make_number (cur_y);
@@ -1347,7 +1335,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
       if (!NILP (prompt) && menu_items_n_panes >= 0)
        ASET (menu_items, MENU_ITEMS_PANE_NAME, prompt);
 
-      keymaps = 1;
+      menuflags |= MENU_KEYMAPS;
     }
   else if (CONSP (menu) && KEYMAPP (XCAR (menu)))
     {
@@ -1380,7 +1368,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
       if (!NILP (title) && menu_items_n_panes >= 0)
        ASET (menu_items, MENU_ITEMS_PANE_NAME, title);
 
-      keymaps = 1;
+      menuflags |= MENU_KEYMAPS;
 
       SAFE_FREE ();
     }
@@ -1392,7 +1380,7 @@ no quit occurs and `x-popup-menu' returns nil.  */)
 
       list_of_panes (Fcdr (menu));
 
-      keymaps = 0;
+      menuflags &= ~MENU_KEYMAPS;
     }
 
   unbind_to (specpdl_count, Qnil);
@@ -1422,40 +1410,12 @@ no quit occurs and `x-popup-menu' returns nil.  */)
   record_unwind_protect_void (discard_menu_items);
 #endif
 
-  /* Display them in a menu.  */
-
-  /* FIXME: Use a terminal hook!  */
-#if defined HAVE_NTGUI
-  if (FRAME_W32_P (f))
-    selection = w32_menu_show (f, xpos, ypos, for_click,
-                              keymaps, title, &error_name);
-  else
-#endif
-#if defined HAVE_NS
-  if (FRAME_NS_P (f))
-    selection = ns_menu_show (f, xpos, ypos, for_click,
-                             keymaps, title, &error_name);
-  else
-#endif
-#if (defined (HAVE_X_WINDOWS) || defined (MSDOS))
-  if (FRAME_X_P (f) || FRAME_MSDOS_P (f))
-    selection = xmenu_show (f, xpos, ypos, for_click,
-                           keymaps, title, &error_name);
-  else
-#endif
-#ifndef MSDOS
-  if (FRAME_TERMCAP_P (f))
-    {
-      ptrdiff_t count1 = SPECPDL_INDEX ();
-
-      /* Avoid crashes if, e.g., another client will connect while we
-        are in a menu.  */
-      temporarily_switch_to_single_kboard (f);
-      selection = tty_menu_show (f, xpos, ypos, for_click, keymaps, title,
-                                kbd_menu_navigation, &error_name);
-      unbind_to (count1, Qnil);
-    }
-#endif
+  /* Display them in a menu, but not if F is the initial frame that
+     doesn't have its hooks set (e.g., in a batch session), because
+     such a frame cannot display menus.  */
+  if (!FRAME_INITIAL_P (f))
+    selection = FRAME_TERMINAL (f)->menu_show_hook (f, xpos, ypos, menuflags,
+                                                   title, &error_name);
 
 #ifdef HAVE_NS
   unbind_to (specpdl_count, Qnil);
@@ -1474,6 +1434,38 @@ no quit occurs and `x-popup-menu' returns nil.  */)
   return selection;
 }
 
+/* If F's terminal is not capable of displaying a popup dialog,
+   emulate it with a menu.  */
+
+static Lisp_Object
+emulate_dialog_with_menu (struct frame *f, Lisp_Object contents)
+{
+  Lisp_Object x, y, frame, newpos, prompt = Fcar (contents);
+  int x_coord, y_coord;
+
+  if (FRAME_WINDOW_P (f))
+    {
+      x_coord = FRAME_PIXEL_WIDTH (f);
+      y_coord = FRAME_PIXEL_HEIGHT (f);
+    }
+  else
+    {
+      x_coord = FRAME_COLS (f);
+      /* Center the title at frame middle.  (TTY menus have
+        their upper-left corner at the given position.)  */
+      if (STRINGP (prompt))
+       x_coord -= SCHARS (prompt);
+      y_coord = FRAME_LINES (f);
+    }
+
+  XSETFRAME (frame, f);
+  XSETINT (x, x_coord / 2);
+  XSETINT (y, y_coord / 2);
+  newpos = list2 (list2 (x, y), frame);
+
+  return Fx_popup_menu (newpos, list2 (prompt, contents));
+}
+
 DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
        doc: /* Pop up a dialog box and return user's selection.
 POSITION specifies which frame to use.
@@ -1506,24 +1498,7 @@ for instance using the window manager, then this produces a quit and
   if (EQ (position, Qt)
       || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar)
                               || EQ (XCAR (position), Qtool_bar))))
-    {
-#if 0 /* Using the frame the mouse is on may not be right.  */
-      /* Use the mouse's current position.  */
-      struct frame *new_f = SELECTED_FRAME ();
-      Lisp_Object bar_window;
-      enum scroll_bar_part part;
-      Time time;
-      Lisp_Object x, y;
-
-      (*mouse_position_hook) (&new_f, 1, &bar_window, &part, &x, &y, &time);
-
-      if (new_f != 0)
-       XSETFRAME (window, new_f);
-      else
-       window = selected_window;
-#endif
-      window = selected_window;
-    }
+    window = selected_window;
   else if (CONSP (position))
     {
       Lisp_Object tem = XCAR (position);
@@ -1570,51 +1545,21 @@ for instance using the window manager, then this produces a quit and
      string contents, because Fredisplay may GC and relocate them.  */
   Fredisplay (Qt);
 
-#if defined USE_X_TOOLKIT || defined USE_GTK
-  if (FRAME_WINDOW_P (f))
-    return xw_popup_dialog (f, header, contents);
-#endif
-#ifdef HAVE_NTGUI
-  if (FRAME_W32_P (f))
+  /* Display the popup dialog by a terminal-specific hook ... */
+  if (FRAME_TERMINAL (f)->popup_dialog_hook)
     {
-      Lisp_Object selection = w32_popup_dialog (f, header, contents);
-
+      Lisp_Object selection
+       = FRAME_TERMINAL (f)->popup_dialog_hook (f, header, contents);
+#ifdef HAVE_NTGUI
+      /* NTGUI supports only simple dialogs with Yes/No choices.  For
+        other dialogs, it returns the symbol 'unsupported--w32-dialog',
+        as a signal for the caller to fall back to the emulation code.  */
       if (!EQ (selection, Qunsupported__w32_dialog))
+#endif
        return selection;
     }
-#endif
-#ifdef HAVE_NS
-  if (FRAME_NS_P (f))
-    return ns_popup_dialog (position, header, contents);
-#endif
-  /* Display a menu with these alternatives
-     in the middle of frame F.  */
-  {
-    Lisp_Object x, y, frame, newpos, prompt;
-    int x_coord, y_coord;
-
-    prompt = Fcar (contents);
-    if (FRAME_WINDOW_P (f))
-      {
-       x_coord = FRAME_PIXEL_WIDTH (f);
-       y_coord = FRAME_PIXEL_HEIGHT (f);
-      }
-    else
-      {
-       x_coord = FRAME_COLS (f);
-       /* Center the title at frame middle.  (TTY menus have their
-          upper-left corner at the given position.)  */
-       if (STRINGP (prompt))
-         x_coord -= SCHARS (prompt);
-       y_coord = FRAME_LINES (f);
-      }
-    XSETFRAME (frame, f);
-    XSETINT (x, x_coord / 2);
-    XSETINT (y, y_coord / 2);
-    newpos = list2 (list2 (x, y), frame);
-
-    return Fx_popup_menu (newpos, list2 (prompt, contents));
-  }
+  /* ... or emulate it with a menu.  */
+  return emulate_dialog_with_menu (f, contents);
 }
 
 void
index 429dcfa62211af65765ef200707e2c66bcce6e85..30a89bead26081c70096393511b339869644e2e9 100644 (file)
@@ -20,11 +20,20 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define MENU_H
 
 #include "systime.h" /* for Time */
+#include "../lwlib/lwlib-widget.h"
 
 #ifdef HAVE_NTGUI
 extern Lisp_Object Qunsupported__w32_dialog;
 #endif
 
+/* Bit fields used by terminal-specific menu_show_hook.  */
+
+enum {
+  MENU_KEYMAPS = 0x1,
+  MENU_FOR_CLICK = 0x2,
+  MENU_KBD_NAVIGATION = 0x4
+};
+
 extern void x_set_menu_bar_lines (struct frame *f,
                                   Lisp_Object value,
                                   Lisp_Object oldval);
@@ -41,21 +50,23 @@ extern void free_menubar_widget_value_tree (widget_value *);
 extern void update_submenu_strings (widget_value *);
 extern void find_and_call_menu_selection (struct frame *, int,
                                           Lisp_Object, void *);
-extern widget_value *xmalloc_widget_value (void);
+extern widget_value *make_widget_value (const char *, char *, bool, Lisp_Object);
 extern widget_value *digest_single_submenu (int, int, bool);
 #endif
 
-#ifdef HAVE_X_WINDOWS
-extern void mouse_position_for_popup (struct frame *f, int *x, int *y);
+#if defined (HAVE_X_WINDOWS) || defined (MSDOS)
+extern Lisp_Object x_menu_show (struct frame *, int, int, int,
+                               Lisp_Object, const char **);
 #endif
-
-extern Lisp_Object w32_menu_show (struct frame *, int, int, int, int,
+#ifdef HAVE_NTGUI
+extern Lisp_Object w32_menu_show (struct frame *, int, int, int,
                                  Lisp_Object, const char **);
-extern Lisp_Object ns_menu_show (struct frame *, int, int, bool, bool,
+#endif
+#ifdef HAVE_NS
+extern Lisp_Object ns_menu_show (struct frame *, int, int, int,
                                 Lisp_Object, const char **);
-extern Lisp_Object xmenu_show (struct frame *, int, int, bool, bool,
-                              Lisp_Object, const char **);
-extern Lisp_Object tty_menu_show (struct frame *, int, int, bool, bool,
-                                 Lisp_Object, bool, const char **);
+#endif
+extern Lisp_Object tty_menu_show (struct frame *, int, int, int,
+                                 Lisp_Object, const char **);
 extern ptrdiff_t menu_item_width (const unsigned char *);
 #endif /* MENU_H */
index c3fcbeb59c7d69c3b32cab8e4f8e35f63fcdf113..93e19d5c120018523fa36fcdfd822db3ef8ab825 100644 (file)
@@ -22,6 +22,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <errno.h>
 #include <stdio.h>
 
+#include <binary-io.h>
+
 #include "lisp.h"
 #include "commands.h"
 #include "character.h"
@@ -34,6 +36,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "intervals.h"
 #include "keymap.h"
 #include "termhooks.h"
+#include "systty.h"
 
 /* List of buffers for use as minibuffers.
    The first element of the list is used for the outermost minibuffer
@@ -224,6 +227,22 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
   char *line;
   Lisp_Object val;
   int c;
+  unsigned char hide_char = 0;
+  struct emacs_tty etty;
+  bool etty_valid;
+
+  /* Check, whether we need to suppress echoing.  */
+  if (CHARACTERP (Vread_hide_char))
+    hide_char = XFASTINT (Vread_hide_char);
+
+  /* Manipulate tty.  */
+  if (hide_char)
+    {
+      etty_valid = emacs_get_tty (fileno (stdin), &etty) == 0;
+      if (etty_valid)
+       set_binary_mode (fileno (stdin), O_BINARY);
+      suppress_echo_on_tty (fileno (stdin));
+    }
 
   fprintf (stdout, "%s", SDATA (prompt));
   fflush (stdout);
@@ -233,7 +252,7 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
   len = 0;
   line = xmalloc (size);
 
-  while ((c = getchar ()) != '\n')
+  while ((c = getchar ()) != '\n' && c != '\r')
     {
       if (c == EOF)
        {
@@ -242,6 +261,8 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
        }
       else
        {
+         if (hide_char)
+           fprintf (stdout, "%c", hide_char);
          if (len == size)
            {
              if (STRING_BYTES_BOUND / 2 < size)
@@ -253,7 +274,18 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
        }
     }
 
-  if (len || c == '\n')
+  /* Reset tty.  */
+  if (hide_char)
+    {
+      fprintf (stdout, "\n");
+      if (etty_valid)
+       {
+         emacs_set_tty (fileno (stdin), &etty, 0);
+         set_binary_mode (fileno (stdin), O_TEXT);
+       }
+    }
+
+  if (len || c == '\n' || c == '\r')
     {
       val = make_string (line, len);
       xfree (line);
@@ -619,6 +651,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
   set_window_buffer (minibuf_window, Fcurrent_buffer (), 0, 0);
   Fselect_window (minibuf_window, Qnil);
   XWINDOW (minibuf_window)->hscroll = 0;
+  XWINDOW (minibuf_window)->suspend_auto_hscroll = 0;
 
   Fmake_local_variable (Qprint_escape_newlines);
   print_escape_newlines = 1;
@@ -1970,7 +2003,7 @@ A value of t means no truncation.
 This variable only affects history lists that don't specify their own
 maximum lengths.  Setting the `history-length' property of a history
 variable overrides this default.  */);
-  XSETFASTINT (Vhistory_length, 30);
+  XSETFASTINT (Vhistory_length, 100);
 
   DEFVAR_BOOL ("history-delete-duplicates", history_delete_duplicates,
               doc: /* Non-nil means to delete duplicates in history.
@@ -2079,6 +2112,12 @@ properties.  */);
      initialization-order problems.  */
   Vminibuffer_prompt_properties = list2 (intern_c_string ("read-only"), Qt);
 
+  DEFVAR_LISP ("read-hide-char", Vread_hide_char,
+              doc: /* Whether to hide input characters in noninteractive mode.
+It must be a character, which will be used to mask the input
+characters.  This variable should never be set globally.  */);
+  Vread_hide_char = Qnil;
+
   defsubr (&Sactive_minibuffer_window);
   defsubr (&Sset_minibuffer_window);
   defsubr (&Sread_from_minibuffer);
index 010a0a3746c7f2ee5d7bb4081a2fe4aa7fdfb040..ccca371583f5adf00c38d82e7944d7eb4739619c 100644 (file)
@@ -566,7 +566,7 @@ dos_set_window_size (int *rows, int *cols)
       };
       int i = 0;
 
-      while (i < sizeof (std_dimension) / sizeof (std_dimension[0]))
+      while (i < ARRAYELTS (std_dimension))
        {
         if (std_dimension[i].need_vga <= have_vga
             && std_dimension[i].rows >= *rows)
@@ -1863,6 +1863,7 @@ initialize_msdos_display (struct terminal *term)
   term->update_end_hook = IT_update_end;
   term->frame_up_to_date_hook = IT_frame_up_to_date;
   term->mouse_position_hook = 0; /* set later by dos_ttraw */
+  term->menu_show_hook = x_menu_show;
   term->frame_rehighlight_hook = 0;
   term->frame_raise_lower_hook = 0;
   term->set_vertical_scroll_bar_hook = 0;
@@ -3455,7 +3456,7 @@ init_environment (int argc, char **argv, int skip_args)
   static const char * const tempdirs[] = {
     "$TMPDIR", "$TEMP", "$TMP", "c:/"
   };
-  const int imax = sizeof (tempdirs) / sizeof (tempdirs[0]);
+  const int imax = ARRAYELTS (tempdirs);
 
   /* Make sure they have a usable $TMPDIR.  Many Emacs functions use
      temporary files and assume "/tmp" if $TMPDIR is unset, which
index 58746aed9faeedf3d99d1941e69097d0e2b245a5..8bce1da2e5dcc1e791e652445f0f672c74e82f94 100644 (file)
@@ -73,15 +73,15 @@ extern Lisp_Object Qicon_type;
 extern Lisp_Object Qicon_name;
 extern Lisp_Object Qicon_left;
 extern Lisp_Object Qicon_top;
-extern Lisp_Object Qleft;
-extern Lisp_Object Qright;
 extern Lisp_Object Qtop;
 extern Lisp_Object Qdisplay;
 extern Lisp_Object Qvertical_scroll_bars;
+extern Lisp_Object Qhorizontal_scroll_bars;
 extern Lisp_Object Qauto_raise;
 extern Lisp_Object Qauto_lower;
 extern Lisp_Object Qbox;
 extern Lisp_Object Qscroll_bar_width;
+extern Lisp_Object Qscroll_bar_height;
 extern Lisp_Object Qx_resource_name;
 extern Lisp_Object Qface_set_after_frame_default;
 extern Lisp_Object Qunderline, Qundefined;
@@ -707,6 +707,26 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 }
 
 
+void
+x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+  int old_width = FRAME_INTERNAL_BORDER_WIDTH (f);
+
+  CHECK_TYPE_RANGED_INTEGER (int, arg);
+  FRAME_INTERNAL_BORDER_WIDTH (f) = XINT (arg);
+  if (FRAME_INTERNAL_BORDER_WIDTH (f) < 0)
+    FRAME_INTERNAL_BORDER_WIDTH (f) = 0;
+
+  if (FRAME_INTERNAL_BORDER_WIDTH (f) == old_width)
+    return;
+
+  if (FRAME_X_WINDOW (f) != 0)
+    adjust_frame_size (f, -1, -1, 3, 0);
+
+  SET_FRAME_GARBAGED (f);
+}
+
+
 static void
 ns_implicitly_set_icon_type (struct frame *f)
 {
@@ -873,12 +893,16 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 static Lisp_Object
 ns_appkit_version_str (void)
 {
-  char tmp[80];
+  char tmp[256];
 
 #ifdef NS_IMPL_GNUSTEP
   sprintf(tmp, "gnustep-gui-%s", Xstr(GNUSTEP_GUI_VERSION));
 #elif defined (NS_IMPL_COCOA)
-  sprintf(tmp, "apple-appkit-%.2f", NSAppKitVersionNumber);
+  NSString *osversion
+    = [[NSProcessInfo processInfo] operatingSystemVersionString];
+  sprintf(tmp, "appkit-%.2f %s",
+          NSAppKitVersionNumber,
+          [osversion UTF8String]);
 #else
   tmp = "ns-unknown";
 #endif
@@ -952,17 +976,19 @@ frame_parm_handler ns_frame_parm_handlers[] =
   x_set_mouse_color,
   x_explicitly_set_name,
   x_set_scroll_bar_width, /* generic OK */
+  x_set_scroll_bar_height, /* generic OK */
   x_set_title,
   x_set_unsplittable, /* generic OK */
   x_set_vertical_scroll_bars, /* generic OK */
+  x_set_horizontal_scroll_bars, /* generic OK */
   x_set_visibility, /* generic OK */
   x_set_tool_bar_lines,
   0, /* x_set_scroll_bar_foreground, will ignore (not possible on NS) */
   0, /* x_set_scroll_bar_background,  will ignore (not possible on NS) */
   x_set_screen_gamma, /* generic OK */
   x_set_line_spacing, /* generic OK, sets f->extra_line_spacing to int */
-  x_set_fringe_width, /* generic OK */
-  x_set_fringe_width, /* generic OK */
+  x_set_left_fringe, /* generic OK */
+  x_set_right_fringe, /* generic OK */
   0, /* x_set_wait_for_wm, will ignore */
   x_set_fullscreen, /* generic OK */
   x_set_font_backend, /* generic OK */
@@ -1024,7 +1050,7 @@ get_geometry_from_preferences (struct ns_display_info *dpyinfo,
   };
 
   int i;
-  for (i = 0; i < sizeof (r)/sizeof (r[0]); ++i)
+  for (i = 0; i < ARRAYELTS (r); ++i)
     {
       if (NILP (Fassq (r[i].tem, parms)))
         {
@@ -1206,7 +1232,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
                       "internalBorderWidth", "InternalBorderWidth",
                       RES_TYPE_NUMBER);
 
-  /* default scrollbars on right on Mac */
+  /* default vertical scrollbars on right on Mac */
   {
       Lisp_Object spos
 #ifdef NS_IMPL_GNUSTEP
@@ -1218,6 +1244,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
                           "verticalScrollBars", "VerticalScrollBars",
                           RES_TYPE_SYMBOL);
   }
+  x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qt,
+                      "horizontalScrollBars", "HorizontalScrollBars",
+                      RES_TYPE_SYMBOL);
   x_default_parameter (f, parms, Qforeground_color, build_string ("Black"),
                       "foreground", "Foreground", RES_TYPE_STRING);
   x_default_parameter (f, parms, Qbackground_color, build_string ("White"),
@@ -1278,6 +1307,8 @@ This function is an internal primitive--use `make-frame' instead.  */)
   f->output_data.ns->vertical_drag_cursor = [NSCursor resizeUpDownCursor];
   FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor
      = [NSCursor arrowCursor];
+  FRAME_DISPLAY_INFO (f)->horizontal_scroll_bar_cursor
+     = [NSCursor arrowCursor];
   f->output_data.ns->current_pointer = f->output_data.ns->text_cursor;
 
   [[EmacsView alloc] initFrameFromEmacs: f];
@@ -1303,6 +1334,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
   x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
                        "scrollBarWidth", "ScrollBarWidth",
                        RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qscroll_bar_height, Qnil,
+                       "scrollBarHeight", "ScrollBarHeight",
+                       RES_TYPE_NUMBER);
   x_default_parameter (f, parms, Qalpha, Qnil,
                        "alpha", "Alpha", RES_TYPE_NUMBER);
   x_default_parameter (f, parms, Qfullscreen, Qnil,
@@ -1386,9 +1420,11 @@ DEFUN ("ns-popup-font-panel", Fns_popup_font_panel, Sns_popup_font_panel,
   NSFont *nsfont;
   if (EQ (font->driver->type, Qns))
     nsfont = ((struct nsfont_info *)font)->nsfont;
+#ifdef NS_IMPL_COCOA
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
   else
     nsfont = (NSFont *) macfont_get_nsctfont (font);
+#endif
 #endif
   [fm setSelectedFont: nsfont isMultiple: NO];
   [fm orderFrontFontPanel: NSApp];
@@ -2096,7 +2132,6 @@ ns_do_applescript (Lisp_Object script, Lisp_Object *result)
 
   returnDescriptor = [scriptObject executeAndReturnError: &errorDict];
   [scriptObject release];
-
   *result = Qnil;
 
   if (returnDescriptor != NULL)
@@ -2157,6 +2192,7 @@ In case the execution fails, an error is signaled. */)
   Lisp_Object result;
   int status;
   NSEvent *nxev;
+  struct input_event ev;
 
   CHECK_STRING (script);
   check_window_system (NULL);
@@ -2184,8 +2220,10 @@ In case the execution fails, an error is signaled. */)
 
   // If there are other events, the event loop may exit.  Keep running
   // until the script has been handled.  */
+  ns_init_events (&ev);
   while (! NILP (as_script))
     [NSApp run];
+  ns_finish_events ();
 
   status = as_status;
   as_status = 0;
@@ -2225,6 +2263,15 @@ x_set_scroll_bar_default_width (struct frame *f)
                                       wid - 1) / wid;
 }
 
+void
+x_set_scroll_bar_default_height (struct frame *f)
+{
+  int height = FRAME_LINE_HEIGHT (f);
+  FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = NS_SCROLL_BAR_WIDTH_DEFAULT;
+  FRAME_CONFIG_SCROLL_BAR_LINES (f) = (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) +
+                                      height - 1) / height;
+}
+
 /* terms impl this instead of x-get-resource directly */
 char *
 x_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
index 14e24c270e8507cc52f236b1fa4b6a45b2e1b34a..98c25fcdedd07191457778a05f357db3df1f04ce 100644 (file)
@@ -649,7 +649,7 @@ struct font_driver nsfont_driver =
     nsfont_encode_char,
     nsfont_text_extents,
     nsfont_draw,
-    /* excluded: get_bitmap, free_bitmap, get_outline, free_outline,
+    /* excluded: get_bitmap, free_bitmap,
                  anchor_point, otf_capability, otf_driver,
                 start_for_frame, end_for_frame, shape */
   };
@@ -830,9 +830,6 @@ nsfont_open (struct frame *f, Lisp_Object font_entity, int pixel_size)
   font->baseline_offset = 0;
   font->relative_compose = 0;
 
-  font->props[FONT_FORMAT_INDEX] = Qns;
-  font->props[FONT_FILE_INDEX] = Qnil;
-
   {
     const char *fontName = [[nsfont fontName] UTF8String];
 
@@ -945,6 +942,8 @@ nsfont_close (struct font *font)
          xfree (font_info->glyphs[i]);
          xfree (font_info->metrics[i]);
        }
+      xfree (font_info->glyphs);
+      xfree (font_info->metrics);
       [font_info->nsfont release];
 #ifdef NS_IMPL_COCOA
       CGFontRelease (font_info->cgfont);
@@ -1037,8 +1036,7 @@ nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs,
 static int
 nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
              bool with_background)
-/* NOTE: focus and clip must be set
-     also, currently assumed (true in nsterm.m call) from ==0, to ==nchars */
+/* NOTE: focus and clip must be set */
 {
   static unsigned char cbuf[1024];
   unsigned char *c = cbuf;
@@ -1056,7 +1054,6 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
   unsigned short *t = s->char2b;
   int i, len, flags;
   char isComposite = s->first_glyph->type == COMPOSITE_GLYPH;
-  int end = isComposite ? s->cmp_to : s->nchars;
 
   block_input ();
 
@@ -1098,8 +1095,8 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
     int cwidth, twidth = 0;
     int hi, lo;
     /* FIXME: composition: no vertical displacement is considered. */
-    t += s->cmp_from; /* advance into composition */
-    for (i = s->cmp_from; i < end; i++, t++)
+    t += from; /* advance into composition */
+    for (i = from; i < to; i++, t++)
       {
         hi = (*t & 0xFF00) >> 8;
         lo = *t & 0x00FF;
@@ -1193,7 +1190,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
 
 
   /* set up for character rendering */
-  r.origin.y = s->ybase;
+  r.origin.y = y;
 
   col = (NS_FACE_FOREGROUND (face) != 0
          ? ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f)
@@ -1275,13 +1272,13 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
     [col set];
 
     CGContextSetTextPosition (gcontext, r.origin.x, r.origin.y);
-    CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from,
+    CGContextShowGlyphsWithAdvances (gcontext, s->char2b + from,
                                      advances, len);
 
     if (face->overstrike)
       {
         CGContextSetTextPosition (gcontext, r.origin.x+0.5, r.origin.y);
-        CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from,
+        CGContextShowGlyphsWithAdvances (gcontext, s->char2b + from,
                                          advances, len);
       }
 
index 5935531fa4800bd4bf206f7eae4d1411d87ccc21..0f963f69e2bfd1233e105f0def512f97fa3392ac 100644 (file)
@@ -48,11 +48,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #undef _GL_VERIFY_H
 #include <verify.h>
 
-/* menu-related */
-#define free_widget_value(wv) xfree (wv)
-#define malloc_widget_value() ((widget_value *) memset (xmalloc \
-    (sizeof (widget_value)), 0, sizeof (widget_value)))
-
 /* Emulate XCharStruct.  */
 typedef struct _XCharStruct
 {
@@ -73,10 +68,10 @@ typedef unichar XChar2b;
   (*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff))))
 
 #define XCHAR2B_BYTE1(chp) \
(((*chp) & 0xff00) >> 8)
 ((*(chp) & 0xff00) >> 8)
 
 #define XCHAR2B_BYTE2(chp) \
((*chp) & 0x00ff)
 (*(chp) & 0x00ff)
 
 
 /* XXX: xfaces requires these structures, but the question is are we
index 24842241f37e22d8f89583bd62bf3edeacd60415..778b068ef8b2405247f3e787fdff23b1d15ccad1 100644 (file)
@@ -266,12 +266,8 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
 
       /* parse stage 2: insert into lucid 'widget_value' structures
          [comments in other terms say not to evaluate lisp code here] */
-      wv = xmalloc_widget_value ();
-      wv->name = "menubar";
-      wv->value = 0;
-      wv->enabled = 1;
+      wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
-      wv->help = Qnil;
       first_wv = wv;
 
       for (i = 0; i < 4*n; i += 4)
@@ -378,12 +374,8 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
       int n;
       Lisp_Object string;
 
-      wv = xmalloc_widget_value ();
-      wv->name = "menubar";
-      wv->value = 0;
-      wv->enabled = 1;
+      wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
-      wv->help = Qnil;
       first_wv = wv;
 
       /* Make widget-value tree w/ just the top level menu bar strings */
@@ -439,12 +431,8 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
            memcpy (previous_strings[i/4], SDATA (string),
                     min (10, SBYTES (string) + 1));
 
-         wv = xmalloc_widget_value ();
-         wv->name = SSDATA (string);
-         wv->value = 0;
-         wv->enabled = 1;
+         wv = make_widget_value (SSDATA (string), NULL, true, Qnil);
          wv->button_type = BUTTON_TYPE_NONE;
-         wv->help = Qnil;
          wv->call_data = (void *) (intptr_t) (-1);
 
 #ifdef NS_IMPL_COCOA
@@ -824,7 +812,7 @@ extern NSString *NSMenuDidBeginTrackingNotification;
    ========================================================================== */
 
 Lisp_Object
-ns_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
+ns_menu_show (struct frame *f, int x, int y, int menuflags,
              Lisp_Object title, const char **error)
 {
   EmacsMenu *pmenu;
@@ -832,18 +820,15 @@ ns_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
   Lisp_Object tem;
   ptrdiff_t specpdl_count = SPECPDL_INDEX ();
   widget_value *wv, *first_wv = 0;
+  bool keymaps = (menuflags & MENU_KEYMAPS);
 
   block_input ();
 
   p.x = x; p.y = y;
 
   /* now parse stage 2 as in ns_update_menubar */
-  wv = xmalloc_widget_value ();
-  wv->name = "contextmenu";
-  wv->value = 0;
-  wv->enabled = 1;
+  wv = make_widget_value ("contextmenu", NULL, true, Qnil);
   wv->button_type = BUTTON_TYPE_NONE;
-  wv->help = Qnil;
   first_wv = wv;
 
 #if 0
@@ -914,18 +899,14 @@ ns_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
             with its items as a submenu beneath it.  */
          if (!keymaps && strcmp (pane_string, ""))
            {
-             wv = xmalloc_widget_value ();
+             wv = make_widget_value (pane_string, NULL, true, Qnil);
              if (save_wv)
                save_wv->next = wv;
              else
                first_wv->contents = wv;
-             wv->name = pane_string;
              if (keymaps && !NILP (prefix))
                wv->name++;
-             wv->value = 0;
-             wv->enabled = 1;
              wv->button_type = BUTTON_TYPE_NONE;
-             wv->help = Qnil;
              save_wv = wv;
              prev_wv = 0;
            }
@@ -963,20 +944,18 @@ ns_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
            }
 #endif /* not HAVE_MULTILINGUAL_MENU */
 
-         wv = xmalloc_widget_value ();
+         wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enable),
+                                 STRINGP (help) ? help : Qnil);
          if (prev_wv)
            prev_wv->next = wv;
          else
            save_wv->contents = wv;
-         wv->name = SSDATA (item_name);
          if (!NILP (descrip))
            wv->key = SSDATA (descrip);
-         wv->value = 0;
          /* If this item has a null value,
             make the call_data null so that it won't display a box
             when the mouse is on it.  */
          wv->call_data = !NILP (def) ? aref_addr (menu_items, i) : 0;
-         wv->enabled = !NILP (enable);
 
          if (NILP (type))
            wv->button_type = BUTTON_TYPE_NONE;
@@ -989,11 +968,6 @@ ns_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
 
          wv->selected = !NILP (selected);
 
-          if (! STRINGP (help))
-           help = Qnil;
-
-         wv->help = help;
-
          prev_wv = wv;
 
          i += MENU_ITEMS_ITEM_LENGTH;
@@ -1004,24 +978,19 @@ ns_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
 
   if (!NILP (title))
     {
-      widget_value *wv_title = xmalloc_widget_value ();
-      widget_value *wv_sep = xmalloc_widget_value ();
+      widget_value *wv_title;
+      widget_value *wv_sep = make_widget_value ("--", NULL, false, Qnil);
 
       /* Maybe replace this separator with a bitmap or owner-draw item
         so that it looks better.  Having two separators looks odd.  */
-      wv_sep->name = "--";
       wv_sep->next = first_wv->contents;
-      wv_sep->help = Qnil;
 
 #ifndef HAVE_MULTILINGUAL_MENU
       if (STRING_MULTIBYTE (title))
        title = ENCODE_MENU_STRING (title);
 #endif
-
-      wv_title->name = SSDATA (title);
-      wv_title->enabled = NO;
+      wv_title = make_widget_value (SSDATA (title), NULL, false, Qnil);
       wv_title->button_type = BUTTON_TYPE_NONE;
-      wv_title->help = Qnil;
       wv_title->next = wv_sep;
       first_wv->contents = wv_title;
     }
@@ -1183,7 +1152,10 @@ update_frame_tool_bar (struct frame *f)
     FRAME_TOOLBAR_HEIGHT (f) = 0;
 
   if (view->wait_for_tool_bar && FRAME_TOOLBAR_HEIGHT (f) > 0)
+    {
+      view->wait_for_tool_bar = NO;
       [view setNeedsDisplay: YES];
+    }
 
   unblock_input ();
 }
@@ -1459,11 +1431,10 @@ pop_down_menu (void *arg)
 
 
 Lisp_Object
-ns_popup_dialog (Lisp_Object position, Lisp_Object header, Lisp_Object contents)
+ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
 {
   id dialog;
   Lisp_Object window, tem, title;
-  struct frame *f;
   NSPoint p;
   BOOL isQ;
   NSAutoreleasePool *pool;
@@ -1472,41 +1443,6 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object header, Lisp_Object contents)
 
   isQ = NILP (header);
 
-  if (EQ (position, Qt)
-      || (CONSP (position) && (EQ (XCAR (position), Qmenu_bar)
-                               || EQ (XCAR (position), Qtool_bar))))
-    {
-      window = selected_window;
-    }
-  else if (CONSP (position))
-    {
-      Lisp_Object tem;
-      tem = Fcar (position);
-      if (XTYPE (tem) == Lisp_Cons)
-        window = Fcar (Fcdr (position));
-      else
-        {
-          tem = Fcar (Fcdr (position));  /* EVENT_START (position) */
-          window = Fcar (tem);      /* POSN_WINDOW (tem) */
-        }
-    }
-  else if (WINDOWP (position) || FRAMEP (position))
-    {
-      window = position;
-    }
-  else
-    window = Qnil;
-
-  if (FRAMEP (window))
-    f = XFRAME (window);
-  else if (WINDOWP (window))
-    {
-      CHECK_LIVE_WINDOW (window);
-      f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
-    }
-  else
-    CHECK_WINDOW (window);
-
   check_window_system (f);
 
   p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2;
index 8c3e4e5c3147ed595ad6b544ef70987196b1b3a0..00a0b54add9d931dff554da039983f69805aed5d 100644 (file)
@@ -100,7 +100,7 @@ typedef float EmacsCGFloat;
 /* We override sendEvent: as a means to stop/start the event loop */
 @interface EmacsApp : NSApplication
 {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
+#ifdef NS_IMPL_COCOA
   BOOL shouldKeepRunning;
   BOOL isFirst;
 #endif
@@ -413,7 +413,6 @@ typedef float EmacsCGFloat;
 
 - initFrame: (NSRect )r window: (Lisp_Object)win;
 - (void)setFrame: (NSRect)r;
-- (void)dealloc;
 
 - setPosition: (int) position portion: (int) portion whole: (int) whole;
 - (int) checkSamePosition: (int)position portion: (int)portion
@@ -607,6 +606,9 @@ struct ns_display_info
   /* The cursor to use for vertical scroll bars. */
   Cursor vertical_scroll_bar_cursor;
 
+  /* The cursor to use for horizontal scroll bars. */
+  Cursor horizontal_scroll_bar_cursor;
+
   /* Information about the range of text currently shown in
      mouse-face.  */
   Mouse_HLInfo mouse_highlight;
@@ -747,12 +749,20 @@ struct x_output
 #endif
 
 /* Compute pixel size for vertical scroll bars */
-#define NS_SCROLL_BAR_WIDTH(f)                              \
-(FRAME_HAS_VERTICAL_SCROLL_BARS (f)                          \
- ? rint (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0               \
-        ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)                 \
-        : (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)))   \
- : 0)
+#define NS_SCROLL_BAR_WIDTH(f)                                         \
+  (FRAME_HAS_VERTICAL_SCROLL_BARS (f)                                  \
+   ? rint (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0                       \
+          ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)                          \
+          : (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)))      \
+   : 0)
+
+/* Compute pixel size for horizontal scroll bars */
+#define NS_SCROLL_BAR_HEIGHT(f)                                                \
+  (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)                                        \
+   ? rint (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) > 0                      \
+          ? FRAME_CONFIG_SCROLL_BAR_HEIGHT (f)                         \
+          : (FRAME_SCROLL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)))      \
+   : 0)
 
 /* Difference btwn char-column-calculated and actual SB widths.
    This is only a concern for rendering when SB on left. */
@@ -761,6 +771,13 @@ struct x_output
     (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)        \
         - NS_SCROLL_BAR_WIDTH (f)) : 0)
 
+/* Difference btwn char-line-calculated and actual SB heights.
+   This is only a concern for rendering when SB on top. */
+#define NS_SCROLL_BAR_ADJUST_HORIZONTALLY(w, f)                \
+  (WINDOW_HAS_HORIZONTAL_SCROLL_BARS (w) ?             \
+   (FRAME_SCROLL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f) \
+    - NS_SCROLL_BAR_HEIGHT (f)) : 0)
+
 /* XXX: fix for GNUstep inconsistent accounting for titlebar */
 #ifdef NS_IMPL_GNUSTEP
 #define NS_TOP_POS(f) ((f)->top_pos + 18)
@@ -778,8 +795,8 @@ struct x_output
 
 /* First position where characters can be shown (instead of scrollbar, if
    it is on left. */
-#define FIRST_CHAR_POSITION(f) \
-  (! (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) ? 0 \
+#define FIRST_CHAR_POSITION(f)                         \
+  (! (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) ? 0  \
    : FRAME_SCROLL_BAR_COLS (f))
 
 extern struct ns_display_info *ns_term_init (Lisp_Object display_name);
@@ -856,7 +873,7 @@ extern void find_and_call_menu_selection (struct frame *f,
 extern Lisp_Object find_and_return_menu_selection (struct frame *f,
                                                    bool keymaps,
                                                    void *client_data);
-extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object header,
+extern Lisp_Object ns_popup_dialog (struct frame *, Lisp_Object header,
                                     Lisp_Object contents);
 
 #define NSAPP_DATA2_RUNASSCRIPT 10
@@ -897,6 +914,9 @@ extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
 extern unsigned long ns_get_rgb_color (struct frame *f,
                                        float r, float g, float b, float a);
 
+extern void ns_init_events ();
+extern void ns_finish_events ();
+
 /* From nsterm.m, needed in nsfont.m. */
 #ifdef __OBJC__
 extern void
@@ -916,6 +936,7 @@ extern char gnustep_base_version[];  /* version tracking */
 #define SCREENMAX 16000
 
 #define NS_SCROLL_BAR_WIDTH_DEFAULT     [EmacsScroller scrollerWidth]
+#define NS_SCROLL_BAR_HEIGHT_DEFAULT    [EmacsScroller scrollerHeight]
 /* This is to match emacs on other platforms, ugly though it is. */
 #define NS_SELECTION_BG_COLOR_DEFAULT  @"LightGoldenrod2";
 #define NS_SELECTION_FG_COLOR_DEFAULT  @"Black";
index 4b1ebb2b5169dfa44e9e9b2cd355014a08a52cbe..47ad28aaa617660f09f657a7b2a07909e40c2e10 100644 (file)
@@ -54,7 +54,7 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
 
 #include "termhooks.h"
 #include "termchar.h"
-
+#include "menu.h"
 #include "window.h"
 #include "keyboard.h"
 #include "buffer.h"
@@ -229,7 +229,7 @@ static unsigned convert_ns_to_X_keysym[] =
 
 static Lisp_Object Qmodifier_value;
 Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper;
-extern Lisp_Object Qcursor_color, Qcursor_type, Qns, Qleft;
+extern Lisp_Object Qcursor_color, Qcursor_type, Qns;
 
 static Lisp_Object QUTF8_STRING;
 static Lisp_Object Qcocoa, Qgnustep;
@@ -283,6 +283,11 @@ static NSMutableArray *ns_pending_files, *ns_pending_service_names,
 static BOOL ns_do_open_file = NO;
 static BOOL ns_last_use_native_fullscreen;
 
+/* Non-zero means that a HELP_EVENT has been generated since Emacs
+   start.  */
+
+static BOOL any_help_event_p = NO;
+
 static struct {
   struct input_event *q;
   int nr, cap;
@@ -396,6 +401,19 @@ void x_set_frame_alpha (struct frame *f);
 
    ========================================================================== */
 
+void
+ns_init_events (struct input_event* ev)
+{
+  EVENT_INIT (*ev);
+  emacs_event = ev;
+}
+
+void
+ns_finish_events ()
+{
+  emacs_event = NULL;
+}
+
 static void
 hold_event (struct input_event *event)
 {
@@ -1324,10 +1342,6 @@ x_set_window_size (struct frame *f,
 
   block_input ();
 
-  check_frame_size (f, &width, &height, pixelwise);
-
-  compute_fringe_widths (f, 0);
-
   if (pixelwise)
     {
       pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
@@ -1399,6 +1413,8 @@ x_set_window_size (struct frame *f,
   cancel_mouse_face (f);
 
   unblock_input ();
+
+  do_pending_window_change (0);
 }
 
 
@@ -1799,12 +1815,12 @@ x_set_frame_alpha (struct frame *f)
 
 
 void
-x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
+frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
 /* --------------------------------------------------------------------------
      Programmatically reposition mouse pointer in pixel coordinates
    -------------------------------------------------------------------------- */
 {
-  NSTRACE (x_set_mouse_pixel_position);
+  NSTRACE (frame_set_mouse_pixel_position);
   ns_raise_frame (f);
 #if 0
   /* FIXME: this does not work, and what about GNUstep? */
@@ -1816,28 +1832,6 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
 #endif
 }
 
-
-void
-x_set_mouse_position (struct frame *f, int h, int v)
-/* --------------------------------------------------------------------------
-     Programmatically reposition mouse pointer in character coordinates
-   -------------------------------------------------------------------------- */
-{
-  int pix_x, pix_y;
-
-  pix_x = FRAME_COL_TO_PIXEL_X (f, h) + FRAME_COLUMN_WIDTH (f) / 2;
-  pix_y = FRAME_LINE_TO_PIXEL_Y (f, v) + FRAME_LINE_HEIGHT (f) / 2;
-
-  if (pix_x < 0) pix_x = 0;
-  if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f);
-
-  if (pix_y < 0) pix_y = 0;
-  if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
-
-  x_set_mouse_pixel_position (f, pix_x, pix_y);
-}
-
-
 static int
 note_mouse_movement (struct frame *frame, CGFloat x, CGFloat y)
 /*   ------------------------------------------------------------------------
@@ -2012,8 +2006,7 @@ ns_convert_key (unsigned code)
     Internal call used by NSView-keyDown.
    -------------------------------------------------------------------------- */
 {
-  const unsigned last_keysym = (sizeof (convert_ns_to_X_keysym)
-                                / sizeof (convert_ns_to_X_keysym[0]));
+  const unsigned last_keysym = ARRAYELTS (convert_ns_to_X_keysym);
   unsigned keysym;
   /* An array would be faster, but less easy to read. */
   for (keysym = 0; keysym < last_keysym; keysym += 2)
@@ -2320,52 +2313,6 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
     {
       int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny;
 
-      /* If the fringe is adjacent to the left (right) scroll bar of a
-        leftmost (rightmost, respectively) window, then extend its
-        background to the gap between the fringe and the bar.  */
-      if ((WINDOW_LEFTMOST_P (w)
-          && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
-         || (WINDOW_RIGHTMOST_P (w)
-             && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
-       {
-         int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
-
-         if (sb_width > 0)
-           {
-             int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
-             int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
-                                   * FRAME_COLUMN_WIDTH (f));
-
-             if (bx < 0)
-               {
-                 /* Bitmap fills the fringe.  */
-                 if (bar_area_x + bar_area_width == p->x)
-                   bx = bar_area_x + sb_width;
-                 else if (p->x + p->wd == bar_area_x)
-                   bx = bar_area_x;
-                 if (bx >= 0)
-                   {
-                     int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
-
-                     nx = bar_area_width - sb_width;
-                     by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
-                                                           row->y));
-                     ny = row->visible_height;
-                   }
-               }
-             else
-               {
-                 if (bar_area_x + bar_area_width == bx)
-                   {
-                     bx = bar_area_x + sb_width;
-                     nx += bar_area_width - sb_width;
-                   }
-                 else if (bx + nx == bar_area_x)
-                   nx += bar_area_width - sb_width;
-               }
-           }
-       }
-
       if (bx >= 0 && nx > 0)
         {
           NSRect r = NSMakeRect (bx, by, nx, ny);
@@ -2599,38 +2546,18 @@ ns_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
   ns_unfocus (f);
 }
 
-
-void
-show_hourglass (struct atimer *timer)
+static void
+ns_show_hourglass (struct frame *f)
 {
-  if (hourglass_shown_p)
-    return;
-
-  block_input ();
-
-  /* TODO: add NSProgressIndicator to selected frame (see macfns.c) */
-
-  hourglass_shown_p = 1;
-  unblock_input ();
+  /* TODO: add NSProgressIndicator to all frames.  */
 }
 
-
-void
-hide_hourglass (void)
+static void
+ns_hide_hourglass (struct frame *f)
 {
-  if (!hourglass_shown_p)
-    return;
-
-  block_input ();
-
-  /* TODO: remove NSProgressIndicator from all frames */
-
-  hourglass_shown_p = 0;
-  unblock_input ();
+  /* TODO: remove NSProgressIndicator from all frames.  */
 }
 
-
-
 /* ==========================================================================
 
     Glyph drawing operations
@@ -3356,10 +3283,16 @@ ns_draw_glyph_string (struct glyph_string *s)
           NS_FACE_FOREGROUND (s->face) = tmp;
         }
 
-      font->driver->draw
-        (s, 0, s->nchars, s->x, s->y,
-         (flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
-         || flags == NS_DUMPGLYPH_MOUSEFACE);
+      {
+        BOOL isComposite = s->first_glyph->type == COMPOSITE_GLYPH;
+        int end = isComposite ? s->cmp_to : s->nchars;
+
+        font->driver->draw
+          (s, s->cmp_from, end, s->x, s->ybase,
+           (flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
+           || flags == NS_DUMPGLYPH_MOUSEFACE);
+
+      }
 
       {
         NSColor *col = (NS_FACE_FOREGROUND (s->face) != 0
@@ -3601,8 +3534,7 @@ ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
 
   block_input ();
   n_emacs_events_pending = 0;
-  EVENT_INIT (ev);
-  emacs_event = &ev;
+  ns_init_events (&ev);
   q_event_ptr = hold_quit;
 
   /* we manage autorelease pools by allocate/reallocate each time around
@@ -3643,7 +3575,8 @@ ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
 
   nevents = n_emacs_events_pending;
   n_emacs_events_pending = 0;
-  emacs_event = q_event_ptr = NULL;
+  ns_finish_events ();
+  q_event_ptr = NULL;
   unblock_input ();
 
   return nevents;
@@ -3738,16 +3671,15 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
       ns_send_appdefined (-1);
     }
 
-  EVENT_INIT (event);
   block_input ();
-  emacs_event = &event;
+  ns_init_events (&event);
   if (++apploopnr != 1)
     {
       emacs_abort ();
     }
   [NSApp run];
   --apploopnr;
-  emacs_event = NULL;
+  ns_finish_events ();
   if (nr > 0 && readfds)
     {
       c = 's';
@@ -3812,10 +3744,9 @@ ns_set_vertical_scroll_bar (struct window *window,
   NSRect r, v;
   struct frame *f = XFRAME (WINDOW_FRAME (window));
   EmacsView *view = FRAME_NS_VIEW (f);
-  int window_y, window_height;
-  int top, left, height, width, sb_width, sb_left;
   EmacsScroller *bar;
-  BOOL fringe_extended_p;
+  int window_y, window_height;
+  int top, left, height, width;
 
   /* optimization; display engine sends WAY too many of these.. */
   if (!NILP (window->vertical_scroll_bar))
@@ -3842,18 +3773,11 @@ ns_set_vertical_scroll_bar (struct window *window,
   width = WINDOW_CONFIG_SCROLL_BAR_COLS (window) * FRAME_COLUMN_WIDTH (f);
   left = WINDOW_SCROLL_BAR_AREA_X (window);
 
-  /* allow for displaying a skinnier scrollbar than char area allotted */
-  sb_width = (WINDOW_CONFIG_SCROLL_BAR_WIDTH (window) > 0) ?
-    WINDOW_CONFIG_SCROLL_BAR_WIDTH (window) : width;
-  sb_left = left;
-
-  r = NSMakeRect (sb_left, top, sb_width, height);
+  r = NSMakeRect (left, top, width, height);
   /* the parent view is flipped, so we need to flip y value */
   v = [view frame];
   r.origin.y = (v.size.height - r.size.height - r.origin.y);
 
-  fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (window);
-
   XSETWINDOW (win, window);
   block_input ();
 
@@ -3866,7 +3790,7 @@ ns_set_vertical_scroll_bar (struct window *window,
           [bar removeFromSuperview];
           wset_vertical_scroll_bar (window, Qnil);
         }
-      ns_clear_frame_area (f, sb_left, top, width, height);
+      ns_clear_frame_area (f, left, top, width, height);
       unblock_input ();
       return;
     }
@@ -3874,12 +3798,7 @@ ns_set_vertical_scroll_bar (struct window *window,
   if (NILP (window->vertical_scroll_bar))
     {
       if (width > 0 && height > 0)
-       {
-         if (fringe_extended_p)
-           ns_clear_frame_area (f, sb_left, top, sb_width, height);
-         else
-           ns_clear_frame_area (f, left, top, width, height);
-        }
+       ns_clear_frame_area (f, left, top, width, height);
 
       bar = [[EmacsScroller alloc] initFrame: r window: win];
       wset_vertical_scroll_bar (window, make_save_ptr (bar));
@@ -3893,7 +3812,97 @@ ns_set_vertical_scroll_bar (struct window *window,
       if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
         {
           if (oldRect.origin.x != r.origin.x)
-              ns_clear_frame_area (f, sb_left, top, width, height);
+              ns_clear_frame_area (f, left, top, width, height);
+          [bar setFrame: r];
+        }
+    }
+
+  [bar setPosition: position portion: portion whole: whole];
+  unblock_input ();
+}
+
+
+static void
+ns_set_horizontal_scroll_bar (struct window *window,
+                             int portion, int whole, int position)
+/* --------------------------------------------------------------------------
+      External (hook): Update or add scrollbar
+   -------------------------------------------------------------------------- */
+{
+  Lisp_Object win;
+  NSRect r, v;
+  struct frame *f = XFRAME (WINDOW_FRAME (window));
+  EmacsView *view = FRAME_NS_VIEW (f);
+  EmacsScroller *bar;
+  int top, height, left, width;
+  int window_x, window_width;
+  int pixel_width = WINDOW_PIXEL_WIDTH (window);
+
+  /* optimization; display engine sends WAY too many of these.. */
+  if (!NILP (window->horizontal_scroll_bar))
+    {
+      bar = XNS_SCROLL_BAR (window->horizontal_scroll_bar);
+      if ([bar checkSamePosition: position portion: portion whole: whole])
+        {
+          if (view->scrollbarsNeedingUpdate == 0)
+            {
+              if (!windows_or_buffers_changed)
+                  return;
+            }
+          else
+            view->scrollbarsNeedingUpdate--;
+        }
+    }
+
+  NSTRACE (ns_set_horizontal_scroll_bar);
+
+  /* Get dimensions.  */
+  window_box (window, ANY_AREA, 0, &window_x, &window_width, 0);
+  left = window_x;
+  width = window_width;
+  height = WINDOW_CONFIG_SCROLL_BAR_LINES (window) * FRAME_LINE_HEIGHT (f);
+  top = WINDOW_SCROLL_BAR_AREA_Y (window);
+
+  r = NSMakeRect (left, top, width, height);
+  /* the parent view is flipped, so we need to flip y value */
+  v = [view frame];
+  /* ??????? PXW/scrollbars !!!!!!!!!!!!!!!!!!!! */
+  r.origin.y = (v.size.height - r.size.height - r.origin.y);
+
+  XSETWINDOW (win, window);
+  block_input ();
+
+  if (WINDOW_TOTAL_COLS (window) < 5)
+    {
+      if (!NILP (window->horizontal_scroll_bar))
+        {
+          bar = XNS_SCROLL_BAR (window->horizontal_scroll_bar);
+          [bar removeFromSuperview];
+          wset_horizontal_scroll_bar (window, Qnil);
+        }
+      ns_clear_frame_area (f, left, top, width, height);
+      unblock_input ();
+      return;
+    }
+
+  if (NILP (window->horizontal_scroll_bar))
+    {
+      if (width > 0 && height > 0)
+       ns_clear_frame_area (f, left, top, width, height);
+
+      bar = [[EmacsScroller alloc] initFrame: r window: win];
+      wset_horizontal_scroll_bar (window, make_save_ptr (bar));
+    }
+  else
+    {
+      NSRect oldRect;
+      bar = XNS_SCROLL_BAR (window->horizontal_scroll_bar);
+      oldRect = [bar frame];
+      r.size.width = oldRect.size.width;
+      if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
+        {
+          if (oldRect.origin.x != r.origin.x)
+              ns_clear_frame_area (f, left, top, width, height);
           [bar setFrame: r];
         }
     }
@@ -3939,6 +3948,12 @@ ns_redeem_scroll_bar (struct window *window)
       bar = XNS_SCROLL_BAR (window->vertical_scroll_bar);
       [bar reprieve];
     }
+
+  if (!NILP (window->horizontal_scroll_bar))
+    {
+      bar = XNS_SCROLL_BAR (window->horizontal_scroll_bar);
+      [bar reprieve];
+    }
 }
 
 
@@ -4114,7 +4129,9 @@ static struct redisplay_interface ns_redisplay_interface =
   ns_draw_window_cursor,
   ns_draw_vertical_window_border,
   ns_draw_window_divider,
-  ns_shift_glyphs_for_insert
+  ns_shift_glyphs_for_insert,
+  ns_show_hourglass,
+  ns_hide_hourglass
 };
 
 
@@ -4154,38 +4171,30 @@ ns_create_terminal (struct ns_display_info *dpyinfo)
 
   NSTRACE (ns_create_terminal);
 
-  terminal = create_terminal ();
+  terminal = create_terminal (output_ns, &ns_redisplay_interface);
 
-  terminal->type = output_ns;
   terminal->display_info.ns = dpyinfo;
   dpyinfo->terminal = terminal;
 
-  terminal->rif = &ns_redisplay_interface;
-
   terminal->clear_frame_hook = ns_clear_frame;
-  terminal->ins_del_lines_hook = 0; /* XXX vestigial? */
-  terminal->delete_glyphs_hook = 0; /* XXX vestigial? */
   terminal->ring_bell_hook = ns_ring_bell;
-  terminal->reset_terminal_modes_hook = NULL;
-  terminal->set_terminal_modes_hook = NULL;
   terminal->update_begin_hook = ns_update_begin;
   terminal->update_end_hook = ns_update_end;
-  terminal->set_terminal_window_hook = NULL; /* XXX vestigial? */
   terminal->read_socket_hook = ns_read_socket;
   terminal->frame_up_to_date_hook = ns_frame_up_to_date;
   terminal->mouse_position_hook = ns_mouse_position;
   terminal->frame_rehighlight_hook = ns_frame_rehighlight;
   terminal->frame_raise_lower_hook = ns_frame_raise_lower;
-
   terminal->fullscreen_hook = ns_fullscreen_hook;
-
+  terminal->menu_show_hook = ns_menu_show;
+  terminal->popup_dialog_hook = ns_popup_dialog;
   terminal->set_vertical_scroll_bar_hook = ns_set_vertical_scroll_bar;
   terminal->condemn_scroll_bars_hook = ns_condemn_scroll_bars;
   terminal->redeem_scroll_bar_hook = ns_redeem_scroll_bar;
   terminal->judge_scroll_bars_hook = ns_judge_scroll_bars;
-
   terminal->delete_frame_hook = x_destroy_window;
   terminal->delete_terminal_hook = ns_delete_terminal;
+  /* Other hooks are NULL by default.  */
 
   return terminal;
 }
@@ -4466,7 +4475,7 @@ ns_term_shutdown (int sig)
 {
   if (self = [super init])
     {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
+#ifdef NS_IMPL_COCOA
       self->isFirst = YES;
 #endif
 #ifdef NS_IMPL_GNUSTEP
@@ -4477,30 +4486,40 @@ ns_term_shutdown (int sig)
   return self;
 }
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
+#ifdef NS_IMPL_COCOA
 - (void)run
 {
-    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+#ifndef NSAppKitVersionNumber10_8
+#define NSAppKitVersionNumber10_8 1187
+#endif
 
-    if (isFirst) [self finishLaunching];
-    isFirst = NO;
+  if (NSAppKitVersionNumber <= NSAppKitVersionNumber10_8) 
+    {
+      [super run];
+      return;
+    }
 
-    shouldKeepRunning = YES;
-    do
-      {
-        [pool release];
-        pool = [[NSAutoreleasePool alloc] init];
-
-        NSEvent *event =
-          [self nextEventMatchingMask:NSAnyEventMask
-                            untilDate:[NSDate distantFuture]
-                               inMode:NSDefaultRunLoopMode
-                              dequeue:YES];
-        [self sendEvent:event];
-        [self updateWindows];
+  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+  if (isFirst) [self finishLaunching];
+  isFirst = NO;
+
+  shouldKeepRunning = YES;
+  do
+    {
+      [pool release];
+      pool = [[NSAutoreleasePool alloc] init];
+
+      NSEvent *event =
+        [self nextEventMatchingMask:NSAnyEventMask
+                          untilDate:[NSDate distantFuture]
+                             inMode:NSDefaultRunLoopMode
+                            dequeue:YES];
+      [self sendEvent:event];
+      [self updateWindows];
     } while (shouldKeepRunning);
 
-    [pool release];
+  [pool release];
 }
 
 - (void)stop: (id)sender
@@ -4510,7 +4529,7 @@ ns_term_shutdown (int sig)
     // The file dialog still leaks 7k - 10k on 10.9 though.
     [super stop:sender];
 }
-#endif
+#endif /* NS_IMPL_COCOA */
 
 - (void)logNotification: (NSNotification *)notification
 {
@@ -5031,9 +5050,11 @@ not_in_argv (NSString *arg)
 
   if (EQ (font->driver->type, Qns))
     nsfont = ((struct nsfont_info *)font)->nsfont;
+#ifdef NS_IMPL_COCOA
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
   else
     nsfont = (NSFont *) macfont_get_nsctfont (font);
+#endif
 #endif
 
   if ((newFont = [sender convertFont: nsfont]))
@@ -5712,14 +5733,10 @@ not_in_argv (NSString *arg)
       /* NOTE: help_echo_{window,pos,object} are set in xdisp.c
          (note_mouse_highlight), which is called through the
          note_mouse_movement () call above */
+      any_help_event_p = YES;
       gen_help_event (help_echo_string, frame, help_echo_window,
                       help_echo_object, help_echo_pos);
     }
-  else
-    {
-      help_echo_string = Qnil;
-      gen_help_event (Qnil, frame, Qnil, Qnil, 0);
-    }
 
   if (emacsframe->mouse_moved && send_appdefined)
     ns_send_appdefined (-1);
@@ -5997,6 +6014,14 @@ if (cols > 0 && rows > 0)
       x_set_frame_alpha (emacsframe);
     }
 
+  if (any_help_event_p)
+    {
+      Lisp_Object frame;
+      XSETFRAME (frame, emacsframe);
+      help_echo_string = Qnil;
+      gen_help_event (Qnil, frame, Qnil, Qnil, 0);
+    }
+
   if (emacs_event && is_focus_frame)
     {
       [self deleteWorkingText];
@@ -7031,7 +7056,7 @@ if (cols > 0 && rows > 0)
 
   if (nr_eff_screens == 1)
     return [super constrainFrameRect:frameRect toScreen:screen];
-  
+
   /* The default implementation does two things 1) ensure that the top
      of the rectangle is below the menu bar (or below the top of the
      screen) and 2) resizes windows larger than the screen. As we
@@ -7159,15 +7184,6 @@ if (cols > 0 && rows > 0)
 }
 
 
-- (void)dealloc
-{
-  NSTRACE (EmacsScroller_dealloc);
-  if (!NILP (win))
-    wset_vertical_scroll_bar (XWINDOW (win), Qnil);
-  [super dealloc];
-}
-
-
 - condemn
 {
   NSTRACE (condemn);
@@ -7195,6 +7211,9 @@ if (cols > 0 && rows > 0)
       view = (EmacsView *)FRAME_NS_VIEW (frame);
       if (view != nil)
         view->scrollbarsNeedingUpdate++;
+      if (!NILP (win))
+        wset_vertical_scroll_bar (XWINDOW (win), Qnil);
+      win = Qnil;
       [self removeFromSuperview];
       [self release];
       unblock_input ();
@@ -7522,8 +7541,6 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
   FRAME_COLUMN_WIDTH (f) = font->average_width;
   FRAME_LINE_HEIGHT (f) = font->height;
 
-  compute_fringe_widths (f, 1);
-
   /* Compute the scroll bar width in character columns.  */
   if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
     {
@@ -7537,6 +7554,19 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
       FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
     }
 
+  /* Compute the scroll bar height in character lines.  */
+  if (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) > 0)
+    {
+      int height = FRAME_LINE_HEIGHT (f);
+      FRAME_CONFIG_SCROLL_BAR_LINES (f)
+       = (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) + height - 1) / height;
+    }
+  else
+    {
+      int height = FRAME_LINE_HEIGHT (f);
+      FRAME_CONFIG_SCROLL_BAR_LINES (f) = (14 + height - 1) / height;
+    }
+
   /* Now make the frame display the given font.  */
   if (FRAME_NS_WINDOW (f) != 0 && ! [view isFullscreen])
     x_set_window_size (f, 0, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
index 475be9ec28542c213462367dfe43835a90adbb25..57fac7af378c1a541be42dff0e52aa24097df72b 100644 (file)
@@ -1228,7 +1228,8 @@ print_preprocess (Lisp_Object obj)
          size = ASIZE (obj);
          if (size & PSEUDOVECTOR_FLAG)
            size &= PSEUDOVECTOR_SIZE_MASK;
-         for (i = 0; i < size; i++)
+         for (i = (SUB_CHAR_TABLE_P (obj)
+                   ? SUB_CHAR_TABLE_OFFSET : 0); i < size; i++)
            print_preprocess (AREF (obj, i));
          if (HASH_TABLE_P (obj))
            { /* For hash tables, the key_and_value slot is past
@@ -1472,7 +1473,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
                  strout (outbuf, len, len, printcharfun);
                }
              else if (! multibyte
-                      && SINGLE_BYTE_CHAR_P (c) && ! ASCII_BYTE_P (c)
+                      && SINGLE_BYTE_CHAR_P (c) && ! ASCII_CHAR_P (c)
                       && print_escape_nonascii)
                {
                  /* When printing in a multibyte buffer
@@ -1968,7 +1969,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
                 Otherwise we'll make a line extremely long, which
                 results in slow redisplay.  */
              if (SUB_CHAR_TABLE_P (obj)
-                 && XINT (XSUB_CHAR_TABLE (obj)->depth) == 3)
+                 && XSUB_CHAR_TABLE (obj)->depth == 3)
                PRINTCHAR ('\n');
              PRINTCHAR ('#');
              PRINTCHAR ('^');
@@ -1981,16 +1982,24 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
 
          PRINTCHAR ('[');
          {
-           register int i;
+           int i, idx = SUB_CHAR_TABLE_P (obj) ? SUB_CHAR_TABLE_OFFSET : 0;
            register Lisp_Object tem;
            ptrdiff_t real_size = size;
 
+           /* For a sub char-table, print heading non-Lisp data first.  */
+           if (SUB_CHAR_TABLE_P (obj))
+             {
+               i = sprintf (buf, "%d %d", XSUB_CHAR_TABLE (obj)->depth,
+                            XSUB_CHAR_TABLE (obj)->min_char);
+               strout (buf, i, i, printcharfun);
+             }
+
            /* Don't print more elements than the specified maximum.  */
            if (NATNUMP (Vprint_length)
                && XFASTINT (Vprint_length) < size)
              size = XFASTINT (Vprint_length);
 
-           for (i = 0; i < size; i++)
+           for (i = idx; i < size; i++)
              {
                if (i) PRINTCHAR (' ');
                tem = AREF (obj, i);
index 2c66b9e976e3c745c11bf0ff0281df174a043c53..f34be69864a011a18256ca75656b1ee60291ac71 100644 (file)
@@ -224,8 +224,9 @@ static EMACS_INT update_tick;
 /* Only W32 has this, it really means that select can't take write mask.  */
 #ifdef BROKEN_NON_BLOCKING_CONNECT
 #undef NON_BLOCKING_CONNECT
-#define SELECT_CANT_DO_WRITE_MASK
+enum { SELECT_CAN_DO_WRITE_MASK = false };
 #else
+enum { SELECT_CAN_DO_WRITE_MASK = true };
 #ifndef NON_BLOCKING_CONNECT
 #ifdef HAVE_SELECT
 #if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX)
@@ -281,17 +282,11 @@ static void create_process (Lisp_Object, char **, Lisp_Object);
 static bool keyboard_bit_set (fd_set *);
 #endif
 static void deactivate_process (Lisp_Object);
-static void status_notify (struct Lisp_Process *);
+static int status_notify (struct Lisp_Process *, struct Lisp_Process *);
 static int read_process_output (Lisp_Object, int);
 static void handle_child_signal (int);
 static void create_pty (Lisp_Object);
 
-/* If we support a window system, turn on the code to poll periodically
-   to detect C-g.  It isn't actually used when doing interrupt input.  */
-#ifdef HAVE_WINDOW_SYSTEM
-#define POLL_FOR_INPUT
-#endif
-
 static Lisp_Object get_process (register Lisp_Object name);
 static void exec_sentinel (Lisp_Object proc, Lisp_Object reason);
 
@@ -468,7 +463,6 @@ static struct fd_callback_data
 void
 add_read_fd (int fd, fd_callback func, void *data)
 {
-  eassert (fd < FD_SETSIZE);
   add_keyboard_wait_descriptor (fd);
 
   fd_callback_info[fd].func = func;
@@ -481,7 +475,6 @@ add_read_fd (int fd, fd_callback func, void *data)
 void
 delete_read_fd (int fd)
 {
-  eassert (fd < FD_SETSIZE);
   delete_keyboard_wait_descriptor (fd);
 
   fd_callback_info[fd].condition &= ~FOR_READ;
@@ -498,7 +491,6 @@ delete_read_fd (int fd)
 void
 add_write_fd (int fd, fd_callback func, void *data)
 {
-  eassert (fd < FD_SETSIZE);
   FD_SET (fd, &write_mask);
   if (fd > max_input_desc)
     max_input_desc = fd;
@@ -529,7 +521,6 @@ delete_input_desc (int fd)
 void
 delete_write_fd (int fd)
 {
-  eassert (fd < FD_SETSIZE);
   FD_CLR (fd, &write_mask);
   fd_callback_info[fd].condition &= ~FOR_WRITE;
   if (fd_callback_info[fd].condition == 0)
@@ -870,7 +861,7 @@ nil, indicating the current buffer's process.  */)
     {
       pset_status (p, list2 (Qexit, make_number (0)));
       p->tick = ++process_tick;
-      status_notify (p);
+      status_notify (p, NULL);
       redisplay_preserve_echo_area (13);
     }
   else
@@ -890,7 +881,7 @@ nil, indicating the current buffer's process.  */)
            pset_status (p, list2 (Qsignal, make_number (SIGKILL)));
 
          p->tick = ++process_tick;
-         status_notify (p);
+         status_notify (p, NULL);
          redisplay_preserve_echo_area (13);
        }
     }
@@ -1663,6 +1654,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
   bool pty_flag = 0;
   char pty_name[PTY_NAME_SIZE];
   Lisp_Object lisp_pty_name = Qnil;
+  sigset_t oldset;
 
   inchannel = outchannel = -1;
 
@@ -1728,7 +1720,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
   setup_process_coding_systems (process);
 
   block_input ();
-  block_child_signal ();
+  block_child_signal (&oldset);
 
 #ifndef WINDOWSNT
   /* vfork, and prevent local vars from being clobbered by the vfork.  */
@@ -1852,7 +1844,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
       signal (SIGPIPE, SIG_DFL);
 
       /* Stop blocking SIGCHLD in the child.  */
-      unblock_child_signal ();
+      unblock_child_signal (&oldset);
 
       if (pty_flag)
        child_setup_tty (xforkout);
@@ -1871,7 +1863,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
     p->alive = 1;
 
   /* Stop blocking in the parent.  */
-  unblock_child_signal ();
+  unblock_child_signal (&oldset);
   unblock_input ();
 
   if (pid < 0)
@@ -1966,9 +1958,6 @@ create_pty (Lisp_Object process)
 /* Convert an internal struct sockaddr to a lisp object (vector or string).
    The address family of sa is not included in the result.  */
 
-#ifndef WINDOWSNT
-static
-#endif
 Lisp_Object
 conv_sockaddr_to_lisp (struct sockaddr *sa, int len)
 {
@@ -2021,11 +2010,11 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, int len)
            terminator, however.  */
         if (name_length > 0 && sockun->sun_path[0] != '\0')
           {
-            const char* terminator =
-              memchr (sockun->sun_path, '\0', name_length);
+            const char *terminator
+             = memchr (sockun->sun_path, '\0', name_length);
 
             if (terminator)
-              name_length = terminator - (const char*) sockun->sun_path;
+              name_length = terminator - (const char *) sockun->sun_path;
           }
 
        return make_unibyte_string (sockun->sun_path, name_length);
@@ -2855,7 +2844,7 @@ usage: (make-network-process &rest ARGS)  */)
   struct gcpro gcpro1;
   ptrdiff_t count = SPECPDL_INDEX ();
   ptrdiff_t count1;
-  Lisp_Object QCaddress;  /* one of QClocal or QCremote */
+  Lisp_Object colon_address;  /* Either QClocal or QCremote.  */
   Lisp_Object tem;
   Lisp_Object name, buffer, host, service, address;
   Lisp_Object filter, sentinel;
@@ -2903,8 +2892,8 @@ usage: (make-network-process &rest ARGS)  */)
        backlog = XINT (tem);
     }
 
-  /* Make QCaddress an alias for :local (server) or :remote (client).  */
-  QCaddress = is_server ? QClocal : QCremote;
+  /* Make colon_address an alias for :local (server) or :remote (client).  */
+  colon_address = is_server ? QClocal : QCremote;
 
   /* :nowait BOOL */
   if (!is_server && socktype != SOCK_DGRAM
@@ -2931,7 +2920,7 @@ usage: (make-network-process &rest ARGS)  */)
   res = &ai;
 
   /* :local ADDRESS or :remote ADDRESS */
-  address = Fplist_get (contact, QCaddress);
+  address = Fplist_get (contact, colon_address);
   if (!NILP (address))
     {
       host = service = Qnil;
@@ -3318,7 +3307,7 @@ usage: (make-network-process &rest ARGS)  */)
            memcpy (datagram_address[s].sa, lres->ai_addr, lres->ai_addrlen);
        }
 #endif
-      contact = Fplist_put (contact, QCaddress,
+      contact = Fplist_put (contact, colon_address,
                            conv_sockaddr_to_lisp (lres->ai_addr, lres->ai_addrlen));
 #ifdef HAVE_GETSOCKNAME
       if (!is_server)
@@ -3933,19 +3922,20 @@ DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output,
        0, 4, 0,
        doc: /* Allow any pending output from subprocesses to be read by Emacs.
 It is given to their filter functions.
-Non-nil arg PROCESS means do not return until some output has been received
-from PROCESS.
+Optional argument PROCESS means do not return until output has been
+received from PROCESS.
 
-Non-nil second arg SECONDS and third arg MILLISEC are number of seconds
-and milliseconds to wait; return after that much time whether or not
-there is any subprocess output.  If SECONDS is a floating point number,
+Optional second argument SECONDS and third argument MILLISEC
+specify a timeout; return after that much time even if there is
+no subprocess output.  If SECONDS is a floating point number,
 it specifies a fractional number of seconds to wait.
 The MILLISEC argument is obsolete and should be avoided.
 
-If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
-from PROCESS, suspending reading output from other processes.
+If optional fourth argument JUST-THIS-ONE is non-nil, accept output
+from PROCESS only, suspending reading output from other processes.
 If JUST-THIS-ONE is an integer, don't run any timers either.
-Return non-nil if we received any output before the timeout expired.  */)
+Return non-nil if we received any output from PROCESS (or, if PROCESS
+is nil, from any process) before the timeout expired.  */)
   (register Lisp_Object process, Lisp_Object seconds, Lisp_Object millisec, Lisp_Object just_this_one)
 {
   intmax_t secs;
@@ -3997,12 +3987,13 @@ Return non-nil if we received any output before the timeout expired.  */)
     nsecs = 0;
 
   return
-    (wait_reading_process_output (secs, nsecs, 0, 0,
+    ((wait_reading_process_output (secs, nsecs, 0, 0,
                                  Qnil,
                                  !NILP (process) ? XPROCESS (process) : NULL,
                                  NILP (just_this_one) ? 0 :
                                  !INTEGERP (just_this_one) ? 1 : -1)
-     ? Qt : Qnil);
+      <= 0)
+     ? Qnil : Qt);
 }
 
 /* Accept a connection for server process SERVER on CHANNEL.  */
@@ -4267,18 +4258,17 @@ wait_reading_process_output_1 (void)
      (and gobble terminal input into the buffer if any arrives).
 
    If WAIT_PROC is specified, wait until something arrives from that
-     process.  The return value is true if we read some input from
-     that process.
+     process.
 
    If JUST_WAIT_PROC is nonzero, handle only output from WAIT_PROC
      (suspending output from other processes).  A negative value
      means don't run any timers either.
 
-   If WAIT_PROC is specified, then the function returns true if we
-     received input from that process before the timeout elapsed.
-   Otherwise, return true if we received input from any process.  */
+   Return positive if we received input from WAIT_PROC (or from any
+   process if WAIT_PROC is null), zero if we attempted to receive
+   input but got none, and negative if we didn't even try.  */
 
-bool
+int
 wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
                             bool do_display,
                             Lisp_Object wait_for_cell,
@@ -4293,8 +4283,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
   int xerrno;
   Lisp_Object proc;
   struct timespec timeout, end_time;
-  int wait_channel = -1;
-  bool got_some_input = 0;
+  int got_some_input = -1;
   ptrdiff_t count = SPECPDL_INDEX ();
 
   FD_ZERO (&Available);
@@ -4305,10 +4294,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
           && EQ (XCAR (wait_proc->status), Qexit)))
     message1 ("Blocking call to accept-process-output with quit inhibited!!");
 
-  /* If wait_proc is a process to watch, set wait_channel accordingly.  */
-  if (wait_proc != NULL)
-    wait_channel = wait_proc->infd;
-
   record_unwind_protect_int (wait_reading_process_output_unwind,
                             waiting_for_user_input_p);
   waiting_for_user_input_p = read_kbd;
@@ -4345,6 +4330,10 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
       if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
        break;
 
+      /* After reading input, vacuum up any leftovers without waiting.  */
+      if (0 <= got_some_input)
+       nsecs = -1;
+
       /* Compute time from now till when time limit is up.  */
       /* Exit if already run out.  */
       if (nsecs < 0)
@@ -4463,7 +4452,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
              /* It's okay for us to do this and then continue with
                 the loop, since timeout has already been zeroed out.  */
              clear_waiting_for_input ();
-             status_notify (NULL);
+             got_some_input = status_notify (NULL, wait_proc);
              if (do_display) redisplay_preserve_echo_area (13);
            }
        }
@@ -4473,6 +4462,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
       if (wait_proc && wait_proc->raw_status_new)
        update_status (wait_proc);
       if (wait_proc
+         && wait_proc->infd >= 0
          && ! EQ (wait_proc->status, Qrun)
          && ! EQ (wait_proc->status, Qconnect))
        {
@@ -4482,21 +4472,26 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
          XSETPROCESS (proc, wait_proc);
 
          /* Read data from the process, until we exhaust it.  */
-         while (wait_proc->infd >= 0)
+         while (true)
            {
              int nread = read_process_output (proc, wait_proc->infd);
-
-             if (nread == 0)
-               break;
-
-             if (nread > 0)
-               got_some_input = read_some_bytes = 1;
-             else if (nread == -1 && (errno == EIO || errno == EAGAIN))
-               break;
+             if (nread < 0)
+               {
+                 if (errno == EIO || errno == EAGAIN)
+                   break;
 #ifdef EWOULDBLOCK
-             else if (nread == -1 && EWOULDBLOCK == errno)
-               break;
+                 if (errno == EWOULDBLOCK)
+                   break;
 #endif
+               }
+             else
+               {
+                 if (got_some_input < nread)
+                   got_some_input = nread;
+                 if (nread == 0)
+                   break;
+                 read_some_bytes = true;
+               }
            }
          if (read_some_bytes && do_display)
            redisplay_preserve_echo_area (10);
@@ -4527,12 +4522,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
          else
            Available = input_wait_mask;
           Writeok = write_mask;
-#ifdef SELECT_CANT_DO_WRITE_MASK
-          check_write = 0;
-#else
-          check_write = 1;
-#endif
-         check_delay = wait_channel >= 0 ? 0 : process_output_delay_count;
+         check_delay = wait_proc ? 0 : process_output_delay_count;
+         check_write = SELECT_CAN_DO_WRITE_MASK;
        }
 
       /* If frame size has changed or the window is newly mapped,
@@ -4558,6 +4549,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
        {
          nfds = read_kbd ? 0 : 1;
          no_avail = 1;
+         FD_ZERO (&Available);
        }
 
       if (!no_avail)
@@ -4567,7 +4559,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
          /* Set the timeout for adaptive read buffering if any
             process has non-zero read_output_skip and non-zero
             read_output_delay, and we are not reading output for a
-            specific wait_channel.  It is not executed if
+            specific process.  It is not executed if
             Vprocess_adaptive_read_buffering is nil.  */
          if (process_output_skip && check_delay > 0)
            {
@@ -4629,12 +4621,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
                      {
                        struct Lisp_Process *p =
                          XPROCESS (chan_process[channel]);
-                       if (p && p->gnutls_p && p->gnutls_state && p->infd
+                       if (p && p->gnutls_p && p->gnutls_state
                            && ((emacs_gnutls_record_check_pending
                                 (p->gnutls_state))
                                > 0))
                          {
                            nfds++;
+                           eassert (p->infd == channel);
                            FD_SET (p->infd, &Available);
                          }
                      }
@@ -4650,6 +4643,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
                          > 0))
                    {
                      nfds = 1;
+                     eassert (0 <= wait_proc->infd);
                      /* Set to Available.  */
                      FD_SET (wait_proc->infd, &Available);
                    }
@@ -4679,12 +4673,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
            report_file_errno ("Failed select", Qnil, xerrno);
        }
 
-      if (no_avail)
-       {
-         FD_ZERO (&Available);
-         check_write = 0;
-       }
-
       /* Check for keyboard input */
       /* If there is any, return immediately
         to give it higher priority than subprocesses */
@@ -4751,9 +4739,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
        handle_input_available_signal (SIGIO);
 #endif
 
-      if (! wait_proc)
-       got_some_input |= nfds > 0;
-
       /* If checking input just got us a size-change event from X,
         obey it now if we should.  */
       if (read_kbd || ! NILP (wait_for_cell))
@@ -4785,12 +4770,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
              /* If waiting for this channel, arrange to return as
                 soon as no more input to be processed.  No more
                 waiting.  */
-             if (wait_channel == channel)
-               {
-                 wait_channel = -1;
-                 nsecs = -1;
-                 got_some_input = 1;
-               }
              proc = chan_process[channel];
              if (NILP (proc))
                continue;
@@ -4806,6 +4785,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
                 buffered-ahead character if we have one.  */
 
              nread = read_process_output (proc, channel);
+             if ((!wait_proc || wait_proc == XPROCESS (proc)) && got_some_input < nread)
+               got_some_input = nread;
              if (nread > 0)
                {
                  /* Since read_process_output can run a filter,
@@ -4930,7 +4911,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
                     status_notify to do it later, it will read input
                     from the process before calling the sentinel.  */
                  exec_sentinel (proc, build_string ("open\n"));
-                 if (!EQ (p->filter, Qt) && !EQ (p->command, Qt))
+                 if (0 <= p->infd && !EQ (p->filter, Qt)
+                     && !EQ (p->command, Qt))
                    {
                      FD_SET (p->infd, &input_wait_mask);
                      FD_SET (p->infd, &non_keyboard_wait_mask);
@@ -5152,7 +5134,7 @@ read_and_dispose_of_process_output (struct Lisp_Process *p, char *chars,
         proc_encode_coding_system[p->outfd] surely points to a
         valid memory because p->outfd will be changed once EOF is
         sent to the process.  */
-      if (NILP (p->encode_coding_system)
+      if (NILP (p->encode_coding_system) && p->outfd >= 0
          && proc_encode_coding_system[p->outfd])
        {
          pset_encode_coding_system
@@ -5826,36 +5808,31 @@ process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
       p->tick = ++process_tick;
       if (!nomsg)
        {
-         status_notify (NULL);
+         status_notify (NULL, NULL);
          redisplay_preserve_echo_area (13);
        }
     }
 #endif
 
+#ifdef TIOCSIGSEND
+  /* Work around a HP-UX 7.0 bug that mishandles signals to subjobs.
+     We don't know whether the bug is fixed in later HP-UX versions.  */
+  if (! NILP (current_group) && ioctl (p->infd, TIOCSIGSEND, signo) != -1)
+    return;
+#endif
+
   /* If we don't have process groups, send the signal to the immediate
      subprocess.  That isn't really right, but it's better than any
      obvious alternative.  */
-  if (no_pgrp)
-    {
-      kill (p->pid, signo);
-      return;
-    }
+  pid_t pid = no_pgrp ? gid : - gid;
 
-  /* gid may be a pid, or minus a pgrp's number */
-#ifdef TIOCSIGSEND
-  if (!NILP (current_group))
-    {
-      if (ioctl (p->infd, TIOCSIGSEND, signo) == -1)
-       kill (-gid, signo);
-    }
-  else
-    {
-      gid = - p->pid;
-      kill (gid, signo);
-    }
-#else /* ! defined (TIOCSIGSEND) */
-  kill (-gid, signo);
-#endif /* ! defined (TIOCSIGSEND) */
+  /* Do not kill an already-reaped process, as that could kill an
+     innocent bystander that happens to have the same process ID.  */
+  sigset_t oldset;
+  block_child_signal (&oldset);
+  if (p->alive)
+    kill (pid, signo);
+  unblock_child_signal (&oldset);
 }
 
 DEFUN ("interrupt-process", Finterrupt_process, Sinterrupt_process, 0, 2, 0,
@@ -6097,8 +6074,8 @@ process has been transmitted to the serial port.  */)
         for communication with the subprocess, call shutdown to cause EOF.
         (In some old system, shutdown to socketpair doesn't work.
         Then we just can't win.)  */
-      if (EQ (p->type, Qnetwork)
-         || p->infd == old_outfd)
+      if (0 <= old_outfd
+         && (EQ (p->type, Qnetwork) || p->infd == old_outfd))
        shutdown (old_outfd, 1);
 #endif
       close_process_fd (&p->open_fd[WRITE_TO_SUBPROCESS]);
@@ -6354,14 +6331,20 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
 /* Report all recent events of a change in process status
    (either run the sentinel or output a message).
    This is usually done while Emacs is waiting for keyboard input
-   but can be done at other times.  */
+   but can be done at other times.
 
-static void
-status_notify (struct Lisp_Process *deleting_process)
+   Return positive if any input was received from WAIT_PROC (or from
+   any process if WAIT_PROC is null), zero if input was attempted but
+   none received, and negative if we didn't even try.  */
+
+static int
+status_notify (struct Lisp_Process *deleting_process,
+              struct Lisp_Process *wait_proc)
 {
-  register Lisp_Object proc;
+  Lisp_Object proc;
   Lisp_Object tail, msg;
   struct gcpro gcpro1, gcpro2;
+  int got_some_input = -1;
 
   tail = Qnil;
   msg = Qnil;
@@ -6391,8 +6374,14 @@ status_notify (struct Lisp_Process *deleting_process)
                 /* Network or serial process not stopped:  */
                 && ! EQ (p->command, Qt)
                 && p->infd >= 0
-                && p != deleting_process
-                && read_process_output (proc, p->infd) > 0);
+                && p != deleting_process)
+           {
+             int nread = read_process_output (proc, p->infd);
+             if (got_some_input < nread)
+               got_some_input = nread;
+             if (nread <= 0)
+               break;
+           }
 
          /* Get the text to use for the message.  */
          if (p->raw_status_new)
@@ -6424,6 +6413,7 @@ status_notify (struct Lisp_Process *deleting_process)
 
   update_mode_lines = 24;  /* In case buffers use %s in mode-line-format.  */
   UNGCPRO;
+  return got_some_input;
 }
 
 DEFUN ("internal-default-process-sentinel", Finternal_default_process_sentinel,
@@ -6559,6 +6549,8 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
 
   CHECK_PROCESS (process);
   p = XPROCESS (process);
+  if (p->infd < 0)
+    return Qnil;
   coding = proc_decode_coding_system[p->infd];
   return (CODING_FOR_UNIBYTE (coding) ? Qnil : Qt);
 }
@@ -6635,9 +6627,11 @@ extern int sys_select (int, fd_set *, fd_set *, fd_set *,
    DO_DISPLAY means redisplay should be done to show subprocess
    output that arrives.
 
-   Return true if we received input from any process.  */
+   Return positive if we received input from WAIT_PROC (or from any
+   process if WAIT_PROC is null), zero if we attempted to receive
+   input but got none, and negative if we didn't even try.  */
 
-bool
+int
 wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
                             bool do_display,
                             Lisp_Object wait_for_cell,
@@ -6825,7 +6819,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 
   start_polling ();
 
-  return 0;
+  return -1;
 }
 
 #endif /* not subprocesses */
@@ -6833,6 +6827,26 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 /* The following functions are needed even if async subprocesses are
    not supported.  Some of them are no-op stubs in that case.  */
 
+#ifdef HAVE_TIMERFD
+
+/* Add FD, which is a descriptor returned by timerfd_create,
+   to the set of non-keyboard input descriptors.  */
+
+void
+add_timer_wait_descriptor (int fd)
+{
+  FD_SET (fd, &input_wait_mask);
+  FD_SET (fd, &non_keyboard_wait_mask);
+  FD_SET (fd, &non_process_wait_mask);  
+  fd_callback_info[fd].func = timerfd_callback;
+  fd_callback_info[fd].data = NULL;
+  fd_callback_info[fd].condition |= FOR_READ;
+  if (fd > max_input_desc)
+    max_input_desc = fd;
+}
+
+#endif /* HAVE_TIMERFD */
+
 /* Add DESC to the set of keyboard input descriptors.  */
 
 void
@@ -7064,15 +7078,13 @@ integer or floating point values.
    futz with the SIGCHLD handler, but before Emacs forks any children.
    This function's caller should block SIGCHLD.  */
 
-#ifndef NS_IMPL_GNUSTEP
-static
-#endif
 void
 catch_child_signal (void)
 {
   struct sigaction action, old_action;
+  sigset_t oldset;
   emacs_sigaction_init (&action, deliver_child_signal);
-  block_child_signal ();
+  block_child_signal (&oldset);
   sigaction (SIGCHLD, &action, &old_action);
   eassert (! (old_action.sa_flags & SA_SIGINFO));
 
@@ -7081,7 +7093,7 @@ catch_child_signal (void)
       = (old_action.sa_handler == SIG_DFL || old_action.sa_handler == SIG_IGN
         ? dummy_handler
         : old_action.sa_handler);
-  unblock_child_signal ();
+  unblock_child_signal (&oldset);
 }
 #endif /* subprocesses */
 
index c3481f295f5b88d7a862d00d544ccb03da98fbef..273ad9267d68d271e1520726ca721a52e7517d52 100644 (file)
@@ -213,8 +213,6 @@ enum
 
 /* Defined in callproc.c.  */
 
-extern void block_child_signal (void);
-extern void unblock_child_signal (void);
 extern Lisp_Object encode_current_directory (void);
 extern void record_kill_process (struct Lisp_Process *, Lisp_Object);
 
@@ -227,9 +225,7 @@ extern Lisp_Object system_process_attributes (Lisp_Object);
 
 extern void record_deleted_pid (pid_t, Lisp_Object);
 struct sockaddr;
-#ifdef WINDOWSNT
 extern Lisp_Object conv_sockaddr_to_lisp (struct sockaddr *, int);
-#endif
 extern void hold_keyboard_input (void);
 extern void unhold_keyboard_input (void);
 extern bool kbd_on_hold_p (void);
@@ -240,9 +236,7 @@ extern void add_read_fd (int fd, fd_callback func, void *data);
 extern void delete_read_fd (int fd);
 extern void add_write_fd (int fd, fd_callback func, void *data);
 extern void delete_write_fd (int fd);
-#ifdef NS_IMPL_GNUSTEP
 extern void catch_child_signal (void);
-#endif
 
 #ifdef WINDOWSNT
 extern Lisp_Object network_interface_list (void);
index fff7c6b0ff6cc41f21350486893dca47a22f2f27..919aabc92af16d710b2ab853975a99d3ec45737a 100644 (file)
@@ -294,7 +294,7 @@ setup_cpu_timer (Lisp_Object sampling_interval)
       sigev.sigev_signo = SIGPROF;
       sigev.sigev_notify = SIGEV_SIGNAL;
 
-      for (i = 0; i < sizeof system_clock / sizeof *system_clock; i++)
+      for (i = 0; i < ARRAYELTS (system_clock); i++)
        if (timer_create (system_clock[i], &sigev, &profiler_timer) == 0)
          {
            profiler_timer_ok = 1;
index ad591c75672243ceed5a4cbbdcf12bde9743ddb3..376b11cf75b39cab5d426cead5bc9f99bb219121 100644 (file)
@@ -40,7 +40,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 
 #ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1720000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1800000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
 #endif
 
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */
index 244924058a0a4854bd844233596da1ce82222119..1c1164da57dc4e87c5cde60c1f12b457faf8e4de 100644 (file)
@@ -713,7 +713,8 @@ typedef enum
 static int
 extract_number (re_char *source)
 {
-  return (SIGN_EXTEND_CHAR (source[1]) << 8) + source[0];
+  unsigned leading_byte = SIGN_EXTEND_CHAR (source[1]);
+  return (leading_byte << 8) + source[0];
 }
 
 /* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
@@ -1189,12 +1190,7 @@ print_double_string (re_char *where, re_char *string1, ssize_t size1,
 # define assert(e)
 
 # define DEBUG_STATEMENT(e)
-# if __STDC_VERSION__ < 199901L
-#  define DEBUG_COMPILES_ARGUMENTS
-#  define DEBUG_PRINT /* 'DEBUG_PRINT (x, y)' discards X and Y.  */ (void)
-# else
-#  define DEBUG_PRINT(...)
-# endif
+# define DEBUG_PRINT(...)
 # define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
 # define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
 
@@ -4346,8 +4342,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, size_t size1,
 
          if (range > 0)        /* Searching forwards.  */
            {
-             register int lim = 0;
-             ssize_t irange = range;
+             ssize_t irange = range, lim = 0;
 
              if (startpos < size1 && startpos + range >= size1)
                lim = range - (size1 - startpos);
index 0a693daa15edd31f1af3ef6d7afbff54535b2a0a..ecfb2352144dc4c710a1bbfc4c0c927c89505fa5 100644 (file)
@@ -1416,7 +1416,7 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
 
                      while (boyer_moore_ok)
                        {
-                         if (ASCII_BYTE_P (inverse))
+                         if (ASCII_CHAR_P (inverse))
                            {
                              if (this_char_base > 0)
                                boyer_moore_ok = 0;
@@ -1827,7 +1827,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
             matching with CHAR_BASE are to be checked.  */
          int ch = -1;
 
-         if (ASCII_BYTE_P (*ptr) || ! multibyte)
+         if (ASCII_CHAR_P (*ptr) || ! multibyte)
            ch = *ptr;
          else if (char_base
                   && ((pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1])))
@@ -2596,7 +2596,7 @@ since only regular expressions have distinguished subexpressions.  */)
            {
              FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext, pos, pos_byte);
              if (!buf_multibyte)
-               c = multibyte_char_to_unibyte (c);
+               c = CHAR_TO_BYTE8 (c);
            }
          else
            {
@@ -2619,7 +2619,7 @@ since only regular expressions have distinguished subexpressions.  */)
                  FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext,
                                                      pos, pos_byte);
                  if (!buf_multibyte && !ASCII_CHAR_P (c))
-                   c = multibyte_char_to_unibyte (c);
+                   c = CHAR_TO_BYTE8 (c);
                }
              else
                {
@@ -2679,18 +2679,8 @@ since only regular expressions have distinguished subexpressions.  */)
        }
 
       if (really_changed)
-       {
-         if (buf_multibyte)
-           {
-             ptrdiff_t nchars =
-               multibyte_chars_in_text (substed, substed_len);
-
-             newtext = make_multibyte_string ((char *) substed, nchars,
-                                              substed_len);
-           }
-         else
-           newtext = make_unibyte_string ((char *) substed, substed_len);
-       }
+       newtext = make_specified_string ((const char *) substed, -1,
+                                        substed_len, buf_multibyte);
       xfree (substed);
     }
 
index a95678812e1a6ac12e7c06777e567bbc55652fd8..7046f4e8e3265b218aa46127b536c1a4af07ef20 100644 (file)
@@ -702,7 +702,7 @@ vox_configure (struct sound_device *sd)
 {
   int val;
 #ifdef USABLE_SIGIO
-  sigset_t blocked;
+  sigset_t oldset, blocked;
 #endif
 
   eassert (sd->fd >= 0);
@@ -714,7 +714,7 @@ vox_configure (struct sound_device *sd)
 #ifdef USABLE_SIGIO
   sigemptyset (&blocked);
   sigaddset (&blocked, SIGIO);
-  pthread_sigmask (SIG_BLOCK, &blocked, 0);
+  pthread_sigmask (SIG_BLOCK, &blocked, &oldset);
 #endif
 
   val = sd->format;
@@ -748,7 +748,7 @@ vox_configure (struct sound_device *sd)
 
   turn_on_atimers (1);
 #ifdef USABLE_SIGIO
-  pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
+  pthread_sigmask (SIG_SETMASK, &oldset, 0);
 #endif
 }
 
@@ -764,10 +764,10 @@ vox_close (struct sound_device *sd)
         be interrupted by a signal.  Block the ones we know to cause
         troubles.  */
 #ifdef USABLE_SIGIO
-      sigset_t blocked;
+      sigset_t blocked, oldset;
       sigemptyset (&blocked);
       sigaddset (&blocked, SIGIO);
-      pthread_sigmask (SIG_BLOCK, &blocked, 0);
+      pthread_sigmask (SIG_BLOCK, &blocked, &oldset);
 #endif
       turn_on_atimers (0);
 
@@ -776,7 +776,7 @@ vox_close (struct sound_device *sd)
 
       turn_on_atimers (1);
 #ifdef USABLE_SIGIO
-      pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
+      pthread_sigmask (SIG_SETMASK, &oldset, 0);
 #endif
 
       /* Close the device.  */
index 0ee48bb3725f90bbb206f2ffbf37a9dd88f8bfc6..4166ee211c76eadad95dc1b15ce70c53a6278131 100644 (file)
@@ -835,12 +835,10 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
       from_byte = comstart_byte;
       UPDATE_SYNTAX_TABLE_FORWARD (from - 1);
     }
-  else
+  else lossage:
     {
       struct lisp_parse_state state;
-      bool adjusted;
-    lossage:
-      adjusted = true;
+      bool adjusted = true;
       /* We had two kinds of string delimiters mixed up
         together.  Decode this going forwards.
         Scan fwd from a known safe place (beginning-of-defun)
index e1fd86f5f3b61f20fa16e04a8e031db0511dfa2b..d5cfd5b88cf167e20e39b5de183bb5353679a6aa 100644 (file)
@@ -105,9 +105,6 @@ int _cdecl _getpid (void);
 #include "syssignal.h"
 #include "systime.h"
 
-static void emacs_get_tty (int, struct emacs_tty *);
-static int emacs_set_tty (int, struct emacs_tty *, bool);
-
 /* ULLONG_MAX is missing on Red Hat Linux 7.3; see Bug#11781.  */
 #ifndef ULLONG_MAX
 #define ULLONG_MAX TYPE_MAXIMUM (unsigned long long int)
@@ -128,7 +125,7 @@ static const int baud_convert[] =
 /* Return the current working directory.  Returns NULL on errors.
    Any other returned value must be freed with free. This is used
    only when get_current_dir_name is not defined on the system.  */
-char*
+char *
 get_current_dir_name (void)
 {
   char *buf;
@@ -222,7 +219,9 @@ discard_tty_input (void)
 void
 stuff_char (char c)
 {
-  if (! FRAME_TERMCAP_P (SELECTED_FRAME ()))
+  if (! (FRAMEP (selected_frame)
+        && FRAME_LIVE_P (XFRAME (selected_frame))
+        && FRAME_TERMCAP_P (XFRAME (selected_frame))))
     return;
 
 /* Should perhaps error if in batch mode */
@@ -255,7 +254,7 @@ init_baud_rate (int fd)
 #endif /* not DOS_NT */
     }
 
-  baud_rate = (emacs_ospeed < sizeof baud_convert / sizeof baud_convert[0]
+  baud_rate = (emacs_ospeed < ARRAYELTS (baud_convert)
               ? baud_convert[emacs_ospeed] : 9600);
   if (baud_rate == 0)
     baud_rate = 1200;
@@ -603,6 +602,7 @@ init_sigio (int fd)
 #endif
 }
 
+#ifndef DOS_NT
 static void
 reset_sigio (int fd)
 {
@@ -610,6 +610,7 @@ reset_sigio (int fd)
   fcntl (fd, F_SETFL, old_fcntl_flags[fd]);
 #endif
 }
+#endif
 
 void
 request_sigio (void)
@@ -657,7 +658,29 @@ ignore_sigio (void)
   signal (SIGIO, SIG_IGN);
 #endif
 }
+\f
+#ifndef MSDOS
+/* Block SIGCHLD.  */
 
+void
+block_child_signal (sigset_t *oldset)
+{
+  sigset_t blocked;
+  sigemptyset (&blocked);
+  sigaddset (&blocked, SIGCHLD);
+  sigaddset (&blocked, SIGINT);
+  pthread_sigmask (SIG_BLOCK, &blocked, oldset);
+}
+
+/* Unblock SIGCHLD.  */
+
+void
+unblock_child_signal (sigset_t const *oldset)
+{
+  pthread_sigmask (SIG_SETMASK, oldset, 0);
+}
+
+#endif /* !MSDOS */
 \f
 /* Saving and restoring the process group of Emacs's terminal.  */
 
@@ -692,21 +715,21 @@ init_foreground_group (void)
 /* Block and unblock SIGTTOU.  */
 
 void
-block_tty_out_signal (void)
+block_tty_out_signal (sigset_t *oldset)
 {
 #ifdef SIGTTOU
   sigset_t blocked;
   sigemptyset (&blocked);
   sigaddset (&blocked, SIGTTOU);
-  pthread_sigmask (SIG_BLOCK, &blocked, 0);
+  pthread_sigmask (SIG_BLOCK, &blocked, oldset);
 #endif
 }
 
 void
-unblock_tty_out_signal (void)
+unblock_tty_out_signal (sigset_t const *oldset)
 {
 #ifdef SIGTTOU
-  pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
+  pthread_sigmask (SIG_SETMASK, oldset, 0);
 #endif
 }
 
@@ -721,10 +744,11 @@ static void
 tcsetpgrp_without_stopping (int fd, pid_t pgid)
 {
 #ifdef SIGTTOU
+  sigset_t oldset;
   block_input ();
-  block_tty_out_signal ();
+  block_tty_out_signal (&oldset);
   tcsetpgrp (fd, pgid);
-  unblock_tty_out_signal ();
+  unblock_tty_out_signal (&oldset);
   unblock_input ();
 #endif
 }
@@ -751,15 +775,28 @@ widen_foreground_group (int fd)
 /* Getting and setting emacs_tty structures.  */
 
 /* Set *TC to the parameters associated with the terminal FD,
-   or clear it if the parameters are not available.  */
-static void
+   or clear it if the parameters are not available.
+   Return 0 on success, -1 on failure.  */
+int
 emacs_get_tty (int fd, struct emacs_tty *settings)
 {
   /* Retrieve the primary parameters - baud rate, character size, etcetera.  */
-#ifndef DOS_NT
-  /* We have those nifty POSIX tcmumbleattr functions.  */
   memset (&settings->main, 0, sizeof (settings->main));
-  tcgetattr (fd, &settings->main);
+#ifdef DOS_NT
+#ifdef WINDOWSNT
+  HANDLE h = (HANDLE)_get_osfhandle (fd);
+  DWORD console_mode;
+
+  if (h && h != INVALID_HANDLE_VALUE && GetConsoleMode (h, &console_mode))
+    {
+      settings->main = console_mode;
+      return 0;
+    }
+#endif /* WINDOWSNT */
+  return -1;
+#else  /* !DOS_NT */
+  /* We have those nifty POSIX tcmumbleattr functions.  */
+  return tcgetattr (fd, &settings->main);
 #endif
 }
 
@@ -768,11 +805,26 @@ emacs_get_tty (int fd, struct emacs_tty *settings)
    *SETTINGS.  If FLUSHP, discard input.
    Return 0 if all went well, and -1 (setting errno) if anything failed.  */
 
-static int
+int
 emacs_set_tty (int fd, struct emacs_tty *settings, bool flushp)
 {
   /* Set the primary parameters - baud rate, character size, etcetera.  */
-#ifndef DOS_NT
+#ifdef DOS_NT
+#ifdef WINDOWSNT
+  HANDLE h = (HANDLE)_get_osfhandle (fd);
+
+  if (h && h != INVALID_HANDLE_VALUE)
+    {
+      DWORD new_mode;
+
+      /* Assume the handle is open for input.  */
+      if (flushp)
+       FlushConsoleInputBuffer (h);
+      new_mode = settings->main;
+      SetConsoleMode (h, new_mode);
+    }
+#endif /* WINDOWSNT */
+#else  /* !DOS_NT */
   int i;
   /* We have those nifty POSIX tcmumbleattr functions.
      William J. Smith <wjs@wiis.wang.com> writes:
@@ -1113,6 +1165,24 @@ tabs_safe_p (int fd)
   return 0;
 #endif /* DOS_NT */
 }
+
+/* Discard echoing.  */
+
+void
+suppress_echo_on_tty (int fd)
+{
+  struct emacs_tty etty;
+
+  emacs_get_tty (fd, &etty);
+#ifdef DOS_NT
+  /* Set raw input mode.  */
+  etty.main = 0;
+#else
+  etty.main.c_lflag &= ~ICANON;        /* Disable buffering */
+  etty.main.c_lflag &= ~ECHO;  /* Disable echoing */
+#endif /* ! WINDOWSNT */
+  emacs_set_tty (fd, &etty, 0);
+}
 \f
 /* Get terminal size from system.
    Store number of lines into *HEIGHTP and width into *WIDTHP.
@@ -1527,9 +1597,6 @@ emacs_sigaction_init (struct sigaction *action, signal_handler_t handler)
 #endif
     }
 
-  if (! IEEE_FLOATING_POINT)
-    sigaddset (&action->sa_mask, SIGFPE);
-
   action->sa_handler = handler;
   action->sa_flags = emacs_sigaction_flags ();
 }
@@ -2133,6 +2200,7 @@ emacs_abort (void)
 #endif
 
 /* Open FILE for Emacs use, using open flags OFLAG and mode MODE.
+   Use binary I/O on systems that care about text vs binary I/O.
    Arrange for subprograms to not inherit the file descriptor.
    Prefer a method that is multithread-safe, if available.
    Do not fail merely because the open was interrupted by a signal.
@@ -2142,6 +2210,8 @@ int
 emacs_open (const char *file, int oflags, int mode)
 {
   int fd;
+  if (! (oflags & O_TEXT))
+    oflags |= O_BINARY;
   oflags |= O_CLOEXEC;
   while ((fd = open (file, oflags, mode)) < 0 && errno == EINTR)
     QUIT;
@@ -2189,7 +2259,7 @@ emacs_pipe (int fd[2])
 #ifdef MSDOS
   return pipe (fd);
 #else  /* !MSDOS */
-  int result = pipe2 (fd, O_CLOEXEC);
+  int result = pipe2 (fd, O_BINARY | O_CLOEXEC);
   if (! O_CLOEXEC && result == 0)
     {
       fcntl (fd[0], F_SETFD, FD_CLOEXEC);
index b76e71a3a758bda67aba9fa8aaa595b8aac03651..db6438ed1f87589837971bb614f4f3979dcb2f52 100644 (file)
@@ -16,6 +16,9 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef SYSSELECT_H
+#define SYSSELECT_H 1
+
 #ifndef DOS_NT
 #include <sys/select.h>
 #endif
@@ -47,3 +50,42 @@ typedef int fd_set;
 #ifdef MSDOS
 #define pselect sys_select
 #endif
+
+#ifndef WINDOWSNT
+INLINE_HEADER_BEGIN
+
+/* Check for out-of-range errors if ENABLE_CHECKING is defined.  */
+
+INLINE void
+fd_CLR (int fd, fd_set *set)
+{
+  eassume (0 <= fd && fd < FD_SETSIZE);
+  FD_CLR (fd, set);
+}
+
+INLINE bool
+fd_ISSET (int fd, fd_set *set)
+{
+  eassume (0 <= fd && fd < FD_SETSIZE);
+  return FD_ISSET (fd, set) != 0;
+}
+
+INLINE void
+fd_SET (int fd, fd_set *set)
+{
+  eassume (0 <= fd && fd < FD_SETSIZE);
+  FD_SET (fd, set);
+}
+
+#undef FD_CLR
+#undef FD_ISSET
+#undef FD_SET
+#define FD_CLR(fd, set) fd_CLR (fd, set)
+#define FD_ISSET(fd, set) fd_ISSET (fd, set)
+#define FD_SET(fd, set) fd_SET (fd, set)
+
+INLINE_HEADER_END
+
+#endif /* !WINDOWSNT */
+
+#endif
index 477ddfc2086a0d5e5fad0a2a12fadcdaca60f352..3fd9730e66593c66455f443d716d353599c3aed3 100644 (file)
@@ -20,6 +20,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <signal.h>
 
 extern void init_signals (bool);
+extern void block_child_signal (sigset_t *);
+extern void unblock_child_signal (sigset_t const *);
+extern void block_tty_out_signal (sigset_t *);
+extern void unblock_tty_out_signal (sigset_t const *);
 
 #ifdef HAVE_PTHREAD
 #include <pthread.h>
index 6eb0c11ef6e7014a65f88272b589d7c30bb92ad6..a29c4933d7ba17a96f6d2f5e86baf4ff42e2c1f3 100644 (file)
@@ -23,6 +23,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <fcntl.h>
 #endif /* not DOS_NT */
 
+#include <stdbool.h>
 #include <sys/ioctl.h>
 
 #ifdef HPUX
@@ -74,10 +75,13 @@ struct emacs_tty {
 #ifndef DOS_NT
   struct termios main;
 #else /* DOS_NT */
-  int main;
+  unsigned main;
 #endif /* DOS_NT */
 };
 \f
 /* From sysdep.c or w32.c  */
+extern int emacs_get_tty (int, struct emacs_tty *) EXTERNALLY_VISIBLE;
+extern int emacs_set_tty (int, struct emacs_tty *, bool) EXTERNALLY_VISIBLE;
+extern void suppress_echo_on_tty (int);
 extern int serial_open (Lisp_Object);
 extern void serial_configure (struct Lisp_Process *, Lisp_Object);
index 8661cba1160057fc2ed02cb4355656a30f49c90d..8c004ccbecbe13b768ab7cbd852a5878217caf69 100644 (file)
@@ -105,9 +105,9 @@ static _Noreturn void vfatal (const char *str, va_list ap)
 
 #define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0)
 
-/* Display space properties */
+/* Display space properties */
 
-/* Chain of all tty device parameters. */
+/* Chain of all tty device parameters.  */
 struct tty_display_info *tty_list;
 
 /* Meaning of bits in no_color_video.  Each bit set means that the
@@ -131,6 +131,9 @@ enum no_color_bit
 
 static int max_frame_cols;
 
+static Lisp_Object Qtty_mode_set_strings;
+static Lisp_Object Qtty_mode_reset_strings;
+
 \f
 
 #ifdef HAVE_GPM
@@ -161,6 +164,28 @@ tty_ring_bell (struct frame *f)
 
 /* Set up termcap modes for Emacs. */
 
+static void
+tty_send_additional_strings (struct terminal *terminal, Lisp_Object sym)
+{
+  Lisp_Object lisp_terminal;
+  Lisp_Object extra_codes;
+  struct tty_display_info *tty = terminal->display_info.tty;
+
+  XSETTERMINAL (lisp_terminal, terminal);
+  for (extra_codes = Fterminal_parameter (lisp_terminal, sym);
+       CONSP (extra_codes);
+       extra_codes = XCDR (extra_codes))
+    {
+      Lisp_Object string = XCAR (extra_codes);
+      if (STRINGP (string))
+        {
+          fwrite (SDATA (string), 1, SBYTES (string), tty->output);
+          if (tty->termscript)
+            fwrite (SDATA (string), 1, SBYTES (string), tty->termscript);
+        }
+    }
+}
+
 static void
 tty_set_terminal_modes (struct terminal *terminal)
 {
@@ -183,6 +208,7 @@ tty_set_terminal_modes (struct terminal *terminal)
       OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal);
       OUTPUT_IF (tty, tty->TS_keypad_mode);
       losecursor (tty);
+      tty_send_additional_strings (terminal, Qtty_mode_set_strings);
       fflush (tty->output);
     }
 }
@@ -196,6 +222,7 @@ tty_reset_terminal_modes (struct terminal *terminal)
 
   if (tty->output)
     {
+      tty_send_additional_strings (terminal, Qtty_mode_reset_strings);
       tty_turn_off_highlight (tty);
       tty_turn_off_insert (tty);
       OUTPUT_IF (tty, tty->TS_end_keypad_mode);
@@ -500,9 +527,6 @@ static ptrdiff_t encode_terminal_dst_size;
    Set CODING->produced to the byte-length of the resulting byte
    sequence, and return a pointer to that byte sequence.  */
 
-#ifndef DOS_NT
-static
-#endif
 unsigned char *
 encode_terminal_code (struct glyph *src, int src_len,
                      struct coding_system *coding)
@@ -1339,7 +1363,7 @@ term_get_fkeys_1 (void)
   if (!KEYMAPP (KVAR (kboard, Vinput_decode_map)))
     kset_input_decode_map (kboard, Fmake_sparse_keymap (Qnil));
 
-  for (i = 0; i < (sizeof (keys) / sizeof (keys[0])); i++)
+  for (i = 0; i < ARRAYELTS (keys); i++)
     {
       char *sequence = tgetstr (keys[i].cap, address);
       if (sequence)
@@ -1837,7 +1861,7 @@ produce_glyphless_glyph (struct it *it, Lisp_Object acronym)
            acronym = XCDR (acronym);
          buf[0] = '[';
          str = STRINGP (acronym) ? SSDATA (acronym) : "";
-         for (len = 0; len < 6 && str[len] && ASCII_BYTE_P (str[len]); len++)
+         for (len = 0; len < 6 && str[len] && ASCII_CHAR_P (str[len]); len++)
            buf[1 + len] = str[len];
          buf[1 + len] = ']';
          len += 2;
@@ -2387,7 +2411,7 @@ frame's terminal). */)
             was suspended.  */
          get_tty_size (fileno (t->display_info.tty->input), &width, &height);
          if (width != old_width || height != old_height)
-           change_frame_size (f, width, height, 0, 0, 0, 0);
+           change_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), 0, 0, 0, 0);
          SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
        }
 
@@ -2918,7 +2942,6 @@ static int
 tty_menu_add_pane (tty_menu *menu, const char *txt)
 {
   int len;
-  const unsigned char *p;
 
   tty_menu_make_room (menu);
   menu->submenu[menu->count] = tty_menu_create ();
@@ -2928,15 +2951,7 @@ tty_menu_add_pane (tty_menu *menu, const char *txt)
   menu->count++;
 
   /* Update the menu width, if necessary.  */
-  for (len = 0, p = (unsigned char *) txt; *p; )
-    {
-      int ch_len;
-      int ch = STRING_CHAR_AND_LENGTH (p, ch_len);
-
-      len += CHAR_WIDTH (ch);
-      p += ch_len;
-    }
-
+  len = menu_item_width ((const unsigned char *) txt);
   if (len > menu->width)
     menu->width = len;
 
@@ -2950,7 +2965,6 @@ tty_menu_add_selection (tty_menu *menu, int pane,
                        char *txt, bool enable, char const *help_text)
 {
   int len;
-  unsigned char *p;
 
   if (pane)
     {
@@ -2966,15 +2980,7 @@ tty_menu_add_selection (tty_menu *menu, int pane,
   menu->count++;
 
   /* Update the menu width, if necessary.  */
-  for (len = 0, p = (unsigned char *) txt; *p; )
-    {
-      int ch_len;
-      int ch = STRING_CHAR_AND_LENGTH (p, ch_len);
-
-      len += CHAR_WIDTH (ch);
-      p += ch_len;
-    }
-
+  len = menu_item_width ((const unsigned char *) txt);
   if (len > menu->width)
     menu->width = len;
 
@@ -3555,9 +3561,10 @@ tty_menu_new_item_coords (struct frame *f, int which, int *x, int *y)
     }
 }
 
+/* WINDOWSNT uses this as menu_show_hook, see w32console.c.  */
 Lisp_Object
-tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
-              Lisp_Object title, bool kbd_navigation, const char **error_name)
+tty_menu_show (struct frame *f, int x, int y, int menuflags,
+              Lisp_Object title, const char **error_name)
 {
   tty_menu *menu;
   int pane, selidx, lpane, status;
@@ -3584,16 +3591,15 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
 
   /* Make the menu on that window.  */
   menu = tty_menu_create ();
-  if (menu == NULL)
-    {
-      *error_name = "Can't create menu";
-      return Qnil;
-    }
 
   /* Don't GC while we prepare and show the menu, because we give the
      menu functions pointers to the contents of strings.  */
   specpdl_count = inhibit_garbage_collection ();
 
+  /* Avoid crashes if, e.g., another client will connect while we
+     are in a menu.  */
+  temporarily_switch_to_single_kboard (f);
+
   /* Adjust coordinates to be root-window-relative.  */
   item_x = x += f->left_pos;
   item_y = y += f->top_pos;
@@ -3615,7 +3621,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
          prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
          pane_string = (NILP (pane_name)
                         ? "" : SSDATA (pane_name));
-         if (keymaps && !NILP (prefix))
+         if ((menuflags & MENU_KEYMAPS) && !NILP (prefix))
            pane_string++;
 
          lpane = tty_menu_add_pane (menu, pane_string);
@@ -3755,7 +3761,8 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
   specbind (Qoverriding_terminal_local_map,
            Fsymbol_value (Qtty_menu_navigation_map));
   status = tty_menu_activate (menu, &pane, &selidx, x, y, &datap,
-                             tty_menu_help_callback, kbd_navigation);
+                             tty_menu_help_callback,
+                             menuflags & MENU_KBD_NAVIGATION);
   entry = pane_prefix = Qnil;
 
   switch (status)
@@ -3781,7 +3788,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
                    {
                      entry
                        = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
-                     if (keymaps != 0)
+                     if (menuflags & MENU_KEYMAPS)
                        {
                          entry = Fcons (entry, Qnil);
                          if (!NILP (pane_prefix))
@@ -3814,7 +3821,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
        Ftop_level ();
       /* Make "Cancel" equivalent to C-g unless FOR_CLICK (which means
         the menu was invoked with a mouse event as POSITION).  */
-      if (! for_click)
+      if (!(menuflags & MENU_FOR_CLICK))
         Fsignal (Qquit, Qnil);
       break;
     }
@@ -3895,7 +3902,9 @@ clear_tty_hooks (struct terminal *terminal)
   terminal->frame_rehighlight_hook = 0;
   terminal->frame_raise_lower_hook = 0;
   terminal->fullscreen_hook = 0;
+  terminal->menu_show_hook = 0;
   terminal->set_vertical_scroll_bar_hook = 0;
+  terminal->set_horizontal_scroll_bar_hook = 0;
   terminal->condemn_scroll_bars_hook = 0;
   terminal->redeem_scroll_bar_hook = 0;
   terminal->judge_scroll_bars_hook = 0;
@@ -3913,43 +3922,25 @@ clear_tty_hooks (struct terminal *terminal)
 static void
 set_tty_hooks (struct terminal *terminal)
 {
-  terminal->rif = 0; /* ttys don't support window-based redisplay. */
-
   terminal->cursor_to_hook = &tty_cursor_to;
   terminal->raw_cursor_to_hook = &tty_raw_cursor_to;
-
   terminal->clear_to_end_hook = &tty_clear_to_end;
   terminal->clear_frame_hook = &tty_clear_frame;
   terminal->clear_end_of_line_hook = &tty_clear_end_of_line;
-
   terminal->ins_del_lines_hook = &tty_ins_del_lines;
-
   terminal->insert_glyphs_hook = &tty_insert_glyphs;
   terminal->write_glyphs_hook = &tty_write_glyphs;
   terminal->delete_glyphs_hook = &tty_delete_glyphs;
-
   terminal->ring_bell_hook = &tty_ring_bell;
-
   terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes;
   terminal->set_terminal_modes_hook = &tty_set_terminal_modes;
-  terminal->update_begin_hook = 0; /* Not needed. */
   terminal->update_end_hook = &tty_update_end;
+  terminal->menu_show_hook = &tty_menu_show;
   terminal->set_terminal_window_hook = &tty_set_terminal_window;
-
-  terminal->mouse_position_hook = 0; /* Not needed. */
-  terminal->frame_rehighlight_hook = 0; /* Not needed. */
-  terminal->frame_raise_lower_hook = 0; /* Not needed. */
-
-  terminal->set_vertical_scroll_bar_hook = 0; /* Not needed. */
-  terminal->condemn_scroll_bars_hook = 0; /* Not needed. */
-  terminal->redeem_scroll_bar_hook = 0; /* Not needed. */
-  terminal->judge_scroll_bars_hook = 0; /* Not needed. */
-
   terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
-  terminal->frame_up_to_date_hook = 0; /* Not needed. */
-
   terminal->delete_frame_hook = &tty_free_frame_resources;
   terminal->delete_terminal_hook = &delete_tty;
+  /* Other hooks are NULL by default.  */
 }
 
 /* If FD is the controlling terminal, drop it.  */
@@ -3964,9 +3955,10 @@ dissociate_if_controlling_tty (int fd)
       /* setsid failed, presumably because Emacs is already a process
         group leader.  Fall back on the obsolescent way to dissociate
         a controlling tty.  */
-      block_tty_out_signal ();
+      sigset_t oldset;
+      block_tty_out_signal (&oldset);
       ioctl (fd, TIOCNOTTY, 0);
-      unblock_tty_out_signal ();
+      unblock_tty_out_signal (&oldset);
 #endif
     }
 }
@@ -3990,6 +3982,7 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
   int status;
   struct tty_display_info *tty = NULL;
   struct terminal *terminal = NULL;
+  sigset_t oldset;
   bool ctty = false;  /* True if asked to open controlling tty.  */
 
   if (!terminal_type)
@@ -4011,7 +4004,7 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
   if (terminal)
     return terminal;
 
-  terminal = create_terminal ();
+  terminal = create_terminal (output_termcap, NULL);
 #ifdef MSDOS
   if (been_here > 0)
     maybe_fatal (0, 0, "Attempt to create another terminal %s", "",
@@ -4025,7 +4018,6 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
   tty->next = tty_list;
   tty_list = tty;
 
-  terminal->type = output_termcap;
   terminal->display_info.tty = tty;
   tty->terminal = terminal;
 
@@ -4051,12 +4043,15 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
        open a frame on the same terminal.  */
     int flags = O_RDWR | O_NOCTTY | (ctty ? 0 : O_IGNORE_CTTY);
     int fd = emacs_open (name, flags, 0);
-    tty->input = tty->output = fd < 0 || ! isatty (fd) ? 0 : fdopen (fd, "w+");
+    tty->input = tty->output
+      = ((fd < 0 || ! isatty (fd))
+        ? NULL
+        : fdopen (fd, "w+"));
 
     if (! tty->input)
       {
        char const *diagnostic
-         = tty->input ? "Not a tty device: %s" : "Could not open file: %s";
+         = (fd < 0) ? "Could not open file: %s" : "Not a tty device: %s";
        emacs_close (fd);
        maybe_fatal (must_succeed, terminal, diagnostic, diagnostic, name);
       }
@@ -4076,11 +4071,11 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
 
   /* On some systems, tgetent tries to access the controlling
      terminal.  */
-  block_tty_out_signal ();
+  block_tty_out_signal (&oldset);
   status = tgetent (tty->termcap_term_buffer, terminal_type);
   if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1])
     emacs_abort ();
-  unblock_tty_out_signal ();
+  unblock_tty_out_signal (&oldset);
 
   if (status < 0)
     {
@@ -4231,6 +4226,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
     tty->specified_window = height;
 
     FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
+    FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = 0;
     tty->char_ins_del_ok = 1;
     baud_rate = 19200;
   }
@@ -4466,7 +4462,7 @@ fatal (const char *str, ...)
 
 \f
 
-/* Delete the given tty terminal, closing all frames on it. */
+/* Delete the given tty terminal, closing all frames on it.  */
 
 static void
 delete_tty (struct terminal *terminal)
@@ -4491,7 +4487,7 @@ delete_tty (struct terminal *terminal)
         ;
 
       if (! p)
-        /* This should not happen. */
+        /* This should not happen.  */
         emacs_abort ();
 
       p->next = tty->next;
@@ -4499,7 +4495,7 @@ delete_tty (struct terminal *terminal)
     }
 
   /* reset_sys_modes needs a valid device, so this call needs to be
-     before delete_terminal. */
+     before delete_terminal.  */
   reset_sys_modes (tty);
 
   delete_terminal (terminal);
@@ -4577,6 +4573,9 @@ bigger, or it may make it blink, or it may do nothing at all.  */);
   encode_terminal_src = NULL;
   encode_terminal_dst = NULL;
 
+  DEFSYM (Qtty_mode_set_strings, "tty-mode-set-strings");
+  DEFSYM (Qtty_mode_reset_strings, "tty-mode-reset-strings");
+
 #ifndef MSDOS
   DEFSYM (Qtty_menu_next_item, "tty-menu-next-item");
   DEFSYM (Qtty_menu_prev_item, "tty-menu-prev-item");
index 8c766bd1994f1afb86a5c6529d016bd93d3b5cf4..26c6de06f88ee731f1d933fbceed2e72b790cd6c 100644 (file)
@@ -520,7 +520,7 @@ scan_file (char *str, int fd, struct termcap_buffer *bufp)
   bufp->ateof = 0;
   *bufp->ptr = '\0';
 
-  lseek (fd, 0L, 0);
+  lseek (fd, 0, 0);
 
   while (!bufp->ateof)
     {
index 708351da83d37c0e0866dd7d908e18faedf04fca..04104eb41e9179e8d9dc94524d222e844b7bf5e6 100644 (file)
@@ -37,7 +37,14 @@ enum scroll_bar_part {
   scroll_bar_to_top,
   scroll_bar_to_bottom,
   scroll_bar_end_scroll,
-  scroll_bar_move_ratio
+  scroll_bar_move_ratio,
+  scroll_bar_before_handle,
+  scroll_bar_horizontal_handle,
+  scroll_bar_after_handle,
+  scroll_bar_left_arrow,
+  scroll_bar_right_arrow,
+  scroll_bar_to_leftmost,
+  scroll_bar_to_rightmost
 };
 
 /* Output method of a terminal (and frames on this terminal, respectively).  */
@@ -130,6 +137,19 @@ enum event_kind
                                   whose scroll bar was clicked in.
                                   .timestamp gives a timestamp (in
                                   milliseconds) for the click.  */
+  HORIZONTAL_SCROLL_BAR_CLICK_EVENT,   /* .code gives the number of the mouse button
+                                  that was clicked.
+                                  .modifiers holds the state of the modifier
+                                  keys.
+                                  .part is a lisp symbol indicating which
+                                  part of the scroll bar got clicked.
+                                  .x gives the distance from the start of the
+                                  scroll bar of the click; .y gives the total
+                                  length of the scroll bar.
+                                  .frame_or_window gives the window
+                                  whose scroll bar was clicked in.
+                                  .timestamp gives a timestamp (in
+                                  milliseconds) for the click.  */
   SELECTION_REQUEST_EVENT,     /* Another X client wants a selection from us.
                                   See `struct selection_input_event'.  */
   SELECTION_CLEAR_EVENT,       /* Another X client cleared our selection.  */
@@ -478,7 +498,14 @@ struct terminal
      may do something OS dependent, like extended window manager hints on X11.  */
   void (*fullscreen_hook) (struct frame *f);
 
-  \f
+  /* This hook is called to display menus.  */
+  Lisp_Object (*menu_show_hook) (struct frame *f, int x, int y, int menuflags,
+                                Lisp_Object title, const char **error_name);
+
+  /* This hook is called to display popup dialog.  */
+  Lisp_Object (*popup_dialog_hook) (struct frame *f, Lisp_Object header,
+                                   Lisp_Object contents);
+
   /* Scroll bar hooks.  */
 
   /* The representation of scroll bars is determined by the code which
@@ -511,6 +538,16 @@ struct terminal
                                         int position);
 
 
+  /* Set the horizontal scroll bar for WINDOW to have its upper left
+     corner at (TOP, LEFT), and be LENGTH rows high.  Set its handle to
+     indicate that we are displaying PORTION characters out of a total
+     of WHOLE characters, starting at POSITION.  If WINDOW doesn't yet
+     have a scroll bar, create one for it.  */
+  void (*set_horizontal_scroll_bar_hook) (struct window *window,
+                                         int portion, int whole,
+                                         int position);
+
+
   /* The following three hooks are used when we're doing a thorough
      redisplay of the frame.  We don't explicitly know which scroll bars
      are going to be deleted, because keeping track of when windows go
@@ -637,16 +674,15 @@ extern struct terminal *terminal_list;
 #endif
 
 extern struct terminal *get_terminal (Lisp_Object terminal, bool);
-extern struct terminal *create_terminal (void);
+extern struct terminal *create_terminal (enum output_method,
+                                        struct redisplay_interface *);
 extern void delete_terminal (struct terminal *);
 
 /* The initial terminal device, created by initial_term_init.  */
 extern struct terminal *initial_terminal;
 
-#ifdef DOS_NT
 extern unsigned char *encode_terminal_code (struct glyph *, int,
                                            struct coding_system *);
-#endif
 
 #ifdef HAVE_GPM
 extern void close_gpm (int gpm_fd);
index d0a38b97bb44537bff2d93f84cd5ea08cb418bd2..a827677a58d5b46e6f31e3ac13fe392295c5f2e2 100644 (file)
@@ -28,13 +28,13 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "coding.h"
 #include "keyboard.h"
 
-/* Chain of all terminals currently in use. */
+/* Chain of all terminals currently in use.  */
 struct terminal *terminal_list;
 
-/* The first unallocated terminal id. */
+/* The first unallocated terminal id.  */
 static int next_terminal_id;
 
-/* The initial terminal device, created by initial_term_init. */
+/* The initial terminal device, created by initial_term_init.  */
 struct terminal *initial_terminal;
 
 static Lisp_Object Qterminal_live_p;
@@ -121,9 +121,9 @@ raw_cursor_to (struct frame *f, int row, int col)
     (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col);
 }
 
-/* Erase operations */
+/* Erase operations */
 
-/* Clear from cursor to end of frame. */
+/* Clear from cursor to end of frame.  */
 void
 clear_to_end (struct frame *f)
 {
@@ -131,7 +131,7 @@ clear_to_end (struct frame *f)
     (*FRAME_TERMINAL (f)->clear_to_end_hook) (f);
 }
 
-/* Clear entire frame */
+/* Clear entire frame */
 
 void
 clear_frame (struct frame *f)
@@ -224,19 +224,19 @@ get_terminal (Lisp_Object terminal, bool throw)
   return result;
 }
 
-\f
-
-/* Create a new terminal object and add it to the terminal list. */
+/* Create a new terminal object of TYPE and add it to the terminal list.  RIF
+   may be NULL if this terminal type doesn't support window-based redisplay.  */
 
 struct terminal *
-create_terminal (void)
+create_terminal (enum output_method type, struct redisplay_interface *rif)
 {
   struct terminal *terminal = allocate_terminal ();
   Lisp_Object terminal_coding, keyboard_coding;
 
   terminal->next_terminal = terminal_list;
   terminal_list = terminal;
-
+  terminal->type = type;
+  terminal->rif = rif;
   terminal->id = next_terminal_id++;
 
   terminal->keyboard_coding = xmalloc (sizeof (struct coding_system));
@@ -519,13 +519,12 @@ init_initial_terminal (void)
   if (initialized || terminal_list || tty_list)
     emacs_abort ();
 
-  initial_terminal = create_terminal ();
-  initial_terminal->type = output_initial;
+  initial_terminal = create_terminal (output_initial, NULL);
   initial_terminal->name = xstrdup ("initial_terminal");
   initial_terminal->kboard = initial_kboard;
   initial_terminal->delete_terminal_hook = &delete_initial_terminal;
   initial_terminal->delete_frame_hook = &initial_free_frame_resources;
-  /* All other hooks are NULL. */
+  /* Other hooks are NULL by default.  */
 
   return initial_terminal;
 }
index 043f3348d16ba935849b920508f936f309237a09..0e47bdd86562dd7d791867cb46c4b4fce75389ff 100644 (file)
@@ -122,7 +122,7 @@ static int pagemask;
    into an int which is the number of a byte.
    This is a no-op on ordinary machines, but not on all.  */
 
-#define ADDR_CORRECT(x) ((char *)(x) - (char*)0)
+#define ADDR_CORRECT(x) ((char *) (x) - (char *) 0)
 
 #include "lisp.h"
 
index fcca5e5cbf201c3169738d7fe7db3b3480736d0d..7636b05a12e7c2aa71f2acae9342d9e538b867b7 100644 (file)
@@ -81,8 +81,7 @@ read_exe_header (int fd, exe_header_t * exe_header_buffer)
 #endif
   assert (exe_header_buffer->file_header.f_nscns > 0);
   assert (exe_header_buffer->file_header.f_nscns <=
-         sizeof (exe_header_buffer->section_header) /
-         sizeof (exe_header_buffer->section_header[0]));
+          ARRAYELTS (exe_header_buffer->section_header));
   assert (exe_header_buffer->file_header.f_opthdr > 0);
 
   ret =
@@ -286,13 +285,6 @@ unexec (const char *outfile, const char *infile)
   int ret;
   int ret2;
 
-  if (bss_sbrk_did_unexec)
-    {
-      /* can only dump once */
-      printf ("You can only dump Emacs once on this platform.\n");
-      return;
-    }
-
   report_sheap_usage (1);
 
   infile = add_exe_suffix_if_necessary (infile, infile_buffer);
index f70cdd794784db778a64b01b678b5c2c350d18d8..7cbd95a46fedd24b648fc97e29c04b39857219bc 100644 (file)
@@ -83,8 +83,6 @@ PCHAR  bss_start_static = 0;
 DWORD_PTR  bss_size_static = 0;
 DWORD_PTR  extra_bss_size_static = 0;
 
-PIMAGE_SECTION_HEADER heap_section;
-
 /* MinGW64 doesn't add a leading underscore to external symbols,
    whereas configure.ac sets up LD_SWITCH_SYSTEM_TEMACS to force the
    entry point at __start, with two underscores.  */
@@ -475,8 +473,6 @@ get_section_info (file_data *p_infile)
       bss_section_static = 0;
       extra_bss_size_static = 0;
     }
-
-  heap_section = rva_to_section (PTR_TO_RVA (get_heap_start ()), nt_header);
 }
 
 
@@ -518,9 +514,11 @@ copy_executable_and_dump_data (file_data *p_infile,
     if (verbose)                                                               \
       {                                                                                \
        printf ("%s\n", (message));                                             \
-       printf ("\t0x%08x Address in process.\n", s);                           \
-       printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \
-       printf ("\t0x%08x Size in bytes.\n", count);                            \
+       printf ("\t0x%p Address in process.\n", s);                             \
+       printf ("\t0x%p Base       output file.\n", p_outfile->file_base); \
+       printf ("\t0x%p Offset  in output file.\n", dst - p_outfile->file_base); \
+       printf ("\t0x%p Address in output file.\n", dst); \
+       printf ("\t0x%p Size in bytes.\n", count);                              \
       }                                                                                \
     memcpy (dst, s, count);                                                    \
     dst += count;                                                              \
@@ -629,34 +627,6 @@ copy_executable_and_dump_data (file_data *p_infile,
          dst_section->Characteristics &= ~IMAGE_SCN_CNT_UNINITIALIZED_DATA;
          dst_section->Characteristics |= IMAGE_SCN_CNT_INITIALIZED_DATA;
        }
-      if (section == heap_section)
-       {
-         DWORD_PTR heap_start = (DWORD_PTR) get_heap_start ();
-         DWORD_PTR heap_size = get_committed_heap_size ();
-
-         /* Dump the used portion of the predump heap, adjusting the
-             section's size to the appropriate size.  */
-         dst = dst_save
-           + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (heap_start), dst_section);
-         COPY_PROC_CHUNK ("Dumping heap...", heap_start, heap_size,
-                          be_verbose);
-         ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment);
-         dst_section->PointerToRawData = PTR_TO_OFFSET (dst_save, p_outfile);
-         /* Determine new size of raw data area.  */
-         dst = max (dst, dst_save + dst_section->SizeOfRawData);
-         dst_section->SizeOfRawData = dst - dst_save;
-         /* Reduce the size of the heap section to fit (must be last
-             section).  */
-         dst_nt_header->OptionalHeader.SizeOfImage -=
-           dst_section->Misc.VirtualSize
-           - ROUND_UP (dst_section->SizeOfRawData,
-                       dst_nt_header->OptionalHeader.SectionAlignment);
-         dst_section->Misc.VirtualSize =
-           ROUND_UP (dst_section->SizeOfRawData,
-                     dst_nt_header->OptionalHeader.SectionAlignment);
-         dst_section->Characteristics &= ~IMAGE_SCN_CNT_UNINITIALIZED_DATA;
-         dst_section->Characteristics |= IMAGE_SCN_CNT_INITIALIZED_DATA;
-       }
 
       /* Align the section's raw data area.  */
       ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment);
@@ -758,6 +728,10 @@ unexec (const char *new_name, const char *old_name)
     abort ();
   strcpy (p, q);
 
+#ifdef ENABLE_CHECKING
+  report_temacs_memory_usage ();
+#endif
+
   /* Make sure that the output filename has the ".exe" extension...patch
      it up if not.  */
   p = out_filename + strlen (out_filename) - 4;
@@ -767,9 +741,6 @@ unexec (const char *new_name, const char *old_name)
   printf ("Dumping from %s\n", in_filename);
   printf ("          to %s\n", out_filename);
 
-  /* We need to round off our heap to NT's page size.  */
-  round_heap (get_page_size ());
-
   /* Open the undumped executable file.  */
   if (!open_input_file (&in_file, in_filename))
     {
@@ -784,7 +755,6 @@ unexec (const char *new_name, const char *old_name)
   /* The size of the dumped executable is the size of the original
      executable plus the size of the heap and the size of the .bss section.  */
   size = in_file.size +
-    get_committed_heap_size () +
     extra_bss_size +
     extra_bss_size_static;
   if (!open_output_file (&out_file, out_filename, size))
@@ -799,6 +769,10 @@ unexec (const char *new_name, const char *old_name)
 
   copy_executable_and_dump_data (&in_file, &out_file);
 
+  /* Unset it because it is plain wrong to keep it after dumping.
+     Malloc can still occur!  */
+  using_dynamic_heap = FALSE;
+
   /* Patch up header fields; profiler is picky about this. */
   {
     PIMAGE_DOS_HEADER dos_header;
index bad1d61e6119b6c6e1ebb6454c0e8f23dde58789..308613f7eb40ba9f51ecf8b62f555cf641aa7ae6 100644 (file)
@@ -21,7 +21,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "lisp.h"
 
 #ifdef MSDOS
-#include <dpmi.h>
+#include "dosfns.h"
 extern int etext;
 #endif
 
@@ -71,15 +71,6 @@ static char *data_space_start;
 /* Number of bytes of writable memory we can expect to be able to get.  */
 static size_t lim_data;
 \f
-/* Return true if PTR cannot be represented as an Emacs Lisp object.  */
-static bool
-exceeds_lisp_ptr (void *ptr)
-{
-  return (! USE_LSB_TAG
-         && VAL_MAX < UINTPTR_MAX
-         && ((uintptr_t) ptr & ~DATA_SEG_BITS) >> VALBITS != 0);
-}
-
 #ifdef HAVE_GETRLIMIT
 
 # ifndef RLIMIT_AS
@@ -115,29 +106,10 @@ get_lim_data (void)
 void
 get_lim_data (void)
 {
-  _go32_dpmi_meminfo info;
-  unsigned long lim1, lim2;
-
-  _go32_dpmi_get_free_memory_information (&info);
-  /* DPMI server of Windows NT and its descendants reports in
-     info.available_memory a much lower amount that is really
-     available, which causes bogus "past 95% of memory limit"
-     warnings.  Try to overcome that via circumstantial evidence.  */
-  lim1 = info.available_memory;
-  lim2 = info.available_physical_pages;
-  /* DPMI Spec: "Fields that are unavailable will hold -1."  */
-  if ((long)lim1 == -1L)
-    lim1 = 0;
-  if ((long)lim2 == -1L)
-    lim2 = 0;
-  else
-    lim2 *= 4096;
-  /* Surely, the available memory is at least what we have physically
-     available, right?  */
-  if (lim1 >= lim2)
-    lim_data = lim1;
-  else
-    lim_data = lim2;
+  unsigned long totalram, freeram, totalswap, freeswap;
+
+  dos_memory_info (&totalram, &freeram, &totalswap, &freeswap);
+  lim_data = freeram;
   /* Don't believe they will give us more that 0.5 GB.   */
   if (lim_data > 512U * 1024U * 1024U)
     lim_data = 512U * 1024U * 1024U;
@@ -222,9 +194,6 @@ check_memory_limits (void)
       else if (warnlevel > warned_85 && data_size < five_percent * 18)
        warnlevel = warned_85;
     }
-
-  if (exceeds_lisp_ptr (cp))
-    (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
 }
 \f
 /* Enable memory usage warnings.
index 15e53600d95b9720e9633304693124f662d006af..7cb9d8960c501e2987432de25e8d2545040eda0a 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -73,9 +73,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <grp.h>
 
 /* MinGW64 (_W64) defines these in its _mingw.h.  */
-#if defined(__GNUC__) && !defined(_W64)
-#define _ANONYMOUS_UNION
-#define _ANONYMOUS_STRUCT
+#ifndef _ANONYMOUS_UNION
+# define _ANONYMOUS_UNION
+#endif
+#ifndef _ANONYMOUS_STRUCT
+# define _ANONYMOUS_STRUCT
 #endif
 #include <windows.h>
 /* Some versions of compiler define MEMORYSTATUSEX, some don't, so we
@@ -880,7 +882,7 @@ set_named_security_info (LPCTSTR lpObjectName,
          g_b_init_set_named_security_info_a = 1;
          hm_advapi32 = LoadLibrary ("Advapi32.dll");
          s_pfn_Set_Named_Security_InfoA =
-           (SetNamedSecurityInfoA_Proc) GetProcAddress (hm_advapi32, 
+           (SetNamedSecurityInfoA_Proc) GetProcAddress (hm_advapi32,
                                                         "SetNamedSecurityInfoA");
        }
       if (s_pfn_Set_Named_Security_InfoA == NULL)
@@ -1707,7 +1709,7 @@ static unsigned num_of_processors;
 /* We maintain 1-sec samples for the last 16 minutes in a circular buffer.  */
 static struct load_sample samples[16*60];
 static int first_idx = -1, last_idx = -1;
-static int max_idx = sizeof (samples) / sizeof (samples[0]);
+static int max_idx = ARRAYELTS (samples);
 
 static int
 buf_next (int from)
@@ -2413,7 +2415,6 @@ unsetenv (const char *name)
 {
   char *var;
   size_t name_len;
-  int retval;
 
   if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
     {
@@ -2512,7 +2513,7 @@ init_environment (char ** argv)
 
   int i;
 
-  const int imax = sizeof (tempdirs) / sizeof (tempdirs[0]);
+  const int imax = ARRAYELTS (tempdirs);
 
   /* Implementation note: This function explicitly works with ANSI
      file names, not with UTF-8 encoded file names.  This is because
@@ -2585,7 +2586,7 @@ init_environment (char ** argv)
       {"LANG", NULL},
     };
 
-#define N_ENV_VARS sizeof (dflt_envvars)/sizeof (dflt_envvars[0])
+#define N_ENV_VARS ARRAYELTS (dflt_envvars)
 
     /* We need to copy dflt_envvars[] and work on the copy because we
        don't want the dumped Emacs to inherit the values of
@@ -6954,6 +6955,35 @@ system_process_attributes (Lisp_Object pid)
   return attrs;
 }
 
+int
+w32_memory_info (unsigned long long *totalram, unsigned long long *freeram,
+                unsigned long long *totalswap, unsigned long long *freeswap)
+{
+  MEMORYSTATUS memst;
+  MEMORY_STATUS_EX memstex;
+
+  /* Use GlobalMemoryStatusEx if available, as it can report more than
+     2GB of memory.  */
+  if (global_memory_status_ex (&memstex))
+    {
+      *totalram  = memstex.ullTotalPhys;
+      *freeram   = memstex.ullAvailPhys;
+      *totalswap = memstex.ullTotalPageFile;
+      *freeswap  = memstex.ullAvailPageFile;
+      return 0;
+    }
+  else if (global_memory_status (&memst))
+    {
+      *totalram = memst.dwTotalPhys;
+      *freeram   = memst.dwAvailPhys;
+      *totalswap = memst.dwTotalPageFile;
+      *freeswap  = memst.dwAvailPageFile;
+      return 0;
+    }
+  else
+    return -1;
+}
+
 \f
 /* Wrappers for  winsock functions to map between our file descriptors
    and winsock's handles; also set h_errno for convenience.
@@ -7835,7 +7865,7 @@ pipe2 (int * phandles, int pipe2_flags)
   int rc;
   unsigned flags;
 
-  eassert (pipe2_flags == O_CLOEXEC);
+  eassert (pipe2_flags == (O_BINARY | O_CLOEXEC));
 
   /* make pipe handles non-inheritable; when we spawn a child, we
      replace the relevant handle with an inheritable one.  Also put
@@ -8698,6 +8728,13 @@ w32_delayed_load (Lisp_Object library_id)
                               /* Possibly truncated */
                               ? make_specified_string (name, -1, len, 1)
                               : Qnil);
+               /* This prevents thread start and end notifications
+                  from being sent to the DLL, for every thread we
+                  start.  We don't need those notifications because
+                  threads we create never use any of these DLLs, only
+                  the main thread uses them.  This is supposed to
+                  speed up thread creation.  */
+               DisableThreadLibraryCalls (dll_handle);
                break;
              }
          }
@@ -9250,8 +9287,6 @@ ssize_t
 emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz)
 {
   int n, err;
-  SELECT_TYPE fdset;
-  struct timespec timeout;
   struct Lisp_Process *process = (struct Lisp_Process *)p;
   int fd = process->infd;
 
index 33fd2709a71eb397d509cfdb964538f598ac96a3..94f7a962833e5aa2e30bd687becafd9934961cfc 100644 (file)
--- a/src/w32.h
+++ b/src/w32.h
@@ -206,6 +206,10 @@ extern void register_child (pid_t, int);
 extern void sys_sleep (int);
 extern int sys_link (const char *, const char *);
 
+/* Return total and free memory info.  */
+extern int w32_memory_info (unsigned long long *, unsigned long long *,
+                           unsigned long long *, unsigned long long *);
+
 #ifdef HAVE_GNUTLS
 #include <gnutls/gnutls.h>
 
index e3ca2f86b8da44bd1671a07a18cbb8dc095e103e..98f681451917be21150dfd94e7ba45ea31bcddd0 100644 (file)
@@ -36,8 +36,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "termhooks.h"
 #include "termchar.h"
 #include "dispextern.h"
+#include "menu.h"      /* for tty_menu_show */
 #include "w32term.h"
-#include "w32common.h" /* for os_subtype */
+#include "w32common.h" /* for os_subtype */
 #include "w32inevt.h"
 
 /* from window.c */
@@ -650,11 +651,13 @@ initialize_w32_display (struct terminal *term, int *width, int *height)
 
   term->read_socket_hook = w32_console_read_socket;
   term->mouse_position_hook = w32_console_mouse_position;
+  term->menu_show_hook = tty_menu_show;
 
   /* The following are not used on the console.  */
   term->frame_rehighlight_hook = 0;
   term->frame_raise_lower_hook = 0;
   term->set_vertical_scroll_bar_hook = 0;
+  term->set_horizontal_scroll_bar_hook = 0;
   term->condemn_scroll_bars_hook = 0;
   term->redeem_scroll_bar_hook = 0;
   term->judge_scroll_bars_hook = 0;
index 1c73cda469a318febc936c6ad07c12fe77d972a7..ac0e693e1c085aaff9bc208c09dce859562378b9 100644 (file)
@@ -89,14 +89,10 @@ extern void w32_free_menu_strings (HWND);
 extern const char *map_w32_filename (const char *, const char **);
 extern char * w32_strerror (int error_no);
 
-/* If non-NULL, a handle to a frame where to display the hourglass cursor.  */
-static HWND hourglass_hwnd = NULL;
-
 #ifndef IDC_HAND
 #define IDC_HAND MAKEINTRESOURCE(32649)
 #endif
 
-Lisp_Object Qsuppress_icon;
 Lisp_Object Qundefined_color;
 Lisp_Object Qcancel_timer;
 Lisp_Object Qfont_param;
@@ -228,16 +224,12 @@ static int w32_unicode_gui;
 
 /* From w32menu.c  */
 extern HMENU current_popup_menu;
-static int menubar_in_use = 0;
+int menubar_in_use = 0;
 
 /* From w32uniscribe.c  */
 extern void syms_of_w32uniscribe (void);
 extern int uniscribe_available;
 
-/* Function prototypes for hourglass support.  */
-static void w32_show_hourglass (struct frame *);
-static void w32_hide_hourglass (void);
-
 #ifdef WINDOWSNT
 /* From w32inevt.c */
 extern int faked_key;
@@ -336,8 +328,7 @@ void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
 void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
 void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-
-
+void x_set_internal_border_width (struct frame *f, Lisp_Object, Lisp_Object);
 \f
 
 /* Store the screen positions of frame F into XPTR and YPTR.
@@ -723,8 +714,7 @@ w32_default_color_map (void)
 
   cmap = Qnil;
 
-  for (i = 0; i < sizeof (w32_color_map) / sizeof (w32_color_map[0]);
-       pc++, i++)
+  for (i = 0; i < ARRAYELTS (w32_color_map); pc++, i++)
     cmap = Fcons (Fcons (build_string (pc->name),
                         make_number (pc->colorref)),
                  cmap);
@@ -1370,23 +1360,23 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
     {
       CHECK_NUMBER (Vx_window_horizontal_drag_shape);
       horizontal_drag_cursor
-       = XCreateFontCursor (FRAME_X_DISPLAY (f),
+       = XCreateFontCursor (FRAME_W32_DISPLAY (f),
                             XINT (Vx_window_horizontal_drag_shape));
     }
   else
     horizontal_drag_cursor
-      = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_h_double_arrow);
+      = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_sb_h_double_arrow);
 
   if (!NILP (Vx_window_vertical_drag_shape))
     {
       CHECK_NUMBER (Vx_window_vertical_drag_shape);
       vertical_drag_cursor
-       = XCreateFontCursor (FRAME_X_DISPLAY (f),
+       = XCreateFontCursor (FRAME_W32_DISPLAY (f),
                             XINT (Vx_window_vertical_drag_shape));
     }
   else
     vertical_drag_cursor
-      = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_v_double_arrow);
+      = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_sb_v_double_arrow);
 
   /* Check and report errors with the above calls.  */
   x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
@@ -1608,8 +1598,53 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
   unblock_input ();
 #endif
 }
-
 \f
+void
+x_clear_under_internal_border (struct frame *f)
+{
+  int border = FRAME_INTERNAL_BORDER_WIDTH (f);
+
+  /* Clear border if it's larger than before.  */
+  if (border != 0)
+    {
+      HDC hdc = get_frame_dc (f);
+      int width = FRAME_PIXEL_WIDTH (f);
+      int height = FRAME_PIXEL_HEIGHT (f);
+
+      block_input ();
+      w32_clear_area (f, hdc, 0, FRAME_TOP_MARGIN_HEIGHT (f), width, border);
+      w32_clear_area (f, hdc, 0, 0, border, height);
+      w32_clear_area (f, hdc, width - border, 0, border, height);
+      w32_clear_area (f, hdc, 0, height - border, width, border);
+      release_frame_dc (f, hdc);
+      unblock_input ();
+    }
+}
+
+
+void
+x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+  int border;
+
+  CHECK_TYPE_RANGED_INTEGER (int, arg);
+  border = max (XINT (arg), 0);
+
+  if (border != FRAME_INTERNAL_BORDER_WIDTH (f))
+    {
+      FRAME_INTERNAL_BORDER_WIDTH (f) = border;
+
+      if (FRAME_X_WINDOW (f) != 0)
+       {
+         adjust_frame_size (f, -1, -1, 3, 0);
+
+         if (FRAME_VISIBLE_P (f))
+           x_clear_under_internal_border (f);
+       }
+    }
+}
+
+
 void
 x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 {
@@ -1630,7 +1665,10 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
   FRAME_MENU_BAR_LINES (f) = 0;
   FRAME_MENU_BAR_HEIGHT (f) = 0;
   if (nlines)
-    FRAME_EXTERNAL_MENU_BAR (f) = 1;
+    {
+      FRAME_EXTERNAL_MENU_BAR (f) = 1;
+      windows_or_buffers_changed = 23;
+    }
   else
     {
       if (FRAME_EXTERNAL_MENU_BAR (f) == 1)
@@ -1639,11 +1677,16 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 
       /* Adjust the frame size so that the client (text) dimensions
         remain the same.  This depends on FRAME_EXTERNAL_MENU_BAR being
-        set correctly.  */
-      x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
-      do_pending_window_change (0);
+        set correctly.  Note that we resize twice: The first time upon
+        a request from the window manager who wants to keep the height
+        of the outer rectangle (including decorations) unchanged, and a
+        second time because we want to keep the height of the inner
+        rectangle (without the decorations unchanged).  */
+      adjust_frame_size (f, -1, -1, 2, 1);
+
+      /* Not sure whether this is needed.  */
+      x_clear_under_internal_border (f);
     }
-  adjust_frame_glyphs (f);
 }
 
 
@@ -1657,8 +1700,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 void
 x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 {
-  int delta, nlines, root_height;
-  int unit = FRAME_LINE_HEIGHT (f);
+  int nlines;
 
   /* Treat tool bars like menu bars.  */
   if (FRAME_MINIBUF_ONLY_P (f))
@@ -1670,66 +1712,50 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
   else
     nlines = 0;
 
-  /* Make sure we redisplay all windows in this frame.  */
-  windows_or_buffers_changed = 23;
+  x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
+}
 
-  /* DELTA is in pixels now.  */
-  delta = (nlines - FRAME_TOOL_BAR_LINES (f)) * unit;
 
-  /* Don't resize the tool-bar to more than we have room for.  Note: The
-     calculations below and the subsequent call to resize_frame_windows
-     are inherently flawed because they can make the toolbar higher than
-     the containing frame.  */
-  if (delta > 0)
-    {
-      root_height = WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_ROOT_WINDOW (f)));
-      if (root_height - delta < unit)
-       {
-         delta = root_height - unit;
-         /* When creating a new frame and toolbar mode is enabled, we
-            need at least one toolbar line.  */
-         nlines = max (FRAME_TOOL_BAR_LINES (f) + delta / unit, 1);
-       }
-    }
+/* Set the pixel height of the tool bar of frame F to HEIGHT.  */
+void
+x_change_tool_bar_height (struct frame *f, int height)
+{
+  Lisp_Object frame;
+  int unit = FRAME_LINE_HEIGHT (f);
+  int old_height = FRAME_TOOL_BAR_HEIGHT (f);
+  int lines = (height + unit - 1) / unit;
+  int old_text_height = FRAME_TEXT_HEIGHT (f);
 
-  FRAME_TOOL_BAR_LINES (f) = nlines;
-  FRAME_TOOL_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
-  ++windows_or_buffers_changed;
-  resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
-  adjust_frame_glyphs (f);
+  /* Make sure we redisplay all windows in this frame.  */
+  windows_or_buffers_changed = 23;
+
+  /* Recalculate tool bar and frame text sizes.  */
+  FRAME_TOOL_BAR_HEIGHT (f) = height;
+  FRAME_TOOL_BAR_LINES (f) = lines;
+  FRAME_TEXT_HEIGHT (f)
+    = FRAME_PIXEL_TO_TEXT_HEIGHT (f, FRAME_PIXEL_HEIGHT (f));
+  FRAME_LINES (f)
+    = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f));
+  /* Store the `tool-bar-lines' and `height' frame parameters.  */
+  store_frame_param (f, Qtool_bar_lines, make_number (lines));
+  store_frame_param (f, Qheight, make_number (FRAME_LINES (f)));
 
-  /* We also have to make sure that the internal border at the top of
-     the frame, below the menu bar or tool bar, is redrawn when the
-     tool bar disappears.  This is so because the internal border is
-     below the tool bar if one is displayed, but is below the menu bar
-     if there isn't a tool bar.  The tool bar draws into the area
-     below the menu bar.  */
   if (FRAME_W32_WINDOW (f) && FRAME_TOOL_BAR_HEIGHT (f) == 0)
     {
       clear_frame (f);
       clear_current_matrices (f);
     }
 
-  /* If the tool bar gets smaller, the internal border below it
-     has to be cleared.  It was formerly part of the display
-     of the larger tool bar, and updating windows won't clear it.  */
-  if (FRAME_INTERNAL_BORDER_WIDTH (f) != 0 && FRAME_VISIBLE_P (f))
-    {
-      int height = FRAME_INTERNAL_BORDER_WIDTH (f);
-      int width = FRAME_PIXEL_WIDTH (f);
-      int y = nlines * unit;
-      HDC hdc = get_frame_dc (f);
+  if ((height < old_height) && WINDOWP (f->tool_bar_window))
+    clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
 
-      block_input ();
-      w32_clear_area (f, hdc, 0, y, width, height);
-      release_frame_dc (f, hdc);
-      unblock_input ();
-    }
+  /* Recalculate toolbar height.  */
+  f->n_tool_bar_rows = 0;
 
-  if (delta < 0 && WINDOWP (f->tool_bar_window))
-    clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
+  adjust_frame_size (f, -1, -1, 4, 0);
 
-  run_window_configuration_change_hook (f);
+  if (FRAME_X_WINDOW (f))
+    x_clear_under_internal_border (f);
 }
 
 
@@ -1848,6 +1874,16 @@ x_set_scroll_bar_default_width (struct frame *f)
     = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + unit - 1) / unit;
 }
 
+
+void
+x_set_scroll_bar_default_height (struct frame *f)
+{
+  int unit = FRAME_LINE_HEIGHT (f);
+
+  FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = GetSystemMetrics (SM_CXHSCROLL);
+  FRAME_CONFIG_SCROLL_BAR_LINES (f)
+    = (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) + unit - 1) / unit;
+}
 \f
 /* Subroutines for creating a frame.  */
 
@@ -1902,7 +1938,7 @@ w32_init_class (HINSTANCE hinst)
 }
 
 static HWND
-w32_createscrollbar (struct frame *f, struct scroll_bar * bar)
+w32_createvscrollbar (struct frame *f, struct scroll_bar * bar)
 {
   return CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
                       /* Position and size of scroll bar.  */
@@ -1910,6 +1946,15 @@ w32_createscrollbar (struct frame *f, struct scroll_bar * bar)
                       FRAME_W32_WINDOW (f), NULL, hinst, NULL);
 }
 
+static HWND
+w32_createhscrollbar (struct frame *f, struct scroll_bar * bar)
+{
+  return CreateWindow ("SCROLLBAR", "", SBS_HORZ | WS_CHILD | WS_VISIBLE,
+                      /* Position and size of scroll bar.  */
+                      bar->left, bar->top, bar->width, bar->height,
+                      FRAME_W32_WINDOW (f), NULL, hinst, NULL);
+}
+
 static void
 w32_createwindow (struct frame *f)
 {
@@ -1961,7 +2006,8 @@ w32_createwindow (struct frame *f)
       SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
       SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
       SetWindowLong (hwnd, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
-      SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_WIDTH (f));
+      SetWindowLong (hwnd, WND_VSCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_WIDTH (f));
+      SetWindowLong (hwnd, WND_HSCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_HEIGHT (f));
       SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
 
       /* Enable drag-n-drop.  */
@@ -2376,7 +2422,8 @@ w32_name_of_message (UINT msg)
       M (WM_EMACS_KILL),
       M (WM_EMACS_CREATEWINDOW),
       M (WM_EMACS_DONE),
-      M (WM_EMACS_CREATESCROLLBAR),
+      M (WM_EMACS_CREATEVSCROLLBAR),
+      M (WM_EMACS_CREATEHSCROLLBAR),
       M (WM_EMACS_SHOWWINDOW),
       M (WM_EMACS_SETWINDOWPOS),
       M (WM_EMACS_DESTROYWINDOW),
@@ -2393,6 +2440,7 @@ w32_name_of_message (UINT msg)
       M (WM_EMACS_SHOW_CARET),
       M (WM_EMACS_HIDE_CARET),
       M (WM_EMACS_SETCURSOR),
+      M (WM_EMACS_SHOWCURSOR),
       M (WM_EMACS_PAINT),
       M (WM_CHAR),
 #undef M
@@ -3450,6 +3498,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
          track_mouse_event_fn (&tme);
          track_mouse_window = hwnd;
        }
+    case WM_HSCROLL:
     case WM_VSCROLL:
       if (w32_mouse_move_interval <= 0
          || (msg == WM_MOUSEMOVE && button_state == 0))
@@ -3788,10 +3837,14 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
       return 0;
 
     case WM_WINDOWPOSCHANGING:
-      /* Don't restrict the sizing of tip frames.  */
-      if (frame_resize_pixelwise || hwnd == tip_window)
-       return 0;
+      /* Don't restrict the sizing of any kind of frames.  If the window
+        manager doesn't, there's no reason to do it ourselves.  */
+#if 0
+        if (frame_resize_pixelwise || hwnd == tip_window)
+#endif
+         return 0;
 
+#if 0
       /* Don't restrict the sizing of fullscreened frames, allowing them to be
          flush with the sides of the screen.  */
       f = x_window_to_frame (dpyinfo, hwnd);
@@ -3814,7 +3867,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
            DWORD font_width;
            DWORD line_height;
            DWORD internal_border;
-           DWORD scrollbar_extra;
+           DWORD vscrollbar_extra;
+           DWORD hscrollbar_extra;
            RECT wr;
 
            wp.length = sizeof (wp);
@@ -3825,7 +3879,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
            font_width = GetWindowLong (hwnd, WND_FONTWIDTH_INDEX);
            line_height = GetWindowLong (hwnd, WND_LINEHEIGHT_INDEX);
            internal_border = GetWindowLong (hwnd, WND_BORDER_INDEX);
-           scrollbar_extra = GetWindowLong (hwnd, WND_SCROLLBAR_INDEX);
+           vscrollbar_extra = GetWindowLong (hwnd, WND_VSCROLLBAR_INDEX);
+           hscrollbar_extra = GetWindowLong (hwnd, WND_HSCROLLBAR_INDEX);
 
            leave_crit ();
 
@@ -3836,10 +3891,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
            /* Force width and height of client area to be exact
               multiples of the character cell dimensions.  */
            wdiff = (lppos->cx - (rect.right - rect.left)
-                    - 2 * internal_border - scrollbar_extra)
+                    - 2 * internal_border - vscrollbar_extra)
              % font_width;
            hdiff = (lppos->cy - (rect.bottom - rect.top)
-                    - 2 * internal_border)
+                    - 2 * internal_border - hscrollbar_extra)
              % line_height;
 
            if (wdiff || hdiff)
@@ -3874,6 +3929,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
       }
 
       goto dflt;
+#endif
 
     case WM_GETMINMAXINFO:
       /* Hack to allow resizing the Emacs frame above the screen size.
@@ -3908,9 +3964,20 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
        return 0;
       }
 
-    case WM_EMACS_CREATESCROLLBAR:
-      return (LRESULT) w32_createscrollbar ((struct frame *) wParam,
-                                           (struct scroll_bar *) lParam);
+    case WM_EMACS_SHOWCURSOR:
+      {
+       ShowCursor ((BOOL) wParam);
+
+       return 0;
+      }
+
+    case WM_EMACS_CREATEVSCROLLBAR:
+      return (LRESULT) w32_createvscrollbar ((struct frame *) wParam,
+                                            (struct scroll_bar *) lParam);
+
+    case WM_EMACS_CREATEHSCROLLBAR:
+      return (LRESULT) w32_createhscrollbar ((struct frame *) wParam,
+                                            (struct scroll_bar *) lParam);
 
     case WM_EMACS_SHOWWINDOW:
       return ShowWindow ((HWND) wParam, (WPARAM) lParam);
@@ -4113,7 +4180,8 @@ my_create_tip_window (struct frame *f)
       SetWindowLong (tip_window, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
 
       /* Tip frames have no scrollbars.  */
-      SetWindowLong (tip_window, WND_SCROLLBAR_INDEX, 0);
+      SetWindowLong (tip_window, WND_VSCROLLBAR_INDEX, 0);
+      SetWindowLong (tip_window, WND_HSCROLLBAR_INDEX, 0);
 
       /* Do this to discard the default setting specified by our parent. */
       ShowWindow (tip_window, SW_HIDE);
@@ -4345,7 +4413,6 @@ This function is an internal primitive--use `make-frame' instead.  */)
   Lisp_Object name;
   int minibuffer_only = 0;
   long window_prompting = 0;
-  int width, height;
   ptrdiff_t count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
   Lisp_Object display;
@@ -4413,8 +4480,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
   XSETFRAME (frame, f);
 
-  /* By default, make scrollbars the system standard width. */
-  x_set_scroll_bar_default_width (f);
+  /* By default, make scrollbars the system standard width and height. */
+  FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
+  FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = GetSystemMetrics (SM_CXHSCROLL);
 
   f->terminal = dpyinfo->terminal;
 
@@ -4440,7 +4508,6 @@ This function is an internal primitive--use `make-frame' instead.  */)
 #endif /* GLYPH_DEBUG */
 
   /* Specify the parent under which to make this window.  */
-
   if (!NILP (parent))
     {
       f->output_data.w32->parent_desc = (Window) XFASTINT (parent);
@@ -4463,7 +4530,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
     {
       fset_name (f, name);
       f->explicit_name = 1;
-      /* use the frame's title when getting resources for this frame.  */
+      /* Use the frame's title when getting resources for this frame.  */
       specbind (Qx_resource_name, name);
     }
 
@@ -4473,9 +4540,11 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
   x_default_parameter (f, parameters, Qfont_backend, Qnil,
                       "fontBackend", "FontBackend", RES_TYPE_STRING);
+
   /* Extract the window parameters from the supplied values
      that are needed to determine window geometry.  */
   x_default_font_parameter (f, parameters);
+
   x_default_parameter (f, parameters, Qborder_width, make_number (2),
                       "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
 
@@ -4489,7 +4558,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
                         "internalBorder", "InternalBorder", RES_TYPE_NUMBER);
       if (! EQ (value, Qunbound))
        parameters = Fcons (Fcons (Qinternal_border_width, value),
-                            parameters);
+                           parameters);
     }
   /* Default internalBorderWidth to 0 on Windows to match other programs.  */
   x_default_parameter (f, parameters, Qinternal_border_width, make_number (0),
@@ -4500,6 +4569,8 @@ This function is an internal primitive--use `make-frame' instead.  */)
                       NULL, NULL, RES_TYPE_NUMBER);
   x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright,
                       "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
+  x_default_parameter (f, parameters, Qhorizontal_scroll_bars, Qbottom,
+                      "horizontalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
 
   /* Also do the stuff which must be set before the window exists.  */
   x_default_parameter (f, parameters, Qforeground_color, build_string ("black"),
@@ -4520,57 +4591,42 @@ This function is an internal primitive--use `make-frame' instead.  */)
                       "rightFringe", "RightFringe", RES_TYPE_NUMBER);
   /* Process alpha here (Bug#16619).  */
   x_default_parameter (f, parameters, Qalpha, Qnil,
-                       "alpha", "Alpha", RES_TYPE_NUMBER);
+                      "alpha", "Alpha", RES_TYPE_NUMBER);
 
-  /* Init faces before x_default_parameter is called for scroll-bar
-     parameters because that function calls x_set_scroll_bar_width,
-     which calls change_frame_size, which calls Fset_window_buffer,
-     which runs hooks, which call Fvertical_motion.  At the end, we
-     end up in init_iterator with a null face cache, which should not
-     happen.  */
+  /* Init faces first since we need the frame's column width/line
+     height in various occasions.  */
   init_frame_faces (f);
 
-  /* Avoid calling window-configuration-change-hook; otherwise we
-     could get an infloop in next_frame since the frame is not yet in
-     Vframe_list.  */
-  {
-    ptrdiff_t count2 = SPECPDL_INDEX ();
-
-    record_unwind_protect (unwind_create_frame_1, inhibit_lisp_code);
-    inhibit_lisp_code = Qt;
-
-    /* PXW: This is a duplicate from below.  We have to do it here since
-       otherwise x_set_tool_bar_lines will work with the character sizes
-       installed by init_frame_faces while the frame's pixel size is still
-       calculated from a character size of 1 and we subsequently hit the
-       eassert (height >= 0) assertion in window_box_height.  The
-       non-pixelwise code apparently worked around this because it had one
-       frame line vs one toolbar line which left us with a zero root
-       window height which was obviously wrong as well ...  */
-    change_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
-                      FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1, 0, 0, 1);
-
-    /* The X resources controlling the menu-bar and tool-bar are
-       processed specially at startup, and reflected in the mode
-       variables; ignore them here.  */
-    x_default_parameter (f, parameters, Qmenu_bar_lines,
-                        NILP (Vmenu_bar_mode)
-                        ? make_number (0) : make_number (1),
-                        NULL, NULL, RES_TYPE_NUMBER);
-    x_default_parameter (f, parameters, Qtool_bar_lines,
-                        NILP (Vtool_bar_mode)
-                        ? make_number (0) : make_number (1),
-                        NULL, NULL, RES_TYPE_NUMBER);
-
-    unbind_to (count2, Qnil);
-  }
+  /* The following call of change_frame_size is needed since otherwise
+     x_set_tool_bar_lines will already work with the character sizes
+     installed by init_frame_faces while the frame's pixel size is
+     still calculated from a character size of 1 and we subsequently
+     hit the (height >= 0) assertion in window_box_height.
+
+     The non-pixelwise code apparently worked around this because it
+     had one frame line vs one toolbar line which left us with a zero
+     root window height which was obviously wrong as well ...  */
+  adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+                    FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 5, 1);
+
+  /* The X resources controlling the menu-bar and tool-bar are
+     processed specially at startup, and reflected in the mode
+     variables; ignore them here.  */
+  x_default_parameter (f, parameters, Qmenu_bar_lines,
+                      NILP (Vmenu_bar_mode)
+                      ? make_number (0) : make_number (1),
+                      NULL, NULL, RES_TYPE_NUMBER);
+  x_default_parameter (f, parameters, Qtool_bar_lines,
+                      NILP (Vtool_bar_mode)
+                      ? make_number (0) : make_number (1),
+                      NULL, NULL, RES_TYPE_NUMBER);
 
   x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
                       "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
   x_default_parameter (f, parameters, Qtitle, Qnil,
                       "title", "Title", RES_TYPE_STRING);
   x_default_parameter (f, parameters, Qfullscreen, Qnil,
-                       "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
+                      "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
 
   f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
   f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
@@ -4613,15 +4669,13 @@ This function is an internal primitive--use `make-frame' instead.  */)
                       "cursorType", "CursorType", RES_TYPE_SYMBOL);
   x_default_parameter (f, parameters, Qscroll_bar_width, Qnil,
                       "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
+  x_default_parameter (f, parameters, Qscroll_bar_height, Qnil,
+                      "scrollBarHeight", "ScrollBarHeight", RES_TYPE_NUMBER);
 
-  /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
-     Change will not be effected unless different from the current
-     FRAME_LINES (f).  */
-  width = FRAME_TEXT_WIDTH (f);
-  height = FRAME_TEXT_HEIGHT (f);
-  FRAME_TEXT_HEIGHT (f) = 0;
-  SET_FRAME_WIDTH (f, 0);
-  change_frame_size (f, width, height, 1, 0, 0, 1);
+  /* Consider frame official, now.  */
+  f->official = true;
+
+  adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, 1);
 
   /* Tell the server what size and position, etc, we want, and how
      badly we want them.  This should be done after we have the menu
@@ -5497,100 +5551,6 @@ no value of TYPE (always string in the MS Windows case).  */)
 
 #endif /* TODO */
 
-\f
-/***********************************************************************
-                               Busy cursor
- ***********************************************************************/
-
-void
-w32_note_current_window (void)
-{
-  struct frame * f = SELECTED_FRAME ();
-
-  if (!FRAME_W32_P (f))
-    return;
-
-  hourglass_hwnd = FRAME_W32_WINDOW (f);
-}
-
-void
-show_hourglass (struct atimer *timer)
-{
-  struct frame *f;
-
-  hourglass_atimer = NULL;
-
-  block_input ();
-  f = x_window_to_frame (&one_w32_display_info,
-                                      hourglass_hwnd);
-
-  if (f)
-    f->output_data.w32->hourglass_p = 0;
-  else
-    f = SELECTED_FRAME ();
-
-  if (!FRAME_W32_P (f))
-    {
-      unblock_input ();
-      return;
-    }
-
-  w32_show_hourglass (f);
-  unblock_input ();
-}
-
-void
-hide_hourglass (void)
-{
-  block_input ();
-  w32_hide_hourglass ();
-  unblock_input ();
-}
-
-
-/* Display an hourglass cursor.  Set the hourglass_p flag in display info
-   to indicate that an hourglass cursor is shown.  */
-
-static void
-w32_show_hourglass (struct frame *f)
-{
-  if (!hourglass_shown_p)
-    {
-      f->output_data.w32->hourglass_p = 1;
-      if (!menubar_in_use && !current_popup_menu)
-       SetCursor (f->output_data.w32->hourglass_cursor);
-      hourglass_shown_p = 1;
-    }
-}
-
-
-/* Hide the hourglass cursor on all frames, if it is currently shown.  */
-
-static void
-w32_hide_hourglass (void)
-{
-  if (hourglass_shown_p)
-    {
-      struct frame *f = x_window_to_frame (&one_w32_display_info,
-                                          hourglass_hwnd);
-      if (f)
-       f->output_data.w32->hourglass_p = 0;
-      else
-       /* If frame was deleted, restore to selected frame's cursor.  */
-       f = SELECTED_FRAME ();
-
-      if (FRAME_W32_P (f))
-       SetCursor (f->output_data.w32->current_cursor);
-      else
-       /* No cursors on non GUI frames - restore to stock arrow cursor.  */
-       SetCursor (w32_load_cursor (IDC_ARROW));
-
-      hourglass_shown_p = 0;
-    }
-}
-
-
-\f
 /***********************************************************************
                                Tool tips
  ***********************************************************************/
@@ -5775,13 +5735,12 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
                       "cursorColor", "Foreground", RES_TYPE_STRING);
   x_default_parameter (f, parms, Qborder_color, build_string ("black"),
                       "borderColor", "BorderColor", RES_TYPE_STRING);
+  x_default_parameter (f, parms, Qalpha, Qnil,
+                       "alpha", "Alpha", RES_TYPE_NUMBER);
 
-  /* Init faces before x_default_parameter is called for scroll-bar
-     parameters because that function calls x_set_scroll_bar_width,
-     which calls change_frame_size, which calls Fset_window_buffer,
-     which runs hooks, which call Fvertical_motion.  At the end, we
-     end up in init_iterator with a null face cache, which should not
-     happen.  */
+  /* Init faces before x_default_parameter is called for the
+     scroll-bar-width parameter because otherwise we end up in
+     init_iterator with a null face cache, which should not happen.  */
   init_frame_faces (f);
 
   f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED;
@@ -5812,9 +5771,10 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
      from the current FRAME_LINES (f).  */
   width = FRAME_COLS (f);
   height = FRAME_LINES (f);
-  FRAME_LINES (f) = 0;
   SET_FRAME_COLS (f, 0);
-  change_frame_size (f, width, height, 1, 0, 0, 0);
+  SET_FRAME_LINES (f, 0);
+  adjust_frame_size (f, width * FRAME_COLUMN_WIDTH (f),
+                    height * FRAME_LINE_HEIGHT (f), 0, 1);
 
   /* Add `tooltip' frame parameter's default value. */
   if (NILP (Fframe_parameter (frame, Qtooltip)))
@@ -5859,6 +5819,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
      below.  And the frame needs to be on Vframe_list or making it
      visible won't work.  */
   Vframe_list = Fcons (frame, Vframe_list);
+  f->official = true;
 
   /* Setting attributes of faces of the tooltip frame from resources
      and similar will increment face_change_count, which leads to the
@@ -6887,24 +6848,33 @@ operations:
                specified DOCUMENT.
  \"find\"    - initiate search starting from DOCUMENT, which must specify
                a directory.
+ \"delete\"  - move DOCUMENT, a file or a directory, to Recycle Bin.
+ \"copy\"    - copy DOCUMENT, which must be a file or a directory, into
+               the clipboard.
+ \"cut\"     - move DOCUMENT, a file or a directory, into the clipboard.
+ \"paste\"   - paste the file whose name is in the clipboard into DOCUMENT,
+               which must be a directory.
+ \"pastelink\"
+           - create a shortcut in DOCUMENT (which must be a directory)
+               the file or directory whose name is in the clipboard.
  \"runas\"   - run DOCUMENT, which must be an excutable file, with
                elevated privileges (a.k.a. \"as Administrator\").
  \"properties\"
-           - open the the property sheet dialog for DOCUMENT; works
-               for *.lnk desktop shortcuts, and little or nothing else.
+           - open the property sheet dialog for DOCUMENT.
  nil       - invoke the default OPERATION, or \"open\" if default is
                not defined or unavailable.
 
 DOCUMENT is typically the name of a document file or a URL, but can
 also be an executable program to run, or a directory to open in the
-Windows Explorer.  If it is a file, it must be a local one; this
-function does not support remote file names.
+Windows Explorer.  If it is a file or a directory, it must be a local
+one; this function does not support remote file names.
 
 If DOCUMENT is an executable program, the optional third arg PARAMETERS
-can be a string containing command line parameters that will be passed
-to the program.  Some values of OPERATION also require parameters (e.g.,
-\"printto\" requires the printer address).  Otherwise, PARAMETERS should
-be nil or unspecified.
+can be a string containing command line parameters, separated by blanks,
+that will be passed to the program.  Some values of OPERATION also require
+parameters (e.g., \"printto\" requires the printer address).  Otherwise,
+PARAMETERS should be nil or unspecified.  Note that double quote characters
+in PARAMETERS must each be enclosed in 2 additional quotes, as in \"\"\".
 
 Optional fourth argument SHOW-FLAG can be used to control how the
 application will be displayed when it is invoked.  If SHOW-FLAG is nil
@@ -6922,11 +6892,13 @@ a ShowWindow flag:
   char *errstr;
   Lisp_Object current_dir = BVAR (current_buffer, directory);;
   wchar_t *doc_w = NULL, *params_w = NULL, *ops_w = NULL;
+#ifdef CYGWIN
   intptr_t result;
-#ifndef CYGWIN
+#else
   int use_unicode = w32_unicode_filenames;
   char *doc_a = NULL, *params_a = NULL, *ops_a = NULL;
   Lisp_Object absdoc, handler;
+  BOOL success;
   struct gcpro gcpro1;
 #endif
 
@@ -6954,7 +6926,48 @@ a ShowWindow flag:
                                     GUI_SDATA (current_dir),
                                     (INTEGERP (show_flag)
                                      ? XINT (show_flag) : SW_SHOWDEFAULT));
+
+  if (result > 32)
+    return Qt;
+
+  switch (result)
+    {
+    case SE_ERR_ACCESSDENIED:
+      errstr = w32_strerror (ERROR_ACCESS_DENIED);
+      break;
+    case SE_ERR_ASSOCINCOMPLETE:
+    case SE_ERR_NOASSOC:
+      errstr = w32_strerror (ERROR_NO_ASSOCIATION);
+      break;
+    case SE_ERR_DDEBUSY:
+    case SE_ERR_DDEFAIL:
+      errstr = w32_strerror (ERROR_DDE_FAIL);
+      break;
+    case SE_ERR_DDETIMEOUT:
+      errstr = w32_strerror (ERROR_TIMEOUT);
+      break;
+    case SE_ERR_DLLNOTFOUND:
+      errstr = w32_strerror (ERROR_DLL_NOT_FOUND);
+      break;
+    case SE_ERR_FNF:
+      errstr = w32_strerror (ERROR_FILE_NOT_FOUND);
+      break;
+    case SE_ERR_OOM:
+      errstr = w32_strerror (ERROR_NOT_ENOUGH_MEMORY);
+      break;
+    case SE_ERR_PNF:
+      errstr = w32_strerror (ERROR_PATH_NOT_FOUND);
+      break;
+    case SE_ERR_SHARE:
+      errstr = w32_strerror (ERROR_SHARING_VIOLATION);
+      break;
+    default:
+      errstr = w32_strerror (0);
+      break;
+    }
+
 #else  /* !CYGWIN */
+
   current_dir = ENCODE_FILE (current_dir);
   /* We have a situation here.  If DOCUMENT is a relative file name,
      but its name includes leading directories, i.e. it lives not in
@@ -6984,6 +6997,7 @@ a ShowWindow flag:
   if (use_unicode)
     {
       wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH];
+      SHELLEXECUTEINFOW shexinfo_w;
 
       /* Encode filename, current directory and parameters, and
         convert operation to UTF-16.  */
@@ -7017,14 +7031,28 @@ a ShowWindow flag:
            *d++ = *s++;
          *d = 0;
        }
-      result = (intptr_t) ShellExecuteW (NULL, ops_w, doc_w, params_w,
-                                        current_dir_w,
-                                        (INTEGERP (show_flag)
-                                         ? XINT (show_flag) : SW_SHOWDEFAULT));
+
+      /* Using ShellExecuteEx and setting the SEE_MASK_INVOKEIDLIST
+        flag succeeds with more OPERATIONs (a.k.a. "verbs"), as it is
+        able to invoke verbs from shortcut menu extensions, not just
+        static verbs listed in the Registry.  */
+      memset (&shexinfo_w, 0, sizeof (shexinfo_w));
+      shexinfo_w.cbSize = sizeof (shexinfo_w);
+      shexinfo_w.fMask =
+       SEE_MASK_INVOKEIDLIST | SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI;
+      shexinfo_w.hwnd = NULL;
+      shexinfo_w.lpVerb = ops_w;
+      shexinfo_w.lpFile = doc_w;
+      shexinfo_w.lpParameters = params_w;
+      shexinfo_w.lpDirectory = current_dir_w;
+      shexinfo_w.nShow =
+       (INTEGERP (show_flag) ? XINT (show_flag) : SW_SHOWDEFAULT);
+      success = ShellExecuteExW (&shexinfo_w);
     }
   else
     {
       char document_a[MAX_PATH], current_dir_a[MAX_PATH];
+      SHELLEXECUTEINFOA shexinfo_a;
 
       filename_to_ansi (SSDATA (current_dir), current_dir_a);
       filename_to_ansi (SSDATA (document), document_a);
@@ -7039,51 +7067,27 @@ a ShowWindow flag:
          /* Assume OPERATION is pure ASCII.  */
          ops_a = SSDATA (operation);
        }
-      result = (intptr_t) ShellExecuteA (NULL, ops_a, doc_a, params_a,
-                                        current_dir_a,
-                                        (INTEGERP (show_flag)
-                                         ? XINT (show_flag) : SW_SHOWDEFAULT));
+      memset (&shexinfo_a, 0, sizeof (shexinfo_a));
+      shexinfo_a.cbSize = sizeof (shexinfo_a);
+      shexinfo_a.fMask =
+       SEE_MASK_INVOKEIDLIST | SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI;
+      shexinfo_a.hwnd = NULL;
+      shexinfo_a.lpVerb = ops_a;
+      shexinfo_a.lpFile = doc_a;
+      shexinfo_a.lpParameters = params_a;
+      shexinfo_a.lpDirectory = current_dir_a;
+      shexinfo_a.nShow =
+       (INTEGERP (show_flag) ? XINT (show_flag) : SW_SHOWDEFAULT);
+      success = ShellExecuteExA (&shexinfo_a);
     }
-#endif /* !CYGWIN */
 
-  if (result > 32)
+  if (success)
     return Qt;
 
-  switch (result)
-    {
-    case SE_ERR_ACCESSDENIED:
-      errstr = w32_strerror (ERROR_ACCESS_DENIED);
-      break;
-    case SE_ERR_ASSOCINCOMPLETE:
-    case SE_ERR_NOASSOC:
-      errstr = w32_strerror (ERROR_NO_ASSOCIATION);
-      break;
-    case SE_ERR_DDEBUSY:
-    case SE_ERR_DDEFAIL:
-      errstr = w32_strerror (ERROR_DDE_FAIL);
-      break;
-    case SE_ERR_DDETIMEOUT:
-      errstr = w32_strerror (ERROR_TIMEOUT);
-      break;
-    case SE_ERR_DLLNOTFOUND:
-      errstr = w32_strerror (ERROR_DLL_NOT_FOUND);
-      break;
-    case SE_ERR_FNF:
-      errstr = w32_strerror (ERROR_FILE_NOT_FOUND);
-      break;
-    case SE_ERR_OOM:
-      errstr = w32_strerror (ERROR_NOT_ENOUGH_MEMORY);
-      break;
-    case SE_ERR_PNF:
-      errstr = w32_strerror (ERROR_PATH_NOT_FOUND);
-      break;
-    case SE_ERR_SHARE:
-      errstr = w32_strerror (ERROR_SHARING_VIOLATION);
-      break;
-    default:
-      errstr = w32_strerror (0);
-      break;
-    }
+  errstr = w32_strerror (0);
+
+#endif /* !CYGWIN */
+
   /* The error string might be encoded in the locale's encoding.  */
   if (!NILP (Vlocale_coding_system))
     {
@@ -7503,8 +7507,8 @@ If the underlying system call fails, value is nil.  */)
       (char *, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER)
       = GetProcAddress (hKernel, "GetDiskFreeSpaceExA");
     bool have_pfn_GetDiskFreeSpaceEx =
-      (w32_unicode_filenames && pfn_GetDiskFreeSpaceExW
-       || !w32_unicode_filenames && pfn_GetDiskFreeSpaceExA);
+      ((w32_unicode_filenames && pfn_GetDiskFreeSpaceExW)
+       || (!w32_unicode_filenames && pfn_GetDiskFreeSpaceExA));
 
     /* On Windows, we may need to specify the root directory of the
        volume holding FILENAME.  */
@@ -8026,17 +8030,19 @@ frame_parm_handler w32_frame_parm_handlers[] =
   x_set_mouse_color,
   x_explicitly_set_name,
   x_set_scroll_bar_width,
+  x_set_scroll_bar_height,
   x_set_title,
   x_set_unsplittable,
   x_set_vertical_scroll_bars,
+  x_set_horizontal_scroll_bars,
   x_set_visibility,
   x_set_tool_bar_lines,
   0, /* x_set_scroll_bar_foreground, */
   0, /* x_set_scroll_bar_background, */
   x_set_screen_gamma,
   x_set_line_spacing,
-  x_set_fringe_width,
-  x_set_fringe_width,
+  x_set_left_fringe,
+  x_set_right_fringe,
   0, /* x_set_wait_for_wm, */
   x_set_fullscreen,
   x_set_font_backend,
@@ -8053,7 +8059,6 @@ syms_of_w32fns (void)
 
   w32_visible_system_caret_hwnd = NULL;
 
-  DEFSYM (Qsuppress_icon, "suppress-icon");
   DEFSYM (Qundefined_color, "undefined-color");
   DEFSYM (Qcancel_timer, "cancel-timer");
   DEFSYM (Qhyper, "hyper");
@@ -8068,8 +8073,6 @@ syms_of_w32fns (void)
   DEFSYM (Qworkarea, "workarea");
   DEFSYM (Qmm_size, "mm-size");
   DEFSYM (Qframes, "frames");
-  /* This is the end of symbol initialization.  */
-
 
   Fput (Qundefined_color, Qerror_conditions,
        listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror));
@@ -8381,9 +8384,6 @@ only be necessary if the default setting causes problems.  */);
 #endif
 
   defsubr (&Sset_message_beep);
-
-  hourglass_hwnd = NULL;
-
   defsubr (&Sx_show_tip);
   defsubr (&Sx_hide_tip);
   tip_timer = Qnil;
index 5262f38663fbf097cadc77c676b3b3bebff3df79..81e25eb0856ae24accb7f2b1009438d7cf731159 100644 (file)
@@ -757,19 +757,6 @@ w32font_get_bitmap (struct font *font, unsigned code,
 static void
 w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap);
   */
-/* w32 implementation of get_outline for font backend.
-   Optional.
-   Return an outline data for glyph-code CODE of FONT.  The format
-   of the outline data depends on the font-driver.
-static void *
-w32font_get_outline (struct font *font, unsigned code);
-  */
-/* w32 implementation of free_outline for font backend.
-   Optional.
-   Free OUTLINE (that is obtained by the above method).
-static void
-w32font_free_outline (struct font *font, void *outline);
-  */
 /* w32 implementation of anchor_point for font backend.
    Optional.
    Get coordinates of the INDEXth anchor point of the glyph whose
@@ -899,7 +886,7 @@ w32font_open_internal (struct frame *f, Lisp_Object font_entity,
   LOGFONT logfont;
   HDC dc;
   HFONT hfont, old_font;
-  Lisp_Object val, extra;
+  Lisp_Object val;
   struct w32font_info *w32_font;
   struct font * font;
   OUTLINETEXTMETRICW* metrics = NULL;
@@ -992,21 +979,6 @@ w32font_open_internal (struct frame *f, Lisp_Object font_entity,
   font->default_ascent = w32_font->metrics.tmAscent;
   font->pixel_size = size;
   font->driver = &w32font_driver;
-  /* Use format cached during list, as the information we have access to
-     here is incomplete.  */
-  extra = AREF (font_entity, FONT_EXTRA_INDEX);
-  if (CONSP (extra))
-    {
-      val = assq_no_quit (QCformat, extra);
-      if (CONSP (val))
-        font->props[FONT_FORMAT_INDEX] = XCDR (val);
-      else
-        font->props[FONT_FORMAT_INDEX] = Qunknown;
-    }
-  else
-    font->props[FONT_FORMAT_INDEX] = Qunknown;
-
-  font->props[FONT_FILE_INDEX] = Qnil;
   font->encoding_charset = -1;
   font->repertory_charset = -1;
   /* TODO: do we really want the minimum width here, which could be negative? */
@@ -2557,8 +2529,6 @@ struct font_driver w32font_driver =
     w32font_draw,
     NULL, /* get_bitmap */
     NULL, /* free_bitmap */
-    NULL, /* get_outline */
-    NULL, /* free_outline */
     NULL, /* anchor_point */
     NULL, /* otf_capability */
     NULL, /* otf_drive */
index b8c8557357a57aa7dd4cf2140ef83a32d83dab9c..d04ce625d1de6b94dd85804d856654764b6840c5 100644 (file)
@@ -22,14 +22,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "systime.h" /* for Time */
 
-/* Local memory management for menus.  */
+/* FIXME: old local memory management for menus.  */
 #define local_heap (GetProcessHeap ())
 #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n)))
 #define local_free(p) (HeapFree (local_heap, 0, ((LPVOID) (p))))
 
-#define malloc_widget_value() ((widget_value *) local_alloc (sizeof (widget_value)))
-#define free_widget_value(wv) (local_free ((wv)))
-
 /* Emulate X GC's by keeping color and font info in a structure.  */
 typedef struct _XGCValues
 {
index 8ab2f58c6e70c6a80849f9ec15163393e9e4638d..c431b87e0c25eb015b8cd01895481f9cacfc11ad 100644 (file)
-/* Heap management routines for GNU Emacs on the Microsoft Windows API.
-   Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc.
+/* Heap management routines for GNU Emacs on the Microsoft Windows
+   API.  Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc.
 
-This file is part of GNU Emacs.
+   This file is part of GNU Emacs.
 
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+   GNU Emacs is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GNU Emacs is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public License
+   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>. */
 
 /*
-   Geoff Voelker (voelker@cs.washington.edu)                        7-29-94
+  Geoff Voelker (voelker@cs.washington.edu)                          7-29-94
 */
 
+/*
+  Heavily modified by Fabrice Popineau (fabrice.popineau@gmail.com) 28-02-2014
+*/
+
+/*
+  Memory allocation scheme for w32/w64:
+
+  - Buffers are mmap'ed using a very simple emulation of mmap/munmap
+  - During the temacs phase:
+    * we use a private heap declared to be stored into the `dumped_data'
+    * unfortunately, this heap cannot be made growable, so the size of
+      blocks it can allocate is limited to (0x80000 - pagesize)
+    * the blocks that are larger than this are allocated from the end
+      of the `dumped_data' array; there are not so many of them.
+      We use a very simple first-fit scheme to reuse those blocks.
+    * we check that the private heap does not cross the area used
+      by the bigger chunks.
+  - During the emacs phase:
+    * we create a private heap for new memory blocks
+    * we make sure that we never free a block that has been dumped.
+      Freeing a dumped block could work in principle, but may prove
+      unreliable if we distribute binaries of emacs.exe: MS does not
+      guarantee that the heap data structures are the same across all
+      versions of their OS, even though the API is available since XP.  */
+
 #include <config.h>
 #include <stdio.h>
+#include <errno.h>
 
+#include <sys/mman.h>
 #include "w32common.h"
 #include "w32heap.h"
 #include "lisp.h"  /* for VALMASK */
 
-#define RVA_TO_PTR(rva) ((unsigned char *)((DWORD_PTR)(rva) + (DWORD_PTR)GetModuleHandle (NULL)))
-
-/* Emulate getpagesize.  */
-int
-getpagesize (void)
-{
-  return sysinfo_cache.dwPageSize;
-}
+/* We chose to leave those declarations here.  They are used only in
+   this file.  The RtlCreateHeap is available since XP.  It is located
+   in ntdll.dll and is available with the DDK.  People often
+   complained that HeapCreate doesn't offer the ability to create a
+   heap at a given place, which we need here, and which RtlCreateHeap
+   provides.  We reproduce here the definitions available with the
+   DDK.  */
+
+typedef PVOID (WINAPI * RtlCreateHeap_Proc) (
+                                             /* _In_ */      ULONG Flags,
+                                             /* _In_opt_ */  PVOID HeapBase,
+                                             /* _In_opt_ */  SIZE_T ReserveSize,
+                                             /* _In_opt_ */  SIZE_T CommitSize,
+                                             /* _In_opt_ */  PVOID Lock,
+                                             /* _In_opt_ */  PVOID Parameters
+                                             );
+
+typedef LONG NTSTATUS;
+
+typedef NTSTATUS
+(NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
+                                   IN PVOID Base,
+                                   IN OUT PVOID *CommitAddress,
+                                   IN OUT PSIZE_T CommitSize
+                                   );
+
+typedef struct _RTL_HEAP_PARAMETERS {
+  ULONG Length;
+  SIZE_T SegmentReserve;
+  SIZE_T SegmentCommit;
+  SIZE_T DeCommitFreeBlockThreshold;
+  SIZE_T DeCommitTotalFreeThreshold;
+  SIZE_T MaximumAllocationSize;
+  SIZE_T VirtualMemoryThreshold;
+  SIZE_T InitialCommit;
+  SIZE_T InitialReserve;
+  PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
+  SIZE_T Reserved[ 2 ];
+} RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
+
+/* We reserve space for dumping emacs lisp byte-code inside a static
+   array.  By storing it in an array, the generic mechanism in
+   unexecw32.c will be able to dump it without the need to add a
+   special segment to the executable.  In order to be able to do this
+   without losing too much space, we need to create a Windows heap at
+   the specific address of the static array.  The RtlCreateHeap
+   available inside the NT kernel since XP will do this.  It allows to
+   create a non-growable heap at a specific address.  So before
+   dumping, we create a non-growable heap at the address of the
+   dumped_data[] array.  After dumping, we reuse memory allocated
+   there without being able to free it (but most of it is not meant to
+   be freed anyway), and we use a new private heap for all new
+   allocations.  */
+
+/* FIXME: Most of the space reserved for dumped_data[] is only used by
+   the 1st bootstrap-emacs.exe built while bootstrapping.  Once the
+   preloaded Lisp files are byte-compiled, the next loadup uses less
+   than half of the size stated below.  It would be nice to find a way
+   to build only the first bootstrap-emacs.exe with the large size,
+   and reset that to a lower value afterwards.  */
+#ifdef _WIN64
+# define DUMPED_HEAP_SIZE (18*1024*1024)
+#else
+# define DUMPED_HEAP_SIZE (11*1024*1024)
+#endif
 
-/* Info for managing our preload heap, which is essentially a fixed size
-   data area in the executable.  */
-PIMAGE_SECTION_HEADER preload_heap_section;
+static unsigned char dumped_data[DUMPED_HEAP_SIZE];
 
-/* Info for keeping track of our heap.  */
+/* Info for keeping track of our dynamic heap used after dumping. */
 unsigned char *data_region_base = NULL;
 unsigned char *data_region_end = NULL;
-unsigned char *real_data_region_end = NULL;
-size_t  reserved_heap_size = 0;
+static DWORD_PTR committed = 0;
 
-/* The start of the data segment.  */
-unsigned char *
-get_data_start (void)
-{
-  return data_region_base;
-}
+/* The maximum block size that can be handled by a non-growable w32
+   heap is limited by the MaxBlockSize value below.
+
+   This point deserves and explanation.
+
+   The W32 heap allocator can be used for a growable
+   heap or a non-growable one.
+
+   A growable heap is not compatible with a fixed base address for the
+   heap.  Only a non-growable one is.  One drawback of non-growable
+   heaps is that they can hold only objects smaller than a certain
+   size (the one defined below).  Most of the largest blocks are GC'ed
+   before dumping.  In any case and to be safe, we implement a simple
+   first-fit allocation algorithm starting at the end of the
+   dumped_data[] array like depicted below:
+
+  ----------------------------------------------
+  |               |              |             |
+  | Private heap  |->          <-|  Big chunks |
+  |               |              |             |
+  ----------------------------------------------
+  ^               ^              ^
+  dumped_data     dumped_data    bc_limit
+                  + committed
 
-/* The end of the data segment.  */
-unsigned char *
-get_data_end (void)
+*/
+
+/* Info for managing our preload heap, which is essentially a fixed size
+   data area in the executable. */
+#define PAGE_SIZE 0x1000
+#define MaxBlockSize (0x80000 - PAGE_SIZE)
+
+#define MAX_BLOCKS 0x40
+
+static struct
 {
-  return data_region_end;
-}
+  unsigned char *address;
+  size_t size;
+  DWORD occupied;
+} blocks[MAX_BLOCKS];
+
+static DWORD          blocks_number = 0;
+static unsigned char *bc_limit;
+
+/* Handle for the private heap:
+    - inside the dumped_data[] array before dump,
+    - outside of it after dump.
+*/
+HANDLE heap = NULL;
 
-#if !USE_LSB_TAG
-static char *
-allocate_heap (void)
+/* We redirect the standard allocation functions.  */
+malloc_fn the_malloc_fn;
+realloc_fn the_realloc_fn;
+free_fn the_free_fn;
+
+/* It doesn't seem to be useful to allocate from a file mapping.
+   It would be if the memory was shared.
+     http://stackoverflow.com/questions/307060/what-is-the-purpose-of-allocating-pages-in-the-pagefile-with-createfilemapping  */
+
+/* This is the function to commit memory when the heap allocator
+   claims for new memory.  Before dumping, we allocate space
+   from the fixed size dumped_data[] array.
+*/
+NTSTATUS NTAPI
+dumped_data_commit (PVOID Base, PVOID *CommitAddress, PSIZE_T CommitSize)
 {
-  /* Try to get as much as possible of the address range from the end of
-     the preload heap section up to the usable address limit.  Since GNU
-     malloc can handle gaps in the memory it gets from sbrk, we can
-     simply set the sbrk pointer to the base of the new heap region.  */
-  DWORD_PTR base =
-    ROUND_UP ((RVA_TO_PTR (preload_heap_section->VirtualAddress)
-              + preload_heap_section->Misc.VirtualSize),
-             get_allocation_unit ());
-  DWORD_PTR end  = ((unsigned __int64)1) << VALBITS; /* 256MB */
-  void *ptr = NULL;
-
-  while (!ptr && (base < end))
+  /* This is used before dumping.
+
+     The private heap is stored at dumped_data[] address.
+     We commit contiguous areas of the dumped_data array
+     as requests arrive.  */
+  *CommitAddress = data_region_base + committed;
+  committed += *CommitSize;
+  /* Check that the private heap area does not overlap the big chunks area.  */
+  if (((unsigned char *)(*CommitAddress)) + *CommitSize >= bc_limit)
     {
-#ifdef _WIN64
-      reserved_heap_size = min(end - base, 0x4000000000ull); /* Limit to 256Gb */
-#else
-      reserved_heap_size = end - base;
-#endif
-      ptr = VirtualAlloc ((void *) base,
-                         get_reserved_heap_size (),
-                         MEM_RESERVE,
-                         PAGE_NOACCESS);
-      base += 0x00100000;  /* 1MB increment */
+      fprintf (stderr,
+              "dumped_data_commit: memory exhausted.\nEnlarge dumped_data[]!\n");
+      exit (-1);
     }
-
-  return ptr;
+  return 0;
 }
-#else  /* USE_LSB_TAG */
-static char *
-allocate_heap (void)
+
+/* Heap creation.  */
+
+/* We want to turn on Low Fragmentation Heap for XP and older systems.
+   MinGW32 lacks those definitions.  */
+#ifndef _W64
+typedef enum _HEAP_INFORMATION_CLASS {
+  HeapCompatibilityInformation
+} HEAP_INFORMATION_CLASS;
+
+typedef WINBASEAPI BOOL (WINAPI * HeapSetInformation_Proc)(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
+#endif
+
+void
+init_heap (void)
 {
-#ifdef _WIN64
-  size_t size = 0x4000000000ull; /* start by asking for 32GB */
-#else
-  /* We used to start with 2GB here, but on Windows 7 that would leave
-     too little room in the address space for threads started by
-     Windows on our behalf, e.g. when we pop up the file selection
-     dialog.  */
-  size_t size = 0x68000000; /* start by asking for 1.7GB */
+  if (using_dynamic_heap)
+    {
+      unsigned long enable_lfh = 2;
+
+      /* After dumping, use a new private heap.  We explicitly enable
+         the low fragmentation heap (LFH) here, for the sake of pre
+         Vista versions.  Note: this will harmlessly fail on Vista and
+         later, where the low-fragmentation heap is enabled by
+         default.  It will also fail on pre-Vista versions when Emacs
+         is run under a debugger; set _NO_DEBUG_HEAP=1 in the
+         environment before starting GDB to get low fragmentation heap
+         on XP and older systems, for the price of losing "certain
+         heap debug options"; for the details see
+         http://msdn.microsoft.com/en-us/library/windows/desktop/aa366705%28v=vs.85%29.aspx.  */
+      data_region_end = data_region_base;
+
+      /* Create the private heap.  */
+      heap = HeapCreate (0, 0, 0);
+
+#ifndef _W64
+      /* Set the low-fragmentation heap for OS before Vista.  */
+      HMODULE hm_kernel32dll = LoadLibrary ("kernel32.dll");
+      HeapSetInformation_Proc s_pfn_Heap_Set_Information = (HeapSetInformation_Proc) GetProcAddress (hm_kernel32dll, "HeapSetInformation");
+      if (s_pfn_Heap_Set_Information != NULL)
+       {
+         if (s_pfn_Heap_Set_Information ((PVOID) heap,
+                                         HeapCompatibilityInformation,
+                                         &enable_lfh, sizeof(enable_lfh)) == 0)
+           DebPrint (("Enabling Low Fragmentation Heap failed: error %ld\n",
+                      GetLastError ()));
+       }
 #endif
-  void *ptr = NULL;
 
-  while (!ptr && size > 0x00100000)
+      the_malloc_fn = malloc_after_dump;
+      the_realloc_fn = realloc_after_dump;
+      the_free_fn = free_after_dump;
+    }
+  else
     {
-      reserved_heap_size = size;
-      ptr = VirtualAlloc (NULL,
-                         get_reserved_heap_size (),
-                         MEM_RESERVE,
-                         PAGE_NOACCESS);
-      size -= 0x00800000; /* if failed, decrease request by 8MB */
+      /* Find the RtlCreateHeap function.  Headers for this function
+         are provided with the w32 ddk, but the function is available
+         in ntdll.dll since XP.  */
+      HMODULE hm_ntdll = LoadLibrary ("ntdll.dll");
+      RtlCreateHeap_Proc s_pfn_Rtl_Create_Heap
+       = (RtlCreateHeap_Proc) GetProcAddress (hm_ntdll, "RtlCreateHeap");
+      /* Specific parameters for the private heap.  */
+      RTL_HEAP_PARAMETERS params;
+      ZeroMemory (&params, sizeof(params));
+      params.Length = sizeof(RTL_HEAP_PARAMETERS);
+
+      data_region_base = (unsigned char *)ROUND_UP (dumped_data, 0x1000);
+      data_region_end = bc_limit = dumped_data + DUMPED_HEAP_SIZE;
+
+      params.InitialCommit = committed = 0x1000;
+      params.InitialReserve = sizeof(dumped_data);
+      /* Use our own routine to commit memory from the dumped_data
+         array.  */
+      params.CommitRoutine = &dumped_data_commit;
+
+      /* Create the private heap.  */
+      if (s_pfn_Rtl_Create_Heap == NULL)
+       {
+         fprintf (stderr, "Cannot build Emacs without RtlCreateHeap being available; exiting.\n");
+         exit (-1);
+       }
+      heap = s_pfn_Rtl_Create_Heap (0, data_region_base, 0, 0, NULL, &params);
+      the_malloc_fn = malloc_before_dump;
+      the_realloc_fn = realloc_before_dump;
+      the_free_fn = free_before_dump;
     }
 
-  return ptr;
+  /* Update system version information to match current system.  */
+  cache_system_info ();
 }
-#endif /* USE_LSB_TAG */
 
+#undef malloc
+#undef realloc
+#undef free
+
+/* FREEABLE_P checks if the block can be safely freed.  */
+#define FREEABLE_P(addr)                                        \
+    ((unsigned char *)(addr) < dumped_data                      \
+     || (unsigned char *)(addr) >= dumped_data + DUMPED_HEAP_SIZE)
 
-/* Emulate Unix sbrk.  Note that ralloc.c expects the return value to
-   be the address of the _start_ (not end) of the new block in case of
-   success, and zero (not -1) in case of failure.  */
 void *
-sbrk (ptrdiff_t increment)
+malloc_after_dump (size_t size)
 {
-  void *result;
-  ptrdiff_t size = increment;
+  /* Use the new private heap.  */
+  void *p = HeapAlloc (heap, 0, size);
+
+  /* After dump, keep track of the "brk value" for sbrk(0).  */
+  if (p)
+    {
+      unsigned char *new_brk = (unsigned char *)p + size;
+
+      if (new_brk > data_region_end)
+       data_region_end = new_brk;
+    }
+  else
+    errno = ENOMEM;
+  return p;
+}
 
-  result = data_region_end;
+void *
+malloc_before_dump (size_t size)
+{
+  void *p;
 
-  /* If size is negative, shrink the heap by decommitting pages.  */
-  if (size < 0)
+  /* Before dumping.  The private heap can handle only requests for
+     less than MaxBlockSize.  */
+  if (size < MaxBlockSize)
+    {
+      /* Use the private heap if possible.  */
+      p = HeapAlloc (heap, 0, size);
+      if (!p)
+       errno = ENOMEM;
+    }
+  else
     {
-      ptrdiff_t new_size;
-      unsigned char *new_data_region_end;
-
-      size = -size;
-
-      /* Sanity checks.  */
-      if ((data_region_end - size) < data_region_base)
-       return NULL;
-
-      /* We can only decommit full pages, so allow for
-        partial deallocation [cga].  */
-      new_data_region_end = (data_region_end - size);
-      new_data_region_end = (unsigned char *)
-       ((DWORD_PTR) (new_data_region_end + syspage_mask) & ~syspage_mask);
-      new_size = real_data_region_end - new_data_region_end;
-      real_data_region_end = new_data_region_end;
-      if (new_size > 0)
+      /* Find the first big chunk that can hold the requested size.  */
+      int i = 0;
+
+      for (i = 0; i < blocks_number; i++)
+       {
+         if (blocks[i].occupied == 0 && blocks[i].size >= size)
+           break;
+       }
+      if (i < blocks_number)
        {
-         /* Decommit size bytes from the end of the heap.  */
-         if (using_dynamic_heap
-             && !VirtualFree (real_data_region_end, new_size, MEM_DECOMMIT))
-           return NULL;
-       }
+         /* If found, use it.  */
+         p = blocks[i].address;
+         blocks[i].occupied = TRUE;
+       }
+      else
+       {
+         /* Allocate a new big chunk from the end of the dumped_data
+            array.  */
+         if (blocks_number >= MAX_BLOCKS)
+           {
+             fprintf (stderr,
+                      "malloc_before_dump: no more big chunks available.\nEnlarge MAX_BLOCKS!\n");
+             exit (-1);
+           }
+         bc_limit -= size;
+         bc_limit = (unsigned char *)ROUND_DOWN (bc_limit, 0x10);
+         p = bc_limit;
+         blocks[blocks_number].address = p;
+         blocks[blocks_number].size = size;
+         blocks[blocks_number].occupied = TRUE;
+         blocks_number++;
+         /* Check that areas do not overlap.  */
+         if (bc_limit < dumped_data + committed)
+           {
+             fprintf (stderr,
+                      "malloc_before_dump: memory exhausted.\nEnlarge dumped_data[]!\n");
+             exit (-1);
+           }
+       }
+    }
+  return p;
+}
 
-      data_region_end -= size;
+/* Re-allocate the previously allocated block in ptr, making the new
+   block SIZE bytes long.  */
+void *
+realloc_after_dump (void *ptr, size_t size)
+{
+  void *p;
+
+  /* After dumping.  */
+  if (FREEABLE_P (ptr))
+    {
+      /* Reallocate the block since it lies in the new heap.  */
+      p = HeapReAlloc (heap, 0, ptr, size);
+      if (!p)
+       errno = ENOMEM;
     }
-  /* If size is positive, grow the heap by committing reserved pages.  */
-  else if (size > 0)
+  else
     {
-      /* Sanity checks.  */
-      if ((data_region_end + size) >
-         (data_region_base + get_reserved_heap_size ()))
-       return NULL;
-
-      /* Commit more of our heap. */
-      if (using_dynamic_heap
-         && VirtualAlloc (data_region_end, size, MEM_COMMIT,
-                          PAGE_READWRITE) == NULL)
-       return NULL;
-      data_region_end += size;
-
-      /* We really only commit full pages, so record where
-        the real end of committed memory is [cga].  */
-      real_data_region_end = (unsigned char *)
-         ((DWORD_PTR) (data_region_end + syspage_mask) & ~syspage_mask);
+      /* If the block lies in the dumped data, do not free it.  Only
+         allocate a new one.  */
+      p = HeapAlloc (heap, 0, size);
+      if (p)
+       CopyMemory (p, ptr, size);
+      else
+       errno = ENOMEM;
     }
+  /* After dump, keep track of the "brk value" for sbrk(0).  */
+  if (p)
+    {
+      unsigned char *new_brk = (unsigned char *)p + size;
 
-  return result;
+      if (new_brk > data_region_end)
+       data_region_end = new_brk;
+    }
+  return p;
 }
 
-/* Initialize the internal heap variables used by sbrk.  When running in
-   preload phase (ie. in the undumped executable), we rely entirely on a
-   fixed size heap section included in the .exe itself; this is
-   preserved during dumping, and truncated to the size actually used.
-
-   When running in the dumped executable, we reserve as much as possible
-   of the address range that is addressable by Lisp object pointers, to
-   supplement what is left of the preload heap.  Although we cannot rely
-   on the dynamically allocated arena being contiguous with the static
-   heap area, it is not a problem because sbrk can pretend that the gap
-   was allocated by something else; GNU malloc detects when there is a
-   jump in the sbrk values, and starts a new heap block.  */
-void
-init_heap (void)
+void *
+realloc_before_dump (void *ptr, size_t size)
 {
-  PIMAGE_DOS_HEADER dos_header;
-  PIMAGE_NT_HEADERS nt_header;
-
-  dos_header = (PIMAGE_DOS_HEADER) RVA_TO_PTR (0);
-  nt_header = (PIMAGE_NT_HEADERS) (((DWORD_PTR) dos_header) +
-                                  dos_header->e_lfanew);
-  preload_heap_section = find_section ("EMHEAP", nt_header);
+  void *p;
 
-  if (using_dynamic_heap)
+  /* Before dumping.  */
+  if (dumped_data < (unsigned char *)ptr
+      && (unsigned char *)ptr < bc_limit && size <= MaxBlockSize)
     {
-      data_region_base = allocate_heap ();
-      if (!data_region_base)
+      p = HeapReAlloc (heap, 0, ptr, size);
+      if (!p)
+       errno = ENOMEM;
+    }
+  else
+    {
+      /* In this case, either the new block is too large for the heap,
+         or the old block was already too large.  In both cases,
+         malloc_before_dump() and free_before_dump() will take care of
+         reallocation.  */
+      p = malloc_before_dump (size);
+      /* If SIZE is below MaxBlockSize, malloc_before_dump will try to
+        allocate it in the fixed heap.  If that fails, we could have
+        kept the block in its original place, above bc_limit, instead
+        of failing the call as below.  But this doesn't seem to be
+        worth the added complexity, as loadup allocates only a very
+        small number of large blocks, and never reallocates them.  */
+      if (p)
        {
-         printf ("Error: Could not reserve dynamic heap area.\n");
-         exit (1);
+         CopyMemory (p, ptr, size);
+         free_before_dump (ptr);
        }
+    }
+  return p;
+}
 
-#if !USE_LSB_TAG
-      /* Ensure that the addresses don't use the upper tag bits since
-        the Lisp type goes there.  */
-      if (((DWORD_PTR) data_region_base & ~VALMASK) != 0)
+/* Free a block allocated by `malloc', `realloc' or `calloc'.  */
+void
+free_after_dump (void *ptr)
+{
+  /* After dumping.  */
+  if (FREEABLE_P (ptr))
+    {
+      /* Free the block if it is in the new private heap.  */
+      HeapFree (heap, 0, ptr);
+    }
+}
+
+void
+free_before_dump (void *ptr)
+{
+  /* Before dumping.  */
+  if (dumped_data < (unsigned char *)ptr
+      && (unsigned char *)ptr < bc_limit)
+    {
+      /* Free the block if it is allocated in the private heap.  */
+      HeapFree (heap, 0, ptr);
+    }
+  else
+    {
+      /* Look for the big chunk.  */
+      int i;
+
+      for (i = 0; i < blocks_number; i++)
        {
-         printf ("Error: The heap was allocated in upper memory.\n");
-         exit (1);
+         if (blocks[i].address == ptr)
+           {
+             /* Reset block occupation if found.  */
+             blocks[i].occupied = 0;
+             break;
+           }
+         /* What if the block is not found?  We should trigger an
+            error here.  */
+         eassert (i < blocks_number);
        }
+    }
+}
+
+#ifdef ENABLE_CHECKING
+void
+report_temacs_memory_usage (void)
+{
+  DWORD blocks_used = 0;
+  size_t large_mem_used = 0;
+  int i;
+
+  for (i = 0; i < blocks_number; i++)
+    if (blocks[i].occupied)
+      {
+       blocks_used++;
+       large_mem_used += blocks[i].size;
+      }
+
+  /* Emulate 'message', which writes to stderr in non-interactive
+     sessions.  */
+  fprintf (stderr,
+          "Dump memory usage: Heap: %" PRIu64 "  Large blocks(%lu/%lu): %" PRIu64 "/%" PRIu64 "\n",
+          (unsigned long long)committed, blocks_used, blocks_number,
+          (unsigned long long)large_mem_used,
+          (unsigned long long)(dumped_data + DUMPED_HEAP_SIZE - bc_limit));
+}
 #endif
-      data_region_end = data_region_base;
-      real_data_region_end = data_region_end;
+
+/* Emulate getpagesize. */
+int
+getpagesize (void)
+{
+  return sysinfo_cache.dwPageSize;
+}
+
+void *
+sbrk (ptrdiff_t increment)
+{
+  /* data_region_end is the address beyond the last allocated byte.
+     The sbrk() function is not emulated at all, except for a 0 value
+     of its parameter.  This is needed by the Emacs Lisp function
+     `memory-limit'.  */
+  eassert (increment == 0);
+  return data_region_end;
+}
+
+#define MAX_BUFFER_SIZE (512 * 1024 * 1024)
+
+/* MMAP allocation for buffers.  */
+void *
+mmap_alloc (void **var, size_t nbytes)
+{
+  void *p = NULL;
+
+  /* We implement amortized allocation.  We start by reserving twice
+     the size requested and commit only the size requested.  Then
+     realloc could proceed and use the reserved pages, reallocating
+     only if needed.  Buffer shrink would happen only so that we stay
+     in the 2x range.  This is a big win when visiting compressed
+     files, where the final size of the buffer is not known in
+     advance, and the buffer is enlarged several times as the data is
+     decompressed on the fly.  */
+  if (nbytes < MAX_BUFFER_SIZE)
+    p = VirtualAlloc (NULL, (nbytes * 2), MEM_RESERVE, PAGE_READWRITE);
+
+  /* If it fails, or if the request is above 512MB, try with the
+     requested size.  */
+  if (p == NULL)
+    p = VirtualAlloc (NULL, nbytes, MEM_RESERVE, PAGE_READWRITE);
+
+  if (p != NULL)
+    {
+      /* Now, commit pages for NBYTES.  */
+      *var = VirtualAlloc (p, nbytes, MEM_COMMIT, PAGE_READWRITE);
     }
-  else
+
+  if (!p)
     {
-      data_region_base = RVA_TO_PTR (preload_heap_section->VirtualAddress);
-      data_region_end = data_region_base;
-      real_data_region_end = data_region_end;
-      reserved_heap_size = preload_heap_section->Misc.VirtualSize;
+      if (GetLastError () == ERROR_NOT_ENOUGH_MEMORY)
+       errno = ENOMEM;
+      else
+       {
+         DebPrint (("mmap_alloc: error %ld\n", GetLastError ()));
+         errno = EINVAL;
+       }
     }
 
-  /* Update system version information to match current system.  */
-  cache_system_info ();
+  return *var = p;
 }
 
-/* Round the heap up to the given alignment.  */
 void
-round_heap (size_t align)
+mmap_free (void **var)
 {
-  DWORD_PTR needs_to_be;
-  DWORD_PTR need_to_alloc;
+  if (*var)
+    {
+      if (VirtualFree (*var, 0, MEM_RELEASE) == 0)
+        DebPrint (("mmap_free: error %ld\n", GetLastError ()));
+      *var = NULL;
+    }
+}
+
+void *
+mmap_realloc (void **var, size_t nbytes)
+{
+  MEMORY_BASIC_INFORMATION memInfo, m2;
+
+  if (*var == NULL)
+    return mmap_alloc (var, nbytes);
+
+  /* This case happens in init_buffer().  */
+  if (nbytes == 0)
+    {
+      mmap_free (var);
+      return mmap_alloc (var, nbytes);
+    }
 
-  needs_to_be = (DWORD_PTR) ROUND_UP (get_heap_end (), align);
-  need_to_alloc = needs_to_be - (DWORD_PTR) get_heap_end ();
+  if (VirtualQuery (*var, &memInfo, sizeof (memInfo)) == 0)
+    DebPrint (("mmap_realloc: VirtualQuery error = %ld\n", GetLastError ()));
+
+  /* We need to enlarge the block.  */
+  if (memInfo.RegionSize < nbytes)
+    {
+      if (VirtualQuery (*var + memInfo.RegionSize, &m2, sizeof(m2)) == 0)
+        DebPrint (("mmap_realloc: VirtualQuery error = %ld\n",
+                  GetLastError ()));
+      /* If there is enough room in the current reserved area, then
+        commit more pages as needed.  */
+      if (m2.State == MEM_RESERVE
+         && nbytes <= memInfo.RegionSize + m2.RegionSize)
+       {
+         void *p;
+
+         p = VirtualAlloc (*var + memInfo.RegionSize,
+                           nbytes - memInfo.RegionSize,
+                           MEM_COMMIT, PAGE_READWRITE);
+         if (!p /* && GetLastError() != ERROR_NOT_ENOUGH_MEMORY */)
+           {
+             DebPrint (("realloc enlarge: VirtualAlloc error %ld\n",
+                        GetLastError ()));
+             errno = ENOMEM;
+           }
+         return *var;
+       }
+      else
+       {
+         /* Else we must actually enlarge the block by allocating a
+            new one and copying previous contents from the old to the
+            new one.  */
+         void *old_ptr = *var;
+
+         if (mmap_alloc (var, nbytes))
+           {
+             CopyMemory (*var, old_ptr, memInfo.RegionSize);
+             mmap_free (&old_ptr);
+             return *var;
+           }
+         else
+           {
+             /* We failed to enlarge the buffer.  */
+             *var = old_ptr;
+             return NULL;
+           }
+       }
+    }
+
+  /* If we are shrinking by more than one page...  */
+  if (memInfo.RegionSize  > nbytes + getpagesize())
+    {
+      /* If we are shrinking a lot...  */
+      if ((memInfo.RegionSize / 2) > nbytes)
+        {
+          /* Let's give some memory back to the system and release
+            some pages.  */
+          void *old_ptr = *var;
+
+         if (mmap_alloc (var, nbytes))
+            {
+              CopyMemory (*var, old_ptr, nbytes);
+              mmap_free (&old_ptr);
+              return *var;
+            }
+          else
+           {
+             /* In case we fail to shrink, try to go on with the old block.
+                But that means there is a lot of memory pressure.
+                We could also decommit pages.  */
+             *var = old_ptr;
+             return *var;
+           }
+        }
+
+      /* We still can decommit pages.  */
+      if (VirtualFree (*var + nbytes + get_page_size(),
+                      memInfo.RegionSize - nbytes - get_page_size(),
+                      MEM_DECOMMIT) == 0)
+        DebPrint (("mmap_realloc: VirtualFree error %ld\n", GetLastError ()));
+      return *var;
+    }
 
-  if (need_to_alloc)
-    sbrk (need_to_alloc);
+  /* Not enlarging, not shrinking by more than one page.  */
+  return *var;
 }
index d5791a3a23c636d18090ca0ea50dec07641c848f..787fe9ade5f1324cb41262b6cc0dab5ba63e6fd8 100644 (file)
@@ -27,15 +27,17 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 /*
  * Heap related stuff.
  */
-#define get_reserved_heap_size()       reserved_heap_size
-#define get_committed_heap_size()      (get_data_end () - get_data_start ())
-#define get_heap_start()               get_data_start ()
-#define get_heap_end()                 get_data_end ()
 
 extern unsigned char *get_data_start (void);
 extern unsigned char *get_data_end (void);
 extern size_t         reserved_heap_size;
-extern BOOL          using_dynamic_heap;
+extern BOOL           using_dynamic_heap;
+
+extern void *mmap_realloc (void **, size_t);
+extern void  mmap_free (void **);
+extern void *mmap_alloc (void **, size_t);
+
+extern void report_temacs_memory_usage (void);
 
 /* Emulation of Unix sbrk().  */
 extern void *sbrk (ptrdiff_t size);
@@ -43,11 +45,8 @@ extern void *sbrk (ptrdiff_t size);
 /* Initialize heap structures for sbrk on startup.  */
 extern void init_heap (void);
 
-/* Round the heap to this size.  */
-extern void round_heap (size_t size);
-
 /* ----------------------------------------------------------------- */
-/* Useful routines for manipulating memory-mapped files. */
+/* Useful routines for manipulating memory-mapped files.  */
 
 typedef struct file_data {
     char          *name;
@@ -61,11 +60,11 @@ int open_input_file (file_data *p_file, char *name);
 int open_output_file (file_data *p_file, char *name, unsigned long size);
 void close_file_data (file_data *p_file);
 
-/* Return pointer to section header for named section. */
+/* Return pointer to section header for named section.  */
 IMAGE_SECTION_HEADER * find_section (char * name, IMAGE_NT_HEADERS * nt_header);
 
 /* Return pointer to section header for section containing the given
-   relative virtual address. */
+   relative virtual address.  */
 IMAGE_SECTION_HEADER * rva_to_section (DWORD_PTR rva, IMAGE_NT_HEADERS * nt_header);
 
 #endif /* NTHEAP_H_ */
index 50538c5b4ba4baa892fcad8564d312ace50c05c2..ccb5a900a16d33f26d016b9040a93a08ffd47320 100644 (file)
@@ -587,7 +587,8 @@ resize_event (WINDOW_BUFFER_SIZE_RECORD *event)
 {
   struct frame *f = get_frame ();
 
-  change_frame_size (f, event->dwSize.X, event->dwSize.Y, 0, 1, 0, 0);
+  change_frame_size (f, event->dwSize.X, event->dwSize.Y
+                    - FRAME_MENU_BAR_LINES (f), 0, 1, 0, 0);
   SET_FRAME_GARBAGED (f);
 }
 
@@ -603,8 +604,8 @@ maybe_generate_resize_event (void)
      if the size hasn't actually changed.  */
   change_frame_size (f,
                     1 + info.srWindow.Right - info.srWindow.Left,
-                    1 + info.srWindow.Bottom - info.srWindow.Top,
-                    0, 0, 0, 0);
+                    1 + info.srWindow.Bottom - info.srWindow.Top
+                    - FRAME_MENU_BAR_LINES (f), 0, 0, 0, 0);
 }
 
 #if HAVE_W32NOTIFY
index a4acdfd9e91b140b62a0dfe458cbad89a49f5bcc..9f777167bf07298a76acda014d1639ba383b236c 100644 (file)
@@ -103,7 +103,7 @@ Lisp_Object Qdebug_on_next_call, Qunsupported__w32_dialog;
 void set_frame_menubar (struct frame *, bool, bool);
 
 #ifdef HAVE_DIALOGS
-static Lisp_Object w32_dialog_show (struct frame *, int, Lisp_Object, char**);
+static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **);
 #else
 static int is_simple_dialog (Lisp_Object);
 static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object);
@@ -141,7 +141,7 @@ w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
 
       /* Display them in a dialog box.  */
       block_input ();
-      selection = w32_dialog_show (f, 0, title, header, &error_name);
+      selection = w32_dialog_show (f, title, header, &error_name);
       unblock_input ();
 
       discard_menu_items ();
@@ -376,12 +376,8 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
       /* Convert menu_items into widget_value trees
         to display the menu.  This cannot evaluate Lisp code.  */
 
-      wv = xmalloc_widget_value ();
-      wv->name = "menubar";
-      wv->value = 0;
-      wv->enabled = 1;
+      wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
-      wv->help = Qnil;
       first_wv = wv;
 
       for (i = 0; i < last_i; i += 4)
@@ -444,12 +440,8 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
       /* Make a widget-value tree containing
         just the top level menu bar strings.  */
 
-      wv = xmalloc_widget_value ();
-      wv->name = "menubar";
-      wv->value = 0;
-      wv->enabled = 1;
+      wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
-      wv->help = Qnil;
       first_wv = wv;
 
       items = FRAME_MENU_BAR_ITEMS (f);
@@ -461,12 +453,8 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
          if (NILP (string))
            break;
 
-         wv = xmalloc_widget_value ();
-         wv->name = SSDATA (string);
-         wv->value = 0;
-         wv->enabled = 1;
+         wv = make_widget_value (SSDATA (string), NULL, true, Qnil);
          wv->button_type = BUTTON_TYPE_NONE;
-         wv->help = Qnil;
          /* This prevents lwlib from assuming this
             menu item is really supposed to be empty.  */
          /* The EMACS_INT cast avoids a warning.
@@ -515,7 +503,8 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
     /* Force the window size to be recomputed so that the frame's text
        area remains the same, if menubar has just been created.  */
     if (old_widget == NULL)
-      x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+      adjust_frame_size (f, FRAME_TEXT_WIDTH (f),
+                        FRAME_TEXT_HEIGHT (f), 2, 0);
   }
 
   unblock_input ();
@@ -561,8 +550,9 @@ free_frame_menubar (struct frame *f)
 /* F is the frame the menu is for.
    X and Y are the frame-relative specified position,
    relative to the inside upper left corner of the frame F.
-   FOR_CLICK is nonzero if this menu was invoked for a mouse click.
-   KEYMAPS is 1 if this menu was specified with keymaps;
+   Bitfield MENUFLAGS bits are:
+   MENU_FOR_CLICK is set if this menu was invoked for a mouse click.
+   MENU_KEYMAPS is set if this menu was specified with keymaps;
     in that case, we return a list containing the chosen item's value
     and perhaps also the pane's prefix.
    TITLE is the specified menu title.
@@ -570,7 +560,7 @@ free_frame_menubar (struct frame *f)
    (We return nil on failure, but the value doesn't actually matter.)  */
 
 Lisp_Object
-w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
+w32_menu_show (struct frame *f, int x, int y, int menuflags,
               Lisp_Object title, const char **error)
 {
   int i;
@@ -600,12 +590,8 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
 
   /* Create a tree of widget_value objects
      representing the panes and their items.  */
-  wv = xmalloc_widget_value ();
-  wv->name = "menu";
-  wv->value = 0;
-  wv->enabled = 1;
+  wv = make_widget_value ("menu", NULL, true, Qnil);
   wv->button_type = BUTTON_TYPE_NONE;
-  wv->help = Qnil;
   first_wv = wv;
   first_pane = 1;
 
@@ -663,20 +649,16 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
          /* If the pane has a meaningful name,
             make the pane a top-level menu item
             with its items as a submenu beneath it.  */
-         if (!keymaps && strcmp (pane_string, ""))
+         if (!(menuflags & MENU_KEYMAPS) && strcmp (pane_string, ""))
            {
-             wv = xmalloc_widget_value ();
+             wv = make_widget_value (pane_string, NULL, true, Qnil);
              if (save_wv)
                save_wv->next = wv;
              else
                first_wv->contents = wv;
-             wv->name = pane_string;
-             if (keymaps && !NILP (prefix))
+             if ((menuflags & MENU_KEYMAPS) && !NILP (prefix))
                wv->name++;
-             wv->value = 0;
-             wv->enabled = 1;
              wv->button_type = BUTTON_TYPE_NONE;
-             wv->help = Qnil;
              save_wv = wv;
              prev_wv = 0;
            }
@@ -717,19 +699,17 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
              ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip);
            }
 
-         wv = xmalloc_widget_value ();
+         wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enable),
+                                 STRINGP (help) ? help : Qnil);
          if (prev_wv)
            prev_wv->next = wv;
          else
            save_wv->contents = wv;
-         wv->name = SSDATA (item_name);
          if (!NILP (descrip))
            wv->key = SSDATA (descrip);
-         wv->value = 0;
          /* Use the contents index as call_data, since we are
              restricted to 16-bits.  */
          wv->call_data = !NILP (def) ? (void *) (EMACS_INT) i : 0;
-         wv->enabled = !NILP (enable);
 
          if (NILP (type))
            wv->button_type = BUTTON_TYPE_NONE;
@@ -742,11 +722,6 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
 
          wv->selected = !NILP (selected);
 
-          if (!STRINGP (help))
-           help = Qnil;
-
-         wv->help = help;
-
          prev_wv = wv;
 
          i += MENU_ITEMS_ITEM_LENGTH;
@@ -756,25 +731,21 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
   /* Deal with the title, if it is non-nil.  */
   if (!NILP (title))
     {
-      widget_value *wv_title = xmalloc_widget_value ();
-      widget_value *wv_sep = xmalloc_widget_value ();
+      widget_value *wv_title;
+      widget_value *wv_sep = make_widget_value ("--", NULL, false, Qnil);
 
       /* Maybe replace this separator with a bitmap or owner-draw item
         so that it looks better.  Having two separators looks odd.  */
-      wv_sep->name = "--";
       wv_sep->next = first_wv->contents;
-      wv_sep->help = Qnil;
 
       if (unicode_append_menu)
        title = ENCODE_UTF_8 (title);
       else if (STRING_MULTIBYTE (title))
        title = ENCODE_SYSTEM (title);
 
-      wv_title->name = SSDATA (title);
-      wv_title->enabled = TRUE;
+      wv_title = make_widget_value (SSDATA (title), NULL, true, Qnil);
       wv_title->title = TRUE;
       wv_title->button_type = BUTTON_TYPE_NONE;
-      wv_title->help = Qnil;
       wv_title->next = wv_sep;
       first_wv->contents = wv_title;
     }
@@ -842,10 +813,10 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
            i += 1;
          else
            {
-             entry     = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
+             entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
              if (menu_item_selection == i)
                {
-                 if (keymaps != 0)
+                 if (menuflags & MENU_KEYMAPS)
                    {
                      int j;
 
@@ -863,7 +834,7 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
            }
        }
     }
-  else if (!for_click)
+  else if (!(menuflags & MENU_FOR_CLICK))
     {
       unblock_input ();
       /* Make "Cancel" equivalent to C-g.  */
@@ -904,9 +875,8 @@ static char * button_names [] = {
   "button6", "button7", "button8", "button9", "button10" };
 
 static Lisp_Object
-w32_dialog_show (struct frame *f, int keymaps,
-                Lisp_Object title, Lisp_Object header,
-                char **error)
+w32_dialog_show (struct frame *f, Lisp_Object title,
+                Lisp_Object header, char **error)
 {
   int i, nb_buttons = 0;
   char dialog_name[6];
@@ -930,19 +900,12 @@ w32_dialog_show (struct frame *f, int keymaps,
   /* Create a tree of widget_value objects
      representing the text label and buttons.  */
   {
-    Lisp_Object pane_name, prefix;
+    Lisp_Object pane_name;
     char *pane_string;
     pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME);
-    prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX);
     pane_string = (NILP (pane_name)
                   ? "" : SSDATA (pane_name));
-    prev_wv = xmalloc_widget_value ();
-    prev_wv->value = pane_string;
-    if (keymaps && !NILP (prefix))
-      prev_wv->name++;
-    prev_wv->enabled = 1;
-    prev_wv->name = "message";
-    prev_wv->help = Qnil;
+    prev_wv = make_widget_value ("message", pane_string, true, Qnil);
     first_wv = prev_wv;
 
     /* Loop over all panes and items, filling in the tree.  */
@@ -979,15 +942,13 @@ w32_dialog_show (struct frame *f, int keymaps,
            return Qnil;
          }
 
-       wv = xmalloc_widget_value ();
+       wv = make_widget_value (button_names[nb_buttons],
+                               SSDATA (item_name),
+                               !NILP (enable), Qnil);
        prev_wv->next = wv;
-       wv->name = (char *) button_names[nb_buttons];
        if (!NILP (descrip))
          wv->key = SSDATA (descrip);
-       wv->value = SSDATA (item_name);
        wv->call_data = aref_addr (menu_items, i);
-       wv->enabled = !NILP (enable);
-       wv->help = Qnil;
        prev_wv = wv;
 
        if (! boundary_seen)
@@ -1002,9 +963,7 @@ w32_dialog_show (struct frame *f, int keymaps,
     if (! boundary_seen)
       left_count = nb_buttons - nb_buttons / 2;
 
-    wv = xmalloc_widget_value ();
-    wv->name = dialog_name;
-    wv->help = Qnil;
+    wv = make_widget_value (dialog_name, NULL, false, Qnil);
 
     /*  Frame title: 'Q' = Question, 'I' = Information.
         Can also have 'E' = Error if, one day, we want
@@ -1052,32 +1011,18 @@ w32_dialog_show (struct frame *f, int keymaps,
      the proper value.  */
   if (menu_item_selection != 0)
     {
-      Lisp_Object prefix;
-
-      prefix = Qnil;
       i = 0;
       while (i < menu_items_used)
        {
          Lisp_Object entry;
 
          if (EQ (AREF (menu_items, i), Qt))
-           {
-             prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
-             i += MENU_ITEMS_PANE_LENGTH;
-           }
+           i += MENU_ITEMS_PANE_LENGTH;
          else
            {
-             entry     = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
+             entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
              if (menu_item_selection == i)
-               {
-                 if (keymaps != 0)
-                   {
-                     entry = Fcons (entry, Qnil);
-                     if (!NILP (prefix))
-                       entry = Fcons (prefix, entry);
-                   }
-                 return entry;
-               }
+               return entry;
              i += MENU_ITEMS_ITEM_LENGTH;
            }
        }
index 7155f16f3b0795cf52d696d8678364dea8aac305..86412b8a97439afad8447c912248e3494884f820 100644 (file)
@@ -247,7 +247,6 @@ watch_worker (LPVOID arg)
 
   do {
     BOOL status;
-    DWORD sleep_result;
     DWORD bytes_ret = 0;
 
     if (dirwatch->dir)
@@ -275,7 +274,7 @@ watch_worker (LPVOID arg)
     /* Sleep indefinitely until awoken by the I/O completion, which
        could be either a change notification or a cancellation of the
        watch.  */
-    sleep_result = SleepEx (INFINITE, TRUE);
+    SleepEx (INFINITE, TRUE);
   } while (!dirwatch->terminate);
 
   return 0;
@@ -287,7 +286,6 @@ static struct notification *
 start_watching (const char *file, HANDLE hdir, BOOL subdirs, DWORD flags)
 {
   struct notification *dirwatch = xzalloc (sizeof (struct notification));
-  HANDLE thr;
 
   dirwatch->signature = DIRWATCH_SIGNATURE;
   dirwatch->buf = xmalloc (16384);
index 96f116578923d5820248469bec7dfd7d550365ff..426a656f5666016d6b6608453663edb40df57f2e 100644 (file)
@@ -1772,12 +1772,12 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
       if (need_quotes)
        {
          int escape_char_run = 0;
-         char * first;
-         char * last;
+         /* char * first; */
+         /* char * last; */
 
          p = *targ;
-         first = p;
-         last = p + strlen (p) - 1;
+         /* first = p; */
+         /* last = p + strlen (p) - 1; */
          *parg++ = '"';
 #if 0
          /* This version does not escape quotes if they occur at the
@@ -2249,10 +2249,9 @@ static BOOL CALLBACK
 find_child_console (HWND hwnd, LPARAM arg)
 {
   child_process * cp = (child_process *) arg;
-  DWORD thread_id;
   DWORD process_id;
 
-  thread_id = GetWindowThreadProcessId (hwnd, &process_id);
+  GetWindowThreadProcessId (hwnd, &process_id);
   if (process_id == cp->procinfo.dwProcessId)
     {
       char window_class[32];
index 2781fb63d6266fa1ffcd7bd92931444bb590c611..dfda29fb903993fff5f4beacfa98ef0a167e8fbc 100644 (file)
@@ -50,6 +50,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "process.h"
 #include "atimer.h"
 #include "keymap.h"
+#include "menu.h"
 
 #ifdef WINDOWSNT
 #include "w32.h"       /* for filename_from_utf16, filename_from_ansi */
@@ -157,8 +158,11 @@ DWORD dwMainThreadId = 0;
 HANDLE hMainThread = NULL;
 
 int vertical_scroll_bar_min_handle;
+int horizontal_scroll_bar_min_handle;
 int vertical_scroll_bar_top_border;
 int vertical_scroll_bar_bottom_border;
+int horizontal_scroll_bar_left_border;
+int horizontal_scroll_bar_right_border;
 
 int last_scroll_bar_drag_pos;
 
@@ -454,7 +458,7 @@ x_set_frame_alpha (struct frame *f)
   if (!pfnSetLayeredWindowAttributes)
     return;
 
-  if (dpyinfo->x_highlight_frame == f)
+  if (dpyinfo->w32_focus_frame == f)
     alpha = f->alpha[0];
   else
     alpha = f->alpha[1];
@@ -999,7 +1003,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
   else
     face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil);
   s->face = FACE_FROM_ID (s->f, face_id);
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   /* If font in this face is same as S->font, use it.  */
   if (s->font == s->face->font)
@@ -1049,7 +1053,7 @@ x_set_mode_line_face_gc (struct glyph_string *s)
 static inline void
 x_set_glyph_string_gc (struct glyph_string *s)
 {
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   if (s->hl == DRAW_NORMAL_TEXT)
     {
@@ -1078,10 +1082,7 @@ x_set_glyph_string_gc (struct glyph_string *s)
       s->stippled_p = s->face->stipple != 0;
     }
   else
-    {
-      s->gc = s->face->gc;
-      s->stippled_p = s->face->stipple != 0;
-    }
+    emacs_abort ();
 
   /* GC must have been set.  */
   eassert (s->gc != 0);
@@ -3339,11 +3340,15 @@ note_mouse_movement (struct frame *frame, MSG *msg)
                              Mouse Face
  ************************************************************************/
 
-static struct scroll_bar *x_window_to_scroll_bar (Window);
+static struct scroll_bar *x_window_to_scroll_bar (Window, int);
 static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *,
                                        enum scroll_bar_part *,
                                        Lisp_Object *, Lisp_Object *,
                                        unsigned long *);
+static void x_horizontal_scroll_bar_report_motion (struct frame **, Lisp_Object *,
+                                                  enum scroll_bar_part *,
+                                                  Lisp_Object *, Lisp_Object *,
+                                                  unsigned long *);
 static void x_check_fullscreen (struct frame *);
 
 static void
@@ -3351,6 +3356,7 @@ w32_define_cursor (Window window, Cursor cursor)
 {
   PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
 }
+
 /* Return the current position of the mouse.
    *fp should be a frame which indicates which display to ask about.
 
@@ -3382,7 +3388,14 @@ w32_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
   block_input ();
 
   if (dpyinfo->last_mouse_scroll_bar && insist == 0)
-    x_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
+    {
+      struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar;
+
+      if (bar->horizontal)
+       x_horizontal_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
+      else
+       x_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
+    }
   else
     {
       POINT pt;
@@ -3410,7 +3423,7 @@ w32_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
        if (! f1)
          {
            struct scroll_bar *bar
-              = x_window_to_scroll_bar (WindowFromPoint (pt));
+              = x_window_to_scroll_bar (WindowFromPoint (pt), 2);
 
            if (bar)
              f1 = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
@@ -3477,12 +3490,12 @@ w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
 
 /* Scroll bar support.  */
 
-/* Given a window ID, find the struct scroll_bar which manages it.
-   This can be called in GC, so we have to make sure to strip off mark
-   bits.  */
+/* Given a window ID, find the struct scroll_bar which manages it
+   vertically.  This can be called in GC, so we have to make sure to
+   strip off mark bits.  */
 
 static struct scroll_bar *
-x_window_to_scroll_bar (Window window_id)
+x_window_to_scroll_bar (Window window_id, int type)
 {
   Lisp_Object tail, frame;
 
@@ -3500,7 +3513,10 @@ x_window_to_scroll_bar (Window window_id)
                               condemned = Qnil,
                               ! NILP (bar));
           bar = XSCROLL_BAR (bar)->next)
-       if (SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar)) == window_id)
+       if (SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar)) == window_id
+           && (type = 2
+               || (type == 1 && XSCROLL_BAR (bar)->horizontal)
+               || (type == 0 && !XSCROLL_BAR (bar)->horizontal)))
          return XSCROLL_BAR (bar);
     }
 
@@ -3509,7 +3525,7 @@ x_window_to_scroll_bar (Window window_id)
 
 
 \f
-/* Set the thumb size and position of scroll bar BAR.  We are currently
+/* Set the thumb size and position of vertical scroll bar BAR.  We are currently
    displaying PORTION out of a whole WHOLE, and our position POSITION.  */
 
 static void
@@ -3583,16 +3599,49 @@ w32_set_scroll_bar_thumb (struct scroll_bar *bar,
   unblock_input ();
 }
 
+/* Set the thumb size and position of horizontal scroll bar BAR.  We are currently
+   displaying PORTION out of a whole WHOLE, and our position POSITION.  */
+
+static void
+w32_set_horizontal_scroll_bar_thumb (struct scroll_bar *bar,
+                                    int portion, int position, int whole)
+{
+  Window w = SCROLL_BAR_W32_WINDOW (bar);
+  SCROLLINFO si;
+
+  block_input ();
+
+  si.cbSize = sizeof (si);
+  si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
+  si.nMin = 0;
+  si.nMax = whole;
+  /* Allow nPage to be one larger than nPos so we don't allow to scroll
+     an already fully visible buffer.  */
+  si.nPage = min (portion, si.nMax) + 1;
+  si.nPos = min (position, si.nMax);
+  SetScrollInfo (w, SB_CTL, &si, TRUE);
+
+  unblock_input ();
+}
+
 \f
 /************************************************************************
                         Scroll bars, general
  ************************************************************************/
 
 static HWND
-my_create_scrollbar (struct frame * f, struct scroll_bar * bar)
+my_create_vscrollbar (struct frame * f, struct scroll_bar * bar)
 {
   return (HWND) SendMessage (FRAME_W32_WINDOW (f),
-                            WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
+                            WM_EMACS_CREATEVSCROLLBAR, (WPARAM) f,
+                            (LPARAM) bar);
+}
+
+static HWND
+my_create_hscrollbar (struct frame * f, struct scroll_bar * bar)
+{
+  return (HWND) SendMessage (FRAME_W32_WINDOW (f),
+                            WM_EMACS_CREATEHSCROLLBAR, (WPARAM) f,
                             (LPARAM) bar);
 }
 
@@ -3662,7 +3711,7 @@ my_bring_window_to_top (HWND hwnd)
    scroll bar. */
 
 static struct scroll_bar *
-x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
+x_scroll_bar_create (struct window *w, int left, int top, int width, int height, bool horizontal)
 {
   struct frame *f = XFRAME (WINDOW_FRAME (w));
   HWND hwnd;
@@ -3681,16 +3730,24 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
   bar->start = 0;
   bar->end = 0;
   bar->dragging = 0;
+  bar->horizontal = horizontal;
 
   /* Requires geometry to be set before call to create the real window */
 
-  hwnd = my_create_scrollbar (f, bar);
+  if (horizontal)
+    hwnd = my_create_hscrollbar (f, bar);
+  else
+    hwnd = my_create_vscrollbar (f, bar);
 
   si.cbSize = sizeof (si);
   si.fMask = SIF_ALL;
   si.nMin = 0;
-  si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height)
-    + VERTICAL_SCROLL_BAR_MIN_HANDLE;
+  if (horizontal)
+    si.nMax = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, width)
+      + HORIZONTAL_SCROLL_BAR_MIN_HANDLE;
+  else
+    si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height)
+      + VERTICAL_SCROLL_BAR_MIN_HANDLE;
   si.nPage = si.nMax;
   si.nPos = 0;
 
@@ -3726,15 +3783,18 @@ x_scroll_bar_remove (struct scroll_bar *bar)
   my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar));
 
   /* Dissociate this scroll bar from its window.  */
-  wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil);
+  if (bar->horizontal)
+    wset_horizontal_scroll_bar (XWINDOW (bar->window), Qnil);
+  else
+    wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil);
 
   unblock_input ();
 }
 
-/* Set the handle of the vertical scroll bar for WINDOW to indicate
-   that we are displaying PORTION characters out of a total of WHOLE
-   characters, starting at POSITION.  If WINDOW has no scroll bar,
-   create one.  */
+/* Set the handle of the vertical scroll bar for WINDOW to indicate that
+   we are displaying PORTION characters out of a total of WHOLE
+   characters, starting at POSITION.  If WINDOW has no vertical scroll
+   bar, create one.  */
 static void
 w32_set_vertical_scroll_bar (struct window *w,
                             int portion, int whole, int position)
@@ -3767,7 +3827,7 @@ w32_set_vertical_scroll_bar (struct window *w,
        }
       unblock_input ();
 
-      bar = x_scroll_bar_create (w, top, left, width, height);
+      bar = x_scroll_bar_create (w, left, top, width, height, 0);
     }
   else
     {
@@ -3831,6 +3891,106 @@ w32_set_vertical_scroll_bar (struct window *w,
   wset_vertical_scroll_bar (w, barobj);
 }
 
+/* Set the handle of the horizontal scroll bar for WINDOW to indicate
+   that we are displaying PORTION characters out of a total of WHOLE
+   characters, starting at POSITION.  If WINDOW has no horizontal scroll
+   bar, create one.  */
+static void
+w32_set_horizontal_scroll_bar (struct window *w,
+                              int portion, int whole, int position)
+{
+  struct frame *f = XFRAME (w->frame);
+  Lisp_Object barobj;
+  struct scroll_bar *bar;
+  int top, height, left, width;
+  int window_x, window_width;
+  int clear_left = WINDOW_LEFT_EDGE_X (w);
+  int clear_width = WINDOW_PIXEL_WIDTH (w) - WINDOW_RIGHT_DIVIDER_WIDTH (w);
+
+  /* Get window dimensions.  */
+  window_box (w, ANY_AREA, &window_x, 0, &window_width, 0);
+  left  = window_x;
+  height = WINDOW_SCROLL_BAR_AREA_HEIGHT (w);
+  width = window_width;
+  top = WINDOW_SCROLL_BAR_AREA_Y (w);
+
+  /* Does the scroll bar exist yet?  */
+  if (NILP (w->horizontal_scroll_bar))
+    {
+      HDC hdc;
+      block_input ();
+      if (width > 0 && height > 0)
+       {
+         hdc = get_frame_dc (f);
+         w32_clear_area (f, hdc, clear_left, top, clear_width, height);
+         release_frame_dc (f, hdc);
+       }
+      unblock_input ();
+
+      bar = x_scroll_bar_create (w, left, top, width, height, 1);
+    }
+  else
+    {
+      /* It may just need to be moved and resized.  */
+      HWND hwnd;
+
+      bar = XSCROLL_BAR (w->horizontal_scroll_bar);
+      hwnd = SCROLL_BAR_W32_WINDOW (bar);
+
+      /* If already correctly positioned, do nothing.  */
+      if (bar->left == left && bar->top == top
+         && bar->width == width && bar->height == height)
+        {
+          /* Redraw after clear_frame. */
+          if (!my_show_window (f, hwnd, SW_NORMAL))
+            InvalidateRect (hwnd, NULL, FALSE);
+        }
+      else
+        {
+          HDC hdc;
+         SCROLLINFO si;
+
+          block_input ();
+         if (width && height)
+           {
+             hdc = get_frame_dc (f);
+             /* Since Windows scroll bars are smaller than the space reserved
+                for them on the frame, we have to clear "under" them.  */
+             w32_clear_area (f, hdc, clear_left, top, clear_width, height);
+             release_frame_dc (f, hdc);
+           }
+          /* Make sure scroll bar is "visible" before moving, to ensure the
+             area of the parent window now exposed will be refreshed.  */
+          my_show_window (f, hwnd, SW_HIDE);
+          MoveWindow (hwnd, left, top, width, max (height, 1), TRUE);
+
+         /* +++ SetScrollInfo +++ */
+         si.cbSize = sizeof (si);
+         si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
+         si.nMin = 0;
+         si.nMax = whole;
+         si.nPage = min (portion, si.nMax) + 1;
+         si.nPos = min (position, si.nMax);
+         SetScrollInfo (hwnd, SB_CTL, &si, FALSE);
+
+          my_show_window (f, hwnd, SW_NORMAL);
+          /* InvalidateRect (w, NULL, FALSE);  */
+
+          /* Remember new settings.  */
+          bar->left = left;
+          bar->top = top;
+          bar->width = width;
+          bar->height = height;
+
+          unblock_input ();
+        }
+    }
+
+  w32_set_horizontal_scroll_bar_thumb (bar, portion, position, whole);
+  XSETVECTOR (barobj, bar);
+  wset_horizontal_scroll_bar (w, barobj);
+}
+
 
 /* The following three hooks are used when we're doing a thorough
    redisplay of the frame.  We don't explicitly know which scroll bars
@@ -3847,17 +4007,22 @@ w32_set_vertical_scroll_bar (struct window *w,
 static void
 w32_condemn_scroll_bars (struct frame *frame)
 {
-  /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS.  */
-  while (! NILP (FRAME_SCROLL_BARS (frame)))
+  if (!NILP (FRAME_SCROLL_BARS (frame)))
     {
-      Lisp_Object bar;
-      bar = FRAME_SCROLL_BARS (frame);
-      fset_scroll_bars (frame, XSCROLL_BAR (bar)->next);
-      XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame);
-      XSCROLL_BAR (bar)->prev = Qnil;
-      if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame)))
-       XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar;
-      fset_condemned_scroll_bars (frame, bar);
+      if (!NILP (FRAME_CONDEMNED_SCROLL_BARS (frame)))
+       {
+         /* Prepend scrollbars to already condemned ones.  */
+         Lisp_Object last = FRAME_SCROLL_BARS (frame);
+
+         while (!NILP (XSCROLL_BAR (last)->next))
+           last = XSCROLL_BAR (last)->next;
+
+         XSCROLL_BAR (last)->next = FRAME_CONDEMNED_SCROLL_BARS (frame);
+         XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = last;
+       }
+
+      fset_condemned_scroll_bars (frame, FRAME_SCROLL_BARS (frame));
+      fset_scroll_bars (frame, Qnil);
     }
 }
 
@@ -3866,47 +4031,84 @@ w32_condemn_scroll_bars (struct frame *frame)
    Note that WINDOW isn't necessarily condemned at all.  */
 
 static void
-w32_redeem_scroll_bar (struct window *window)
+w32_redeem_scroll_bar (struct window *w)
 {
   struct scroll_bar *bar;
   Lisp_Object barobj;
   struct frame *f;
 
   /* We can't redeem this window's scroll bar if it doesn't have one.  */
-  if (NILP (window->vertical_scroll_bar))
+  if (NILP (w->vertical_scroll_bar) && NILP (w->horizontal_scroll_bar))
     emacs_abort ();
 
-  bar = XSCROLL_BAR (window->vertical_scroll_bar);
-
-  /* Unlink it from the condemned list.  */
-  f = XFRAME (WINDOW_FRAME (window));
-  if (NILP (bar->prev))
+  if (!NILP (w->vertical_scroll_bar) && WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
     {
-      /* If the prev pointer is nil, it must be the first in one of
-         the lists.  */
-      if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
-        /* It's not condemned.  Everything's fine.  */
-        return;
-      else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
-                   window->vertical_scroll_bar))
-        fset_condemned_scroll_bars (f, bar->next);
+      bar = XSCROLL_BAR (w->vertical_scroll_bar);
+      /* Unlink it from the condemned list.  */
+      f = XFRAME (WINDOW_FRAME (w));
+      if (NILP (bar->prev))
+       {
+         /* If the prev pointer is nil, it must be the first in one of
+            the lists.  */
+         if (EQ (FRAME_SCROLL_BARS (f), w->vertical_scroll_bar))
+           /* It's not condemned.  Everything's fine.  */
+           goto horizontal;
+         else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
+                      w->vertical_scroll_bar))
+           fset_condemned_scroll_bars (f, bar->next);
+         else
+           /* If its prev pointer is nil, it must be at the front of
+              one or the other!  */
+           emacs_abort ();
+       }
       else
-        /* If its prev pointer is nil, it must be at the front of
-           one or the other!  */
-        emacs_abort ();
+       XSCROLL_BAR (bar->prev)->next = bar->next;
+
+      if (! NILP (bar->next))
+       XSCROLL_BAR (bar->next)->prev = bar->prev;
+
+      bar->next = FRAME_SCROLL_BARS (f);
+      bar->prev = Qnil;
+      XSETVECTOR (barobj, bar);
+      fset_scroll_bars (f, barobj);
+      if (! NILP (bar->next))
+       XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
     }
-  else
-    XSCROLL_BAR (bar->prev)->next = bar->next;
 
-  if (! NILP (bar->next))
-    XSCROLL_BAR (bar->next)->prev = bar->prev;
+ horizontal:
+  if (!NILP (w->horizontal_scroll_bar) && WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w))
+    {
+      bar = XSCROLL_BAR (w->horizontal_scroll_bar);
+      /* Unlink it from the condemned list.  */
+      f = XFRAME (WINDOW_FRAME (w));
+      if (NILP (bar->prev))
+       {
+         /* If the prev pointer is nil, it must be the first in one of
+            the lists.  */
+         if (EQ (FRAME_SCROLL_BARS (f), w->horizontal_scroll_bar))
+           /* It's not condemned.  Everything's fine.  */
+           return;
+         else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
+                      w->horizontal_scroll_bar))
+           fset_condemned_scroll_bars (f, bar->next);
+         else
+           /* If its prev pointer is nil, it must be at the front of
+              one or the other!  */
+           emacs_abort ();
+       }
+      else
+       XSCROLL_BAR (bar->prev)->next = bar->next;
 
-  bar->next = FRAME_SCROLL_BARS (f);
-  bar->prev = Qnil;
-  XSETVECTOR (barobj, bar);
-  fset_scroll_bars (f, barobj);
-  if (! NILP (bar->next))
-    XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
+      if (! NILP (bar->next))
+       XSCROLL_BAR (bar->next)->prev = bar->prev;
+
+      bar->next = FRAME_SCROLL_BARS (f);
+      bar->prev = Qnil;
+      XSETVECTOR (barobj, bar);
+      fset_scroll_bars (f, barobj);
+      if (! NILP (bar->next))
+       XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
+    }
 }
 
 /* Remove all scroll bars on FRAME that haven't been saved since the
@@ -3937,8 +4139,9 @@ w32_judge_scroll_bars (struct frame *f)
      and they should get garbage-collected.  */
 }
 
-/* Handle a mouse click on the scroll bar BAR.  If *EMACS_EVENT's kind
-   is set to something other than NO_EVENT, it is enqueued.
+/* Handle a mouse click on the vertical scroll bar BAR.  If
+   *EMACS_EVENT's kind is set to something other than NO_EVENT, it is
+   enqueued.
 
    This may be called from a signal handler, so we have to ignore GC
    mark bits.  */
@@ -4045,9 +4248,120 @@ w32_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
   }
 }
 
-/* Return information to the user about the current position of the mouse
-   on the scroll bar.  */
+/* Handle a mouse click on the horizontal scroll bar BAR.  If
+   *EMACS_EVENT's kind is set to something other than NO_EVENT, it is
+   enqueued.
+
+   This may be called from a signal handler, so we have to ignore GC
+   mark bits.  */
+
+static int
+w32_horizontal_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
+                                       struct input_event *emacs_event)
+{
+  if (! WINDOWP (bar->window))
+    emacs_abort ();
+
+  emacs_event->kind = HORIZONTAL_SCROLL_BAR_CLICK_EVENT;
+  emacs_event->code = 0;
+  /* not really meaningful to distinguish left/right */
+  emacs_event->modifiers = msg->dwModifiers;
+  emacs_event->frame_or_window = bar->window;
+  emacs_event->arg = Qnil;
+  emacs_event->timestamp = msg->msg.time;
+
+  {
+    int left_range = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width);
+    int x;
+    int dragging = bar->dragging;
+    SCROLLINFO si;
+
+    si.cbSize = sizeof (si);
+    si.fMask = SIF_POS;
+
+    GetScrollInfo ((HWND) msg->msg.lParam, SB_CTL, &si);
+    x = si.nPos;
 
+    bar->dragging = 0;
+    FRAME_DISPLAY_INFO (f)->last_mouse_scroll_bar_pos = msg->msg.wParam;
+
+    switch (LOWORD (msg->msg.wParam))
+      {
+      case SB_LINELEFT:
+       emacs_event->part = scroll_bar_left_arrow;
+       break;
+      case SB_LINERIGHT:
+       emacs_event->part = scroll_bar_right_arrow;
+       break;
+      case SB_PAGELEFT:
+       emacs_event->part = scroll_bar_before_handle;
+       break;
+      case SB_PAGERIGHT:
+       emacs_event->part = scroll_bar_after_handle;
+       break;
+      case SB_LEFT:
+       emacs_event->part = scroll_bar_horizontal_handle;
+       x = 0;
+       break;
+      case SB_RIGHT:
+       emacs_event->part = scroll_bar_horizontal_handle;
+       x = left_range;
+       break;
+      case SB_THUMBTRACK:
+      case SB_THUMBPOSITION:
+       if (HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width) <= 0xffff)
+          x = HIWORD (msg->msg.wParam);
+       bar->dragging = 1;
+       emacs_event->part = scroll_bar_horizontal_handle;
+
+       /* "Silently" update current position.  */
+       {
+         SCROLLINFO si;
+
+         si.cbSize = sizeof (si);
+         si.fMask = SIF_POS;
+         si.nPos = min (x, XWINDOW (bar->window)->hscroll_whole - 1);
+         /* Remember apparent position (we actually lag behind the real
+            position, so don't set that directly).  */
+         last_scroll_bar_drag_pos = x;
+
+         SetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, FALSE);
+       }
+       break;
+      case SB_ENDSCROLL:
+       /* If this is the end of a drag sequence, then reset the scroll
+          handle size to normal and do a final redraw.  Otherwise do
+          nothing.  */
+       if (dragging)
+         {
+           SCROLLINFO si;
+           int start = bar->start;
+           int end = bar->end;
+
+           si.cbSize = sizeof (si);
+/**        si.fMask = SIF_PAGE | SIF_POS; **/
+           si.fMask = SIF_POS;
+/**        si.nPage = end - start + HORIZONTAL_SCROLL_BAR_MIN_HANDLE; **/
+           si.nPos = min (last_scroll_bar_drag_pos,
+                          XWINDOW (bar->window)->hscroll_whole - 1);
+/**        si.nPos = last_scroll_bar_drag_pos; **/
+           SetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, TRUE);
+         }
+       /* fall through */
+      default:
+       emacs_event->kind = NO_EVENT;
+       return FALSE;
+      }
+
+    XSETINT (emacs_event->x, x);
+    XSETINT (emacs_event->y, left_range);
+
+    return TRUE;
+  }
+}
+
+/* Return information to the user about the current position of the mouse
+   on the vertical scroll bar.  */
 static void
 x_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
                            enum scroll_bar_part *part,
@@ -4102,6 +4416,62 @@ x_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
   unblock_input ();
 }
 
+/* Return information to the user about the current position of the mouse
+   on the horizontal scroll bar.  */
+static void
+x_horizontal_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
+                                      enum scroll_bar_part *part,
+                                      Lisp_Object *x, Lisp_Object *y,
+                                      unsigned long *time)
+{
+  struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (*fp);
+  struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar;
+  Window w = SCROLL_BAR_W32_WINDOW (bar);
+  struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
+  int pos;
+  int left_range = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width);
+  SCROLLINFO si;
+
+  block_input ();
+
+  *fp = f;
+  *bar_window = bar->window;
+
+  si.cbSize = sizeof (si);
+  si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE;
+
+  GetScrollInfo (w, SB_CTL, &si);
+  pos = si.nPos;
+  left_range = si.nMax - si.nPage + 1;
+
+  switch (LOWORD (dpyinfo->last_mouse_scroll_bar_pos))
+  {
+  case SB_THUMBPOSITION:
+  case SB_THUMBTRACK:
+      *part = scroll_bar_handle;
+      if (HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width) <= 0xffff)
+       pos = HIWORD (dpyinfo->last_mouse_scroll_bar_pos);
+      break;
+  case SB_LINERIGHT:
+      *part = scroll_bar_handle;
+      pos++;
+      break;
+  default:
+      *part = scroll_bar_handle;
+      break;
+  }
+
+  XSETINT (*y, pos);
+  XSETINT (*x, left_range);
+
+  f->mouse_moved = 0;
+  dpyinfo->last_mouse_scroll_bar = NULL;
+
+  *time = dpyinfo->last_mouse_movement_time;
+
+  unblock_input ();
+}
+
 
 /* The screen has been cleared so we may have changed foreground or
    background colors, and the scroll bars may need to be redrawn.
@@ -4116,7 +4486,8 @@ x_scroll_bar_clear (struct frame *f)
   /* We can have scroll bars even if this is 0,
      if we just turned off scroll bar mode.
      But in that case we should not clear them.  */
-  if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
+  if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)
+      || FRAME_HAS_HORIZONTAL_SCROLL_BARS (f))
     for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar);
          bar = XSCROLL_BAR (bar)->next)
       {
@@ -4137,7 +4508,18 @@ x_scroll_bar_clear (struct frame *f)
       }
 }
 
-\f
+static void
+set_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
+{
+  register Lisp_Object old_alist_elt;
+
+  old_alist_elt = Fassq (prop, f->param_alist);
+  if (EQ (old_alist_elt, Qnil))
+    fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist));
+  else
+    Fsetcdr (old_alist_elt, val);
+}
+
 /* The main W32 event-reading loop - w32_read_socket.  */
 
 /* Record the last 100 characters stored
@@ -4538,10 +4920,11 @@ w32_read_socket (struct terminal *terminal,
                    Emacs events should reflect only motion after
                    the ButtonPress.  */
                 if (f != 0)
-                  f->mouse_moved = 0;
-
-                if (!tool_bar_p)
-                  last_tool_bar_item = -1;
+                 {
+                   f->mouse_moved = 0;
+                   if (!tool_bar_p)
+                     f->last_tool_bar_item = -1;
+                 }
              }
            break;
          }
@@ -4566,9 +4949,9 @@ w32_read_socket (struct terminal *terminal,
                   should reflect only motion after the
                   ButtonPress.  */
                f->mouse_moved = 0;
+               f->last_tool_bar_item = -1;
              }
            dpyinfo->last_mouse_frame = f;
-           last_tool_bar_item = -1;
          }
          break;
 
@@ -4579,10 +4962,20 @@ w32_read_socket (struct terminal *terminal,
            construct_drag_n_drop (&inev, &msg, f);
          break;
 
+       case WM_HSCROLL:
+         {
+           struct scroll_bar *bar =
+             x_window_to_scroll_bar ((HWND)msg.msg.lParam, 1);
+
+           if (bar)
+             w32_horizontal_scroll_bar_handle_click (bar, &msg, &inev);
+           break;
+         }
+
        case WM_VSCROLL:
          {
            struct scroll_bar *bar =
-             x_window_to_scroll_bar ((HWND)msg.msg.lParam);
+             x_window_to_scroll_bar ((HWND)msg.msg.lParam, 0);
 
            if (bar)
              w32_scroll_bar_handle_click (bar, &msg, &inev);
@@ -4760,8 +5153,8 @@ w32_read_socket (struct terminal *terminal,
              width = rect.right - rect.left;
              text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width);
              text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height);
-             rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
-             columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
+             /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */
+             /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */
 
              /* TODO: Clip size to the screen dimensions.  */
 
@@ -4777,10 +5170,6 @@ w32_read_socket (struct terminal *terminal,
                  change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
                  SET_FRAME_GARBAGED (f);
                  cancel_mouse_face (f);
-                 /* Do we want to set these here ????  */
-/**              FRAME_PIXEL_WIDTH (f) = width; **/
-/**              FRAME_TEXT_WIDTH (f) = text_width; **/
-/**              FRAME_PIXEL_HEIGHT (f) = height; **/
                  f->win_gravity = NorthWestGravity;
                }
            }
@@ -5420,8 +5809,6 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
   FRAME_COLUMN_WIDTH (f) = unit = font->average_width;
   FRAME_LINE_HEIGHT (f) = font->height;
 
-  compute_fringe_widths (f, 1);
-
   /* Compute number of scrollbar columns.  */
   unit = FRAME_COLUMN_WIDTH (f);
   if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
@@ -5441,8 +5828,8 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
         doing it because it's done in Fx_show_tip, and it leads to
         problems because the tip frame has no widget.  */
       if (NILP (tip_frame) || XFRAME (tip_frame) != f)
-       x_set_window_size (f, 0, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
-                          FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1);
+       adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+                          FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3, 0);
     }
 
   /* X version sets font of input methods here also.  */
@@ -5562,6 +5949,47 @@ x_set_offset (struct frame *f, register int xoff, register int yoff,
   unblock_input ();
 }
 
+/* Calculate fullscreen size.  Return in *TOP_POS and *LEFT_POS the
+   wanted positions of the WM window (not Emacs window).
+   Return in *WIDTH and *HEIGHT the wanted width and height of Emacs
+   window (FRAME_X_WINDOW).
+ */
+
+static void
+x_fullscreen_adjust (struct frame *f, int *width, int *height, int *top_pos, int *left_pos)
+{
+  int newwidth = FRAME_COLS (f);
+  int newheight = FRAME_LINES (f);
+  Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
+
+  *top_pos = f->top_pos;
+  *left_pos = f->left_pos;
+
+  if (f->want_fullscreen & FULLSCREEN_HEIGHT)
+    {
+      int ph;
+
+      ph = x_display_pixel_height (dpyinfo);
+      newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph);
+      ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, newheight) - f->y_pixels_diff;
+      newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph);
+      *top_pos = 0;
+    }
+
+  if (f->want_fullscreen & FULLSCREEN_WIDTH)
+    {
+      int pw;
+
+      pw = x_display_pixel_width (dpyinfo);
+      newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw);
+      pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, newwidth) - f->x_pixels_diff;
+      newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw);
+      *left_pos = 0;
+    }
+
+  *width = newwidth;
+  *height = newheight;
+}
 
 /* Check if we need to resize the frame due to a fullscreen request.
    If so needed, resize the frame.  */
@@ -5598,6 +6026,7 @@ w32fullscreen_hook (struct frame *f)
       HWND hwnd = FRAME_W32_WINDOW(f);
       DWORD dwStyle = GetWindowLong (hwnd, GWL_STYLE);
       RECT rect;
+      enum fullscreen_type prev_fsmode = FRAME_PREV_FSMODE (f);
 
       block_input();
       f->want_fullscreen &= ~FULLSCREEN_WAIT;
@@ -5619,7 +6048,14 @@ w32fullscreen_hook (struct frame *f)
       if (f->want_fullscreen == FULLSCREEN_NONE)
        ShowWindow (hwnd, SW_SHOWNORMAL);
       else if (f->want_fullscreen == FULLSCREEN_MAXIMIZED)
-       ShowWindow (hwnd, SW_MAXIMIZE);
+       {
+         if (prev_fsmode == FULLSCREEN_BOTH || prev_fsmode == FULLSCREEN_WIDTH
+             || prev_fsmode == FULLSCREEN_HEIGHT)
+           /* Make window normal since otherwise the subsequent
+              maximization might fail in some cases.  */
+           ShowWindow (hwnd, SW_SHOWNORMAL);
+         ShowWindow (hwnd, SW_MAXIMIZE);
+       }
       else if (f->want_fullscreen == FULLSCREEN_BOTH)
         {
          w32_fullscreen_rect (hwnd, f->want_fullscreen,
@@ -5654,70 +6090,40 @@ void
 x_set_window_size (struct frame *f, int change_gravity, int width, int height, bool pixelwise)
 {
   int pixelwidth, pixelheight;
+  RECT rect;
 
   block_input ();
 
-  check_frame_size (f, &width, &height, pixelwise);
-
-  compute_fringe_widths (f, 0);
-
-  if (frame_resize_pixelwise)
+  if (pixelwise)
     {
-      if (pixelwise)
-       {
-         pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
-         pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
-       }
-      else
-       {
-         pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
-         pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
-       }
+      pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
+      pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
     }
   else
     {
-      /* If we don't resize frames pixelwise, round sizes to multiples
-        of character sizes here.  Otherwise, when enforcing size hints
-        while processing WM_WINDOWPOSCHANGING in w32_wnd_proc, we might
-        clip our frame rectangle to a multiple of the frame's character
-        size and subsequently lose our mode line or scroll bar.
-        Bug#16923 could be one possible consequence of this.  Carefully
-        reverse-engineer what WM_WINDOWPOSCHANGING does here since
-        otherwise we might make our frame too small, see Bug#17077.  */
-      int unit_width = FRAME_COLUMN_WIDTH (f);
-      int unit_height = FRAME_LINE_HEIGHT (f);
-
-      pixelwidth = (((((pixelwise ? width : (width * FRAME_COLUMN_WIDTH (f)))
-                      + FRAME_TOTAL_FRINGE_WIDTH (f))
-                     / unit_width) * unit_width)
-                   + FRAME_SCROLL_BAR_AREA_WIDTH (f)
-                   + 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
-
-      pixelheight = ((((pixelwise ? height : (height * FRAME_LINE_HEIGHT (f)))
-                      / unit_height) * unit_height)
-                    + 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
+      pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
+      pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
     }
 
   f->win_gravity = NorthWestGravity;
   x_wm_set_size_hint (f, (long) 0, 0);
 
-  {
-    RECT rect;
+  f->want_fullscreen = FULLSCREEN_NONE;
+  w32fullscreen_hook (f);
 
-    rect.left = rect.top = 0;
-    rect.right = pixelwidth;
-    rect.bottom = pixelheight;
+  rect.left = rect.top = 0;
+  rect.right = pixelwidth;
+  rect.bottom = pixelheight;
 
-    AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
-                     FRAME_EXTERNAL_MENU_BAR (f));
+  AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
+                   FRAME_EXTERNAL_MENU_BAR (f));
 
-    my_set_window_pos (FRAME_W32_WINDOW (f),
-                      NULL,
-                      0, 0,
-                      rect.right - rect.left,
-                      rect.bottom - rect.top,
-                      SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
-  }
+  my_set_window_pos (FRAME_W32_WINDOW (f),
+                    NULL,
+                    0, 0,
+                    rect.right - rect.left,
+                    rect.bottom - rect.top,
+                    SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
 
   /* If w32_enable_frame_resize_hack is non-nil, immediately apply the
      new pixel sizes to the frame and its subwindows.
@@ -5766,31 +6172,14 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
     }
 
   unblock_input ();
+
+  do_pending_window_change (0);
 }
 \f
 /* Mouse warping.  */
 
-void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
-
 void
-x_set_mouse_position (struct frame *f, int x, int y)
-{
-  int pix_x, pix_y;
-
-  pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2;
-  pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2;
-
-  if (pix_x < 0) pix_x = 0;
-  if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f);
-
-  if (pix_y < 0) pix_y = 0;
-  if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
-
-  x_set_mouse_pixel_position (f, pix_x, pix_y);
-}
-
-void
-x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
+frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
 {
   RECT rect;
   POINT pt;
@@ -5813,7 +6202,9 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
 void
 x_focus_frame (struct frame *f)
 {
+#if 0
   struct w32_display_info *dpyinfo = &one_w32_display_info;
+#endif
 
   /* Give input focus to frame.  */
   block_input ();
@@ -6122,7 +6513,8 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
   SetWindowLong (window, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
   SetWindowLong (window, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
   SetWindowLong (window, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
-  SetWindowLong (window, WND_SCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_WIDTH (f));
+  SetWindowLong (window, WND_VSCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_WIDTH (f));
+  SetWindowLong (window, WND_HSCROLLBAR_INDEX, FRAME_SCROLL_BAR_AREA_HEIGHT (f));
 
   leave_crit ();
 }
@@ -6146,8 +6538,40 @@ x_check_font (struct frame *f, struct font *font)
 
 #endif /* GLYPH_DEBUG */
 
+/* Show hourglass cursor on frame F.  */
+
+static void
+w32_show_hourglass (struct frame *f)
+{
+  if (!menubar_in_use && !current_popup_menu)
+    {
+      struct w32_output *w32 = FRAME_X_OUTPUT (f);
+
+      w32->hourglass_p = 1;
+      SetCursor (w32->hourglass_cursor);
+    }
+}
+
+/* Hide hourglass cursor on frame F.  */
+
+static void
+w32_hide_hourglass (struct frame *f)
+{
+  struct w32_output *w32 = FRAME_X_OUTPUT (f);
+
+  w32->hourglass_p = 0;
+  SetCursor (w32->current_cursor);
+}
+
+/* FIXME: old code did that, but I don't know why.  Anyway,
+   this is used for non-GUI frames (see cancel_hourglass).  */
+
+void
+w32_arrow_cursor (void)
+{
+  SetCursor (w32_load_cursor (IDC_ARROW));
+}
 
-\f
 /***********************************************************************
                            Initialization
  ***********************************************************************/
@@ -6177,6 +6601,7 @@ w32_initialize_display_info (Lisp_Object display_name)
   dpyinfo->smallest_font_height = 1;
   dpyinfo->smallest_char_width = 1;
   dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
+  dpyinfo->horizontal_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
   /* TODO: dpyinfo->gray */
 
   reset_mouse_highlight (&dpyinfo->mouse_highlight);
@@ -6263,7 +6688,9 @@ static struct redisplay_interface w32_redisplay_interface =
   w32_draw_window_cursor,
   w32_draw_vertical_window_border,
   w32_draw_window_divider,
-  w32_shift_glyphs_for_insert
+  w32_shift_glyphs_for_insert,
+  w32_show_hourglass,
+  w32_hide_hourglass
 };
 
 static void x_delete_terminal (struct terminal *term);
@@ -6273,9 +6700,8 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
 {
   struct terminal *terminal;
 
-  terminal = create_terminal ();
+  terminal = create_terminal (output_w32, &w32_redisplay_interface);
 
-  terminal->type = output_w32;
   terminal->display_info.w32 = dpyinfo;
   dpyinfo->terminal = terminal;
 
@@ -6285,26 +6711,24 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
   terminal->ins_del_lines_hook = x_ins_del_lines;
   terminal->delete_glyphs_hook = x_delete_glyphs;
   terminal->ring_bell_hook = w32_ring_bell;
-  terminal->reset_terminal_modes_hook = NULL;
-  terminal->set_terminal_modes_hook = NULL;
   terminal->update_begin_hook = x_update_begin;
   terminal->update_end_hook = x_update_end;
-  terminal->set_terminal_window_hook = NULL;
   terminal->read_socket_hook = w32_read_socket;
   terminal->frame_up_to_date_hook = w32_frame_up_to_date;
   terminal->mouse_position_hook = w32_mouse_position;
   terminal->frame_rehighlight_hook = w32_frame_rehighlight;
   terminal->frame_raise_lower_hook = w32_frame_raise_lower;
   terminal->fullscreen_hook = w32fullscreen_hook;
+  terminal->menu_show_hook = w32_menu_show;
+  terminal->popup_dialog_hook = w32_popup_dialog;
   terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
+  terminal->set_horizontal_scroll_bar_hook = w32_set_horizontal_scroll_bar;
   terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
   terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
   terminal->judge_scroll_bars_hook = w32_judge_scroll_bars;
-
   terminal->delete_frame_hook = x_destroy_window;
   terminal->delete_terminal_hook = x_delete_terminal;
-
-  terminal->rif = &w32_redisplay_interface;
+  /* Other hooks are NULL by default.  */
 
   /* We don't yet support separate terminals on W32, so don't try to share
      keyboards between virtual terminals that are on the same physical
@@ -6426,12 +6850,6 @@ x_delete_display (struct w32_display_info *dpyinfo)
     if (dpyinfo->palette)
       DeleteObject (dpyinfo->palette);
   }
-  /* Avoid freeing dpyinfo->w32_id_name more than once if emacs is
-     running as a daemon; see bug#17510. */
-#ifndef CYGWIN
-  xfree (dpyinfo->w32_id_name);
-#endif
-
   w32_reset_fringes ();
 }
 
@@ -6483,7 +6901,6 @@ w32_initialize (void)
                             &w32_use_visible_system_caret, 0))
     w32_use_visible_system_caret = 0;
 
-  last_tool_bar_item = -1;
   any_help_event_p = 0;
 
   /* Initialize input mode: interrupt_input off, no flow control, allow
@@ -6538,13 +6955,16 @@ w32_initialize (void)
 
 #undef LOAD_PROC
 
-    /* Ensure scrollbar handle is at least 5 pixels.  */
+    /* Ensure scrollbar handles are at least 5 pixels.  */
     vertical_scroll_bar_min_handle = 5;
+    horizontal_scroll_bar_min_handle = 5;
 
     /* For either kind of scroll bar, take account of the arrows; these
        effectively form the border of the main scroll bar range.  */
     vertical_scroll_bar_top_border = vertical_scroll_bar_bottom_border
       = GetSystemMetrics (SM_CYVSCROLL);
+    horizontal_scroll_bar_left_border = horizontal_scroll_bar_right_border
+      = GetSystemMetrics (SM_CYHSCROLL);
   }
 }
 
index e3b65f0ffaf75d98eef50a6c3878a072759819b9..0fabe12819c55b701b61136402929bea60fc630a 100644 (file)
@@ -99,6 +99,9 @@ struct w32_display_info
   /* The cursor to use for vertical scroll bars.  */
   Cursor vertical_scroll_bar_cursor;
 
+  /* The cursor to use for horizontal scroll bars.  */
+  Cursor horizontal_scroll_bar_cursor;
+
   /* Resource data base */
   XrmDatabase xrdb;
 
@@ -194,12 +197,19 @@ struct w32_display_info
 
   /* Time of last mouse movement.  */
   Time last_mouse_movement_time;
+
+  /* Value returned by last call of ShowCursor.  */
+  int cursor_display_counter;
 };
 
 /* This is a chain of structures for all the displays currently in use.  */
 extern struct w32_display_info *x_display_list;
 extern struct w32_display_info one_w32_display_info;
 
+/* These 2 are set by w32fns.c and examined in w32term.c.  */
+extern HMENU current_popup_menu;
+extern int menubar_in_use;
+
 extern struct frame *x_window_to_frame (struct w32_display_info *, HWND);
 
 struct w32_display_info *x_display_info_for_name (Lisp_Object);
@@ -219,8 +229,6 @@ extern void x_set_window_size (struct frame *f, int change_grav,
 extern int x_display_pixel_height (struct w32_display_info *);
 extern int x_display_pixel_width (struct w32_display_info *);
 extern Lisp_Object x_get_focus_frame (struct frame *);
-extern void x_set_mouse_position (struct frame *f, int h, int v);
-extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
 extern void x_make_frame_visible (struct frame *f);
 extern void x_make_frame_invisible (struct frame *f);
 extern void x_iconify_frame (struct frame *f);
@@ -229,6 +237,9 @@ extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_tool_bar_lines (struct frame *f,
                                   Lisp_Object value,
                                   Lisp_Object oldval);
+extern void x_set_internal_border_width (struct frame *f,
+                                        Lisp_Object value,
+                                        Lisp_Object oldval);
 extern void x_activate_menubar (struct frame *);
 extern int x_bitmap_icon (struct frame *, Lisp_Object);
 extern void initialize_frame_menubar (struct frame *);
@@ -449,6 +460,9 @@ struct scroll_bar {
      place where the user grabbed it.  If the handle isn't currently
      being dragged, this is Qnil.  */
   int dragging;
+
+  /* true if the scroll bar is horizontal.  */
+  bool horizontal;
 };
 
 /* Turning a lisp vector value into a pointer to a struct scroll_bar.  */
@@ -482,9 +496,9 @@ struct scroll_bar {
 
 /* Return the inside width of a vertical scroll bar, given the outside
    width.  */
-#define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f,width) \
-  ((width) \
-   - VERTICAL_SCROLL_BAR_LEFT_BORDER \
+#define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f,width)      \
+  ((width)                                             \
+   - VERTICAL_SCROLL_BAR_LEFT_BORDER                   \
    - VERTICAL_SCROLL_BAR_RIGHT_BORDER)
 
 /* Return the length of the rectangle within which the top of the
@@ -494,14 +508,36 @@ struct scroll_bar {
    This is the real range of motion for the scroll bar, so when we're
    scaling buffer positions to scroll bar positions, we use this, not
    VERTICAL_SCROLL_BAR_INSIDE_HEIGHT.  */
-#define VERTICAL_SCROLL_BAR_TOP_RANGE(f,height) \
+#define VERTICAL_SCROLL_BAR_TOP_RANGE(f,height)                                \
   (VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, height) - VERTICAL_SCROLL_BAR_MIN_HANDLE)
 
 /* Return the inside height of vertical scroll bar, given the outside
    height.  See VERTICAL_SCROLL_BAR_TOP_RANGE too.  */
-#define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(f,height) \
+#define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(f,height)                    \
   ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER)
 
+/* Return the inside height of a horizontal scroll bar, given the
+   outside height.  */
+#define HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT(f,height) \
+  ((height)                                          \
+   - HORIZONTAL_SCROLL_BAR_TOP_BORDER                \
+   - HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
+
+/* Return the length of the rectangle within which the left of the
+   handle must stay.  This isn't equivalent to the inside width,
+   because the scroll bar handle has a minimum width.
+
+   This is the real range of motion for the scroll bar, so when we're
+   scaling buffer positions to scroll bar positions, we use this, not
+   HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH.  */
+#define HORIZONTAL_SCROLL_BAR_LEFT_RANGE(f,width)                      \
+  (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH (f, width) - HORIZONTAL_SCROLL_BAR_MIN_HANDLE)
+
+/* Return the inside width of horizontal scroll bar, given the outside
+   width.  See HORIZONTAL_SCROLL_BAR_LEFT_RANGE too.  */
+#define HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH(f,width)                    \
+  ((width) - HORIZONTAL_SCROLL_BAR_LEFT_BORDER - HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
+
 
 /* Border widths for scroll bars.
 
@@ -519,8 +555,14 @@ struct scroll_bar {
 #define VERTICAL_SCROLL_BAR_TOP_BORDER (vertical_scroll_bar_top_border)
 #define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (vertical_scroll_bar_bottom_border)
 
+#define HORIZONTAL_SCROLL_BAR_LEFT_BORDER (horizontal_scroll_bar_left_border)
+#define HORIZONTAL_SCROLL_BAR_RIGHT_BORDER (horizontal_scroll_bar_right_border)
+#define HORIZONTAL_SCROLL_BAR_TOP_BORDER (0)
+#define HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER (0)
+
 /* Minimum lengths for scroll bar handles, in pixels.  */
 #define VERTICAL_SCROLL_BAR_MIN_HANDLE (vertical_scroll_bar_min_handle)
+#define HORIZONTAL_SCROLL_BAR_MIN_HANDLE (horizontal_scroll_bar_min_handle)
 
 struct frame;  /* from frame.h */
 
@@ -582,35 +624,38 @@ do { \
 #define WM_EMACS_KILL                  (WM_EMACS_START + 0)
 #define WM_EMACS_CREATEWINDOW          (WM_EMACS_START + 1)
 #define WM_EMACS_DONE                  (WM_EMACS_START + 2)
-#define WM_EMACS_CREATESCROLLBAR       (WM_EMACS_START + 3)
-#define WM_EMACS_SHOWWINDOW            (WM_EMACS_START + 4)
-#define WM_EMACS_SETWINDOWPOS          (WM_EMACS_START + 5)
-#define WM_EMACS_DESTROYWINDOW         (WM_EMACS_START + 6)
-#define WM_EMACS_TRACKPOPUPMENU        (WM_EMACS_START + 7)
-#define WM_EMACS_SETFOCUS              (WM_EMACS_START + 8)
-#define WM_EMACS_SETFOREGROUND         (WM_EMACS_START + 9)
-#define WM_EMACS_SETLOCALE             (WM_EMACS_START + 10)
-#define WM_EMACS_SETKEYBOARDLAYOUT     (WM_EMACS_START + 11)
-#define WM_EMACS_REGISTER_HOT_KEY      (WM_EMACS_START + 12)
-#define WM_EMACS_UNREGISTER_HOT_KEY    (WM_EMACS_START + 13)
-#define WM_EMACS_TOGGLE_LOCK_KEY       (WM_EMACS_START + 14)
-#define WM_EMACS_TRACK_CARET           (WM_EMACS_START + 15)
-#define WM_EMACS_DESTROY_CARET         (WM_EMACS_START + 16)
-#define WM_EMACS_SHOW_CARET            (WM_EMACS_START + 17)
-#define WM_EMACS_HIDE_CARET            (WM_EMACS_START + 18)
-#define WM_EMACS_SETCURSOR             (WM_EMACS_START + 19)
-#define WM_EMACS_PAINT                 (WM_EMACS_START + 20)
-#define WM_EMACS_BRINGTOTOP            (WM_EMACS_START + 21)
-#define WM_EMACS_INPUT_READY           (WM_EMACS_START + 22)
-#define WM_EMACS_FILENOTIFY            (WM_EMACS_START + 23)
-#define WM_EMACS_END                   (WM_EMACS_START + 24)
+#define WM_EMACS_CREATEVSCROLLBAR      (WM_EMACS_START + 3)
+#define WM_EMACS_CREATEHSCROLLBAR      (WM_EMACS_START + 4)
+#define WM_EMACS_SHOWWINDOW            (WM_EMACS_START + 5)
+#define WM_EMACS_SETWINDOWPOS          (WM_EMACS_START + 6)
+#define WM_EMACS_DESTROYWINDOW         (WM_EMACS_START + 7)
+#define WM_EMACS_TRACKPOPUPMENU        (WM_EMACS_START + 8)
+#define WM_EMACS_SETFOCUS              (WM_EMACS_START + 9)
+#define WM_EMACS_SETFOREGROUND         (WM_EMACS_START + 10)
+#define WM_EMACS_SETLOCALE             (WM_EMACS_START + 11)
+#define WM_EMACS_SETKEYBOARDLAYOUT     (WM_EMACS_START + 12)
+#define WM_EMACS_REGISTER_HOT_KEY      (WM_EMACS_START + 13)
+#define WM_EMACS_UNREGISTER_HOT_KEY    (WM_EMACS_START + 14)
+#define WM_EMACS_TOGGLE_LOCK_KEY       (WM_EMACS_START + 15)
+#define WM_EMACS_TRACK_CARET           (WM_EMACS_START + 16)
+#define WM_EMACS_DESTROY_CARET         (WM_EMACS_START + 17)
+#define WM_EMACS_SHOW_CARET            (WM_EMACS_START + 18)
+#define WM_EMACS_HIDE_CARET            (WM_EMACS_START + 19)
+#define WM_EMACS_SETCURSOR             (WM_EMACS_START + 20)
+#define WM_EMACS_SHOWCURSOR            (WM_EMACS_START + 21)
+#define WM_EMACS_PAINT                 (WM_EMACS_START + 22)
+#define WM_EMACS_BRINGTOTOP            (WM_EMACS_START + 23)
+#define WM_EMACS_INPUT_READY           (WM_EMACS_START + 24)
+#define WM_EMACS_FILENOTIFY            (WM_EMACS_START + 25)
+#define WM_EMACS_END                   (WM_EMACS_START + 26)
 
 #define WND_FONTWIDTH_INDEX    (0)
 #define WND_LINEHEIGHT_INDEX   (4)
 #define WND_BORDER_INDEX       (8)
-#define WND_SCROLLBAR_INDEX    (12)
-#define WND_BACKGROUND_INDEX   (16)
-#define WND_LAST_INDEX         (20)
+#define WND_VSCROLLBAR_INDEX   (12)
+#define WND_HSCROLLBAR_INDEX   (16)
+#define WND_BACKGROUND_INDEX   (20)
+#define WND_LAST_INDEX         (24)
 
 #define WND_EXTRA_BYTES     (WND_LAST_INDEX)
 
@@ -782,6 +827,7 @@ typedef char guichar_t;
 #define GUI_SDATA(x) ((guichar_t*) SDATA (x))
 
 extern Lisp_Object w32_popup_dialog (struct frame *, Lisp_Object, Lisp_Object);
+extern void w32_arrow_cursor (void);
 
 extern void syms_of_w32term (void);
 extern void syms_of_w32menu (void);
index 5bb444f519af74303c921999a7c8437214082d2c..d06586f973ab5a9b653fa7a3b0b3c4804b5cf86b 100644 (file)
@@ -127,8 +127,6 @@ uniscribe_open (struct frame *f, Lisp_Object font_entity, int pixel_size)
   /* Uniscribe backend uses glyph indices.  */
   uniscribe_font->w32_font.glyph_idx = ETO_GLYPH_INDEX;
 
-  /* Mark the format as opentype  */
-  uniscribe_font->w32_font.font.props[FONT_FORMAT_INDEX] = Qopentype;
   uniscribe_font->w32_font.font.driver = &uniscribe_font_driver;
 
   return font_object;
@@ -604,8 +602,6 @@ uniscribe_encode_char (struct font *font, int c)
    int uniscribe_get_bitmap (struct font *font, unsigned code,
                              struct font_bitmap *bitmap, int bits_per_pixel);
    void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap);
-   void * uniscribe_get_outline (struct font *font, unsigned code);
-   void uniscribe_free_outline (struct font *font, void *outline);
    int uniscribe_anchor_point (struct font *font, unsigned code,
                                int index, int *x, int *y);
    int uniscribe_start_for_frame (struct frame *f);
@@ -981,8 +977,6 @@ struct font_driver uniscribe_font_driver =
     w32font_draw,
     NULL, /* get_bitmap */
     NULL, /* free_bitmap */
-    NULL, /* get_outline */
-    NULL, /* free_outline */
     NULL, /* anchor_point */
     uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works.  */
     NULL, /* otf_drive - use shape instead.  */
index bd0fe826e6831769d121a5391b74ab597685273e..45118a887307d392a20f5e85a52cd9f213749e49 100644 (file)
@@ -404,7 +404,6 @@ set_frame_size (EmacsFrame ew)
     }
 #endif /* 0 */
   {
-    struct frame *f = ew->emacs_frame.frame;
     Dimension pixel_width, pixel_height;
 
     /* Take into account the size of the scrollbar.  Always use the
@@ -413,8 +412,6 @@ set_frame_size (EmacsFrame ew)
        frame's character width which is bad for vertically split
        windows.  */
 
-    compute_fringe_widths (f, 0);
-
 #if 0 /* This can run Lisp code, and it is dangerous to give
         out the frame to Lisp code before it officially exists.
         This is handled in Fx_create_frame so not needed here.  */
@@ -472,10 +469,6 @@ update_wm_hints (EmacsFrame ew)
   /* This happens when the frame is just created.  */
   if (! wmshell) return;
 
-#if 0
-  check_frame_size (ew->emacs_frame.frame, &min_cols, &min_rows, 0);
-#endif
-
   pixel_to_char_size (ew, ew->core.width, ew->core.height,
                      &char_width, &char_height);
   char_to_pixel_size (ew, char_width, char_height,
@@ -690,6 +683,15 @@ EmacsFrameResize (Widget widget)
   if (true || frame_resize_pixelwise)
     {
       int width, height;
+/**       int width = (ew->core.width **/
+/**               - FRAME_SCROLL_BAR_AREA_WIDTH (f) **/
+/**               - FRAME_TOTAL_FRINGE_WIDTH (f) **/
+/**               - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/
+
+/**       int height  = (ew->core.height **/
+/**                 - FRAME_TOOLBAR_HEIGHT (f) **/
+/**                 - FRAME_SCROLL_BAR_AREA_HEIGHT (f) **/
+/**                 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/
 
       pixel_to_text_size (ew, ew->core.width, ew->core.height, &width, &height);
       change_frame_size (f, width, height, 0, 1, 0, 1);
@@ -829,7 +831,8 @@ EmacsFrameSetCharSize (Widget widget, int columns, int rows)
   EmacsFrame ew = (EmacsFrame) widget;
   struct frame *f = ew->emacs_frame.frame;
 
-  x_set_window_size (f, 0, columns, rows, 0);
+  if (!frame_inhibit_resize (f, 0) && !frame_inhibit_resize (f, 1))
+    x_set_window_size (f, 0, columns, rows, 0);
 }
 
 \f
index 5c4e2f97a3bc80556bd718b8cdaa0964d4380454..e3554ea032e9bfc14b409d0bb1d630473223d38e 100644 (file)
@@ -27,6 +27,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "buffer.h"
 #include "keyboard.h"
 #include "keymap.h"
+#include "menu.h"
 #include "frame.h"
 #include "window.h"
 #include "commands.h"
@@ -51,6 +52,7 @@ static Lisp_Object Qrecord_window_buffer;
 static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer;
 static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window;
 static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically;
+static Lisp_Object Qwindow_sanitize_window_sizes;
 static Lisp_Object Qwindow_pixel_to_total;
 static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
 static Lisp_Object Qsafe, Qabove, Qbelow, Qwindow_size, Qclone_of;
@@ -86,7 +88,7 @@ static struct window *set_window_fringes (struct window *, Lisp_Object,
 static struct window *set_window_margins (struct window *, Lisp_Object,
                                          Lisp_Object);
 static struct window *set_window_scroll_bars (struct window *, Lisp_Object,
-                                             Lisp_Object, Lisp_Object);
+                                             Lisp_Object, Lisp_Object, Lisp_Object);
 static void apply_window_adjustment (struct window *);
 
 /* This is the window in which the terminal's cursor should
@@ -119,9 +121,6 @@ static Lisp_Object Qtemp_buffer_show_hook;
 /* Incremented for each window created.  */
 static int sequence_number;
 
-/* Nonzero after init_window_once has finished.  */
-static int window_initialized;
-
 /* Hook to run when window config changes.  */
 static Lisp_Object Qwindow_configuration_change_hook;
 
@@ -145,66 +144,85 @@ wset_combination_limit (struct window *w, Lisp_Object val)
 {
   w->combination_limit = val;
 }
+
 static void
 wset_dedicated (struct window *w, Lisp_Object val)
 {
   w->dedicated = val;
 }
+
 static void
 wset_display_table (struct window *w, Lisp_Object val)
 {
   w->display_table = val;
 }
+
 static void
 wset_new_normal (struct window *w, Lisp_Object val)
 {
   w->new_normal = val;
 }
+
 static void
 wset_new_total (struct window *w, Lisp_Object val)
 {
   w->new_total = val;
 }
+
 static void
 wset_normal_cols (struct window *w, Lisp_Object val)
 {
   w->normal_cols = val;
 }
+
 static void
 wset_normal_lines (struct window *w, Lisp_Object val)
 {
   w->normal_lines = val;
 }
+
 static void
 wset_parent (struct window *w, Lisp_Object val)
 {
   w->parent = val;
 }
+
 static void
 wset_pointm (struct window *w, Lisp_Object val)
 {
   w->pointm = val;
 }
+
+static void
+wset_old_pointm (struct window *w, Lisp_Object val)
+{
+  w->old_pointm = val;
+}
+
 static void
 wset_start (struct window *w, Lisp_Object val)
 {
   w->start = val;
 }
+
 static void
 wset_temslot (struct window *w, Lisp_Object val)
 {
   w->temslot = val;
 }
+
 static void
 wset_vertical_scroll_bar_type (struct window *w, Lisp_Object val)
 {
   w->vertical_scroll_bar_type = val;
 }
+
 static void
 wset_window_parameters (struct window *w, Lisp_Object val)
 {
   w->window_parameters = val;
 }
+
 static void
 wset_combination (struct window *w, bool horflag, Lisp_Object val)
 {
@@ -873,6 +891,9 @@ window_body_height (struct window *w, bool pixelwise)
 {
   int height = (w->pixel_height
                - WINDOW_HEADER_LINE_HEIGHT (w)
+               - (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w)
+                  ? WINDOW_SCROLL_BAR_AREA_HEIGHT (w)
+                  : 0)
                - WINDOW_MODE_LINE_HEIGHT (w)
                - WINDOW_BOTTOM_DIVIDER_WIDTH (w));
 
@@ -993,6 +1014,15 @@ WINDOW must be a live window and defaults to the selected one.  */)
   return (make_number (WINDOW_SCROLL_BAR_AREA_WIDTH (decode_live_window (window))));
 }
 
+DEFUN ("window-scroll-bar-height", Fwindow_scroll_bar_height,
+       Swindow_scroll_bar_height, 0, 1, 0,
+       doc: /* Return the height in pixels of WINDOW's horizontal scrollbar.
+WINDOW must be a live window and defaults to the selected one.  */)
+  (Lisp_Object window)
+{
+  return (make_number (WINDOW_SCROLL_BAR_AREA_HEIGHT (decode_live_window (window))));
+}
+
 DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
        doc: /* Return the number of columns by which WINDOW is scrolled from left margin.
 WINDOW must be a live window and defaults to the selected one.  */)
@@ -1020,6 +1050,8 @@ set_window_hscroll (struct window *w, EMACS_INT hscroll)
     XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1;
 
   w->hscroll = new_hscroll;
+  w->suspend_auto_hscroll = 1;
+
   return make_number (new_hscroll);
 }
 
@@ -1169,12 +1201,16 @@ display margins, fringes, header line, and/or mode line.  */)
 
   return list4i ((WINDOW_BOX_LEFT_EDGE_COL (w)
                  + WINDOW_LEFT_MARGIN_COLS (w)
-                 + WINDOW_LEFT_FRINGE_COLS (w)),
+                 + ((WINDOW_LEFT_FRINGE_WIDTH (w)
+                     + WINDOW_FRAME_COLUMN_WIDTH (w) - 1)
+                    / WINDOW_FRAME_COLUMN_WIDTH (w))),
                 (WINDOW_TOP_EDGE_LINE (w)
                  + WINDOW_HEADER_LINE_LINES (w)),
                 (WINDOW_BOX_RIGHT_EDGE_COL (w)
                  - WINDOW_RIGHT_MARGIN_COLS (w)
-                 - WINDOW_RIGHT_FRINGE_COLS (w)),
+                 - ((WINDOW_RIGHT_FRINGE_WIDTH (w)
+                     + WINDOW_FRAME_COLUMN_WIDTH (w) - 1)
+                    / WINDOW_FRAME_COLUMN_WIDTH (w))),
                 (WINDOW_BOTTOM_EDGE_LINE (w)
                  - WINDOW_MODE_LINE_LINES (w)));
 }
@@ -1288,6 +1324,17 @@ coordinates_in_window (register struct window *w, int x, int y)
           && x >= right_x - WINDOW_RIGHT_DIVIDER_WIDTH (w)
           && x <= right_x)
     return ON_RIGHT_DIVIDER;
+  /* On the horizontal scroll bar?  (Including the empty space at its
+     right!)  */
+  else if ((WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w)
+           && y >= (bottom_y
+                    - WINDOW_SCROLL_BAR_AREA_HEIGHT (w)
+                    - CURRENT_MODE_LINE_HEIGHT (w)
+                    - WINDOW_BOTTOM_DIVIDER_WIDTH (w))
+           && y <= (bottom_y
+                    - CURRENT_MODE_LINE_HEIGHT (w)
+                    - WINDOW_BOTTOM_DIVIDER_WIDTH (w))))
+    return ON_HORIZONTAL_SCROLL_BAR;
   /* On the mode or header line?   */
   else if ((WINDOW_WANTS_MODELINE_P (w)
            && y >= (bottom_y
@@ -1331,7 +1378,7 @@ coordinates_in_window (register struct window *w, int x, int y)
 
   /* Outside any interesting column?  */
   if (x < left_x || x > right_x)
-    return ON_SCROLL_BAR;
+    return ON_VERTICAL_SCROLL_BAR;
 
   lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
   rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
@@ -1495,10 +1542,13 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
     case ON_RIGHT_MARGIN:
       return Qright_margin;
 
-    case ON_SCROLL_BAR:
+    case ON_VERTICAL_SCROLL_BAR:
       /* Historically we are supposed to return nil in this case.  */
       return Qnil;
 
+    case ON_HORIZONTAL_SCROLL_BAR:
+      return Qnil;
+
     case ON_RIGHT_DIVIDER:
       return Qright_divider;
 
@@ -1639,6 +1689,14 @@ correct to return the top-level value of `point', outside of any
     return Fmarker_position (w->pointm);
 }
 
+DEFUN ("window-old-point", Fwindow_old_point, Swindow_old_point, 0, 1, 0,
+       doc: /* Return old value of point in WINDOW.
+WINDOW must be a live window and defaults to the selected one.  */)
+  (Lisp_Object window)
+{
+  return Fmarker_position (decode_live_window (window)->old_pointm);
+}
+
 DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
        doc: /* Return position at which display currently starts in WINDOW.
 WINDOW must be a live window and defaults to the selected one.
@@ -2917,6 +2975,7 @@ selected frame and no others.  */)
     return Qnil;
 }
 
+
 static Lisp_Object
 resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore, Lisp_Object pixelwise)
 {
@@ -2924,10 +2983,17 @@ resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizonta
 }
 
 
+Lisp_Object
+sanitize_window_sizes (Lisp_Object frame, Lisp_Object horizontal)
+{
+  return call2 (Qwindow_sanitize_window_sizes, frame, horizontal);
+}
+
+
 static Lisp_Object
 window_pixel_to_total (Lisp_Object frame, Lisp_Object horizontal)
 {
-  return call2(Qwindow_pixel_to_total, frame, horizontal);
+  return call2 (Qwindow_pixel_to_total, frame, horizontal);
 }
 
 
@@ -3206,89 +3272,6 @@ replace_buffer_in_windows_safely (Lisp_Object buffer)
        window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, 1, frame);
     }
 }
-
-/* If *HEIGHT or *WIDTH are too small a size for FRAME, set them to the
-   minimum allowable size.  PIXELWISE means interpret these as pixel
-   sizes.  */
-
-void
-check_frame_size (struct frame *frame, int *width, int *height, bool pixelwise)
-{
-  /* For height, we have to see:
-     how many windows the frame has at minimum (one or two),
-     and whether it has a menu bar or other special stuff at the top.  */
-  if (pixelwise)
-    {
-      int min_height = MIN_SAFE_WINDOW_HEIGHT * FRAME_LINE_HEIGHT (frame);
-      int min_width = MIN_SAFE_WINDOW_WIDTH * FRAME_COLUMN_WIDTH (frame);
-
-      if (!FRAME_MINIBUF_ONLY_P (frame) && FRAME_HAS_MINIBUF_P (frame))
-       min_height = 2 * min_height;
-
-      min_height += FRAME_TOP_MARGIN_HEIGHT (frame);
-      min_height += FRAME_INTERNAL_BORDER_WIDTH (frame);
-
-      if (*height < min_height)
-       *height = min_height;
-      if (*width < min_width)
-       *width = min_width;
-    }
-  else
-    {
-      int min_height
-       = ((FRAME_MINIBUF_ONLY_P (frame) || ! FRAME_HAS_MINIBUF_P (frame))
-          ? MIN_SAFE_WINDOW_HEIGHT
-          : 2 * MIN_SAFE_WINDOW_HEIGHT);
-
-      if (FRAME_TOP_MARGIN (frame) > 0)
-       min_height += FRAME_TOP_MARGIN (frame);
-
-      if (*height < min_height)
-       *height = min_height;
-      if (*width  < MIN_SAFE_WINDOW_WIDTH)
-       *width = MIN_SAFE_WINDOW_WIDTH;
-    }
-}
-
-/* Adjust the margins of window W if text area is too small.
-   Return 1 if window width is ok after adjustment; 0 if window
-   is still too narrow.  */
-
-static int
-adjust_window_margins (struct window *w)
-{
-  int box_width = (WINDOW_PIXEL_WIDTH (w)
-                  - WINDOW_FRINGES_WIDTH (w)
-                  - WINDOW_SCROLL_BAR_AREA_WIDTH (w));
-  int margin_width = WINDOW_MARGINS_WIDTH (w);
-
-  if (box_width - margin_width >= MIN_SAFE_WINDOW_PIXEL_WIDTH (w))
-    return 1;
-
-  if (margin_width < 0 || box_width < MIN_SAFE_WINDOW_PIXEL_WIDTH (w))
-    return 0;
-  else
-    /* Window's text area is too narrow, but reducing the window
-       margins will fix that.  */
-    {
-      int unit = WINDOW_FRAME_COLUMN_WIDTH (w);
-
-      margin_width = box_width - MIN_SAFE_WINDOW_PIXEL_WIDTH (w);
-
-      if (WINDOW_RIGHT_MARGIN_WIDTH (w) > 0)
-       {
-         if (WINDOW_LEFT_MARGIN_WIDTH (w) > 0)
-           w->left_margin_cols = w->right_margin_cols =
-             margin_width / (2 * unit);
-         else
-           w->right_margin_cols = margin_width / unit;
-       }
-      else
-       w->left_margin_cols = margin_width / unit;
-
-      return 1;
-    }
-}
 \f
 /* The following three routines are needed for running a window's
    configuration change hook.  */
@@ -3322,7 +3305,7 @@ run_window_configuration_change_hook (struct frame *f)
     = Fdefault_value (Qwindow_configuration_change_hook);
   XSETFRAME (frame, f);
 
-  if (NILP (Vrun_hooks) || !NILP (inhibit_lisp_code))
+  if (NILP (Vrun_hooks) || !(f->official))
     return;
 
   /* Use the right buffer.  Matters when running the local hooks.  */
@@ -3417,17 +3400,21 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
   w->last_cursor_vpos = 0;
 
   if (!(keep_margins_p && samebuf))
-    { /* If we're not actually changing the buffer, don't reset hscroll and
-        vscroll.  This case happens for example when called from
+    { /* If we're not actually changing the buffer, don't reset hscroll
+        and vscroll.  This case happens for example when called from
         change_frame_size_1, where we use a dummy call to
-        Fset_window_buffer on the frame's selected window (and no other)
-        just in order to run window-configuration-change-hook.
-        Resetting hscroll and vscroll here is problematic for things like
-        image-mode and doc-view-mode since it resets the image's position
-        whenever we resize the frame.  */
-      w->hscroll = w->min_hscroll = 0;
+        Fset_window_buffer on the frame's selected window (and no
+        other) just in order to run window-configuration-change-hook
+        (no longer true since change_frame_size_1 directly calls
+        run_window_configuration_change_hook).  Resetting hscroll and
+        vscroll here is problematic for things like image-mode and
+        doc-view-mode since it resets the image's position whenever we
+        resize the frame.  */
+      w->hscroll = w->min_hscroll = w->hscroll_whole = 0;
+      w->suspend_auto_hscroll = 0;
       w->vscroll = 0;
       set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
+      set_marker_both (w->old_pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
       set_marker_restricted (w->start,
                             make_number (b->last_window_start),
                             buffer);
@@ -3439,16 +3426,13 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
   wset_redisplay (w);
   w->update_mode_line = true;
 
-  /* We must select BUFFER for running the window-scroll-functions.  */
-  /* We can't check ! NILP (Vwindow_scroll_functions) here
-     because that might itself be a local variable.  */
-  if (window_initialized)
-    {
-      record_unwind_current_buffer ();
-      Fset_buffer (buffer);
-    }
+  /* We must select BUFFER to run the window-scroll-functions and to look up
+     the buffer-local value of Vwindow_point_insertion_type.  */
+  record_unwind_current_buffer ();
+  Fset_buffer (buffer);
 
   XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type);
+  XMARKER (w->old_pointm)->insertion_type = !NILP (Vwindow_point_insertion_type);
 
   if (!keep_margins_p)
     {
@@ -3457,7 +3441,9 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
                          BVAR (b, right_fringe_width),
                          BVAR (b, fringes_outside_margins));
       set_window_scroll_bars (w, BVAR (b, scroll_bar_width),
-                             BVAR (b, vertical_scroll_bar_type), Qnil);
+                             BVAR (b, vertical_scroll_bar_type),
+                             BVAR (b, scroll_bar_height),
+                             BVAR (b, horizontal_scroll_bar_type));
       set_window_margins (w, BVAR (b, left_margin_cols),
                          BVAR (b, right_margin_cols));
       apply_window_adjustment (w);
@@ -3603,10 +3589,11 @@ temp_output_buffer_show (register Lisp_Object buf)
        Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
       Vminibuf_scroll_window = window;
       w = XWINDOW (window);
-      w->hscroll = 0;
-      w->min_hscroll = 0;
+      w->hscroll = w->min_hscroll = w->hscroll_whole = 0;
+      w->suspend_auto_hscroll = 0;
       set_marker_restricted_both (w->start, buf, BEG, BEG);
       set_marker_restricted_both (w->pointm, buf, BEG, BEG);
+      set_marker_restricted_both (w->old_pointm, buf, BEG, BEG);
 
       /* Run temp-buffer-show-hook, with the chosen window selected
         and its buffer current.  */
@@ -3658,6 +3645,7 @@ make_parent_window (Lisp_Object window, bool horflag)
   /* ...but now P becomes an internal window.  */
   wset_start (p, Qnil);
   wset_pointm (p, Qnil);
+  wset_old_pointm (p, Qnil);
   wset_buffer (p, Qnil);
   wset_combination (p, horflag, window);
   wset_combination_limit (p, Qnil);
@@ -3681,7 +3669,9 @@ make_window (void)
   wset_new_pixel (w, make_number (0));
   wset_start (w, Fmake_marker ());
   wset_pointm (w, Fmake_marker ());
+  wset_old_pointm (w, Fmake_marker ());
   wset_vertical_scroll_bar_type (w, Qt);
+  wset_horizontal_scroll_bar_type (w, Qt);
   /* These Lisp fields are marked specially so they're not set to nil by
      allocate_window.  */
   wset_prev_buffers (w, Qnil);
@@ -3698,8 +3688,8 @@ make_window (void)
 #endif
   w->sequence_number = ++sequence_number;
   w->scroll_bar_width = -1;
+  w->scroll_bar_height = -1;
   w->column_number_displayed = -1;
-
   /* Reset window_list.  */
   Vwindow_list = Qnil;
   /* Return window.  */
@@ -3949,11 +3939,8 @@ window_resize_apply (struct window *w, bool horflag)
        }
     }
   else
-    {
-      adjust_window_margins (w);
-      /* Bug#15957.  */
-      w->window_end_valid = 0;
-    }
+    /* Bug#15957.  */
+    w->window_end_valid = 0;
 }
 
 
@@ -4113,6 +4100,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
   /* old_size is the old size of the frame's root window.  */
   int old_size = horflag ? r->total_cols : r->total_lines;
   int old_pixel_size = horflag ? r->pixel_width : r->pixel_height;
+  int old_pixel_top = r->pixel_top;
   /* new_size is the new size of the frame's root window.  */
   int new_size, new_pixel_size;
   int unit = horflag ? FRAME_COLUMN_WIDTH (f) : FRAME_LINE_HEIGHT (f);
@@ -4127,7 +4115,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
       new_pixel_size = max (horflag
                            ? size
                            : (size
-                              - FRAME_TOP_MARGIN_HEIGHT (f)
+/**                           - FRAME_TOP_MARGIN_HEIGHT (f) **/
                               - ((FRAME_HAS_MINIBUF_P (f)
                                   && !FRAME_MINIBUF_ONLY_P (f))
                                  ? FRAME_LINE_HEIGHT (f) : 0)),
@@ -4139,7 +4127,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
       new_size = max (horflag
                      ? size
                      : (size
-                        - FRAME_TOP_MARGIN (f)
+/**                     - FRAME_TOP_MARGIN (f) **/
                         - ((FRAME_HAS_MINIBUF_P (f)
                             && !FRAME_MINIBUF_ONLY_P (f))
                            ? 1 : 0)),
@@ -4150,7 +4138,8 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
   r->top_line = FRAME_TOP_MARGIN (f);
   r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f);
 
-  if (new_pixel_size == old_pixel_size)
+  if (new_pixel_size == old_pixel_size
+      && r->pixel_top == old_pixel_top)
     ;
   else if (WINDOW_LEAF_P (r))
     /* For a leaf root window just set the size.  */
@@ -4192,6 +4181,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
            {
              window_resize_apply (r, horflag);
              window_pixel_to_total (r->frame, horflag ? Qt : Qnil);
+#if 0 /* Let's try without safe sizes and/or killing other windows.  */
            }
          else
            {
@@ -4204,7 +4194,6 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
                  window_resize_apply (r, horflag);
                  window_pixel_to_total (r->frame, horflag ? Qt : Qnil);
                }
-#if 0 /* Let's try without killing other windows.  */
              else
                {
                  /* We lost.  Delete all windows but the frame's
@@ -4408,7 +4397,9 @@ set correctly.  See the code of `split-window' for how this is done.  */)
   n->right_fringe_width = r->right_fringe_width;
   n->fringes_outside_margins = r->fringes_outside_margins;
   n->scroll_bar_width = r->scroll_bar_width;
+  n->scroll_bar_height = r->scroll_bar_height;
   wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type);
+  wset_horizontal_scroll_bar_type (n, r->horizontal_scroll_bar_type);
 
   /* Directly assign orthogonal coordinates and sizes.  */
   if (horflag)
@@ -4552,6 +4543,7 @@ Signal an error when WINDOW is the only window on its frame.  */)
        {
          unshow_buffer (w);
          unchain_marker (XMARKER (w->pointm));
+         unchain_marker (XMARKER (w->old_pointm));
          unchain_marker (XMARKER (w->start));
          wset_buffer (w, Qnil);
        }
@@ -4813,6 +4805,7 @@ window_internal_height (struct window *w)
 
   return ht;
 }
+
 \f
 /************************************************************************
                           Window Scrolling
@@ -4863,6 +4856,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
   void *itdata = NULL;
   int window_total_lines;
   int frame_line_height = default_line_pixel_height (w);
+  bool adjust_old_pointm = !NILP (Fequal (Fwindow_point (window),
+                                         Fwindow_old_point (window)));
 
   SET_TEXT_POS_FROM_MARKER (start, w->start);
   /* Scrolling a minibuffer window via scroll bar when the echo area
@@ -4874,7 +4869,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
   /* If PT is not visible in WINDOW, move back one half of
      the screen.  Allow PT to be partially visible, otherwise
      something like (scroll-down 1) with PT in the line before
-     the partially visible one would recenter. */
+     the partially visible one would recenter.  */
 
   if (!pos_visible_p (w, PT, &x, &y, &rtop, &rbot, &rowh, &vpos))
     {
@@ -4903,7 +4898,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
     }
   else if (auto_window_vscroll_p)
     {
-      if (rtop || rbot)                /* partially visible */
+      if (rtop || rbot)                /* Partially visible.  */
        {
          int px;
          int dy = frame_line_height;
@@ -4991,6 +4986,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
     {
       ptrdiff_t start_pos = IT_CHARPOS (it);
       int dy = frame_line_height;
+
       dy = max ((window_box_height (w)
                 - next_screen_context_lines * dy),
                dy) * n;
@@ -5234,6 +5230,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
        }
     }
   bidi_unshelve_cache (itdata, 0);
+
+  if (adjust_old_pointm)
+    Fset_marker (w->old_pointm,
+                ((w == XWINDOW (selected_window))
+                 ? make_number (BUF_PT (XBUFFER (w->contents)))
+                 : Fmarker_position (w->pointm)),
+                w->contents);
 }
 
 
@@ -5258,6 +5261,8 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, int noerror)
   ptrdiff_t startpos = marker_position (w->start);
   ptrdiff_t startbyte = marker_byte_position (w->start);
   Lisp_Object original_pos = Qnil;
+  bool adjust_old_pointm = !NILP (Fequal (Fwindow_point (window),
+                                         Fwindow_old_point (window)));
 
   /* If scrolling screen-fulls, compute the number of lines to
      scroll from the window's height.  */
@@ -5273,6 +5278,7 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, int noerror)
          struct position posit
            = *compute_motion (startpos, startbyte, 0, 0, 0,
                               PT, ht, 0, -1, w->hscroll, 0, w);
+
          window_scroll_preserve_vpos = posit.vpos;
          window_scroll_preserve_hpos = posit.hpos + w->hscroll;
        }
@@ -5388,6 +5394,13 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, int noerror)
       else
        xsignal0 (Qend_of_buffer);
     }
+
+  if (adjust_old_pointm)
+    Fset_marker (w->old_pointm,
+                ((w == XWINDOW (selected_window))
+                 ? make_number (BUF_PT (XBUFFER (w->contents)))
+                 : Fmarker_position (w->pointm)),
+                w->contents);
 }
 
 
@@ -5524,6 +5537,7 @@ specifies the window to scroll.  This takes precedence over
 
   Fset_buffer (w->contents);
   SET_PT_BOTH (marker_position (w->pointm), marker_byte_position (w->pointm));
+  SET_PT_BOTH (marker_position (w->old_pointm), marker_byte_position (w->old_pointm));
 
   if (NILP (arg))
     window_scroll (window, 1, 1, 1);
@@ -5538,6 +5552,7 @@ specifies the window to scroll.  This takes precedence over
     }
 
   set_marker_both (w->pointm, Qnil, PT, PT_BYTE);
+  set_marker_both (w->old_pointm, Qnil, PT, PT_BYTE);
   unbind_to (count, Qnil);
 
   return Qnil;
@@ -5563,6 +5578,8 @@ by this function.  This happens in an interactive call.  */)
   if (!NILP (set_minimum))
     w->min_hscroll = w->hscroll;
 
+  w->suspend_auto_hscroll = 1;
+
   return result;
 }
 
@@ -5586,6 +5603,8 @@ by this function.  This happens in an interactive call.  */)
   if (!NILP (set_minimum))
     w->min_hscroll = w->hscroll;
 
+  w->suspend_auto_hscroll = 1;
+
   return result;
 }
 
@@ -5676,14 +5695,16 @@ and redisplay normally--don't erase and redraw the frame.  */)
 {
   struct window *w = XWINDOW (selected_window);
   struct buffer *buf = XBUFFER (w->contents);
-  struct buffer *obuf = current_buffer;
   bool center_p = 0;
   ptrdiff_t charpos, bytepos;
   EMACS_INT iarg IF_LINT (= 0);
   int this_scroll_margin;
 
+  if (buf != current_buffer)
+    error ("`recenter'ing a window that does not display current-buffer.");
+
   /* If redisplay is suppressed due to an error, try again.  */
-  obuf->display_error_modiff = 0;
+  buf->display_error_modiff = 0;
 
   if (NILP (arg))
     {
@@ -5705,7 +5726,7 @@ and redisplay normally--don't erase and redraw the frame.  */)
 
       center_p = 1;
     }
-  else if (CONSP (arg)) /* Just C-u. */
+  else if (CONSP (arg)) /* Just C-u.  */
     center_p = 1;
   else
     {
@@ -5714,12 +5735,10 @@ and redisplay normally--don't erase and redraw the frame.  */)
       iarg = XINT (arg);
     }
 
-  set_buffer_internal (buf);
-
   /* Do this after making BUF current
      in case scroll_margin is buffer-local.  */
-  this_scroll_margin =
-    max (0, min (scroll_margin, w->total_lines / 4));
+  this_scroll_margin
+    max (0, min (scroll_margin, w->total_lines / 4));
 
   /* Handle centering on a graphical frame specially.  Such frames can
      have variable-height lines and centering point on the basis of
@@ -5767,7 +5786,7 @@ and redisplay normally--don't erase and redraw the frame.  */)
            h -= it.current_y;
          else
            {
-             /* Last line has no newline */
+             /* Last line has no newline */
              h -= line_bottom_y (&it);
              it.vpos++;
            }
@@ -5846,42 +5865,53 @@ and redisplay normally--don't erase and redraw the frame.  */)
 
   w->optional_new_start = 1;
 
-  w->start_at_line_beg = (bytepos == BEGV_BYTE ||
-                         FETCH_BYTE (bytepos - 1) == '\n');
+  w->start_at_line_beg = (bytepos == BEGV_BYTE
+                         || FETCH_BYTE (bytepos - 1) == '\n');
 
-  set_buffer_internal (obuf);
   return Qnil;
 }
 
 DEFUN ("window-text-width", Fwindow_text_width, Swindow_text_width,
-       0, 1, 0,
+       0, 2, 0,
        doc: /* Return the width in columns of the text display area of WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 
 The returned width does not include dividers, scrollbars, margins,
 fringes, nor any partial-width columns at the right of the text
-area.  */)
-  (Lisp_Object window)
+area.
+
+Optional argument PIXELWISE non-nil, means to return the width in
+pixels.  */)
+  (Lisp_Object window, Lisp_Object pixelwise)
 {
   struct window *w = decode_live_window (window);
 
-  return make_number (window_box_width (w, TEXT_AREA)
-                     / FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)));
+  if (NILP (pixelwise))
+    return make_number (window_box_width (w, TEXT_AREA)
+                       / FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)));
+  else
+    return make_number (window_box_width (w, TEXT_AREA));
 }
 
 DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height,
-       0, 1, 0,
+       0, 2, 0,
        doc: /* Return the height in lines of the text display area of WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 
 The returned height does not include dividers, the mode line, any header
-line, nor any partial-height lines at the bottom of the text area.  */)
-  (Lisp_Object window)
+line, nor any partial-height lines at the bottom of the text area.
+
+Optional argument PIXELWISE non-nil, means to return the height in
+pixels.  */)
+  (Lisp_Object window, Lisp_Object pixelwise)
 {
   struct window *w = decode_live_window (window);
 
-  return make_number (window_box_height (w)
-                     / FRAME_LINE_HEIGHT (WINDOW_XFRAME (w)));
+  if (NILP (pixelwise))
+    return make_number (window_box_height (w)
+                       / FRAME_LINE_HEIGHT (WINDOW_XFRAME (w)));
+  else
+    return make_number (window_box_height (w));
 }
 \f
 DEFUN ("move-to-window-line", Fmove_to_window_line, Smove_to_window_line,
@@ -5986,22 +6016,23 @@ struct save_window_data
     int frame_menu_bar_height, frame_tool_bar_height;
   };
 
-/* This is saved as a Lisp_Vector  */
+/* This is saved as a Lisp_Vector.  */
 struct saved_window
 {
   struct vectorlike_header header;
 
-  Lisp_Object window, buffer, start, pointm, mark;
+  Lisp_Object window, buffer, start, pointm, old_pointm;
   Lisp_Object pixel_left, pixel_top, pixel_height, pixel_width;
   Lisp_Object left_col, top_line, total_cols, total_lines;
   Lisp_Object normal_cols, normal_lines;
-  Lisp_Object hscroll, min_hscroll;
+  Lisp_Object hscroll, min_hscroll, hscroll_whole, suspend_auto_hscroll;
   Lisp_Object parent, prev;
   Lisp_Object start_at_line_beg;
   Lisp_Object display_table;
   Lisp_Object left_margin_cols, right_margin_cols;
   Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins;
   Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated;
+  Lisp_Object scroll_bar_height, horizontal_scroll_bar_type;
   Lisp_Object combination_limit, window_parameters;
 };
 
@@ -6029,13 +6060,359 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config
   return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
 }
 
-/* From Chong's unwind_create_frame_1.  */
-static void
-unwind_change_frame (Lisp_Object val)
+DEFUN ("set-window-configuration", Fset_window_configuration,
+       Sset_window_configuration, 1, 1, 0,
+       doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION.
+CONFIGURATION must be a value previously returned
+by `current-window-configuration' (which see).
+If CONFIGURATION was made from a frame that is now deleted,
+only frame-independent values can be restored.  In this case,
+the return value is nil.  Otherwise the value is t.  */)
+  (Lisp_Object configuration)
 {
-  inhibit_lisp_code = val;
+  register struct save_window_data *data;
+  struct Lisp_Vector *saved_windows;
+  Lisp_Object new_current_buffer;
+  Lisp_Object frame;
+  struct frame *f;
+  ptrdiff_t old_point = -1;
+
+  CHECK_WINDOW_CONFIGURATION (configuration);
+
+  data = (struct save_window_data *) XVECTOR (configuration);
+  saved_windows = XVECTOR (data->saved_windows);
+
+  new_current_buffer = data->current_buffer;
+  if (!BUFFER_LIVE_P (XBUFFER (new_current_buffer)))
+    new_current_buffer = Qnil;
+  else
+    {
+      if (XBUFFER (new_current_buffer) == current_buffer)
+       /* The code further down "preserves point" by saving here PT in
+          old_point and then setting it later back into PT.  When the
+          current-selected-window and the final-selected-window both show
+          the current buffer, this suffers from the problem that the
+          current PT is the window-point of the current-selected-window,
+          while the final PT is the point of the final-selected-window, so
+          this copy from one PT to the other would end up moving the
+          window-point of the final-selected-window to the window-point of
+          the current-selected-window.  So we have to be careful which
+          point of the current-buffer we copy into old_point.  */
+       if (EQ (XWINDOW (data->current_window)->contents, new_current_buffer)
+           && WINDOWP (selected_window)
+           && EQ (XWINDOW (selected_window)->contents, new_current_buffer)
+           && !EQ (selected_window, data->current_window))
+         old_point = marker_position (XWINDOW (data->current_window)->pointm);
+       else
+         old_point = PT;
+      else
+       /* BUF_PT (XBUFFER (new_current_buffer)) gives us the position of
+          point in new_current_buffer as of the last time this buffer was
+          used.  This can be non-deterministic since it can be changed by
+          things like jit-lock by mere temporary selection of some random
+          window that happens to show this buffer.
+          So if possible we want this arbitrary choice of "which point" to
+          be the one from the to-be-selected-window so as to prevent this
+          window's cursor from being copied from another window.  */
+       if (EQ (XWINDOW (data->current_window)->contents, new_current_buffer)
+           /* If current_window = selected_window, its point is in BUF_PT.  */
+           && !EQ (selected_window, data->current_window))
+         old_point = marker_position (XWINDOW (data->current_window)->pointm);
+       else
+         old_point = BUF_PT (XBUFFER (new_current_buffer));
+    }
+
+  frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
+  f = XFRAME (frame);
+
+  /* If f is a dead frame, don't bother rebuilding its window tree.
+     However, there is other stuff we should still try to do below.  */
+  if (FRAME_LIVE_P (f))
+    {
+      Lisp_Object window;
+      Lisp_Object dead_windows = Qnil;
+      register Lisp_Object tem, par, pers;
+      register struct window *w;
+      register struct saved_window *p;
+      struct window *root_window;
+      struct window **leaf_windows;
+      int n_leaf_windows;
+      ptrdiff_t k;
+      int i, n;
+
+      /* Don't do this within the main loop below: This may call Lisp
+        code and is thus potentially unsafe while input is blocked.  */
+      for (k = 0; k < saved_windows->header.size; k++)
+       {
+         p = SAVED_WINDOW_N (saved_windows, k);
+         window = p->window;
+         w = XWINDOW (window);
+         if (BUFFERP (w->contents)
+             && !EQ (w->contents, p->buffer)
+             && BUFFER_LIVE_P (XBUFFER (p->buffer)))
+           /* If a window we restore gets another buffer, record the
+              window's old buffer.  */
+           call1 (Qrecord_window_buffer, window);
+       }
+
+      /* Consider frame unofficial, temporarily.  */
+      f->official = false;
+      /* The mouse highlighting code could get screwed up
+        if it runs during this.  */
+      block_input ();
+
+      /* "Swap out" point from the selected window's buffer
+        into the window itself.  (Normally the pointm of the selected
+        window holds garbage.)  We do this now, before
+        restoring the window contents, and prevent it from
+        being done later on when we select a new window.  */
+      if (! NILP (XWINDOW (selected_window)->contents))
+       {
+         w = XWINDOW (selected_window);
+         set_marker_both (w->pointm,
+                          w->contents,
+                          BUF_PT (XBUFFER (w->contents)),
+                          BUF_PT_BYTE (XBUFFER (w->contents)));
+       }
+
+      fset_redisplay (f);
+      FRAME_WINDOW_SIZES_CHANGED (f) = 1;
+
+      /* Problem: Freeing all matrices and later allocating them again
+        is a serious redisplay flickering problem.  What we would
+        really like to do is to free only those matrices not reused
+        below.  */
+      root_window = XWINDOW (FRAME_ROOT_WINDOW (f));
+      leaf_windows = alloca (count_windows (root_window)
+                            * sizeof *leaf_windows);
+      n_leaf_windows = get_leaf_windows (root_window, leaf_windows, 0);
+
+      /* Kludge Alert!
+        Mark all windows now on frame as "deleted".
+        Restoring the new configuration "undeletes" any that are in it.
+
+        Save their current buffers in their height fields, since we may
+        need it later, if a buffer saved in the configuration is now
+        dead.  */
+      delete_all_child_windows (FRAME_ROOT_WINDOW (f));
+
+      for (k = 0; k < saved_windows->header.size; k++)
+       {
+         p = SAVED_WINDOW_N (saved_windows, k);
+         window = p->window;
+         w = XWINDOW (window);
+         wset_next (w, Qnil);
+
+         if (!NILP (p->parent))
+           wset_parent
+             (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->parent))->window);
+         else
+           wset_parent (w, Qnil);
+
+         if (!NILP (p->prev))
+           {
+             wset_prev
+               (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window);
+             wset_next (XWINDOW (w->prev), p->window);
+           }
+         else
+           {
+             wset_prev (w, Qnil);
+             if (!NILP (w->parent))
+               wset_combination (XWINDOW (w->parent),
+                                 (XINT (p->total_cols)
+                                  != XWINDOW (w->parent)->total_cols),
+                                 p->window);
+           }
+
+         /* If we squirreled away the buffer, restore it now.  */
+         if (BUFFERP (w->combination_limit))
+           wset_buffer (w, w->combination_limit);
+         w->pixel_left = XFASTINT (p->pixel_left);
+         w->pixel_top = XFASTINT (p->pixel_top);
+         w->pixel_width = XFASTINT (p->pixel_width);
+         w->pixel_height = XFASTINT (p->pixel_height);
+         w->left_col = XFASTINT (p->left_col);
+         w->top_line = XFASTINT (p->top_line);
+         w->total_cols = XFASTINT (p->total_cols);
+         w->total_lines = XFASTINT (p->total_lines);
+         wset_normal_cols (w, p->normal_cols);
+         wset_normal_lines (w, p->normal_lines);
+         w->hscroll = XFASTINT (p->hscroll);
+         w->suspend_auto_hscroll = !NILP (p->suspend_auto_hscroll);
+         w->min_hscroll = XFASTINT (p->min_hscroll);
+         w->hscroll_whole = XFASTINT (p->hscroll_whole);
+         wset_display_table (w, p->display_table);
+         w->left_margin_cols = XINT (p->left_margin_cols);
+         w->right_margin_cols = XINT (p->right_margin_cols);
+         w->left_fringe_width = XINT (p->left_fringe_width);
+         w->right_fringe_width = XINT (p->right_fringe_width);
+         w->fringes_outside_margins = !NILP (p->fringes_outside_margins);
+         w->scroll_bar_width = XINT (p->scroll_bar_width);
+         w->scroll_bar_height = XINT (p->scroll_bar_height);
+         wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type);
+         wset_horizontal_scroll_bar_type (w, p->horizontal_scroll_bar_type);
+         wset_dedicated (w, p->dedicated);
+         wset_combination_limit (w, p->combination_limit);
+         /* Restore any window parameters that have been saved.
+            Parameters that have not been saved are left alone.  */
+         for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem))
+           {
+             pers = XCAR (tem);
+             if (CONSP (pers))
+               {
+                 if (NILP (XCDR (pers)))
+                   {
+                     par = Fassq (XCAR (pers), w->window_parameters);
+                     if (CONSP (par) && !NILP (XCDR (par)))
+                       /* Reset a parameter to nil if and only if it
+                          has a non-nil association.  Don't make new
+                          associations.  */
+                       Fsetcdr (par, Qnil);
+                   }
+                 else
+                   /* Always restore a non-nil value.  */
+                   Fset_window_parameter (window, XCAR (pers), XCDR (pers));
+               }
+           }
+
+         if (BUFFERP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer)))
+           /* If saved buffer is alive, install it.  */
+           {
+             wset_buffer (w, p->buffer);
+             w->start_at_line_beg = !NILP (p->start_at_line_beg);
+             set_marker_restricted (w->start, p->start, w->contents);
+             set_marker_restricted (w->pointm, p->pointm, w->contents);
+             set_marker_restricted (w->old_pointm, p->old_pointm, w->contents);
+             /* As documented in Fcurrent_window_configuration, don't
+                restore the location of point in the buffer which was
+                current when the window configuration was recorded.  */
+             if (!EQ (p->buffer, new_current_buffer)
+                 && XBUFFER (p->buffer) == current_buffer)
+               Fgoto_char (w->pointm);
+           }
+         else if (BUFFERP (w->contents) && BUFFER_LIVE_P (XBUFFER (w->contents)))
+           /* Keep window's old buffer; make sure the markers are real.  */
+           {
+             /* Set window markers at start of visible range.  */
+             if (XMARKER (w->start)->buffer == 0)
+               set_marker_restricted_both (w->start, w->contents, 0, 0);
+             if (XMARKER (w->pointm)->buffer == 0)
+               set_marker_restricted_both
+                 (w->pointm, w->contents,
+                  BUF_PT (XBUFFER (w->contents)),
+                  BUF_PT_BYTE (XBUFFER (w->contents)));
+             if (XMARKER (w->old_pointm)->buffer == 0)
+               set_marker_restricted_both
+                 (w->old_pointm, w->contents,
+                  BUF_PT (XBUFFER (w->contents)),
+                  BUF_PT_BYTE (XBUFFER (w->contents)));
+             w->start_at_line_beg = 1;
+           }
+         else if (!NILP (w->start))
+           /* Leaf window has no live buffer, get one.  */
+           {
+             /* Get the buffer via other_buffer_safely in order to
+                avoid showing an unimportant buffer and, if necessary, to
+                recreate *scratch* in the course (part of Juanma's bs-show
+                scenario from March 2011).  */
+             wset_buffer (w, other_buffer_safely (Fcurrent_buffer ()));
+             /* This will set the markers to beginning of visible
+                range.  */
+             set_marker_restricted_both (w->start, w->contents, 0, 0);
+             set_marker_restricted_both (w->pointm, w->contents, 0, 0);
+             set_marker_restricted_both (w->old_pointm, w->contents, 0, 0);
+             w->start_at_line_beg = 1;
+             if (!NILP (w->dedicated))
+               /* Record this window as dead.  */
+               dead_windows = Fcons (window, dead_windows);
+             /* Make sure window is no more dedicated.  */
+             wset_dedicated (w, Qnil);
+           }
+       }
+
+      fset_root_window (f, data->root_window);
+      /* Arrange *not* to restore point in the buffer that was
+        current when the window configuration was saved.  */
+      if (EQ (XWINDOW (data->current_window)->contents, new_current_buffer))
+       set_marker_restricted (XWINDOW (data->current_window)->pointm,
+                              make_number (old_point),
+                              XWINDOW (data->current_window)->contents);
+
+      /* In the following call to `select-window', prevent "swapping out
+        point" in the old selected window using the buffer that has
+        been restored into it.  We already swapped out that point from
+        that window's old buffer.
+
+        Do not record the buffer here.  We do that in a separate call
+        to select_window below.  See also Bug#16207.  */
+      select_window (data->current_window, Qt, 1);
+      BVAR (XBUFFER (XWINDOW (selected_window)->contents),
+           last_selected_window)
+       = selected_window;
+
+      if (NILP (data->focus_frame)
+         || (FRAMEP (data->focus_frame)
+             && FRAME_LIVE_P (XFRAME (data->focus_frame))))
+       Fredirect_frame_focus (frame, data->focus_frame);
+
+      /* Now, free glyph matrices in windows that were not reused.  */
+      for (i = n = 0; i < n_leaf_windows; ++i)
+       {
+         if (NILP (leaf_windows[i]->contents))
+           free_window_matrices (leaf_windows[i]);
+         else if (EQ (leaf_windows[i]->contents, new_current_buffer))
+           ++n;
+       }
+
+      /* Make frame official again and apply frame size changes if
+        needed.  */
+      f->official = true;
+      adjust_frame_size (f, -1, -1, 1, 0);
+
+      adjust_frame_glyphs (f);
+      unblock_input ();
+
+      /* Scan dead buffer windows.  */
+      for (; CONSP (dead_windows); dead_windows = XCDR (dead_windows))
+       {
+         window = XCAR (dead_windows);
+         if (WINDOW_LIVE_P (window) && !EQ (window, FRAME_ROOT_WINDOW (f)))
+           delete_deletable_window (window);
+       }
+
+      /* Record the selected window's buffer here.  The window should
+        already be the selected one from the call above.  */
+      select_window (data->current_window, Qnil, 0);
+
+      /* Fselect_window will have made f the selected frame, so we
+        reselect the proper frame here.  Fhandle_switch_frame will change the
+        selected window too, but that doesn't make the call to
+        Fselect_window above totally superfluous; it still sets f's
+        selected window.  */
+      if (FRAME_LIVE_P (XFRAME (data->selected_frame)))
+       do_switch_frame (data->selected_frame, 0, 0, Qnil);
+
+      run_window_configuration_change_hook (f);
+    }
+
+  if (!NILP (new_current_buffer))
+    {
+      Fset_buffer (new_current_buffer);
+      /* If the new current buffer doesn't appear in the selected
+        window, go to its old point (see bug#12208).  */
+      if (!EQ (XWINDOW (data->current_window)->contents, new_current_buffer))
+       Fgoto_char (make_number (old_point));
+    }
+
+  Vminibuf_scroll_window = data->minibuf_scroll_window;
+  minibuf_selected_window = data->minibuf_selected_window;
+
+  return (FRAME_LIVE_P (f) ? Qt : Qnil);
 }
 
+
+#if 0
 DEFUN ("set-window-configuration", Fset_window_configuration,
        Sset_window_configuration, 1, 1, 0,
        doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION.
@@ -6144,18 +6521,18 @@ the return value is nil.  Otherwise the value is t.  */)
            call1 (Qrecord_window_buffer, window);
        }
 
-      /* Don't run lisp in the following segment since the frame is in a
-        completely inconsistent state.  See Bug#16207.  */
-      record_unwind_protect (unwind_change_frame, inhibit_lisp_code);
-      inhibit_lisp_code = Qt;
+      /* Consider frame unofficial, temporarily.  */
+      f->official = false;
       /* The mouse highlighting code could get screwed up
         if it runs during this.  */
       block_input ();
 
       if (data->frame_text_width != previous_frame_text_width
          || data->frame_text_height != previous_frame_text_height)
-       change_frame_size (f, data->frame_text_width,
-                          data->frame_text_height, 0, 0, 0, 1);
+       /* Make frame size fit the one in data, so window sizes restored
+          from data match those of the frame.  */
+       adjust_frame_size (f, data->frame_text_width,
+                          data->frame_text_height, 5, 0);
 
       if (data->frame_menu_bar_lines != previous_frame_menu_bar_lines)
        {
@@ -6252,7 +6629,9 @@ the return value is nil.  Otherwise the value is t.  */)
          wset_normal_cols (w, p->normal_cols);
          wset_normal_lines (w, p->normal_lines);
          w->hscroll = XFASTINT (p->hscroll);
+         w->suspend_auto_hscroll = !NILP (p->suspend_auto_hscroll);
          w->min_hscroll = XFASTINT (p->min_hscroll);
+         w->hscroll_whole = XFASTINT (p->hscroll_whole);
          wset_display_table (w, p->display_table);
          w->left_margin_cols = XINT (p->left_margin_cols);
          w->right_margin_cols = XINT (p->right_margin_cols);
@@ -6260,7 +6639,9 @@ the return value is nil.  Otherwise the value is t.  */)
          w->right_fringe_width = XINT (p->right_fringe_width);
          w->fringes_outside_margins = !NILP (p->fringes_outside_margins);
          w->scroll_bar_width = XINT (p->scroll_bar_width);
+         w->scroll_bar_height = XINT (p->scroll_bar_height);
          wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type);
+         wset_horizontal_scroll_bar_type (w, p->horizontal_scroll_bar_type);
          wset_dedicated (w, p->dedicated);
          wset_combination_limit (w, p->combination_limit);
          /* Restore any window parameters that have been saved.
@@ -6291,18 +6672,15 @@ the return value is nil.  Otherwise the value is t.  */)
              wset_buffer (w, p->buffer);
              w->start_at_line_beg = !NILP (p->start_at_line_beg);
              set_marker_restricted (w->start, p->start, w->contents);
-             set_marker_restricted (w->pointm, p->pointm,
-                                    w->contents);
-             Fset_marker (BVAR (XBUFFER (w->contents), mark),
-                          p->mark, w->contents);
-
+             set_marker_restricted (w->pointm, p->pointm, w->contents);
+             set_marker_restricted (w->old_pointm, p->old_pointm, w->contents);
              /* As documented in Fcurrent_window_configuration, don't
                 restore the location of point in the buffer which was
                 current when the window configuration was recorded.  */
              if (!EQ (p->buffer, new_current_buffer)
                  && XBUFFER (p->buffer) == current_buffer)
                Fgoto_char (w->pointm);
-            }
+           }
          else if (BUFFERP (w->contents) && BUFFER_LIVE_P (XBUFFER (w->contents)))
            /* Keep window's old buffer; make sure the markers are real.  */
            {
@@ -6314,20 +6692,26 @@ the return value is nil.  Otherwise the value is t.  */)
                  (w->pointm, w->contents,
                   BUF_PT (XBUFFER (w->contents)),
                   BUF_PT_BYTE (XBUFFER (w->contents)));
+             if (XMARKER (w->old_pointm)->buffer == 0)
+               set_marker_restricted_both
+                 (w->old_pointm, w->contents,
+                  BUF_PT (XBUFFER (w->contents)),
+                  BUF_PT_BYTE (XBUFFER (w->contents)));
              w->start_at_line_beg = 1;
            }
          else if (!NILP (w->start))
            /* Leaf window has no live buffer, get one.  */
            {
              /* Get the buffer via other_buffer_safely in order to
-             avoid showing an unimportant buffer and, if necessary, to
-             recreate *scratch* in the course (part of Juanma's bs-show
-             scenario from March 2011).  */
+                avoid showing an unimportant buffer and, if necessary, to
+                recreate *scratch* in the course (part of Juanma's bs-show
+                scenario from March 2011).  */
              wset_buffer (w, other_buffer_safely (Fcurrent_buffer ()));
              /* This will set the markers to beginning of visible
                 range.  */
              set_marker_restricted_both (w->start, w->contents, 0, 0);
              set_marker_restricted_both (w->pointm, w->contents, 0, 0);
+             set_marker_restricted_both (w->old_pointm, w->contents, 0, 0);
              w->start_at_line_beg = 1;
              if (!NILP (w->dedicated))
                /* Record this window as dead.  */
@@ -6365,8 +6749,8 @@ the return value is nil.  Otherwise the value is t.  */)
       /* Set the frame size to the value it had before this function.  */
       if (previous_frame_text_width != FRAME_TEXT_WIDTH (f)
          || previous_frame_text_height != FRAME_TEXT_HEIGHT (f))
-       change_frame_size (f, previous_frame_text_width,
-                          previous_frame_text_height, 0, 0, 0, 1);
+       adjust_frame_size (f, previous_frame_text_width,
+                          previous_frame_text_height, 5, 0);
 
       if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f))
        {
@@ -6395,9 +6779,13 @@ the return value is nil.  Otherwise the value is t.  */)
            ++n;
        }
 
+      /* Make frame official again and apply frame size changes if
+        needed.  */
+      f->official = true;
+      adjust_frame_size (f, -1, -1, 1, 0);
+
       adjust_frame_glyphs (f);
       unblock_input ();
-      unbind_to (count, Qnil);
 
       /* Scan dead buffer windows.  */
       for (; CONSP (dead_windows); dead_windows = XCDR (dead_windows))
@@ -6436,6 +6824,7 @@ the return value is nil.  Otherwise the value is t.  */)
 
   return (FRAME_LIVE_P (f) ? Qt : Qnil);
 }
+#endif
 
 void
 restore_window_configuration (Lisp_Object configuration)
@@ -6468,6 +6857,7 @@ delete_all_child_windows (Lisp_Object window)
     {
       unshow_buffer (w);
       unchain_marker (XMARKER (w->pointm));
+      unchain_marker (XMARKER (w->old_pointm));
       unchain_marker (XMARKER (w->start));
       /* Since combination limit makes sense for an internal windows
         only, we use this slot to save the buffer for the sake of
@@ -6574,7 +6964,9 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
       p->normal_cols = w->normal_cols;
       p->normal_lines = w->normal_lines;
       XSETFASTINT (p->hscroll, w->hscroll);
+      p->suspend_auto_hscroll = w->suspend_auto_hscroll ? Qt : Qnil;
       XSETFASTINT (p->min_hscroll, w->min_hscroll);
+      XSETFASTINT (p->hscroll_whole, w->hscroll_whole);
       p->display_table = w->display_table;
       p->left_margin_cols = make_number (w->left_margin_cols);
       p->right_margin_cols = make_number (w->right_margin_cols);
@@ -6582,7 +6974,9 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
       p->right_fringe_width = make_number (w->right_fringe_width);
       p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil;
       p->scroll_bar_width = make_number (w->scroll_bar_width);
+      p->scroll_bar_height = make_number (w->scroll_bar_height);
       p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
+      p->horizontal_scroll_bar_type = w->horizontal_scroll_bar_type;
       p->dedicated = w->dedicated;
       p->combination_limit = w->combination_limit;
       p->window_parameters = Qnil;
@@ -6644,33 +7038,27 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
                                      BUF_PT_BYTE (XBUFFER (w->contents)));
          else
            p->pointm = Fcopy_marker (w->pointm, Qnil);
+         p->old_pointm = Fcopy_marker (w->old_pointm, Qnil);
          XMARKER (p->pointm)->insertion_type
-           = !NILP (buffer_local_value_1 /* Don't signal error if void.  */
+           = !NILP (buffer_local_value /* Don't signal error if void.  */
+                    (Qwindow_point_insertion_type, w->contents));
+         XMARKER (p->old_pointm)->insertion_type
+           = !NILP (buffer_local_value /* Don't signal error if void.  */
                     (Qwindow_point_insertion_type, w->contents));
 
          p->start = Fcopy_marker (w->start, Qnil);
          p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
-
-         tem = BVAR (XBUFFER (w->contents), mark);
-         p->mark = Fcopy_marker (tem, Qnil);
        }
       else
        {
          p->pointm = Qnil;
+         p->old_pointm = Qnil;
          p->start = Qnil;
-         p->mark = Qnil;
          p->start_at_line_beg = Qnil;
        }
 
-      if (NILP (w->parent))
-       p->parent = Qnil;
-      else
-       p->parent = XWINDOW (w->parent)->temslot;
-
-      if (NILP (w->prev))
-       p->prev = Qnil;
-      else
-       p->prev = XWINDOW (w->prev)->temslot;
+      p->parent = NILP (w->parent) ? Qnil : XWINDOW (w->parent)->temslot;
+      p->prev = NILP (w->prev) ? Qnil : XWINDOW (w->prev)->temslot;
 
       if (WINDOWP (w->contents))
        i = save_window_save (w->contents, vector, i);
@@ -6684,8 +7072,8 @@ DEFUN ("current-window-configuration", Fcurrent_window_configuration,
        doc: /* Return an object representing the current window configuration of FRAME.
 If FRAME is nil or omitted, use the selected frame.
 This describes the number of windows, their sizes and current buffers,
-and for each displayed buffer, where display starts, and the positions of
-point and mark.  An exception is made for point in the current buffer:
+and for each displayed buffer, where display starts, and the position of
+point.  An exception is made for point in the current buffer:
 its value is -not- saved.
 This also records the currently selected frame, and FRAME's focus
 redirection (see `redirect-frame-focus').  The variable
@@ -6734,7 +7122,6 @@ static void
 apply_window_adjustment (struct window *w)
 {
   eassert (w);
-  adjust_window_margins (w);
   clear_glyph_matrix (w->current_matrix);
   w->window_end_valid = 0;
   windows_or_buffers_changed = 30;
@@ -6752,8 +7139,8 @@ set_window_margins (struct window *w, Lisp_Object left_width,
                    Lisp_Object right_width)
 {
   int left, right;
+  int unit = WINDOW_FRAME_COLUMN_WIDTH (w);
 
-  /* FIXME: what about margins that are too wide?  */
   left = (NILP (left_width) ? 0
          : (CHECK_NATNUM (left_width), XINT (left_width)));
   right = (NILP (right_width) ? 0
@@ -6761,11 +7148,23 @@ set_window_margins (struct window *w, Lisp_Object left_width,
 
   if (w->left_margin_cols != left || w->right_margin_cols != right)
     {
-      w->left_margin_cols = left;
-      w->right_margin_cols = right;
-      return w;
+      /* Don't change anything if new margins won't fit.  */
+      if ((WINDOW_PIXEL_WIDTH (w)
+          - WINDOW_FRINGES_WIDTH (w)
+          - WINDOW_SCROLL_BAR_AREA_WIDTH (w)
+          - (left + right) * unit)
+         >= MIN_SAFE_WINDOW_PIXEL_WIDTH (w))
+       {
+         w->left_margin_cols = left;
+         w->right_margin_cols = right;
+
+         return w;
+       }
+      else
+       return NULL;
     }
-  return NULL;
+  else
+    return NULL;
 }
 
 DEFUN ("set-window-margins", Fset_window_margins, Sset_window_margins,
@@ -6827,12 +7226,25 @@ set_window_fringes (struct window *w, Lisp_Object left_width,
          || w->right_fringe_width != right
          || w->fringes_outside_margins != outside))
     {
+      if (left > 0 || right > 0)
+       {
+         /* Don't change anything if new fringes don't fit.  */
+         if ((WINDOW_PIXEL_WIDTH (w)
+              - WINDOW_MARGINS_WIDTH (w)
+              - WINDOW_SCROLL_BAR_AREA_WIDTH (w)
+              - max (left, 0) - max (right, 0))
+             < MIN_SAFE_WINDOW_PIXEL_WIDTH (w))
+           return NULL;
+       }
+
       w->left_fringe_width = left;
       w->right_fringe_width = right;
       w->fringes_outside_margins = outside;
+
       return w;
     }
-  return NULL;
+  else
+    return NULL;
 }
 
 DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
@@ -6883,9 +7295,12 @@ Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS).  */)
 
 static struct window *
 set_window_scroll_bars (struct window *w, Lisp_Object width,
-                       Lisp_Object vertical_type, Lisp_Object horizontal_type)
+                       Lisp_Object vertical_type, Lisp_Object height,
+                       Lisp_Object horizontal_type)
 {
   int iwidth = (NILP (width) ? -1 : (CHECK_NATNUM (width), XINT (width)));
+  int iheight = (NILP (height) ? -1 : (CHECK_NATNUM (height), XINT (height)));
+  bool changed = 0;
 
   if (iwidth == 0)
     vertical_type = Qnil;
@@ -6899,32 +7314,69 @@ set_window_scroll_bars (struct window *w, Lisp_Object width,
   if (w->scroll_bar_width != iwidth
       || !EQ (w->vertical_scroll_bar_type, vertical_type))
     {
-      w->scroll_bar_width = iwidth;
-      wset_vertical_scroll_bar_type (w, vertical_type);
-      return w;
+      /* Don't change anything if new scroll bar won't fit.  */
+      if ((WINDOW_PIXEL_WIDTH (w)
+          - WINDOW_MARGINS_WIDTH (w)
+          - WINDOW_FRINGES_WIDTH (w)
+          - max (iwidth, 0))
+         >= MIN_SAFE_WINDOW_PIXEL_WIDTH (w))
+       {
+         w->scroll_bar_width = iwidth;
+         wset_vertical_scroll_bar_type (w, vertical_type);
+         changed = 1;
+       }
+    }
+
+  if (MINI_WINDOW_P (w) || iheight == 0)
+    horizontal_type = Qnil;
+
+  if (!(NILP (horizontal_type)
+       || EQ (horizontal_type, Qbottom)
+       || EQ (horizontal_type, Qt)))
+    error ("Invalid type of horizontal scroll bar");
+
+  if (w->scroll_bar_height != iheight
+      || !EQ (w->horizontal_scroll_bar_type, horizontal_type))
+    {
+      /* Don't change anything if new scroll bar won't fit.  */
+      if ((WINDOW_PIXEL_HEIGHT (w)
+          - WINDOW_HEADER_LINE_HEIGHT (w)
+          - WINDOW_MODE_LINE_HEIGHT (w)
+          - max (iheight, 0))
+         >= MIN_SAFE_WINDOW_PIXEL_HEIGHT (w))
+       {
+         w->scroll_bar_height = iheight;
+         wset_horizontal_scroll_bar_type (w, horizontal_type);
+         changed = 1;
+       }
     }
-  return NULL;
+
+  return changed ? w : NULL;
 }
 
 DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars,
-       Sset_window_scroll_bars, 2, 4, 0,
+       Sset_window_scroll_bars, 1, 5, 0,
        doc: /* Set width and type of scroll bars of window WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 
 Second parameter WIDTH specifies the pixel width for the scroll bar.
 Third parameter VERTICAL-TYPE specifies the type of the vertical scroll
-bar: left, right, or nil.
-If WIDTH is nil, use the frame's scroll-bar width.
-If VERTICAL-TYPE is t, use the frame's scroll-bar type.
-Fourth parameter HORIZONTAL-TYPE is currently unused.
+bar: left, right, or nil.  If WIDTH is nil, use the frame's scroll-bar
+width.  If VERTICAL-TYPE is t, use the frame's scroll-bar type.
+
+Fourth parameter HEIGHT specifies the pixel height for the scroll bar.
+Fifth parameter HORIZONTAL-TYPE specifies the type of the vertical
+scroll bar: nil, bottom, or t.  If HEIGHT is nil, use the frame's
+scroll-bar height.  If HORIZONTAL-TYPE is t, use the frame's scroll-bar
+type.
 
 Return t if scroll bars were actually changed and nil otherwise.  */)
-  (Lisp_Object window, Lisp_Object width,
-   Lisp_Object vertical_type, Lisp_Object horizontal_type)
+  (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type,
+   Lisp_Object height, Lisp_Object horizontal_type)
 {
   struct window *w
     = set_window_scroll_bars (decode_live_window (window),
-                             width, vertical_type, horizontal_type);
+                             width, vertical_type, height, horizontal_type);
   return w ? (apply_window_adjustment (w), Qt) : Qnil;
 }
 
@@ -6934,19 +7386,20 @@ DEFUN ("window-scroll-bars", Fwindow_scroll_bars, Swindow_scroll_bars,
        doc: /* Get width and type of scroll bars of window WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 
-Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE).
-If WIDTH is nil or TYPE is t, the window is using the frame's corresponding
-value.  */)
+Value is a list of the form (WIDTH COLS VERTICAL-TYPE HEIGHT LINES
+HORIZONTAL-TYPE).  If WIDTH or HEIGHT is nil or TYPE is t, the window is
+using the frame's corresponding value.  */)
   (Lisp_Object window)
 {
   struct window *w = decode_live_window (window);
 
-  return list4 (make_number (WINDOW_SCROLL_BAR_AREA_WIDTH (w)),
-               make_number (WINDOW_SCROLL_BAR_COLS (w)),
-               w->vertical_scroll_bar_type, Qnil);
+  return Fcons (make_number (WINDOW_SCROLL_BAR_AREA_WIDTH (w)),
+               list5 (make_number (WINDOW_SCROLL_BAR_COLS (w)),
+                      w->vertical_scroll_bar_type,
+                      make_number (WINDOW_SCROLL_BAR_AREA_HEIGHT (w)),
+                      make_number (WINDOW_SCROLL_BAR_LINES (w)),
+                      w->horizontal_scroll_bar_type));
 }
-
-
 \f
 /***********************************************************************
                           Smooth scrolling
@@ -7129,15 +7582,16 @@ compare_window_configurations (Lisp_Object configuration1,
                  || !EQ (sw1->min_hscroll, sw2->min_hscroll)
                  || !EQ (sw1->start_at_line_beg, sw2->start_at_line_beg)
                  || NILP (Fequal (sw1->start, sw2->start))
-                 || NILP (Fequal (sw1->pointm, sw2->pointm))
-                 || NILP (Fequal (sw1->mark, sw2->mark))))
+                 || NILP (Fequal (sw1->pointm, sw2->pointm))))
          || !EQ (sw1->left_margin_cols, sw2->left_margin_cols)
          || !EQ (sw1->right_margin_cols, sw2->right_margin_cols)
          || !EQ (sw1->left_fringe_width, sw2->left_fringe_width)
          || !EQ (sw1->right_fringe_width, sw2->right_fringe_width)
          || !EQ (sw1->fringes_outside_margins, sw2->fringes_outside_margins)
          || !EQ (sw1->scroll_bar_width, sw2->scroll_bar_width)
-         || !EQ (sw1->vertical_scroll_bar_type, sw2->vertical_scroll_bar_type))
+         || !EQ (sw1->scroll_bar_height, sw2->scroll_bar_height)
+         || !EQ (sw1->vertical_scroll_bar_type, sw2->vertical_scroll_bar_type)
+         || !EQ (sw1->horizontal_scroll_bar_type, sw2->horizontal_scroll_bar_type))
        return 0;
     }
 
@@ -7147,7 +7601,7 @@ compare_window_configurations (Lisp_Object configuration1,
 DEFUN ("compare-window-configurations", Fcompare_window_configurations,
        Scompare_window_configurations, 2, 2, 0,
        doc: /* Compare two window configurations as regards the structure of windows.
-This function ignores details such as the values of point and mark
+This function ignores details such as the values of point
 and scrolling positions.  */)
   (Lisp_Object x, Lisp_Object y)
 {
@@ -7164,8 +7618,6 @@ init_window_once (void)
   Vterminal_frame = selected_frame;
   minibuf_window = f->minibuffer_window;
   selected_window = f->selected_window;
-
-  window_initialized = 1;
 }
 
 void
@@ -7193,6 +7645,7 @@ syms_of_window (void)
   DEFSYM (Qdelete_window, "delete-window");
   DEFSYM (Qwindow_resize_root_window, "window--resize-root-window");
   DEFSYM (Qwindow_resize_root_window_vertically, "window--resize-root-window-vertically");
+  DEFSYM (Qwindow_sanitize_window_sizes, "window--sanitize-window-sizes");
   DEFSYM (Qwindow_pixel_to_total, "window--pixel-to-total");
   DEFSYM (Qsafe, "safe");
   DEFSYM (Qdisplay_buffer, "display-buffer");
@@ -7419,12 +7872,14 @@ pixelwise even if this option is nil.  */);
   defsubr (&Swindow_right_divider_width);
   defsubr (&Swindow_bottom_divider_width);
   defsubr (&Swindow_scroll_bar_width);
+  defsubr (&Swindow_scroll_bar_height);
   defsubr (&Swindow_inside_edges);
   defsubr (&Swindow_inside_pixel_edges);
   defsubr (&Swindow_inside_absolute_pixel_edges);
   defsubr (&Scoordinates_in_window_p);
   defsubr (&Swindow_at);
   defsubr (&Swindow_point);
+  defsubr (&Swindow_old_point);
   defsubr (&Swindow_start);
   defsubr (&Swindow_end);
   defsubr (&Sset_window_point);
index b9c2b1f5ba83873d25f08113e75cab1ec6efe74d..cdf8da931380004c05ff6c7b4b05f697788119cd 100644 (file)
@@ -128,21 +128,37 @@ struct window
        each one can have its own value of point.  */
     Lisp_Object pointm;
 
+    /* A marker pointing to where in the text point was in this window
+       at the time of last redisplay.  The value is saved for the
+       selected window too.  */
+    Lisp_Object old_pointm;
+
     /* No permanent meaning; used by save-window-excursion's
        bookkeeping.  */
     Lisp_Object temslot;
 
-    /* This window's vertical scroll bar.  This field is only for use
-       by the window-system-dependent code which implements the
-       scroll bars; it can store anything it likes here.  If this
-       window is newly created and we haven't displayed a scroll bar in
-       it yet, or if the frame doesn't have any scroll bars, this is nil.  */
+    /* This window's vertical scroll bar.  This field is only for use by
+       the window-system-dependent code which implements the scroll
+       bars; it can store anything it likes here.  If this window is
+       newly created and we haven't displayed a scroll bar in it yet, or
+       if the frame doesn't have any scroll bars, this is nil.  */
     Lisp_Object vertical_scroll_bar;
 
     /* Type of vertical scroll bar.  A value of nil means
        no scroll bar.  A value of t means use frame value.  */
     Lisp_Object vertical_scroll_bar_type;
 
+    /* This window's horizontal scroll bar.  This field is only for use
+       by the window-system-dependent code which implements the scroll
+       bars; it can store anything it likes here.  If this window is
+       newly created and we haven't displayed a scroll bar in it yet, or
+       if the frame doesn't have any scroll bars, this is nil.  */
+    Lisp_Object horizontal_scroll_bar;
+
+    /* Type of horizontal scroll bar.  A value of nil means
+       no scroll bar.  A value of t means use frame value.  */
+    Lisp_Object horizontal_scroll_bar_type;
+
     /* Display-table to use for displaying chars in this window.
        Nil means use the buffer's own display-table.  */
     Lisp_Object display_table;
@@ -209,6 +225,10 @@ struct window
        the user has set, by set-window-hscroll for example.  */
     ptrdiff_t min_hscroll;
 
+    /* Maximum line length in pixels within window bound by size of
+       window (set up by set_horizontal_scroll_bar).  */
+    ptrdiff_t hscroll_whole;
+
     /* Displayed buffer's text modification events counter as of last time
        display completed.  */
     EMACS_INT last_modified;
@@ -282,6 +302,10 @@ struct window
        A value of -1 means use frame values.  */
     int scroll_bar_width;
 
+    /* Pixel height of scroll bars.
+       A value of -1 means use frame values.  */
+    int scroll_bar_height;
+
     /* Effective height of the mode line, or -1 if not known.  */
     int mode_line_height;
 
@@ -355,6 +379,10 @@ struct window
     /* True if it needs to be redisplayed.  */
     bool_bf redisplay : 1;
 
+    /* True if auto hscrolling is currently suspended in this
+       window.  */
+    bool_bf suspend_auto_hscroll : 1;
+
     /* Amount by which lines of this window are scrolled in
        y-direction (smooth scrolling).  */
     int vscroll;
@@ -402,6 +430,18 @@ wset_vertical_scroll_bar (struct window *w, Lisp_Object val)
   w->vertical_scroll_bar = val;
 }
 
+INLINE void
+wset_horizontal_scroll_bar (struct window *w, Lisp_Object val)
+{
+  w->horizontal_scroll_bar = val;
+}
+
+INLINE void
+wset_horizontal_scroll_bar_type (struct window *w, Lisp_Object val)
+{
+  w->horizontal_scroll_bar_type = val;
+}
+
 INLINE void
 wset_prev_buffers (struct window *w, Lisp_Object val)
 {
@@ -415,8 +455,17 @@ wset_next_buffers (struct window *w, Lisp_Object val)
 }
 
 /* True if W is a minibuffer window.  */
+#define MINI_WINDOW_P(W) ((W)->mini)
 
-#define MINI_WINDOW_P(W)       ((W)->mini)
+/* 1 if W is a non-only minibuffer window.  */
+/* The first check is redundant and the second overly complicated. */
+#define MINI_NON_ONLY_WINDOW_P(W)                              \
+  (MINI_WINDOW_P (W)                                           \
+   && (EQ (W->prev, FRAME_ROOT_WINDOW (WINDOW_XFRAME (W)))))
+
+/* 1 if W is a minibuffer-only window.  */
+#define MINI_ONLY_WINDOW_P(W)                  \
+  (MINI_WINDOW_P (W) && NILP (W->prev))
 
 /* General window layout:
 
@@ -460,16 +509,17 @@ wset_next_buffers (struct window *w, Lisp_Object val)
 #define WINDOW_VERTICAL_COMBINATION_P(W) \
   (WINDOWP ((W)->contents) && !(W)->horizontal)
 
-#define WINDOW_XFRAME(W) \
-  (XFRAME (WINDOW_FRAME ((W))))
+/* WINDOW's XFRAME.  */
+#define WINDOW_XFRAME(W) (XFRAME (WINDOW_FRAME ((W))))
 
-/* Return the canonical column width of the frame of window W.  */
+/* Whether WINDOW is a pseudo window.  */
+#define WINDOW_PSEUDO_P(W) ((W)->pseudo_window_p)
 
+/* Return the canonical column width of the frame of window W.  */
 #define WINDOW_FRAME_COLUMN_WIDTH(W) \
   (FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W))))
 
 /* Return the canonical column width of the frame of window W.  */
-
 #define WINDOW_FRAME_LINE_HEIGHT(W) \
   (FRAME_LINE_HEIGHT (WINDOW_XFRAME ((W))))
 
@@ -613,6 +663,10 @@ wset_next_buffers (struct window *w, Lisp_Object val)
 #define WINDOW_LEFTMOST_P(W) \
   (WINDOW_LEFT_PIXEL_EDGE (W) == 0)
 
+/* True if window W's has no other windows above in its frame.  */
+#define WINDOW_TOPMOST_P(W) \
+  (WINDOW_TOP_PIXEL_EDGE (W) == 0)
+
 /* True if window W's has no other windows to its right in its frame.  */
 #define WINDOW_RIGHTMOST_P(W)                                  \
   (WINDOW_RIGHT_PIXEL_EDGE (W)                                 \
@@ -629,7 +683,6 @@ wset_next_buffers (struct window *w, Lisp_Object val)
 /* Return the frame column at which the text (or left fringe) in
    window W starts.  This is different from the `LEFT_EDGE' because it
    does not include a left-hand scroll bar if any.  */
-
 #define WINDOW_BOX_LEFT_EDGE_COL(W) \
   (WINDOW_LEFT_EDGE_COL (W) \
    + WINDOW_LEFT_SCROLL_BAR_COLS (W))
@@ -644,7 +697,6 @@ wset_next_buffers (struct window *w, Lisp_Object val)
 /* Return the window column before which the text in window W ends.
    This is different from WINDOW_RIGHT_EDGE_COL because it does not
    include a scroll bar or window-separating line on the right edge.  */
-
 #define WINDOW_BOX_RIGHT_EDGE_COL(W) \
   (WINDOW_RIGHT_EDGE_COL (W) \
    - WINDOW_RIGHT_SCROLL_BAR_COLS (W))
@@ -706,114 +758,108 @@ wset_next_buffers (struct window *w, Lisp_Object val)
 #define WINDOW_FRINGES_WIDTH(W)                \
   (WINDOW_LEFT_FRINGE_WIDTH (W) + WINDOW_RIGHT_FRINGE_WIDTH (W))
 
-/* Widths of fringes in columns.  */
-#define WINDOW_FRINGE_COLS(W)                  \
-  ((W->left_fringe_width >= 0                  \
-    && W->right_fringe_width >= 0)             \
-   ? ((WINDOW_FRINGES_WIDTH (W)                        \
-       + WINDOW_FRAME_COLUMN_WIDTH (W) - 1)    \
-      / WINDOW_FRAME_COLUMN_WIDTH (W))         \
-   : FRAME_FRINGE_COLS (WINDOW_XFRAME (W)))
-
-#define WINDOW_LEFT_FRINGE_COLS(W)             \
-  ((WINDOW_LEFT_FRINGE_WIDTH ((W))             \
-    + WINDOW_FRAME_COLUMN_WIDTH (W) - 1)       \
-   / WINDOW_FRAME_COLUMN_WIDTH (W))
-
-#define WINDOW_RIGHT_FRINGE_COLS(W)            \
-  ((WINDOW_RIGHT_FRINGE_WIDTH ((W))            \
-    + WINDOW_FRAME_COLUMN_WIDTH (W) - 1)       \
-   / WINDOW_FRAME_COLUMN_WIDTH (W))
-
 /* Are fringes outside display margins in window W.  */
 #define WINDOW_HAS_FRINGES_OUTSIDE_MARGINS(W)  \
   ((W)->fringes_outside_margins)
 
-/* Say whether scroll bars are currently enabled for window W,
+/* Say whether vertical scroll bars are currently enabled for window W,
    and which side they are on.  */
-#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w)             \
-  (EQ (w->vertical_scroll_bar_type, Qt)                        \
-   ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w))        \
-   : EQ (w->vertical_scroll_bar_type, Qleft)           \
+#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(W)             \
+  (WINDOW_PSEUDO_P (W)                                 \
+   ? vertical_scroll_bar_none                          \
+   : EQ (W->vertical_scroll_bar_type, Qt)              \
+   ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (W))        \
+   : EQ (W->vertical_scroll_bar_type, Qleft)           \
    ? vertical_scroll_bar_left                          \
-   : EQ (w->vertical_scroll_bar_type, Qright)          \
+   : EQ (W->vertical_scroll_bar_type, Qright)          \
    ? vertical_scroll_bar_right                         \
-   : vertical_scroll_bar_none)                         \
-
-#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w)              \
-  (EQ (w->vertical_scroll_bar_type, Qt)                        \
-   ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w))        \
-   : !NILP (w->vertical_scroll_bar_type))
-
-#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w)              \
-  (EQ (w->vertical_scroll_bar_type, Qt)                                \
-   ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w))        \
-   : EQ (w->vertical_scroll_bar_type, Qleft))
-
-#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w)                     \
-  (EQ (w->vertical_scroll_bar_type, Qt)                                        \
-   ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))       \
-   : EQ (w->vertical_scroll_bar_type, Qright))
+   : vertical_scroll_bar_none)
+
+#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(W)                      \
+  (WINDOW_VERTICAL_SCROLL_BAR_TYPE (W) == vertical_scroll_bar_left)
+
+#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(W)                     \
+  (WINDOW_VERTICAL_SCROLL_BAR_TYPE (W) == vertical_scroll_bar_right)
+
+#define WINDOW_HAS_VERTICAL_SCROLL_BAR(W)              \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (W)          \
+   || WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (W))
+
+/* Say whether horizontal scroll bars are currently enabled for window
+   W.  Horizontal scrollbars exist for toolkit versions only.  */
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+#define WINDOW_HAS_HORIZONTAL_SCROLL_BAR(W)                    \
+  ((WINDOW_PSEUDO_P (W) || MINI_NON_ONLY_WINDOW_P (W))         \
+   ? false                                                     \
+   : EQ (W->horizontal_scroll_bar_type, Qt)                    \
+   ? FRAME_HAS_HORIZONTAL_SCROLL_BARS (WINDOW_XFRAME (W))      \
+   : EQ (W->horizontal_scroll_bar_type, Qbottom)               \
+   ? true                                                      \
+   : false)
+#else
+#define WINDOW_HAS_HORIZONTAL_SCROLL_BAR(W) false
+#endif
 
 /* Width that a scroll bar in window W should have, if there is one.
    Measured in pixels.  If scroll bars are turned off, this is still
    nonzero.  */
-#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w)              \
-  (w->scroll_bar_width >= 0                            \
-   ? w->scroll_bar_width                               \
-   : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
+#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(W)              \
+  (W->scroll_bar_width >= 0                            \
+   ? W->scroll_bar_width                               \
+   : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (W)))
 
 /* Width that a scroll bar in window W should have, if there is one.
    Measured in columns (characters).  If scroll bars are turned off,
    this is still nonzero.  */
-#define WINDOW_CONFIG_SCROLL_BAR_COLS(w)               \
-  (w->scroll_bar_width >= 0                            \
-   ? ((w->scroll_bar_width                             \
-       + WINDOW_FRAME_COLUMN_WIDTH (w) - 1)            \
-      / WINDOW_FRAME_COLUMN_WIDTH (w))                 \
-   : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
+#define WINDOW_CONFIG_SCROLL_BAR_COLS(W)               \
+  (W->scroll_bar_width >= 0                            \
+   ? ((W->scroll_bar_width                             \
+       + WINDOW_FRAME_COLUMN_WIDTH (W) - 1)            \
+      / WINDOW_FRAME_COLUMN_WIDTH (W))                 \
+   : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (W)))
 
 /* Width of left scroll bar in window W, measured in columns
    (characters).  If scroll bars are on the right in this frame, or
    there are no scroll bars, value is 0.  */
-#define WINDOW_LEFT_SCROLL_BAR_COLS(w)        \
-  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)  \
-   ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w))       \
+#define WINDOW_LEFT_SCROLL_BAR_COLS(W)        \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (W)  \
+   ? (WINDOW_CONFIG_SCROLL_BAR_COLS (W))       \
    : 0)
 
 /* Width of right scroll bar in window W, measured in columns
    (characters).  If scroll bars are on the left in this frame, or there
    are no scroll bars, value is 0.  */
-#define WINDOW_RIGHT_SCROLL_BAR_COLS(w)                \
-  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \
-   ? WINDOW_CONFIG_SCROLL_BAR_COLS (w)         \
+#define WINDOW_RIGHT_SCROLL_BAR_COLS(W)                \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (W) \
+   ? WINDOW_CONFIG_SCROLL_BAR_COLS (W)         \
    : 0)
 
 /* Width of a scroll bar in window W, measured in columns.  */
-#define WINDOW_SCROLL_BAR_COLS(w)             \
-  (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)         \
-   ? WINDOW_CONFIG_SCROLL_BAR_COLS (w)        \
+#define WINDOW_SCROLL_BAR_COLS(W)             \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR (W)         \
+   ? WINDOW_CONFIG_SCROLL_BAR_COLS (W)        \
    : 0)
 
 /* Width of a left scroll bar area in window W, measured in pixels.  */
-#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w)                           \
-  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)                          \
-   ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)                                        \
+#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(W)                           \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (W)                          \
+   ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (W)                                        \
    : 0)
 
 /* Width of a right scroll bar area in window W, measured in pixels.  */
-#define WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH(w)                          \
-  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)                         \
-   ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)                                        \
+#define WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH(W)                          \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (W)                         \
+   ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (W)                                        \
    : 0)
 
 /* Width of scroll bar area in window W, measured in pixels.  */
-#define WINDOW_SCROLL_BAR_AREA_WIDTH(w)                                        \
-  (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)                                  \
-   ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)                                        \
+#define WINDOW_SCROLL_BAR_AREA_WIDTH(W)                                        \
+  (WINDOW_HAS_VERTICAL_SCROLL_BAR (W)                                  \
+   ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (W)                                        \
    : 0)
 
-/* Return the frame position where the scroll bar of window W starts.  */
+/* Return the frame position where the vertical scroll bar of window W
+   starts.  */
 #define WINDOW_SCROLL_BAR_AREA_X(W)            \
   (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (W) \
    ? WINDOW_BOX_RIGHT_EDGE_X (W)               \
@@ -829,6 +875,36 @@ wset_next_buffers (struct window *w, Lisp_Object val)
    ? 0                                                                 \
    : FRAME_BOTTOM_DIVIDER_WIDTH (WINDOW_XFRAME (W)))
 
+/* Height that a scroll bar in window W should have, if there is one.
+   Measured in pixels.  If scroll bars are turned off, this is still
+   nonzero.  */
+#define WINDOW_CONFIG_SCROLL_BAR_HEIGHT(W)                     \
+  (W->scroll_bar_height >= 0                                   \
+   ? W->scroll_bar_height                                      \
+   : FRAME_CONFIG_SCROLL_BAR_HEIGHT (WINDOW_XFRAME (W)))
+
+/* Height that a scroll bar in window W should have, if there is one.
+   Measured in lines (characters).  If scroll bars are turned off, this
+   is still nonzero.  */
+#define WINDOW_CONFIG_SCROLL_BAR_LINES(W)              \
+  (W->scroll_bar_height >= 0                           \
+   ? ((W->scroll_bar_height                            \
+       + WINDOW_FRAME_LINE_HEIGHT (W) - 1)             \
+      / WINDOW_FRAME_LINE_HEIGHT (W))                  \
+   : FRAME_CONFIG_SCROLL_BAR_LINES (WINDOW_XFRAME (W)))
+
+/* Height of a scroll bar in window W, measured in columns.  */
+#define WINDOW_SCROLL_BAR_LINES(W)            \
+  (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (W)               \
+   ? WINDOW_CONFIG_SCROLL_BAR_LINES (W)               \
+   : 0)
+
+/* Height of scroll bar area in window W, measured in pixels.  */
+#define WINDOW_SCROLL_BAR_AREA_HEIGHT(W)       \
+  (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (W)                \
+   ? WINDOW_CONFIG_SCROLL_BAR_HEIGHT (W)       \
+   : 0)
+
 /* Height in pixels, and in lines, of the mode line.
    May be zero if W doesn't have a mode line.  */
 #define WINDOW_MODE_LINE_HEIGHT(W)     \
@@ -837,67 +913,63 @@ wset_next_buffers (struct window *w, Lisp_Object val)
    : 0)
 
 #define WINDOW_MODE_LINE_LINES(W)      \
-  (!! WINDOW_WANTS_MODELINE_P ((W)))
+  (!! WINDOW_WANTS_MODELINE_P (W))
 
 /* Height in pixels, and in lines, of the header line.
    Zero if W doesn't have a header line.  */
 #define WINDOW_HEADER_LINE_HEIGHT(W)   \
-  (WINDOW_WANTS_HEADER_LINE_P ((W))    \
+  (WINDOW_WANTS_HEADER_LINE_P (W)      \
    ? CURRENT_HEADER_LINE_HEIGHT (W)    \
    : 0)
 
 #define WINDOW_HEADER_LINE_LINES(W)    \
-  (!! WINDOW_WANTS_HEADER_LINE_P ((W)))
+  (!! WINDOW_WANTS_HEADER_LINE_P (W))
 
-/* Pixel height of window W without mode line and bottom divider.  */
+/* Pixel height of window W without mode line, bottom scroll bar and
+   bottom divider.  */
 #define WINDOW_BOX_HEIGHT_NO_MODE_LINE(W)      \
-  (WINDOW_PIXEL_HEIGHT ((W))                   \
+  (WINDOW_PIXEL_HEIGHT (W)                     \
    - WINDOW_BOTTOM_DIVIDER_WIDTH (W)           \
-   - WINDOW_MODE_LINE_HEIGHT ((W)))
+   - WINDOW_SCROLL_BAR_AREA_HEIGHT (W)         \
+   - WINDOW_MODE_LINE_HEIGHT (W))
 
 /* Pixel height of window W without mode and header line and bottom
    divider.  */
 #define WINDOW_BOX_TEXT_HEIGHT(W)      \
   (WINDOW_PIXEL_HEIGHT ((W))           \
    - WINDOW_BOTTOM_DIVIDER_WIDTH (W)   \
-   - WINDOW_MODE_LINE_HEIGHT ((W))     \
-   - WINDOW_HEADER_LINE_HEIGHT ((W)))
+   - WINDOW_SCROLL_BAR_AREA_HEIGHT (W) \
+   - WINDOW_MODE_LINE_HEIGHT (W)       \
+   - WINDOW_HEADER_LINE_HEIGHT (W))
+
+/* Return the frame position where the horizontal scroll bar of window W
+   starts.  */
+#define WINDOW_SCROLL_BAR_AREA_Y(W)                    \
+  (WINDOW_TOP_EDGE_Y (W)                               \
+   + (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (W)             \
+      ? WINDOW_BOX_HEIGHT_NO_MODE_LINE (W) : 0))
 
 /* Convert window W relative pixel X to frame pixel coordinates.  */
 #define WINDOW_TO_FRAME_PIXEL_X(W, X)  \
   ((X) + WINDOW_BOX_LEFT_EDGE_X ((W)))
 
 /* Convert window W relative pixel Y to frame pixel coordinates.  */
-#define WINDOW_TO_FRAME_PIXEL_Y(W, Y)  \
-  ((Y) + WINDOW_TOP_EDGE_Y ((W)))
+#define WINDOW_TO_FRAME_PIXEL_Y(W, Y)          \
+  ((Y) + WINDOW_TOP_EDGE_Y (W))
 
 /* Convert frame relative pixel X to window relative pixel X.  */
-#define FRAME_TO_WINDOW_PIXEL_X(W, X)  \
+#define FRAME_TO_WINDOW_PIXEL_X(W, X)          \
   ((X) - WINDOW_BOX_LEFT_EDGE_X ((W)))
 
 /* Convert frame relative pixel Y to window relative pixel Y.  */
-#define FRAME_TO_WINDOW_PIXEL_Y(W, Y)  \
-  ((Y) - WINDOW_TOP_EDGE_Y ((W)))
+#define FRAME_TO_WINDOW_PIXEL_Y(W, Y)          \
+  ((Y) - WINDOW_TOP_EDGE_Y (W))
 
 /* Convert a text area relative x-position in window W to frame X
    pixel coordinates.  */
 #define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X)     \
   (window_box_left ((W), TEXT_AREA) + (X))
 
-/* True if the background of the window W's fringe that is adjacent to
-   a scroll bar is extended to the gap between the fringe and the bar.  */
-
-#define WINDOW_FRINGE_EXTENDED_P(w)                    \
-  (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)          \
-   ? (WINDOW_LEFTMOST_P (w)                            \
-      && WINDOW_LEFT_FRINGE_WIDTH (w)                  \
-      && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)       \
-         || WINDOW_LEFT_MARGIN_COLS (w) == 0))         \
-   : (WINDOW_RIGHTMOST_P (w)                           \
-      && WINDOW_RIGHT_FRINGE_WIDTH (w)                 \
-      && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)       \
-         || WINDOW_RIGHT_MARGIN_COLS (w) == 0)))
-
 /* This is the window in which the terminal's cursor should be left when
    nothing is being done with it.  This must always be a leaf window, and its
    buffer is selected by the top level editing loop at the end of each command.
@@ -981,11 +1053,6 @@ extern void bset_update_mode_line (struct buffer *b);
    above already does it, so it's only needed in unusual cases.  */
 extern void redisplay_other_windows (void);
 
-/* If *ROWS or *COLS are too small a size for FRAME, set them to the
-   minimum allowable size.  */
-
-extern void check_frame_size (struct frame *frame, int *width, int *height, bool pixelwise);
-
 /* Return a pointer to the glyph W's physical cursor is on.  Value is
    null if W's current matrix is invalid, so that no meaningful glyph
    can be returned.  */
@@ -1010,7 +1077,6 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
   CHECK_TYPE (WINDOW_LIVE_P (WINDOW), Qwindow_live_p, WINDOW)
 
 /* These used to be in lisp.h.  */
-
 extern Lisp_Object Qwindow_live_p;
 extern Lisp_Object Vwindow_list;
 
@@ -1024,6 +1090,7 @@ extern int window_body_width (struct window *w, bool);
 extern void temp_output_buffer_show (Lisp_Object);
 extern void replace_buffer_in_windows (Lisp_Object);
 extern void replace_buffer_in_windows_safely (Lisp_Object);
+extern Lisp_Object sanitize_window_sizes (Lisp_Object, Lisp_Object);
 /* This looks like a setter, but it is a bit special.  */
 extern void wset_buffer (struct window *, Lisp_Object);
 extern bool window_outdated (struct window *);
index 776e4d000eeaa1818cf1552c3365b2335bc4d8b8..fe16b2c6a0723d3f2df81ded924f9eb8de6a1e07 100644 (file)
@@ -816,11 +816,11 @@ Lisp_Object previous_help_echo_string;
 #ifdef HAVE_WINDOW_SYSTEM
 
 /* Non-zero means an hourglass cursor is currently shown.  */
-bool hourglass_shown_p;
+static bool hourglass_shown_p;
 
 /* If non-null, an asynchronous timer that, when it expires, displays
    an hourglass cursor on all frames.  */
-struct atimer *hourglass_atimer;
+static struct atimer *hourglass_atimer;
 
 #endif /* HAVE_WINDOW_SYSTEM */
 
@@ -1024,6 +1024,8 @@ window_text_bottom_y (struct window *w)
   if (WINDOW_WANTS_MODELINE_P (w))
     height -= CURRENT_MODE_LINE_HEIGHT (w);
 
+  height -= WINDOW_SCROLL_BAR_AREA_HEIGHT (w);
+
   return height;
 }
 
@@ -1068,6 +1070,7 @@ window_box_height (struct window *w)
   eassert (height >= 0);
 
   height -= WINDOW_BOTTOM_DIVIDER_WIDTH (w);
+  height -= WINDOW_SCROLL_BAR_AREA_HEIGHT (w);
 
   /* Note: the code below that determines the mode-line/header-line
      height is essentially the same as that contained in the macro
@@ -1954,8 +1957,8 @@ pixel_to_glyph_coords (struct frame *f, register int pix_x, register int pix_y,
 
          if (pix_y < 0)
            pix_y = 0;
-         else if (pix_y > FRAME_LINES (f))
-           pix_y = FRAME_LINES (f);
+         else if (pix_y > FRAME_TOTAL_LINES (f))
+           pix_y = FRAME_TOTAL_LINES (f);
        }
     }
 #endif
@@ -2498,7 +2501,7 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect)
       gx = WINDOW_PIXEL_WIDTH (w) - width;
       goto row_glyph;
 
-    case ON_SCROLL_BAR:
+    case ON_VERTICAL_SCROLL_BAR:
       gx = (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)
            ? 0
            : (window_box_right_offset (w, RIGHT_MARGIN_AREA)
@@ -8290,7 +8293,7 @@ next_element_from_buffer (struct it *it)
 
       /* Get the next character, maybe multibyte.  */
       p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
-      if (it->multibyte_p && !ASCII_BYTE_P (*p))
+      if (it->multibyte_p && !ASCII_CHAR_P (*p))
        it->c = STRING_CHAR_AND_LENGTH (p, it->len);
       else
        it->c = *p, it->len = 1;
@@ -9972,9 +9975,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte)
          for (i = 0; i < nbytes; i += char_bytes)
            {
              c = string_char_and_length (msg + i, &char_bytes);
-             work[0] = (ASCII_CHAR_P (c)
-                        ? c
-                        : multibyte_char_to_unibyte (c));
+             work[0] = CHAR_TO_BYTE8 (c);
              insert_1_both (work, 1, 1, 1, 0, 0);
            }
        }
@@ -10256,19 +10257,17 @@ message_with_string (const char *m, Lisp_Object string, int log)
     {
       if (m)
        {
-         /* ENCODE_SYSTEM below can GC and/or relocate the Lisp
-            String whose data pointer might be passed to us in M.  So
-            we use a local copy.  */
-         char *fmt = xstrdup (m);
+         /* ENCODE_SYSTEM below can GC and/or relocate the
+            Lisp data, so make sure we don't use it here.  */
+         eassert (relocatable_string_data_p (m) != 1);
 
          if (noninteractive_need_newline)
            putc ('\n', stderr);
          noninteractive_need_newline = 0;
-         fprintf (stderr, fmt, SDATA (ENCODE_SYSTEM (string)));
+         fprintf (stderr, m, SDATA (ENCODE_SYSTEM (string)));
          if (!cursor_in_echo_area)
            fprintf (stderr, "\n");
          fflush (stderr);
-         xfree (fmt);
        }
     }
   else if (INTERACTIVE)
@@ -10525,6 +10524,7 @@ with_echo_area_buffer (struct window *w, int which,
     {
       wset_buffer (w, buffer);
       set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
+      set_marker_both (w->old_pointm, buffer, BEG, BEG_BYTE);
     }
 
   bset_undo_list (current_buffer, Qt);
@@ -10563,7 +10563,7 @@ with_echo_area_buffer_unwind_data (struct window *w)
   Vwith_echo_area_save_vector = Qnil;
 
   if (NILP (vector))
-    vector = Fmake_vector (make_number (9), Qnil);
+    vector = Fmake_vector (make_number (11), Qnil);
 
   XSETBUFFER (tmp, current_buffer); ASET (vector, i, tmp); ++i;
   ASET (vector, i, Vdeactivate_mark); ++i;
@@ -10575,12 +10575,14 @@ with_echo_area_buffer_unwind_data (struct window *w)
       ASET (vector, i, w->contents); ++i;
       ASET (vector, i, make_number (marker_position (w->pointm))); ++i;
       ASET (vector, i, make_number (marker_byte_position (w->pointm))); ++i;
+      ASET (vector, i, make_number (marker_position (w->old_pointm))); ++i;
+      ASET (vector, i, make_number (marker_byte_position (w->old_pointm))); ++i;
       ASET (vector, i, make_number (marker_position (w->start))); ++i;
       ASET (vector, i, make_number (marker_byte_position (w->start))); ++i;
     }
   else
     {
-      int end = i + 6;
+      int end = i + 8;
       for (; i < end; ++i)
        ASET (vector, i, Qnil);
     }
@@ -10612,9 +10614,12 @@ unwind_with_echo_area_buffer (Lisp_Object vector)
       set_marker_both (w->pointm, buffer,
                       XFASTINT (AREF (vector, 5)),
                       XFASTINT (AREF (vector, 6)));
-      set_marker_both (w->start, buffer,
+      set_marker_both (w->old_pointm, buffer,
                       XFASTINT (AREF (vector, 7)),
                       XFASTINT (AREF (vector, 8)));
+      set_marker_both (w->start, buffer,
+                      XFASTINT (AREF (vector, 9)),
+                      XFASTINT (AREF (vector, 10)));
     }
 
   Vwith_echo_area_save_vector = vector;
@@ -11863,11 +11868,6 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
 
 #ifdef HAVE_WINDOW_SYSTEM
 
-/* Tool-bar item index of the item on which a mouse button was pressed
-   or -1.  */
-
-int last_tool_bar_item;
-
 /* Select `frame' temporarily without running all the code in
    do_switch_frame.
    FIXME: Maybe do_switch_frame should be trimmed down similarly
@@ -11894,7 +11894,7 @@ update_tool_bar (struct frame *f, int save_match_data)
   int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
 #else
   int do_update = (WINDOWP (f->tool_bar_window)
-                  && WINDOW_PIXEL_HEIGHT (XWINDOW (f->tool_bar_window)) > 0);
+                  && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)) > 0);
 #endif
 
   if (do_update)
@@ -12278,16 +12278,9 @@ display_tool_bar_line (struct it *it, int height)
 }
 
 
-/* Max tool-bar height.  Basically, this is what makes all other windows
-   disappear when the frame gets too small.  Rethink this!  */
-
-#define MAX_FRAME_TOOL_BAR_HEIGHT(f) \
-  ((FRAME_LINE_HEIGHT (f) * FRAME_LINES (f)))
-
 /* Value is the number of pixels needed to make all tool-bar items of
    frame F visible.  The actual number of glyph rows needed is
    returned in *N_ROWS if non-NULL.  */
-
 static int
 tool_bar_height (struct frame *f, int *n_rows, bool pixelwise)
 {
@@ -12326,11 +12319,6 @@ tool_bar_height (struct frame *f, int *n_rows, bool pixelwise)
 
 #endif /* !USE_GTK && !HAVE_NS */
 
-#if defined USE_GTK || defined HAVE_NS
-EXFUN (Ftool_bar_height, 2) ATTRIBUTE_CONST;
-EXFUN (Ftool_bar_lines_needed, 1) ATTRIBUTE_CONST;
-#endif
-
 DEFUN ("tool-bar-height", Ftool_bar_height, Stool_bar_height,
        0, 2, 0,
        doc: /* Return the number of lines occupied by the tool bar of FRAME.
@@ -12361,7 +12349,6 @@ PIXELWISE non-nil means return the height of the tool bar in pixels.  */)
 
 /* Display the tool-bar of frame F.  Value is non-zero if tool-bar's
    height should be changed.  */
-
 static int
 redisplay_tool_bar (struct frame *f)
 {
@@ -12383,7 +12370,7 @@ redisplay_tool_bar (struct frame *f)
      can turn off tool-bars by specifying tool-bar-lines zero.  */
   if (!WINDOWP (f->tool_bar_window)
       || (w = XWINDOW (f->tool_bar_window),
-          WINDOW_PIXEL_HEIGHT (w) == 0))
+          WINDOW_TOTAL_LINES (w) == 0))
     return 0;
 
   /* Set up an iterator for the tool-bar window.  */
@@ -12410,14 +12397,7 @@ redisplay_tool_bar (struct frame *f)
 
       if (new_height != WINDOW_PIXEL_HEIGHT (w))
        {
-         Lisp_Object frame;
-         int new_lines = ((new_height + FRAME_LINE_HEIGHT (f) - 1)
-                          / FRAME_LINE_HEIGHT (f));
-
-         XSETFRAME (frame, f);
-         Fmodify_frame_parameters (frame,
-                                   list1 (Fcons (Qtool_bar_lines,
-                                                 make_number (new_lines))));
+         x_change_tool_bar_height (f, new_height);
          /* Always do that now.  */
          clear_glyph_matrix (w->desired_matrix);
          f->fonts_changed = 1;
@@ -12470,14 +12450,11 @@ redisplay_tool_bar (struct frame *f)
 
   if (!NILP (Vauto_resize_tool_bars))
     {
-      /* Do we really allow the toolbar to occupy the whole frame?  */
-      int max_tool_bar_height = MAX_FRAME_TOOL_BAR_HEIGHT (f);
       int change_height_p = 0;
 
       /* If we couldn't display everything, change the tool-bar's
         height if there is room for more.  */
-      if (IT_STRING_CHARPOS (it) < it.end_charpos
-         && it.current_y < max_tool_bar_height)
+      if (IT_STRING_CHARPOS (it) < it.end_charpos)
        change_height_p = 1;
 
       /* We subtract 1 because display_tool_bar_line advances the
@@ -12496,15 +12473,13 @@ redisplay_tool_bar (struct frame *f)
       /* If row displays tool-bar items, but is partially visible,
         change the tool-bar's height.  */
       if (MATRIX_ROW_DISPLAYS_TEXT_P (row)
-         && MATRIX_ROW_BOTTOM_Y (row) > it.last_visible_y
-         && MATRIX_ROW_BOTTOM_Y (row) < max_tool_bar_height)
+         && MATRIX_ROW_BOTTOM_Y (row) > it.last_visible_y)
        change_height_p = 1;
 
       /* Resize windows as needed by changing the `tool-bar-lines'
         frame parameter.  */
       if (change_height_p)
        {
-         Lisp_Object frame;
          int nrows;
          int new_height = tool_bar_height (f, &nrows, 1);
 
@@ -12516,35 +12491,12 @@ redisplay_tool_bar (struct frame *f)
 
          if (change_height_p)
            {
-             /* Current size of the tool-bar window in canonical line
-                units.  */
-             int old_lines = WINDOW_TOTAL_LINES (w);
-             /* Required size of the tool-bar window in canonical
-                line units. */
-             int new_lines = ((new_height + FRAME_LINE_HEIGHT (f) - 1)
-                              / FRAME_LINE_HEIGHT (f));
-             /* Maximum size of the tool-bar window in canonical line
-                units that this frame can allow. */
-             int max_lines =
-               WINDOW_TOTAL_LINES (XWINDOW (FRAME_ROOT_WINDOW (f))) - 1;
-
-             /* Don't try to change the tool-bar window size and set
-                the fonts_changed flag unless really necessary.  That
-                flag causes redisplay to give up and retry
-                redisplaying the frame from scratch, so setting it
-                unnecessarily can lead to nasty redisplay loops.  */
-             if (new_lines <= max_lines
-                 && eabs (new_lines - old_lines) >= 1)
-               {
-                 XSETFRAME (frame, f);
-                 Fmodify_frame_parameters (frame,
-                                           list1 (Fcons (Qtool_bar_lines,
-                                                         make_number (new_lines))));
-                 clear_glyph_matrix (w->desired_matrix);
-                 f->n_tool_bar_rows = nrows;
-                 f->fonts_changed = 1;
-                 return 1;
-               }
+             x_change_tool_bar_height (f, new_height);
+             clear_glyph_matrix (w->desired_matrix);
+             f->n_tool_bar_rows = nrows;
+             f->fonts_changed = 1;
+
+             return 1;
            }
        }
     }
@@ -12669,7 +12621,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
      where the button was pressed, disregarding where it was
      released.  */
   if (NILP (Vmouse_highlight) && !down_p)
-    prop_idx = last_tool_bar_item;
+    prop_idx = f->last_tool_bar_item;
 
   /* If item is disabled, do nothing.  */
   enabled_p = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_ENABLED_P);
@@ -12681,7 +12633,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
       /* Show item in pressed state.  */
       if (!NILP (Vmouse_highlight))
        show_mouse_face (hlinfo, DRAW_IMAGE_SUNKEN);
-      last_tool_bar_item = prop_idx;
+      f->last_tool_bar_item = prop_idx;
     }
   else
     {
@@ -12706,7 +12658,7 @@ handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
       event.arg = key;
       event.modifiers = modifiers;
       kbd_buffer_store_event (&event);
-      last_tool_bar_item = -1;
+      f->last_tool_bar_item = -1;
     }
 }
 
@@ -12756,8 +12708,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
   mouse_down_p = (x_mouse_grabbed (dpyinfo)
                  && f == dpyinfo->last_mouse_frame);
 
-  if (mouse_down_p
-      && last_tool_bar_item != prop_idx)
+  if (mouse_down_p && f->last_tool_bar_item != prop_idx)
     return;
 
   draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
@@ -12879,7 +12830,20 @@ hscroll_window_tree (Lisp_Object window)
          /* Scroll when cursor is inside this scroll margin.  */
          h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
 
+         /* If the position of this window's point has explicitly
+            changed, no more suspend auto hscrolling.  */
+         if (NILP (Fequal (Fwindow_point (window), Fwindow_old_point (window))))
+           w->suspend_auto_hscroll = 0;
+
+         /* Remember window point.  */
+         Fset_marker (w->old_pointm,
+                      ((w == XWINDOW (selected_window))
+                       ? make_number (BUF_PT (XBUFFER (w->contents)))
+                       : Fmarker_position (w->pointm)),
+                      w->contents);
+
          if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->contents))
+             && w->suspend_auto_hscroll == 0
              /* In some pathological cases, like restoring a window
                 configuration into a frame that is much smaller than
                 the one from which the configuration was saved, we
@@ -12892,8 +12856,7 @@ hscroll_window_tree (Lisp_Object window)
                 inside the left margin and the window is already
                 hscrolled.  */
              && ((!row_r2l_p
-                  && ((w->hscroll
-                       && w->cursor.x <= h_margin)
+                  && ((w->hscroll && w->cursor.x <= h_margin)
                       || (cursor_row->enabled_p
                           && cursor_row->truncated_on_right_p
                           && (w->cursor.x >= text_area_width - h_margin))))
@@ -15774,9 +15737,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
   return rc;
 }
 
-#if !defined USE_TOOLKIT_SCROLL_BARS || defined USE_GTK
-static
-#endif
+
 void
 set_vertical_scroll_bar (struct window *w)
 {
@@ -15815,6 +15776,60 @@ set_vertical_scroll_bar (struct window *w)
 }
 
 
+void
+set_horizontal_scroll_bar (struct window *w)
+{
+  int start, end, whole, box_width;
+
+  if (!MINI_WINDOW_P (w)
+      || (w == XWINDOW (minibuf_window)
+         && NILP (echo_area_buffer[0])))
+    {
+      struct buffer *b = XBUFFER (w->contents);
+      struct buffer *old_buffer = NULL;
+      struct it it;
+      struct text_pos startp;
+
+      if (b != current_buffer)
+       {
+         old_buffer = current_buffer;
+         set_buffer_internal (b);
+       }
+
+      SET_TEXT_POS_FROM_MARKER (startp, w->start);
+      start_display (&it, w, startp);
+      it.last_visible_x = INT_MAX;
+      whole = move_it_to (&it, -1, INT_MAX, window_box_height (w), -1,
+                         MOVE_TO_X | MOVE_TO_Y);
+      /* whole = move_it_to (&it, w->window_end_pos, INT_MAX,
+                         window_box_height (w), -1,
+                         MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); */
+
+      start = w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w));
+      box_width = window_box_width (w, TEXT_AREA);
+      end = start + box_width;
+
+      /* The following is needed to ensure that if after maximizing a
+        window we get hscroll > 0, we can still drag the thumb to the
+        left.  */
+      whole = max (whole, w->hscroll + box_width);
+      whole = max (whole, end - start);
+
+      if (old_buffer)
+       set_buffer_internal (old_buffer);
+    }
+  else
+    start = end = whole = 0;
+
+  w->hscroll_whole = whole;
+
+  /* Indicate what this scroll bar ought to be displaying now.  */
+  if (FRAME_TERMINAL (XFRAME (w->frame))->set_horizontal_scroll_bar_hook)
+    (*FRAME_TERMINAL (XFRAME (w->frame))->set_horizontal_scroll_bar_hook)
+      (w, end - start, whole, start);
+}
+
+
 /* Redisplay leaf window WINDOW.  JUST_THIS_ONE_P non-zero means only
    selected_window is redisplayed.
 
@@ -16028,6 +16043,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
     {
       ptrdiff_t new_pt = marker_position (w->pointm);
       ptrdiff_t new_pt_byte = marker_byte_position (w->pointm);
+
       if (new_pt < BEGV)
        {
          new_pt = BEGV;
@@ -16767,7 +16783,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
            redisplay_tool_bar (f);
 #else
          if (WINDOWP (f->tool_bar_window)
-             && (FRAME_TOOL_BAR_HEIGHT (f) > 0
+             && (FRAME_TOOL_BAR_LINES (f) > 0
                  || !NILP (Vauto_resize_tool_bars))
              && redisplay_tool_bar (f))
            ignore_mouse_drag_p = 1;
@@ -16807,10 +16823,15 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
   ;
  finish_scroll_bars:
 
-  if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
+   if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) || WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w))
     {
-      /* Set the thumb's position and size.  */
-      set_vertical_scroll_bar (w);
+      if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
+       /* Set the thumb's position and size.  */
+       set_vertical_scroll_bar (w);
+
+      if (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w))
+       /* Set the thumb's position and size.  */
+       set_horizontal_scroll_bar (w);
 
       /* Note that we actually used the scroll bar attached to this
         window, so it shouldn't be deleted at the end of redisplay.  */
@@ -22881,7 +22902,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
        return decode_mode_spec_buf;
     no_value:
         {
-         charp = decode_mode_spec_buf;
+         char *p = decode_mode_spec_buf;
          int pad = width - 2;
          while (pad-- > 0)
            *p++ = ' ';
@@ -23633,7 +23654,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
            return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w));
        }
 
-      prop = buffer_local_value_1 (prop, it->w->contents);
+      prop = buffer_local_value (prop, it->w->contents);
       if (EQ (prop, Qunbound))
        prop = Qnil;
     }
@@ -23685,7 +23706,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
              return OK_PIXELS (pixels);
            }
 
-         car = buffer_local_value_1 (car, it->w->contents);
+         car = buffer_local_value (car, it->w->contents);
          if (EQ (car, Qunbound))
            car = Qnil;
        }
@@ -23862,7 +23883,7 @@ get_char_face_and_encoding (struct frame *f, int c, int face_id,
 #endif
     {
       eassert (face != NULL);
-      PREPARE_FACE_FOR_DISPLAY (f, face);
+      prepare_face_for_display (f, face);
     }
 
   return face;
@@ -23885,7 +23906,7 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
 
   /* Make sure X resources of the face are allocated.  */
   eassert (face != NULL);
-  PREPARE_FACE_FOR_DISPLAY (f, face);
+  prepare_face_for_display (f, face);
 
   if (two_byte_p)
     *two_byte_p = 0;
@@ -24202,7 +24223,7 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end)
   s->ybase += voffset;
 
   /* The case that face->gc == 0 is handled when drawing the glyph
-     string by calling PREPARE_FACE_FOR_DISPLAY.  */
+     string by calling prepare_face_for_display.  */
   eassert (s->face);
   return glyph - s->row->glyphs[s->area];
 }
@@ -24800,13 +24821,16 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
          else
            overlap_hl = DRAW_NORMAL_TEXT;
 
+         if (hl != overlap_hl)
+           clip_head = head;
          j = i;
          BUILD_GLYPH_STRINGS (j, start, h, t,
                               overlap_hl, dummy_x, last_x);
          start = i;
          compute_overhangs_and_x (t, head->x, 1);
          prepend_glyph_string_lists (&head, &tail, h, t);
-         clip_head = head;
+         if (clip_head == NULL)
+           clip_head = head;
        }
 
       /* Prepend glyph strings for glyphs in front of the first glyph
@@ -24827,7 +24851,8 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
          else
            overlap_hl = DRAW_NORMAL_TEXT;
 
-         clip_head = head;
+         if (hl == overlap_hl || clip_head == NULL)
+           clip_head = head;
          BUILD_GLYPH_STRINGS (i, start, h, t,
                               overlap_hl, dummy_x, last_x);
          for (s = h; s; s = s->next)
@@ -24851,13 +24876,16 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
          else
            overlap_hl = DRAW_NORMAL_TEXT;
 
+         if (hl != overlap_hl)
+           clip_tail = tail;
          BUILD_GLYPH_STRINGS (end, i, h, t,
                               overlap_hl, x, last_x);
          /* Because BUILD_GLYPH_STRINGS updates the first argument,
             we don't have `end = i;' here.  */
          compute_overhangs_and_x (h, tail->x + tail->width, 0);
          append_glyph_string_lists (&head, &tail, h, t);
-         clip_tail = tail;
+         if (clip_tail == NULL)
+           clip_tail = tail;
        }
 
       /* Append glyph strings for glyphs following the last glyph
@@ -24875,7 +24903,8 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
          else
            overlap_hl = DRAW_NORMAL_TEXT;
 
-         clip_tail = tail;
+         if (hl == overlap_hl || clip_tail == NULL)
+           clip_tail = tail;
          i++;                  /* We must include the Ith glyph.  */
          BUILD_GLYPH_STRINGS (end, i, h, t,
                               overlap_hl, x, last_x);
@@ -25143,7 +25172,7 @@ produce_image_glyph (struct it *it)
   face = FACE_FROM_ID (it->f, it->face_id);
   eassert (face);
   /* Make sure X resources of the face is loaded.  */
-  PREPARE_FACE_FOR_DISPLAY (it->f, face);
+  prepare_face_for_display (it->f, face);
 
   if (it->image_id < 0)
     {
@@ -25439,7 +25468,7 @@ produce_stretch_glyph (struct it *it)
     {
       struct face *face = FACE_FROM_ID (it->f, it->face_id);
       font = face->font ? face->font : FRAME_FONT (it->f);
-      PREPARE_FACE_FOR_DISPLAY (it->f, face);
+      prepare_face_for_display (it->f, face);
     }
 #endif
 
@@ -25903,7 +25932,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
 
       face = FACE_FROM_ID (it->f, face_id);
       font = face->font ? face->font : FRAME_FONT (it->f);
-      PREPARE_FACE_FOR_DISPLAY (it->f, face);
+      prepare_face_for_display (it->f, face);
 
       if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM)
        {
@@ -25919,7 +25948,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
          sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c);
          str = buf;
        }
-      for (len = 0; str[len] && ASCII_BYTE_P (str[len]) && len < 6; len++)
+      for (len = 0; str[len] && ASCII_CHAR_P (str[len]) && len < 6; len++)
        code[len] = font->driver->encode_char (font, str[len]);
       upper_len = (len + 1) / 2;
       font->driver->text_extents (font, code, upper_len,
@@ -27244,9 +27273,6 @@ draw_phys_cursor_glyph (struct window *w, struct glyph_row *row,
 
 /* Erase the image of a cursor of window W from the screen.  */
 
-#ifndef HAVE_NTGUI
-static
-#endif
 void
 erase_phys_cursor (struct window *w)
 {
@@ -28772,8 +28798,8 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
          else if (area == ON_MODE_LINE)
            {
              Lisp_Object default_help
-               = buffer_local_value_1 (Qmode_line_default_help_echo,
-                                       w->contents);
+               = buffer_local_value (Qmode_line_default_help_echo,
+                                     w->contents);
 
              if (STRINGP (default_help))
                {
@@ -29067,7 +29093,8 @@ note_mouse_highlight (struct frame *f, int x, int y)
     else
       cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
   else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE
-          || part == ON_SCROLL_BAR)
+          || part == ON_VERTICAL_SCROLL_BAR
+          || part == ON_HORIZONTAL_SCROLL_BAR)
     cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
   else
     cursor = FRAME_X_OUTPUT (f)->text_cursor;
@@ -29988,8 +30015,10 @@ expose_frame (struct frame *f, int x, int y, int w, int h)
   if (w == 0 || h == 0)
     {
       r.x = r.y = 0;
-      r.width = FRAME_COLUMN_WIDTH (f) * FRAME_COLS (f);
-      r.height = FRAME_LINE_HEIGHT (f) * FRAME_LINES (f);
+      r.width = FRAME_TEXT_WIDTH (f);
+      r.height = FRAME_TEXT_HEIGHT (f);
+/**       r.width = FRAME_COLUMN_WIDTH (f) * FRAME_COLS (f); **/
+/**       r.height = FRAME_LINE_HEIGHT (f) * FRAME_LINES (f); **/
     }
   else
     {
@@ -30275,8 +30304,9 @@ A value of nil means no special handling of these characters.  */);
 
   DEFVAR_LISP ("void-text-area-pointer", Vvoid_text_area_pointer,
     doc: /* The pointer shape to show in void text areas.
-A value of nil means to show the text pointer.  Other options are `arrow',
-`text', `hand', `vdrag', `hdrag', `modeline', and `hourglass'.  */);
+A value of nil means to show the text pointer.  Other options are
+`arrow', `text', `hand', `vdrag', `hdrag', `nhdrag', `modeline', and
+`hourglass'.  */);
   Vvoid_text_area_pointer = Qarrow;
 
   DEFVAR_LISP ("inhibit-redisplay", Vinhibit_redisplay,
@@ -30771,10 +30801,10 @@ init_xdisp (void)
       r->pixel_top = r->top_line * FRAME_LINE_HEIGHT (f);
       r->total_cols = FRAME_COLS (f);
       r->pixel_width = r->total_cols * FRAME_COLUMN_WIDTH (f);
-      r->total_lines = FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f);
+      r->total_lines = FRAME_TOTAL_LINES (f) - 1 - FRAME_TOP_MARGIN (f);
       r->pixel_height = r->total_lines * FRAME_LINE_HEIGHT (f);
 
-      m->top_line = FRAME_LINES (f) - 1;
+      m->top_line = FRAME_TOTAL_LINES (f) - 1;
       m->pixel_top = m->top_line * FRAME_LINE_HEIGHT (f);
       m->total_cols = FRAME_COLS (f);
       m->pixel_width = m->total_cols * FRAME_COLUMN_WIDTH (f);
@@ -30807,7 +30837,38 @@ init_xdisp (void)
 
 /* Platform-independent portion of hourglass implementation.  */
 
+/* Timer function of hourglass_atimer.  */
+
+static void
+show_hourglass (struct atimer *timer)
+{
+  /* The timer implementation will cancel this timer automatically
+     after this function has run.  Set hourglass_atimer to null
+     so that we know the timer doesn't have to be canceled.  */
+  hourglass_atimer = NULL;
+
+  if (!hourglass_shown_p)
+    {
+      Lisp_Object tail, frame;
+
+      block_input ();
+
+      FOR_EACH_FRAME (tail, frame)
+       {
+         struct frame *f = XFRAME (frame);
+
+         if (FRAME_LIVE_P (f) && FRAME_WINDOW_P (f)
+             && FRAME_RIF (f)->show_hourglass)
+           FRAME_RIF (f)->show_hourglass (f);
+       }
+
+      hourglass_shown_p = 1;
+      unblock_input ();
+    }
+}
+
 /* Cancel a currently active hourglass timer, and start a new one.  */
+
 void
 start_hourglass (void)
 {
@@ -30826,20 +30887,13 @@ start_hourglass (void)
   else
     delay = make_timespec (DEFAULT_HOURGLASS_DELAY, 0);
 
-#ifdef HAVE_NTGUI
-  {
-    extern void w32_note_current_window (void);
-    w32_note_current_window ();
-  }
-#endif /* HAVE_NTGUI */
-
   hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
                                   show_hourglass, NULL);
 }
 
-
 /* Cancel the hourglass cursor timer if active, hide a busy cursor if
    shown.  */
+
 void
 cancel_hourglass (void)
 {
@@ -30850,7 +30904,28 @@ cancel_hourglass (void)
     }
 
   if (hourglass_shown_p)
-    hide_hourglass ();
+    {
+      Lisp_Object tail, frame;
+
+      block_input ();
+
+      FOR_EACH_FRAME (tail, frame)
+       {
+         struct frame *f = XFRAME (frame);
+
+         if (FRAME_LIVE_P (f) && FRAME_WINDOW_P (f)
+             && FRAME_RIF (f)->hide_hourglass)
+           FRAME_RIF (f)->hide_hourglass (f);
+#ifdef HAVE_NTGUI
+         /* No cursors on non GUI frames - restore to stock arrow cursor.  */
+         else if (!FRAME_W32_P (f))
+           w32_arrow_cursor ();
+#endif
+       }
+
+      hourglass_shown_p = 0;
+      unblock_input ();
+    }
 }
 
 #endif /* HAVE_WINDOW_SYSTEM */
index ac67c7b7be434f3a74e06cff24272fee1654deb4..34895123db9896481219cd7cf44cd1b23e7a6afb 100644 (file)
@@ -273,10 +273,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define IGNORE_DEFFACE_P(ATTR) EQ ((ATTR), QCignore_defface)
 
-/* Value is the number of elements of VECTOR.  */
-
-#define DIM(VECTOR) (sizeof (VECTOR) / sizeof *(VECTOR))
-
 /* Size of hash table of realized faces in face caches (should be a
    prime number).  */
 
@@ -515,7 +511,7 @@ DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0,
 
   fputc ('\n', stderr);
 
-  for (i = n = 0; i < sizeof color_count / sizeof color_count[0]; ++i)
+  for (i = n = 0; i < ARRAYELTS (color_count); ++i)
     if (color_count[i])
       {
        fprintf (stderr, "%3d: %5d", i, color_count[i]);
@@ -1242,9 +1238,6 @@ load_color2 (struct frame *f, struct face *face, Lisp_Object name,
    record that fact in flags of the face so that we don't try to free
    these colors.  */
 
-#ifndef MSDOS
-static
-#endif
 unsigned long
 load_color (struct frame *f, struct face *face, Lisp_Object name,
            enum lface_attribute_index target_index)
@@ -4095,15 +4088,15 @@ free_realized_face (struct frame *f, struct face *face)
     }
 }
 
+#ifdef HAVE_WINDOW_SYSTEM
 
-/* Prepare face FACE for subsequent display on frame F.  This
-   allocated GCs if they haven't been allocated yet or have been freed
-   by clearing the face cache.  */
+/* Prepare face FACE for subsequent display on frame F.  This must be called
+   before using X resources of FACE to allocate GCs if they haven't been
+   allocated yet or have been freed by clearing the face cache.  */
 
 void
 prepare_face_for_display (struct frame *f, struct face *face)
 {
-#ifdef HAVE_WINDOW_SYSTEM
   eassert (FRAME_WINDOW_P (f));
 
   if (face->gc == 0)
@@ -4131,10 +4124,10 @@ prepare_face_for_display (struct frame *f, struct face *face)
        font_prepare_for_face (f, face);
       unblock_input ();
     }
-#endif /* HAVE_WINDOW_SYSTEM */
 }
 
-\f
+#endif /* HAVE_WINDOW_SYSTEM */
+
 /* Returns the `distance' between the colors X and Y.  */
 
 static int
@@ -5083,14 +5076,14 @@ Value is ORDER.  */)
 {
   Lisp_Object list;
   int i;
-  int indices[DIM (font_sort_order)];
+  int indices[ARRAYELTS (font_sort_order)];
 
   CHECK_LIST (order);
   memset (indices, 0, sizeof indices);
   i = 0;
 
   for (list = order;
-       CONSP (list) && i < DIM (indices);
+       CONSP (list) && i < ARRAYELTS (indices);
        list = XCDR (list), ++i)
     {
       Lisp_Object attr = XCAR (list);
@@ -5112,9 +5105,9 @@ Value is ORDER.  */)
       indices[i] = xlfd;
     }
 
-  if (!NILP (list) || i != DIM (indices))
+  if (!NILP (list) || i != ARRAYELTS (indices))
     signal_error ("Invalid font sort order", order);
-  for (i = 0; i < DIM (font_sort_order); ++i)
+  for (i = 0; i < ARRAYELTS (font_sort_order); ++i)
     if (indices[i] == 0)
       signal_error ("Invalid font sort order", order);
 
@@ -5480,7 +5473,6 @@ realize_non_ascii_face (struct frame *f, Lisp_Object font_object,
   face = xmalloc (sizeof *face);
   *face = *base_face;
   face->gc = 0;
-  face->extra = NULL;
   face->overstrike
     = (! NILP (font_object)
        && FONT_WEIGHT_NAME_NUMERIC (face->lface[LFACE_WEIGHT_INDEX]) > 100
@@ -5555,7 +5547,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
        }
       if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
        attrs[LFACE_FONT_INDEX]
-         = font_load_for_lface (f, attrs, attrs[LFACE_FONT_INDEX]);
+         = font_load_for_lface (f, attrs, Ffont_spec (0, NULL));
       if (FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
        {
          face->font = XFONT_OBJECT (attrs[LFACE_FONT_INDEX]);
@@ -6307,7 +6299,7 @@ dump_realized_face (struct face *face)
 {
   fprintf (stderr, "ID: %d\n", face->id);
 #ifdef HAVE_X_WINDOWS
-  fprintf (stderr, "gc: %ld\n", (long) face->gc);
+  fprintf (stderr, "gc: %p\n", face->gc);
 #endif
   fprintf (stderr, "foreground: 0x%lx (%s)\n",
           face->foreground,
@@ -6338,7 +6330,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, doc: /* */)
       int i;
 
       fprintf (stderr, "font selection order: ");
-      for (i = 0; i < DIM (font_sort_order); ++i)
+      for (i = 0; i < ARRAYELTS (font_sort_order); ++i)
        fprintf (stderr, "%d ", font_sort_order[i]);
       fprintf (stderr, "\n");
 
index 23fba44f1f380d057fb90b680359d614f59d12a2..1787d0297e6e2c923b6a8dd7f17f3c11af98de25 100644 (file)
@@ -24,6 +24,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 #include "xterm.h"
+#include "menu.h"
 #include "frame.h"
 #include "window.h"
 #include "character.h"
@@ -124,7 +125,6 @@ extern LWLIB_ID widget_id_tick;
 
 #define MAXREQUEST(dpy) (XMaxRequestSize (dpy))
 
-static Lisp_Object Qsuppress_icon;
 static Lisp_Object Qundefined_color;
 static Lisp_Object Qcompound_text, Qcancel_timer;
 Lisp_Object Qfont_param;
@@ -329,8 +329,43 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
   *yptr = real_y;
 }
 
-\f
+/* Get the mouse position in frame relative coordinates.  */
+
+void
+x_relative_mouse_position (struct frame *f, int *x, int *y)
+{
+  Window root, dummy_window;
+  int dummy;
+
+  eassert (FRAME_X_P (f));
+
+  block_input ();
+
+  XQueryPointer (FRAME_X_DISPLAY (f),
+                 DefaultRootWindow (FRAME_X_DISPLAY (f)),
+
+                 /* The root window which contains the pointer.  */
+                 &root,
 
+                 /* Window pointer is on, not used  */
+                 &dummy_window,
+
+                 /* The position on that root window.  */
+                 x, y,
+
+                 /* x/y in dummy_window coordinates, not used.  */
+                 &dummy, &dummy,
+
+                 /* Modifier keys and pointer buttons, about which
+                    we don't care.  */
+                 (unsigned int *) &dummy);
+
+  unblock_input ();
+
+  /* Translate root window coordinates to window coordinates.  */
+  *x -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
+  *y -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
+}
 
 /* Gamma-correct COLOR on frame F.  */
 
@@ -422,15 +457,23 @@ x_set_tool_bar_position (struct frame *f,
                          Lisp_Object new_value,
                          Lisp_Object old_value)
 {
-  if (! EQ (new_value, Qleft) && ! EQ (new_value, Qright)
-      && ! EQ (new_value, Qbottom) && ! EQ (new_value, Qtop))
-    return;
-  if (EQ (new_value, old_value)) return;
+  Lisp_Object choice = list4 (Qleft, Qright, Qtop, Qbottom);
 
+  if (!NILP (Fmemq (new_value, choice)))
+    {
 #ifdef USE_GTK
-  xg_change_toolbar_position (f, new_value);
-  fset_tool_bar_position (f, new_value);
+      if (!EQ (new_value, old_value))
+       {
+         xg_change_toolbar_position (f, new_value);
+         fset_tool_bar_position (f, new_value);
+       }
+#else
+      if (!EQ (new_value, Qtop))
+       error ("The only supported tool bar position is top");
 #endif
+    }
+  else
+    wrong_choice (choice, new_value);
 }
 
 #ifdef USE_GTK
@@ -577,35 +620,6 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
     }
 }
 
-static Cursor
-make_invisible_cursor (struct frame *f)
-{
-  Display *dpy = FRAME_X_DISPLAY (f);
-  static char const no_data[] = { 0 };
-  Pixmap pix;
-  XColor col;
-  Cursor c = 0;
-
-  x_catch_errors (dpy);
-  pix = XCreateBitmapFromData (dpy, FRAME_DISPLAY_INFO (f)->root_window,
-                               no_data, 1, 1);
-  if (! x_had_errors_p (dpy) && pix != None)
-    {
-      Cursor pixc;
-      col.pixel = 0;
-      col.red = col.green = col.blue = 0;
-      col.flags = DoRed | DoGreen | DoBlue;
-      pixc = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0);
-      if (! x_had_errors_p (dpy) && pixc != None)
-        c = pixc;
-      XFreePixmap (dpy, pix);
-    }
-
-  x_uncatch_errors ();
-
-  return c;
-}
-
 static void
 x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
@@ -723,9 +737,6 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
     XDefineCursor (dpy, FRAME_X_WINDOW (f),
                    f->output_data.x->current_cursor = cursor);
 
-  if (FRAME_DISPLAY_INFO (f)->invisible_cursor == 0)
-    FRAME_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
-
   if (cursor != x->text_cursor
       && x->text_cursor != 0)
     XFreeCursor (dpy, x->text_cursor);
@@ -998,7 +1009,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 #else /* not USE_X_TOOLKIT && not USE_GTK */
   FRAME_MENU_BAR_LINES (f) = nlines;
   FRAME_MENU_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
-  resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
+  adjust_frame_size (f, -1, -1, 2, 1);
   if (FRAME_X_WINDOW (f))
     x_clear_under_internal_border (f);
 
@@ -1053,10 +1064,6 @@ void
 x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 {
   int nlines;
-#if ! defined (USE_GTK)
-  int delta, root_height;
-  int unit = FRAME_LINE_HEIGHT (f);
-#endif
 
   /* Treat tool bars like menu bars.  */
   if (FRAME_MINIBUF_ONLY_P (f))
@@ -1068,11 +1075,18 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
   else
     nlines = 0;
 
-#ifdef USE_GTK
+  x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
+}
 
+
+/* Set the pixel height of the tool bar of frame F to HEIGHT.  */
+void
+x_change_tool_bar_height (struct frame *f, int height)
+{
+#ifdef USE_GTK
   FRAME_TOOL_BAR_LINES (f) = 0;
   FRAME_TOOL_BAR_HEIGHT (f) = 0;
-  if (nlines)
+  if (height)
     {
       FRAME_EXTERNAL_TOOL_BAR (f) = 1;
       if (FRAME_X_P (f) && f->output_data.x->toolbar_widget == 0)
@@ -1086,39 +1100,25 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
         free_frame_tool_bar (f);
       FRAME_EXTERNAL_TOOL_BAR (f) = 0;
     }
-
 #else /* !USE_GTK */
+  int unit = FRAME_LINE_HEIGHT (f);
+  int old_height = FRAME_TOOL_BAR_HEIGHT (f);
+  int lines = (height + unit - 1) / unit;
 
   /* Make sure we redisplay all windows in this frame.  */
   windows_or_buffers_changed = 60;
 
-  /* DELTA is in pixels now.  */
-  delta = (nlines - FRAME_TOOL_BAR_LINES (f)) * unit;
-
-  /* Don't resize the tool-bar to more than we have room for.  Note: The
-     calculations below and the subsequent call to resize_frame_windows
-     are inherently flawed because they can make the toolbar higher than
-     the containing frame.  */
-  if (delta > 0)
-    {
-      root_height = WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_ROOT_WINDOW (f)));
-      if (root_height - delta < unit)
-       {
-         delta = root_height - unit;
-         /* When creating a new frame and toolbar mode is enabled, we
-            need at least one toolbar line.  */
-         nlines = max (FRAME_TOOL_BAR_LINES (f) + delta / unit, 1);
-       }
-    }
 
-  FRAME_TOOL_BAR_LINES (f) = nlines;
-  FRAME_TOOL_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
-  resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
-#if !defined USE_X_TOOLKIT && !defined USE_GTK
-  if (FRAME_X_WINDOW (f))
-    x_clear_under_internal_border (f);
-#endif
-  adjust_frame_glyphs (f);
+  /* Recalculate tool bar and frame text sizes.  */
+  FRAME_TOOL_BAR_HEIGHT (f) = height;
+  FRAME_TOOL_BAR_LINES (f) = lines;
+  FRAME_TEXT_HEIGHT (f)
+    = FRAME_PIXEL_TO_TEXT_HEIGHT (f, FRAME_PIXEL_HEIGHT (f));
+  FRAME_LINES (f)
+    = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f));
+  /* Store the `tool-bar-lines' and `height' frame parameters.  */
+  store_frame_param (f, Qtool_bar_lines, make_number (lines));
+  store_frame_param (f, Qheight, make_number (FRAME_LINES (f)));
 
   /* We also have to make sure that the internal border at the top of
      the frame, below the menu bar or tool bar, is redrawn when the
@@ -1132,30 +1132,52 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
       clear_current_matrices (f);
     }
 
-  /* If the tool bar gets smaller, the internal border below it
-     has to be cleared.  It was formerly part of the display
-     of the larger tool bar, and updating windows won't clear it.  */
-  if (delta < 0)
+  if ((height < old_height) && WINDOWP (f->tool_bar_window))
+    clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
+
+  /* Recalculate toolbar height.  */
+  f->n_tool_bar_rows = 0;
+
+  adjust_frame_size (f, -1, -1, 4, 0);
+
+/** #if !defined USE_X_TOOLKIT **/
+  if (FRAME_X_WINDOW (f))
+    x_clear_under_internal_border (f);
+/** #endif **/
+
+#endif /* USE_GTK */
+}
+
+
+void
+x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+  int border;
+
+  CHECK_TYPE_RANGED_INTEGER (int, arg);
+  border = max (XINT (arg), 0);
+
+  if (border != FRAME_INTERNAL_BORDER_WIDTH (f))
     {
-      int height = FRAME_INTERNAL_BORDER_WIDTH (f);
-      int width = FRAME_PIXEL_WIDTH (f);
-      int y = nlines * unit;
+      FRAME_INTERNAL_BORDER_WIDTH (f) = border;
 
-      /* height can be zero here. */
-      if (height > 0 && width > 0)
+#ifdef USE_X_TOOLKIT
+      if (FRAME_X_OUTPUT (f)->edit_widget)
+       widget_store_internal_border (FRAME_X_OUTPUT (f)->edit_widget);
+#endif
+
+      if (FRAME_X_WINDOW (f) != 0)
        {
-          block_input ();
-         x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                       0, y, width, height);
-          unblock_input ();
-        }
+         adjust_frame_size (f, -1, -1, 3, 0);
 
-      if (WINDOWP (f->tool_bar_window))
-       clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
+#ifdef USE_GTK
+         xg_clear_under_internal_border (f);
+#else    
+         x_clear_under_internal_border (f);
+#endif
+       }
     }
 
-  run_window_configuration_change_hook (f);
-#endif /* USE_GTK */
 }
 
 
@@ -1210,7 +1232,7 @@ x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object old
   if (f->output_data.x->scroll_bar_background_pixel != -1)
     unload_color (f, f->output_data.x->scroll_bar_background_pixel);
 
-#ifdef USE_TOOLKIT_SCROLL_BARS
+#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS)
   /* Scrollbar shadow colors.  */
   if (f->output_data.x->scroll_bar_top_shadow_pixel != -1)
     {
@@ -1222,7 +1244,7 @@ x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object old
       unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel);
       f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
     }
-#endif /* USE_TOOLKIT_SCROLL_BARS */
+#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */
 
   f->output_data.x->scroll_bar_background_pixel = pixel;
   if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f))
@@ -1249,10 +1271,6 @@ x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object old
    CODING_SYSTEM, and return a newly allocated memory area which
    should be freed by `xfree' by a caller.
 
-   SELECTIONP non-zero means the string is being encoded for an X
-   selection, so it is safe to run pre-write conversions (which
-   may run Lisp code).
-
    Store the byte length of resulting text in *TEXT_BYTES.
 
    If the text contains only ASCII and Latin-1, store 1 in *STRING_P,
@@ -1261,8 +1279,8 @@ x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object old
    the result should be `COMPOUND_TEXT'.  */
 
 static unsigned char *
-x_encode_text (Lisp_Object string, Lisp_Object coding_system, int selectionp,
-              ptrdiff_t *text_bytes, int *stringp, int *freep)
+x_encode_text (Lisp_Object string, Lisp_Object coding_system,
+              ptrdiff_t *text_bytes, int *stringp, bool *freep)
 {
   int result = string_xstring_p (string);
   struct coding_system coding;
@@ -1305,7 +1323,7 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
        XTextProperty text, icon;
        ptrdiff_t bytes;
        int stringp;
-        int do_free_icon_value = 0, do_free_text_value = 0;
+       bool do_free_icon_value = 0, do_free_text_value = 0;
        Lisp_Object coding_system;
        Lisp_Object encoded_name;
        Lisp_Object encoded_icon_name;
@@ -1337,14 +1355,12 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
           properties.  Per the EWMH specification, those two properties
           are always UTF8_STRING.  This matches what gtk_window_set_title()
           does in the USE_GTK case. */
-       text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
-                                   &do_free_text_value);
+       text.value = x_encode_text (name, coding_system, &bytes,
+                                   &stringp, &do_free_text_value);
        text.encoding = (stringp ? XA_STRING
                         : FRAME_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
        text.format = 8;
        text.nitems = bytes;
-       if (text.nitems != bytes)
-         error ("Window name too large");
 
        if (!STRINGP (f->icon_name))
          {
@@ -1354,14 +1370,12 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
        else
          {
            /* See the above comment "Note: Encoding strategy".  */
-           icon.value = x_encode_text (f->icon_name, coding_system, 0,
-                                       &bytes, &stringp, &do_free_icon_value);
+           icon.value = x_encode_text (f->icon_name, coding_system, &bytes,
+                                       &stringp, &do_free_icon_value);
            icon.encoding = (stringp ? XA_STRING
                             : FRAME_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
            icon.format = 8;
            icon.nitems = bytes;
-           if (icon.nitems != bytes)
-             error ("Icon name too large");
 
            encoded_icon_name = ENCODE_UTF_8 (f->icon_name);
          }
@@ -1399,16 +1413,16 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
 /* Change the name of frame F to NAME.  If NAME is nil, set F's name to
        x_id_name.
 
-   If EXPLICIT is non-zero, that indicates that lisp code is setting the
+   If EXPLICIT is true, that indicates that lisp code is setting the
        name; if NAME is a string, set F's name to NAME and set
        F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
 
-   If EXPLICIT is zero, that indicates that Emacs redisplay code is
+   If EXPLICIT is false, that indicates that Emacs redisplay code is
        suggesting a new name, which lisp code should override; if
        F->explicit_name is set, ignore the new name; otherwise, set it.  */
 
 static void
-x_set_name (struct frame *f, Lisp_Object name, int explicit)
+x_set_name (struct frame *f, Lisp_Object name, bool explicit)
 {
   /* Make sure that requests from lisp code override requests from
      Emacs redisplay code.  */
@@ -1505,14 +1519,36 @@ x_set_scroll_bar_default_width (struct frame *f)
   FRAME_CONFIG_SCROLL_BAR_COLS (f) = (minw + unit - 1) / unit;
   FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = minw;
 #else
-  /* The width of a non-toolkit scrollbar is at least 14 pixels and a
-     multiple of the frame's character width.  */
+  /* The width of a non-toolkit scrollbar is 14 pixels.  */
   FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + unit - 1) / unit;
   FRAME_CONFIG_SCROLL_BAR_WIDTH (f)
     = FRAME_CONFIG_SCROLL_BAR_COLS (f) * unit;
 #endif
 }
 
+void
+x_set_scroll_bar_default_height (struct frame *f)
+{
+  int height = FRAME_LINE_HEIGHT (f);
+#ifdef USE_TOOLKIT_SCROLL_BARS
+#ifdef USE_GTK
+  int min_height = xg_get_default_scrollbar_height ();
+#else
+  int min_height = 16;
+#endif
+  /* A minimum height of 14 doesn't look good for toolkit scroll bars.  */
+  FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = min_height;
+  FRAME_CONFIG_SCROLL_BAR_LINES (f) = (min_height + height - 1) / height;
+#else
+  /* The height of a non-toolkit scrollbar is 14 pixels.  */
+  FRAME_CONFIG_SCROLL_BAR_LINES (f) = (14 + height - 1) / height;
+
+  /* Use all of that space (aside from required margins) for the
+     scroll bar.  */
+  FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = 14;
+#endif
+}
+
 \f
 /* Record in frame F the specified or default value according to ALIST
    of the parameter named PROP (a Lisp symbol).  If no value is
@@ -1592,7 +1628,7 @@ hack_wm_protocols (struct frame *f, Widget widget)
 
     if ((XGetWindowProperty (dpy, w,
                             FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols,
-                            (long)0, (long)100, False, XA_ATOM,
+                            0, 100, False, XA_ATOM,
                             &type, &format, &nitems, &bytes_after,
                             &catoms)
         == Success)
@@ -1944,8 +1980,7 @@ static XIMStyle
 best_xim_style (XIMStyles *xim)
 {
   int i, j;
-  int nr_supported =
-    sizeof (supported_xim_styles) / sizeof (supported_xim_styles[0]);
+  int nr_supported = ARRAYELTS (supported_xim_styles);
 
   for (i = 0; i < nr_supported; ++i)
     for (j = 0; j < xim->count_styles; ++j)
@@ -2253,8 +2288,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
 
   /* Do some needed geometry management.  */
   {
-    char *tem, shell_position[sizeof "=x++" + 4 * INT_STRLEN_BOUND (int)];
-    Arg gal[10];
+    Arg gal[3];
     int gac = 0;
     int extra_borders = 0;
     int menubar_size
@@ -2273,7 +2307,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
       }
 #endif
 
-    f->output_data.x->menubar_height = menubar_size;
+    FRAME_MENUBAR_HEIGHT (f) = menubar_size;
 
 #ifndef USE_LUCID
     /* Motif seems to need this amount added to the sizes
@@ -2284,6 +2318,8 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
     extra_borders *= 2;
 #endif
 
+    f->shell_position = xmalloc (sizeof "=x++" + 4 * INT_STRLEN_BOUND (int));
+
     /* Convert our geometry parameters into a geometry string
        and specify it.
        Note that we do not specify here whether the position
@@ -2300,14 +2336,14 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
        top = -top;
 
       if (window_prompting & USPosition)
-       sprintf (shell_position, "=%dx%d%c%d%c%d",
+       sprintf (f->shell_position, "=%dx%d%c%d%c%d",
                 FRAME_PIXEL_WIDTH (f) + extra_borders,
                 FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders,
                 (xneg ? '-' : '+'), left,
                 (yneg ? '-' : '+'), top);
       else
         {
-          sprintf (shell_position, "=%dx%d",
+          sprintf (f->shell_position, "=%dx%d",
                    FRAME_PIXEL_WIDTH (f) + extra_borders,
                    FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders);
 
@@ -2321,12 +2357,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
         }
     }
 
-    /* We don't free this because we don't know whether
-       it is safe to free it while the frame exists.
-       It isn't worth the trouble of arranging to free it
-       when the frame is deleted.  */
-    tem = xstrdup (shell_position);
-    XtSetArg (gal[gac], XtNgeometry, tem); gac++;
+    XtSetArg (gal[gac], XtNgeometry, f->shell_position); gac++;
     XtSetValues (shell_widget, gal, gac);
   }
 
@@ -2395,7 +2426,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
      the X server hasn't been told.  */
   {
     Lisp_Object name;
-    int explicit = f->explicit_name;
+    bool explicit = f->explicit_name;
 
     f->explicit_name = 0;
     name = f->name;
@@ -2509,10 +2540,6 @@ x_window (struct frame *f)
   class_hints.res_class = SSDATA (Vx_resource_class);
   XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints);
 
-  /* The menubar is part of the ordinary display;
-     it does not count in addition to the height of the window.  */
-  f->output_data.x->menubar_height = 0;
-
   /* This indicates that we use the "Passive Input" input model.
      Unless we do this, we don't get the Focus{In,Out} events that we
      need to draw the cursor correctly.  Accursed bureaucrats.
@@ -2538,7 +2565,7 @@ x_window (struct frame *f)
      the X server hasn't been told.  */
   {
     Lisp_Object name;
-    int explicit = f->explicit_name;
+    bool explicit = f->explicit_name;
 
     f->explicit_name = 0;
     name = f->name;
@@ -2761,12 +2788,6 @@ do_unwind_create_frame (Lisp_Object frame)
   unwind_create_frame (frame);
 }
 
-static void
-unwind_create_frame_1 (Lisp_Object val)
-{
-  inhibit_lisp_code = val;
-}
-
 static void
 x_default_font_parameter (struct frame *f, Lisp_Object parms)
 {
@@ -2851,29 +2872,31 @@ Signal error if FRAME is not an X frame.  */)
 static void
 set_machine_and_pid_properties (struct frame *f)
 {
-  long pid = (long) getpid ();
-
   /* This will set WM_CLIENT_MACHINE and WM_LOCALE_NAME.  */
   XSetWMProperties (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), NULL, NULL,
                     NULL, 0, NULL, NULL, NULL);
-  XChangeProperty (FRAME_X_DISPLAY (f),
-                   FRAME_OUTER_WINDOW (f),
-                   XInternAtom (FRAME_X_DISPLAY (f),
-                                "_NET_WM_PID",
-                                False),
-                   XA_CARDINAL, 32, PropModeReplace,
-                   (unsigned char *) &pid, 1);
+  pid_t pid = getpid ();
+  if (pid <= 0xffffffffu)
+    {
+      unsigned long xpid = pid;
+      XChangeProperty (FRAME_X_DISPLAY (f),
+                      FRAME_OUTER_WINDOW (f),
+                      XInternAtom (FRAME_X_DISPLAY (f),
+                                   "_NET_WM_PID",
+                                   False),
+                      XA_CARDINAL, 32, PropModeReplace,
+                      (unsigned char *) &xpid, 1);
+    }
 }
 
 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
        1, 1, 0,
        doc: /* Make a new X window, which is called a "frame" in Emacs terms.
-Return an Emacs frame object.
-PARMS is an alist of frame parameters.
+Return an Emacs frame object.  PARMS is an alist of frame parameters.
 If the parameters specify that the frame should not have a minibuffer,
-and do not specify a specific minibuffer window to use,
-then `default-minibuffer-frame' must be a frame whose minibuffer can
-be shared by the new frame.
+and do not specify a specific minibuffer window to use, then
+`default-minibuffer-frame' must be a frame whose minibuffer can be
+shared by the new frame.
 
 This function is an internal primitive--use `make-frame' instead.  */)
   (Lisp_Object parms)
@@ -2883,7 +2906,6 @@ This function is an internal primitive--use `make-frame' instead.  */)
   Lisp_Object name;
   int minibuffer_only = 0;
   long window_prompting = 0;
-  int width, height;
   ptrdiff_t count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
   Lisp_Object display;
@@ -2953,10 +2975,10 @@ This function is an internal primitive--use `make-frame' instead.  */)
   FRAME_FONTSET (f) = -1;
   f->output_data.x->scroll_bar_foreground_pixel = -1;
   f->output_data.x->scroll_bar_background_pixel = -1;
-#ifdef USE_TOOLKIT_SCROLL_BARS
+#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS)
   f->output_data.x->scroll_bar_top_shadow_pixel = -1;
   f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
-#endif /* USE_TOOLKIT_SCROLL_BARS */
+#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */
   f->output_data.x->white_relief.pixel = -1;
   f->output_data.x->black_relief.pixel = -1;
 
@@ -3005,7 +3027,6 @@ This function is an internal primitive--use `make-frame' instead.  */)
   }
 
   /* Specify the parent under which to make this X window.  */
-
   if (!NILP (parent))
     {
       f->output_data.x->parent_desc = (Window) XFASTINT (parent);
@@ -3028,7 +3049,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
     {
       fset_name (f, name);
       f->explicit_name = 1;
-      /* use the frame's title when getting resources for this frame.  */
+      /* Use the frame's title when getting resources for this frame.  */
       specbind (Qx_resource_name, name);
     }
 
@@ -3091,6 +3112,14 @@ This function is an internal primitive--use `make-frame' instead.  */)
 #endif
                       "verticalScrollBars", "ScrollBars",
                       RES_TYPE_SYMBOL);
+  x_default_parameter (f, parms, Qhorizontal_scroll_bars,
+#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
+                      Qt,
+#else
+                      Qnil,
+#endif
+                      "horizontalScrollBars", "ScrollBars",
+                      RES_TYPE_SYMBOL);
 
   /* Also do the stuff which must be set before the window exists.  */
   x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
@@ -3123,49 +3152,36 @@ This function is an internal primitive--use `make-frame' instead.  */)
   dpyinfo_refcount = dpyinfo->reference_count;
 #endif /* GLYPH_DEBUG */
 
-  /* Init faces before x_default_parameter is called for scroll-bar
-     parameters because that function calls x_set_scroll_bar_width,
-     which calls change_frame_size, which calls Fset_window_buffer,
-     which runs hooks, which call Fvertical_motion.  At the end, we
-     end up in init_iterator with a null face cache, which should not
-     happen.  */
+  /* Init faces before x_default_parameter is called for the
+     scroll-bar-width parameter because otherwise we end up in
+     init_iterator with a null face cache, which should not happen.  */
   init_frame_faces (f);
 
-  /* PXW: This is a duplicate from below.  We have to do it here since
-     otherwise x_set_tool_bar_lines will work with the character sizes
-     installed by init_frame_faces while the frame's pixel size is still
-     calculated from a character size of 1 and we subsequently hit the
-     eassert (height >= 0) assertion in window_box_height.  The
-     non-pixelwise code apparently worked around this because it had one
-     frame line vs one toolbar line which left us with a zero root
-     window height which was obviously wrong as well ...  */
-  change_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
-                    FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1, 0, 0, 1);
+  /* The following call of change_frame_size is needed since otherwise
+     x_set_tool_bar_lines will already work with the character sizes
+     installed by init_frame_faces while the frame's pixel size is
+     still calculated from a character size of 1 and we subsequently
+     hit the (height >= 0) assertion in window_box_height.
+
+     The non-pixelwise code apparently worked around this because it
+     had one frame line vs one toolbar line which left us with a zero
+     root window height which was obviously wrong as well ...  */
+  adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+                    FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 5, 1);
 
   /* Set the menu-bar-lines and tool-bar-lines parameters.  We don't
      look up the X resources controlling the menu-bar and tool-bar
      here; they are processed specially at startup, and reflected in
-     the values of the mode variables.
+     the values of the mode variables.  */
 
-     Avoid calling window-configuration-change-hook; otherwise we
-     could get an infloop in next_frame since the frame is not yet in
-     Vframe_list.  */
-  {
-    ptrdiff_t count2 = SPECPDL_INDEX ();
-    record_unwind_protect (unwind_create_frame_1, inhibit_lisp_code);
-    inhibit_lisp_code = Qt;
-
-    x_default_parameter (f, parms, Qmenu_bar_lines,
-                        NILP (Vmenu_bar_mode)
-                        ? make_number (0) : make_number (1),
-                        NULL, NULL, RES_TYPE_NUMBER);
-    x_default_parameter (f, parms, Qtool_bar_lines,
-                        NILP (Vtool_bar_mode)
-                        ? make_number (0) : make_number (1),
-                        NULL, NULL, RES_TYPE_NUMBER);
-
-    unbind_to (count2, Qnil);
-  }
+  x_default_parameter (f, parms, Qmenu_bar_lines,
+                      NILP (Vmenu_bar_mode)
+                      ? make_number (0) : make_number (1),
+                      NULL, NULL, RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qtool_bar_lines,
+                      NILP (Vtool_bar_mode)
+                      ? make_number (0) : make_number (1),
+                      NULL, NULL, RES_TYPE_NUMBER);
 
   x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
                       "bufferPredicate", "BufferPredicate",
@@ -3175,9 +3191,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
   x_default_parameter (f, parms, Qwait_for_wm, Qt,
                       "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN);
   x_default_parameter (f, parms, Qfullscreen, Qnil,
-                       "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
+                      "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
   x_default_parameter (f, parms, Qtool_bar_position,
-                       f->tool_bar_position, 0, 0, RES_TYPE_SYMBOL);
+                       FRAME_TOOL_BAR_POSITION (f), 0, 0, RES_TYPE_SYMBOL);
 
   /* Compute the size of the X window.  */
   window_prompting = x_figure_window_size (f, parms, 1);
@@ -3216,17 +3232,16 @@ This function is an internal primitive--use `make-frame' instead.  */)
   x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
                       "scrollBarWidth", "ScrollBarWidth",
                       RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qscroll_bar_height, Qnil,
+                      "scrollBarHeight", "ScrollBarHeight",
+                      RES_TYPE_NUMBER);
   x_default_parameter (f, parms, Qalpha, Qnil,
                       "alpha", "Alpha", RES_TYPE_NUMBER);
 
-  /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
-     Change will not be effected unless different from the current
-     FRAME_LINES (f).  */
-  width = FRAME_TEXT_WIDTH (f);
-  height = FRAME_TEXT_HEIGHT (f);
-  FRAME_TEXT_HEIGHT (f) = 0;
-  SET_FRAME_WIDTH (f, 0);
-  change_frame_size (f, width, height, 1, 0, 0, 1);
+  /* Consider frame official, now.  */
+  f->official = true;
+
+  adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, 1);
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
   /* Create the menu bar.  */
@@ -4583,75 +4598,43 @@ FRAME nil or omitted means use the selected frame.  Value is PROP.  */)
 }
 
 
-DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
-       1, 6, 0,
-       doc: /* Value is the value of window property PROP on FRAME.
-If FRAME is nil or omitted, use the selected frame.
-
-On X Windows, the following optional arguments are also accepted:
-If TYPE is nil or omitted, get the property as a string.
-Otherwise TYPE is the name of the atom that denotes the type expected.
-If SOURCE is non-nil, get the property on that window instead of from
-FRAME.  The number 0 denotes the root window.
-If DELETE-P is non-nil, delete the property after retrieving it.
-If VECTOR-RET-P is non-nil, don't return a string but a vector of values.
-
-On MS Windows, this function accepts but ignores those optional arguments.
-
-Value is nil if FRAME hasn't a property with name PROP or if PROP has
-no value of TYPE (always string in the MS Windows case).  */)
-  (Lisp_Object prop, Lisp_Object frame, Lisp_Object type,
-   Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p)
+static Lisp_Object
+x_window_property_intern (struct frame *f,
+                          Window target_window,
+                          Atom prop_atom,
+                          Atom target_type,
+                          Lisp_Object delete_p,
+                          Lisp_Object vector_ret_p,
+                          bool *found)
 {
-  struct frame *f = decode_window_system_frame (frame);
-  Atom prop_atom;
-  int rc;
-  Lisp_Object prop_value = Qnil;
   unsigned char *tmp_data = NULL;
+  Lisp_Object prop_value = Qnil;
   Atom actual_type;
-  Atom target_type = XA_STRING;
   int actual_format;
   unsigned long actual_size, bytes_remaining;
-  Window target_window = FRAME_X_WINDOW (f);
+  int rc;
   struct gcpro gcpro1;
 
   GCPRO1 (prop_value);
-  CHECK_STRING (prop);
 
-  if (! NILP (source))
-    {
-      CONS_TO_INTEGER (source, Window, target_window);
-      if (! target_window)
-       target_window = FRAME_DISPLAY_INFO (f)->root_window;
-    }
-
-  block_input ();
-  if (STRINGP (type))
-    {
-      if (strcmp ("AnyPropertyType", SSDATA (type)) == 0)
-        target_type = AnyPropertyType;
-      else
-        target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False);
-    }
-
-  prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False);
   rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window,
                           prop_atom, 0, 0, False, target_type,
                           &actual_type, &actual_format, &actual_size,
                           &bytes_remaining, &tmp_data);
-  if (rc == Success)
-    {
-      int size = bytes_remaining;
 
+  *found = actual_format != 0;
+
+  if (rc == Success && *found)
+    {
       XFree (tmp_data);
       tmp_data = NULL;
 
       rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window,
-                              prop_atom, 0, bytes_remaining,
-                              ! NILP (delete_p), target_type,
-                              &actual_type, &actual_format,
-                              &actual_size, &bytes_remaining,
-                              &tmp_data);
+                               prop_atom, 0, bytes_remaining,
+                               ! NILP (delete_p), target_type,
+                               &actual_type, &actual_format,
+                               &actual_size, &bytes_remaining,
+                               &tmp_data);
       if (rc == Success && tmp_data)
         {
           /* The man page for XGetWindowProperty says:
@@ -4679,7 +4662,7 @@ no value of TYPE (always string in the MS Windows case).  */)
             }
 
           if (NILP (vector_ret_p))
-            prop_value = make_string ((char *) tmp_data, size);
+            prop_value = make_string ((char *) tmp_data, actual_size);
           else
             prop_value = x_property_data_to_lisp (f,
                                                   tmp_data,
@@ -4691,121 +4674,85 @@ no value of TYPE (always string in the MS Windows case).  */)
       if (tmp_data) XFree (tmp_data);
     }
 
-  unblock_input ();
   UNGCPRO;
   return prop_value;
 }
 
+DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
+       1, 6, 0,
+       doc: /* Value is the value of window property PROP on FRAME.
+If FRAME is nil or omitted, use the selected frame.
 
-\f
-/***********************************************************************
-                               Busy cursor
- ***********************************************************************/
-
-/* Timer function of hourglass_atimer.  TIMER is equal to
-   hourglass_atimer.
+On X Windows, the following optional arguments are also accepted:
+If TYPE is nil or omitted, get the property as a string.
+Otherwise TYPE is the name of the atom that denotes the type expected.
+If SOURCE is non-nil, get the property on that window instead of from
+FRAME.  The number 0 denotes the root window.
+If DELETE-P is non-nil, delete the property after retrieving it.
+If VECTOR-RET-P is non-nil, don't return a string but a vector of values.
 
-   Display an hourglass pointer on all frames by mapping the frames'
-   hourglass_window.  Set the hourglass_p flag in the frames'
-   output_data.x structure to indicate that an hourglass cursor is
-   shown on the frames.  */
+On MS Windows, this function accepts but ignores those optional arguments.
 
-void
-show_hourglass (struct atimer *timer)
+Value is nil if FRAME hasn't a property with name PROP or if PROP has
+no value of TYPE (always string in the MS Windows case).  */)
+  (Lisp_Object prop, Lisp_Object frame, Lisp_Object type,
+   Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p)
 {
-  /* The timer implementation will cancel this timer automatically
-     after this function has run.  Set hourglass_atimer to null
-     so that we know the timer doesn't have to be canceled.  */
-  hourglass_atimer = NULL;
-
-  if (!hourglass_shown_p)
-    {
-      Lisp_Object rest, frame;
-
-      block_input ();
-
-      FOR_EACH_FRAME (rest, frame)
-       {
-         struct frame *f = XFRAME (frame);
-
-         if (FRAME_LIVE_P (f) && FRAME_X_P (f) && FRAME_X_DISPLAY (f))
-           {
-             Display *dpy = FRAME_X_DISPLAY (f);
-
-#ifdef USE_X_TOOLKIT
-             if (f->output_data.x->widget)
-#else
-             if (FRAME_OUTER_WINDOW (f))
-#endif
-               {
-                 f->output_data.x->hourglass_p = 1;
+  struct frame *f = decode_window_system_frame (frame);
+  Atom prop_atom;
+  Lisp_Object prop_value = Qnil;
+  Atom target_type = XA_STRING;
+  Window target_window = FRAME_X_WINDOW (f);
+  struct gcpro gcpro1;
+  bool found;
 
-                 if (!f->output_data.x->hourglass_window)
-                   {
-                     unsigned long mask = CWCursor;
-                     XSetWindowAttributes attrs;
-#ifdef USE_GTK
-                      Window parent = FRAME_X_WINDOW (f);
-#else
-                      Window parent = FRAME_OUTER_WINDOW (f);
-#endif
-                     attrs.cursor = f->output_data.x->hourglass_cursor;
-
-                     f->output_data.x->hourglass_window
-                       = XCreateWindow (dpy, parent,
-                                        0, 0, 32000, 32000, 0, 0,
-                                        InputOnly,
-                                        CopyFromParent,
-                                        mask, &attrs);
-                   }
-
-                 XMapRaised (dpy, f->output_data.x->hourglass_window);
-                 XFlush (dpy);
-               }
-           }
-       }
+  GCPRO1 (prop_value);
+  CHECK_STRING (prop);
 
-      hourglass_shown_p = 1;
-      unblock_input ();
+  if (! NILP (source))
+    {
+      CONS_TO_INTEGER (source, Window, target_window);
+      if (! target_window)
+       target_window = FRAME_DISPLAY_INFO (f)->root_window;
     }
-}
-
 
-/* Hide the hourglass pointer on all frames, if it is currently
-   shown.  */
-
-void
-hide_hourglass (void)
-{
-  if (hourglass_shown_p)
+  block_input ();
+  if (STRINGP (type))
     {
-      Lisp_Object rest, frame;
+      if (strcmp ("AnyPropertyType", SSDATA (type)) == 0)
+        target_type = AnyPropertyType;
+      else
+        target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False);
+    }
 
-      block_input ();
-      FOR_EACH_FRAME (rest, frame)
-       {
-         struct frame *f = XFRAME (frame);
+  prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False);
+  prop_value = x_window_property_intern (f,
+                                         target_window,
+                                         prop_atom,
+                                         target_type,
+                                         delete_p,
+                                         vector_ret_p,
+                                         &found);
+  if (NILP (prop_value)
+      && ! found
+      && NILP (source)
+      && target_window != FRAME_OUTER_WINDOW (f))
+    {
+      prop_value = x_window_property_intern (f,
+                                             FRAME_OUTER_WINDOW (f),
+                                             prop_atom,
+                                             target_type,
+                                             delete_p,
+                                             vector_ret_p,
+                                             &found);
+    }
 
-         if (FRAME_X_P (f)
-             /* Watch out for newly created frames.  */
-             && f->output_data.x->hourglass_window)
-           {
-             XUnmapWindow (FRAME_X_DISPLAY (f),
-                           f->output_data.x->hourglass_window);
-             /* Sync here because XTread_socket looks at the
-                hourglass_p flag that is reset to zero below.  */
-             XSync (FRAME_X_DISPLAY (f), False);
-             f->output_data.x->hourglass_p = 0;
-           }
-       }
 
-      hourglass_shown_p = 0;
-      unblock_input ();
-    }
+  unblock_input ();
+  UNGCPRO;
+  return prop_value;
 }
 
-
-\f
 /***********************************************************************
                                Tool tips
  ***********************************************************************/
@@ -4913,10 +4860,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   FRAME_FONTSET (f) = -1;
   f->output_data.x->scroll_bar_foreground_pixel = -1;
   f->output_data.x->scroll_bar_background_pixel = -1;
-#ifdef USE_TOOLKIT_SCROLL_BARS
+#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS)
   f->output_data.x->scroll_bar_top_shadow_pixel = -1;
   f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
-#endif /* USE_TOOLKIT_SCROLL_BARS */
+#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */
   f->output_data.x->white_relief.pixel = -1;
   f->output_data.x->black_relief.pixel = -1;
 
@@ -5032,12 +4979,9 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   dpyinfo_refcount = dpyinfo->reference_count;
 #endif /* GLYPH_DEBUG */
 
-  /* Init faces before x_default_parameter is called for scroll-bar
-     parameters because that function calls x_set_scroll_bar_width,
-     which calls change_frame_size, which calls Fset_window_buffer,
-     which runs hooks, which call Fvertical_motion.  At the end, we
-     end up in init_iterator with a null face cache, which should not
-     happen.  */
+  /* Init faces before x_default_parameter is called for the
+     scroll-bar-width parameter because otherwise we end up in
+     init_iterator with a null face cache, which should not happen.  */
   init_frame_faces (f);
 
   f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
@@ -5094,7 +5038,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   width = FRAME_COLS (f);
   height = FRAME_LINES (f);
   SET_FRAME_COLS (f, 0);
-  FRAME_LINES (f) = 0;
+  SET_FRAME_LINES (f, 0);
   change_frame_size (f, width, height, 1, 0, 0, 0);
 
   /* Add `tooltip' frame parameter's default value. */
@@ -5152,7 +5096,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
      below.  And the frame needs to be on Vframe_list or making it
      visible won't work.  */
   Vframe_list = Fcons (frame, Vframe_list);
-
+  f->official = true;
 
   /* Setting attributes of faces of the tooltip frame from resources
      and similar will increment face_change_count, which leads to the
@@ -6036,7 +5980,11 @@ present and mapped to the usual X keysyms.  */)
          XkbFreeNames (kb, 0, True);
        }
 
-      XkbFreeClientMap (kb, 0, True);
+      /* As of libX11-1.6.2, XkbGetMap manual says that you should use
+        XkbFreeClientMap to free the data returned by XkbGetMap.  But
+        this function just frees the data referenced from KB and not
+        KB itself.  To free KB as well, call XkbFreeKeyboard.  */
+      XkbFreeKeyboard (kb, XkbAllMapComponentsMask, True);
 
       if (delete_keycode
          && backspace_keycode
@@ -6078,17 +6026,19 @@ frame_parm_handler x_frame_parm_handlers[] =
   x_set_mouse_color,
   x_explicitly_set_name,
   x_set_scroll_bar_width,
+  x_set_scroll_bar_height,
   x_set_title,
   x_set_unsplittable,
   x_set_vertical_scroll_bars,
+  x_set_horizontal_scroll_bars,
   x_set_visibility,
   x_set_tool_bar_lines,
   x_set_scroll_bar_foreground,
   x_set_scroll_bar_background,
   x_set_screen_gamma,
   x_set_line_spacing,
-  x_set_fringe_width,
-  x_set_fringe_width,
+  x_set_left_fringe,
+  x_set_right_fringe,
   x_set_wait_for_wm,
   x_set_fullscreen,
   x_set_font_backend,
@@ -6100,15 +6050,10 @@ frame_parm_handler x_frame_parm_handlers[] =
 void
 syms_of_xfns (void)
 {
-  /* The section below is built by the lisp expression at the top of the file,
-     just above where these variables are declared.  */
-  /*&&& init symbols here &&&*/
-  DEFSYM (Qsuppress_icon, "suppress-icon");
   DEFSYM (Qundefined_color, "undefined-color");
   DEFSYM (Qcompound_text, "compound-text");
   DEFSYM (Qcancel_timer, "cancel-timer");
   DEFSYM (Qfont_param, "font-parameter");
-  /* This is the end of symbol initialization.  */
 
   Fput (Qundefined_color, Qerror_conditions,
        listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror));
index 525f00031c5b371eb4ea7ca4ccc048431bc4e132..8996783541b9e3353cdfedeac771dd52123aba94 100644 (file)
@@ -121,7 +121,7 @@ static Lisp_Object xfont_match (struct frame *, Lisp_Object);
 static Lisp_Object xfont_list_family (struct frame *);
 static Lisp_Object xfont_open (struct frame *, Lisp_Object, int);
 static void xfont_close (struct font *);
-static int xfont_prepare_face (struct frame *, struct face *);
+static void xfont_prepare_face (struct frame *, struct face *);
 static int xfont_has_char (Lisp_Object, int);
 static unsigned xfont_encode_char (struct font *, int);
 static int xfont_text_extents (struct font *, unsigned *, int,
@@ -146,7 +146,7 @@ struct font_driver xfont_driver =
     xfont_encode_char,
     xfont_text_extents,
     xfont_draw,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
     xfont_check,
     NULL, /* get_variation_glyphs */
     NULL, /* filter_properties */
@@ -804,8 +804,6 @@ xfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
       ASET (font_object, FONT_NAME_INDEX, make_string (buf, len));
     }
   ASET (font_object, FONT_FULLNAME_INDEX, fullname);
-  ASET (font_object, FONT_FILE_INDEX, Qnil);
-  ASET (font_object, FONT_FORMAT_INDEX, Qx);
   font = XFONT_OBJECT (font_object);
   ((struct xfont_info *) font)->xfont = xfont;
   ((struct xfont_info *) font)->display = FRAME_X_DISPLAY (f);
@@ -916,15 +914,13 @@ xfont_close (struct font *font)
     }
 }
 
-static int
+static void
 xfont_prepare_face (struct frame *f, struct face *face)
 {
   block_input ();
   XSetFont (FRAME_X_DISPLAY (f), face->gc,
            ((struct xfont_info *) face->font)->xfont->fid);
   unblock_input ();
-
-  return 0;
 }
 
 static int
index 18c180f906a0a46fb376c3b37cff67d13713b60b..9726a3b991199317bfba7c148756ecfb4b3471ea 100644 (file)
@@ -270,8 +270,7 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
   double size = 0;
   XftFont *xftfont = NULL;
   int spacing;
-  char name[256];
-  int len, i;
+  int i;
   XGlyphInfo extents;
   FT_Face ft_face;
   FcMatrix *matrix;
@@ -322,16 +321,6 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
 
 
   block_input ();
-  /* Make sure that the Xrender extension is added before the Xft one.
-     Otherwise, the close-display hook set by Xft is called after the
-     one for Xrender, and the former tries to re-add the latter.  This
-     results in inconsistency of internal states and leads to X
-     protocol error when one reconnects to the same X server.
-     (Bug#1696)  */
-  {
-    int event_base, error_base;
-    XRenderQueryExtension (display, &event_base, &error_base);
-  }
 
   /* Substitute in values from X resources and XftDefaultSet.  */
   XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat);
@@ -351,20 +340,9 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
 
   /* We should not destroy PAT here because it is kept in XFTFONT and
      destroyed automatically when XFTFONT is closed.  */
-  font_object = font_make_object (VECSIZE (struct xftfont_info), entity, size);
-  ASET (font_object, FONT_TYPE_INDEX, Qxft);
-  len = font_unparse_xlfd (entity, size, name, 256);
-  if (len > 0)
-    ASET (font_object, FONT_NAME_INDEX, make_string (name, len));
-  len = font_unparse_fcname (entity, size, name, 256);
-  if (len > 0)
-    ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len));
-  else
-    ASET (font_object, FONT_FULLNAME_INDEX,
-         AREF (font_object, FONT_NAME_INDEX));
+  font_object = font_build_object (VECSIZE (struct xftfont_info),
+                                  Qxft, entity, size);
   ASET (font_object, FONT_FILE_INDEX, filename);
-  ASET (font_object, FONT_FORMAT_INDEX,
-       ftfont_font_format (xftfont->pattern, filename));
   font = XFONT_OBJECT (font_object);
   font->pixel_size = size;
   font->driver = &xftfont_driver;
@@ -507,7 +485,7 @@ xftfont_close (struct font *font)
     }
 }
 
-static int
+static void
 xftfont_prepare_face (struct frame *f, struct face *face)
 {
   struct xftface_info *xftface_info;
@@ -517,17 +495,14 @@ xftfont_prepare_face (struct frame *f, struct face *face)
   if (face != face->ascii_face)
     {
       face->extra = face->ascii_face->extra;
-      return 0;
+      return;
     }
 #endif
 
-  xftface_info = malloc (sizeof *xftface_info);
-  if (! xftface_info)
-    return -1;
+  xftface_info = xmalloc (sizeof *xftface_info);
   xftfont_get_colors (f, face, face->gc, NULL,
                      &xftface_info->xft_fg, &xftface_info->xft_bg);
   face->extra = xftface_info;
-  return 0;
 }
 
 static void
@@ -545,7 +520,7 @@ xftfont_done_face (struct frame *f, struct face *face)
   xftface_info = (struct xftface_info *) face->extra;
   if (xftface_info)
     {
-      free (xftface_info);
+      xfree (xftface_info);
       face->extra = NULL;
     }
 }
@@ -606,7 +581,7 @@ xftfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct
 static XftDraw *
 xftfont_get_xft_draw (struct frame *f)
 {
-  XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver);
+  XftDraw *xft_draw = font_get_frame_data (f, Qxft);
 
   if (! xft_draw)
     {
@@ -617,7 +592,7 @@ xftfont_get_xft_draw (struct frame *f)
                               FRAME_X_COLORMAP (f));
       unblock_input ();
       eassert (xft_draw != NULL);
-      font_put_frame_data (f, &xftfont_driver, xft_draw);
+      font_put_frame_data (f, Qxft, xft_draw);
     }
   return xft_draw;
 }
@@ -693,14 +668,14 @@ xftfont_end_for_frame (struct frame *f)
   /* Don't do anything if display is dead */
   if (FRAME_X_DISPLAY (f) == NULL) return 0;
 
-  xft_draw = font_get_frame_data (f, &xftfont_driver);
+  xft_draw = font_get_frame_data (f, Qxft);
 
   if (xft_draw)
     {
       block_input ();
       XftDrawDestroy (xft_draw);
       unblock_input ();
-      font_put_frame_data (f, &xftfont_driver, NULL);
+      font_put_frame_data (f, Qxft, NULL);
     }
   return 0;
 }
index 42fdfed0d3448c1311de48424c3ea5ae471e7095..bf889a90e978a329f7f09f18c0e13068d34fb01a 100644 (file)
@@ -53,7 +53,7 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
   int have_wfds = wfds != NULL;
   GPollFD gfds_buf[128];
   GPollFD *gfds = gfds_buf;
-  int gfds_size = sizeof gfds_buf / sizeof *gfds_buf;
+  int gfds_size = ARRAYELTS (gfds_buf);
   int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1;
   int i, nfds, tmo_in_millisec;
   bool need_to_dispatch;
index 9b1ac540c217888a2bd260eb38f66eae3188d5ae..a7d47188ef5a755c0e902004e7f9e390f38ca3e0 100644 (file)
@@ -110,11 +110,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 static Lisp_Object Qdebug_on_next_call;
 
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
-static Lisp_Object xdialog_show (struct frame *, bool, Lisp_Object, Lisp_Object,
-                                 const char **);
-#endif
-\f
 /* Flag which when set indicates a dialog or menu has been posted by
    Xt on behalf of one of the widget sets.  */
 static int popup_activated_flag;
@@ -122,7 +117,7 @@ static int popup_activated_flag;
 \f
 #ifdef USE_X_TOOLKIT
 
-static int next_menubar_widget_id;
+static LWLIB_ID next_menubar_widget_id;
 
 /* Return the frame whose ->output_data.x->id equals ID, or 0 if none.  */
 
@@ -144,53 +139,6 @@ menubar_id_to_frame (LWLIB_ID id)
 }
 
 #endif
-\f
-#ifdef HAVE_X_WINDOWS
-/* Return the mouse position in *X and *Y.  The coordinates are window
-   relative for the edit window in frame F.
-   This is for Fx_popup_menu.  The mouse_position_hook can not
-   be used for X, as it returns window relative coordinates
-   for the window where the mouse is in.  This could be the menu bar,
-   the scroll bar or the edit window.  Fx_popup_menu needs to be
-   sure it is the edit window.  */
-void
-mouse_position_for_popup (struct frame *f, int *x, int *y)
-{
-  Window root, dummy_window;
-  int dummy;
-
-  eassert (FRAME_X_P (f));
-
-  block_input ();
-
-  XQueryPointer (FRAME_X_DISPLAY (f),
-                 DefaultRootWindow (FRAME_X_DISPLAY (f)),
-
-                 /* The root window which contains the pointer.  */
-                 &root,
-
-                 /* Window pointer is on, not used  */
-                 &dummy_window,
-
-                 /* The position on that root window.  */
-                 x, y,
-
-                 /* x/y in dummy_window coordinates, not used.  */
-                 &dummy, &dummy,
-
-                 /* Modifier keys and pointer buttons, about which
-                    we don't care.  */
-                 (unsigned int *) &dummy);
-
-  unblock_input ();
-
-  /* xmenu_show expects window coordinates, not root window
-     coordinates.  Translate.  */
-  *x -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
-  *y -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
-}
-
-#endif /* HAVE_X_WINDOWS */
 
 #ifndef MSDOS
 
@@ -213,9 +161,6 @@ x_menu_set_in_use (int in_use)
 
 /* Wait for an X event to arrive or for a timer to expire.  */
 
-#ifndef USE_MOTIF
-static
-#endif
 void
 x_menu_wait_for_event (void *data)
 {
@@ -682,7 +627,7 @@ update_frame_menubar (struct frame *f)
   xg_update_frame_menubar (f);
 #else
   struct x_output *x;
-  int columns, rows;
+/**   int columns, rows; **/
 
   eassert (FRAME_X_P (f));
 
@@ -694,8 +639,8 @@ update_frame_menubar (struct frame *f)
   block_input ();
   /* Save the size of the frame because the pane widget doesn't accept
      to resize itself. So force it.  */
-  columns = FRAME_COLS (f);
-  rows = FRAME_LINES (f);
+/**   columns = FRAME_COLS (f); **/
+/**   rows = FRAME_LINES (f); **/
 
   /* Do the voodoo which means "I'm changing lots of things, don't try
      to refigure sizes until I'm done."  */
@@ -717,7 +662,8 @@ update_frame_menubar (struct frame *f)
   lw_refigure_widget (x->column_widget, True);
 
   /* Force the pane widget to resize itself with the right values.  */
-  EmacsFrameSetCharSize (x->edit_widget, columns, rows);
+/**   EmacsFrameSetCharSize (x->edit_widget, columns, rows); **/
+  adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 2, 0);
   unblock_input ();
 #endif
 }
@@ -760,7 +706,7 @@ apply_systemfont_to_menu (struct frame *f, Widget w)
 void
 set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
 {
-  xt_or_gtk_widget menubar_widget;
+  xt_or_gtk_widget menubar_widget, old_widget;
 #ifdef USE_X_TOOLKIT
   LWLIB_ID id;
 #endif
@@ -773,7 +719,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
 
   eassert (FRAME_X_P (f));
 
-  menubar_widget = f->output_data.x->menubar_widget;
+  menubar_widget = old_widget = f->output_data.x->menubar_widget;
 
   XSETFRAME (Vmenu_updating_frame, f);
 
@@ -887,12 +833,8 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
       /* Convert menu_items into widget_value trees
         to display the menu.  This cannot evaluate Lisp code.  */
 
-      wv = xmalloc_widget_value ();
-      wv->name = "menubar";
-      wv->value = 0;
-      wv->enabled = 1;
+      wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
-      wv->help = Qnil;
       first_wv = wv;
 
       for (i = 0; submenu_start[i] >= 0; i++)
@@ -957,12 +899,8 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
       /* Make a widget-value tree containing
         just the top level menu bar strings.  */
 
-      wv = xmalloc_widget_value ();
-      wv->name = "menubar";
-      wv->value = 0;
-      wv->enabled = 1;
+      wv = make_widget_value ("menubar", NULL, true, Qnil);
       wv->button_type = BUTTON_TYPE_NONE;
-      wv->help = Qnil;
       first_wv = wv;
 
       items = FRAME_MENU_BAR_ITEMS (f);
@@ -974,12 +912,8 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
          if (NILP (string))
            break;
 
-         wv = xmalloc_widget_value ();
-         wv->name = SSDATA (string);
-         wv->value = 0;
-         wv->enabled = 1;
+         wv = make_widget_value (SSDATA (string), NULL, true, Qnil);
          wv->button_type = BUTTON_TYPE_NONE;
-         wv->help = Qnil;
          /* This prevents lwlib from assuming this
             menu item is really supposed to be empty.  */
          /* The intptr_t cast avoids a warning.
@@ -1090,7 +1024,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
 #endif /* USE_LUCID */
 #endif /* 1 */
 
-    f->output_data.x->menubar_height = menubar_size;
+    FRAME_MENUBAR_HEIGHT (f) = menubar_size;
   }
 #endif /* not USE_GTK */
 
@@ -1133,7 +1067,7 @@ free_frame_menubar (struct frame *f)
 
   menubar_widget = f->output_data.x->menubar_widget;
 
-  f->output_data.x->menubar_height = 0;
+  FRAME_MENUBAR_HEIGHT (f) = 0;
 
   if (menubar_widget)
     {
@@ -1166,7 +1100,15 @@ free_frame_menubar (struct frame *f)
          if (x1 == 0 && y1 == 0)
            XtVaSetValues (f->output_data.x->widget, XtNx, x0, XtNy, y0, NULL);
 #endif
-         x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+         adjust_frame_size (f, FRAME_TEXT_WIDTH (f),
+                            FRAME_TEXT_HEIGHT (f), 2, 0);
+         /*
+           if (frame_inhibit_resize (f, 0))
+           change_frame_size (f, 0, 0, 0, 0, 0, 1);
+         else
+           x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
+           FRAME_TEXT_HEIGHT (f), 1);
+         */
        }
       unblock_input ();
     }
@@ -1175,16 +1117,17 @@ free_frame_menubar (struct frame *f)
 
 #endif /* USE_X_TOOLKIT || USE_GTK */
 \f
-/* xmenu_show actually displays a menu using the panes and items in menu_items
+/* x_menu_show actually displays a menu using the panes and items in menu_items
    and returns the value selected from it.
-   There are two versions of xmenu_show, one for Xt and one for Xlib.
+   There are two versions of x_menu_show, one for Xt and one for Xlib.
    Both assume input is blocked by the caller.  */
 
 /* F is the frame the menu is for.
    X and Y are the frame-relative specified position,
    relative to the inside upper left corner of the frame F.
-   FOR_CLICK is true if this menu was invoked for a mouse click.
-   KEYMAPS is true if this menu was specified with keymaps;
+   Bitfield MENUFLAGS bits are:
+   MENU_FOR_CLICK is set if this menu was invoked for a mouse click.
+   MENU_KEYMAPS is set if this menu was specified with keymaps;
     in that case, we return a list containing the chosen item's value
     and perhaps also the pane's prefix.
    TITLE is the specified menu title.
@@ -1339,8 +1282,8 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
 /* We need a unique id for each widget handled by the Lucid Widget
    library.
 
-   For the main windows, and popup menus, we use this counter,
-   which we increment each time after use.  This starts from 1<<16.
+   For the main windows, and popup menus, we use this counter, which we
+   increment each time after use.  This starts from WIDGET_ID_TICK_START.
 
    For menu bars, we use numbers starting at 0, counted in
    next_menubar_widget_id.  */
@@ -1352,17 +1295,13 @@ popup_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
   menu_item_selection = client_data;
 }
 
-/* ARG is the LWLIB ID of the dialog box, represented
-   as a Lisp object as (HIGHPART . LOWPART).  */
+/* ID is the LWLIB ID of the dialog box.  */
 
 static void
-pop_down_menu (Lisp_Object arg)
+pop_down_menu (int id)
 {
-  LWLIB_ID id = (XINT (XCAR (arg)) << 4 * sizeof (LWLIB_ID)
-                 | XINT (XCDR (arg)));
-
   block_input ();
-  lw_destroy_all_widgets (id);
+  lw_destroy_all_widgets ((LWLIB_ID) id);
   unblock_input ();
   popup_activated_flag = 0;
 }
@@ -1428,11 +1367,9 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
   x_activate_timeout_atimer ();
 
   {
-    int fact = 4 * sizeof (LWLIB_ID);
     ptrdiff_t specpdl_count = SPECPDL_INDEX ();
-    record_unwind_protect (pop_down_menu,
-                           Fcons (make_number (menu_id >> (fact)),
-                                  make_number (menu_id & ~(-1 << (fact)))));
+
+    record_unwind_protect_int (pop_down_menu, (int) menu_id);
 
     /* Process events that apply to the menu.  */
     popup_get_selection (0, FRAME_DISPLAY_INFO (f), menu_id, 1);
@@ -1450,8 +1387,8 @@ cleanup_widget_value_tree (void *arg)
 }
 
 Lisp_Object
-xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
-           Lisp_Object title, const char **error_name)
+x_menu_show (struct frame *f, int x, int y, int menuflags,
+            Lisp_Object title, const char **error_name)
 {
   int i;
   widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
@@ -1479,12 +1416,8 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
 
   /* Create a tree of widget_value objects
      representing the panes and their items.  */
-  wv = xmalloc_widget_value ();
-  wv->name = "menu";
-  wv->value = 0;
-  wv->enabled = 1;
+  wv = make_widget_value ("menu", NULL, true, Qnil);
   wv->button_type = BUTTON_TYPE_NONE;
-  wv->help =Qnil;
   first_wv = wv;
   first_pane = 1;
 
@@ -1540,20 +1473,16 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
          /* If the pane has a meaningful name,
             make the pane a top-level menu item
             with its items as a submenu beneath it.  */
-         if (!keymaps && strcmp (pane_string, ""))
+         if (!(menuflags & MENU_KEYMAPS) && strcmp (pane_string, ""))
            {
-             wv = xmalloc_widget_value ();
+             wv = make_widget_value (pane_string, NULL, true, Qnil);
              if (save_wv)
                save_wv->next = wv;
              else
                first_wv->contents = wv;
-             wv->name = (char *) pane_string;
-             if (keymaps && !NILP (prefix))
+             if ((menuflags & MENU_KEYMAPS) && !NILP (prefix))
                wv->name++;
-             wv->value = 0;
-             wv->enabled = 1;
              wv->button_type = BUTTON_TYPE_NONE;
-             wv->help = Qnil;
              save_wv = wv;
              prev_wv = 0;
            }
@@ -1591,20 +1520,18 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
            }
 #endif /* not HAVE_MULTILINGUAL_MENU */
 
-         wv = xmalloc_widget_value ();
+         wv = make_widget_value (SSDATA (item_name), NULL, !NILP (enable),
+                                 STRINGP (help) ? help : Qnil);
          if (prev_wv)
            prev_wv->next = wv;
          else
            save_wv->contents = wv;
-         wv->name = SSDATA (item_name);
          if (!NILP (descrip))
            wv->key = SSDATA (descrip);
-         wv->value = 0;
          /* If this item has a null value,
             make the call_data null so that it won't display a box
             when the mouse is on it.  */
          wv->call_data = !NILP (def) ? aref_addr (menu_items, i) : 0;
-         wv->enabled = !NILP (enable);
 
          if (NILP (type))
            wv->button_type = BUTTON_TYPE_NONE;
@@ -1617,11 +1544,6 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
 
          wv->selected = !NILP (selected);
 
-          if (! STRINGP (help))
-           help = Qnil;
-
-         wv->help = help;
-
          prev_wv = wv;
 
          i += MENU_ITEMS_ITEM_LENGTH;
@@ -1631,27 +1553,20 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
   /* Deal with the title, if it is non-nil.  */
   if (!NILP (title))
     {
-      widget_value *wv_title = xmalloc_widget_value ();
-      widget_value *wv_sep1 = xmalloc_widget_value ();
-      widget_value *wv_sep2 = xmalloc_widget_value ();
+      widget_value *wv_title;
+      widget_value *wv_sep1 = make_widget_value ("--", NULL, false, Qnil);
+      widget_value *wv_sep2 = make_widget_value ("--", NULL, false, Qnil);
 
-      wv_sep2->name = "--";
       wv_sep2->next = first_wv->contents;
-      wv_sep2->help = Qnil;
-
-      wv_sep1->name = "--";
       wv_sep1->next = wv_sep2;
-      wv_sep1->help = Qnil;
 
 #ifndef HAVE_MULTILINGUAL_MENU
       if (STRING_MULTIBYTE (title))
        title = ENCODE_MENU_STRING (title);
 #endif
 
-      wv_title->name = SSDATA (title);
-      wv_title->enabled = true;
+      wv_title = make_widget_value (SSDATA (title), NULL, true, Qnil);
       wv_title->button_type = BUTTON_TYPE_NONE;
-      wv_title->help = Qnil;
       wv_title->next = wv_sep1;
       first_wv->contents = wv_title;
     }
@@ -1664,7 +1579,8 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
   record_unwind_protect_ptr (cleanup_widget_value_tree, first_wv);
 
   /* Actually create and show the menu until popped down.  */
-  create_and_show_popup_menu (f, first_wv, x, y, for_click);
+  create_and_show_popup_menu (f, first_wv, x, y,
+                             menuflags & MENU_FOR_CLICK);
 
   unbind_to (specpdl_count, Qnil);
 
@@ -1705,7 +1621,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
                = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
              if (menu_item_selection == aref_addr (menu_items, i))
                {
-                 if (keymaps)
+                 if (menuflags & MENU_KEYMAPS)
                    {
                      int j;
 
@@ -1723,7 +1639,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
            }
        }
     }
-  else if (!for_click)
+  else if (!(menuflags & MENU_FOR_CLICK))
     {
       unblock_input ();
       /* Make "Cancel" equivalent to C-g.  */
@@ -1819,12 +1735,10 @@ create_and_show_dialog (struct frame *f, widget_value *first_wv)
      Also handle timers.  */
   {
     ptrdiff_t count = SPECPDL_INDEX ();
-    int fact = 4 * sizeof (LWLIB_ID);
 
     /* xdialog_show_unwind is responsible for popping the dialog box down.  */
-    record_unwind_protect (pop_down_menu,
-                           Fcons (make_number (dialog_id >> (fact)),
-                                  make_number (dialog_id & ~(-1 << (fact)))));
+
+    record_unwind_protect_int (pop_down_menu, (int) dialog_id);
 
     popup_get_selection (0, FRAME_DISPLAY_INFO (f), dialog_id, 1);
 
@@ -1839,11 +1753,8 @@ static const char * button_names [] = {
   "button6", "button7", "button8", "button9", "button10" };
 
 static Lisp_Object
-xdialog_show (struct frame *f,
-              bool keymaps,
-              Lisp_Object title,
-              Lisp_Object header,
-              const char **error_name)
+x_dialog_show (struct frame *f, Lisp_Object title,
+              Lisp_Object header, const char **error_name)
 {
   int i, nb_buttons=0;
   char dialog_name[6];
@@ -1870,19 +1781,12 @@ xdialog_show (struct frame *f,
   /* Create a tree of widget_value objects
      representing the text label and buttons.  */
   {
-    Lisp_Object pane_name, prefix;
+    Lisp_Object pane_name;
     const char *pane_string;
     pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME);
-    prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX);
     pane_string = (NILP (pane_name)
                   ? "" : SSDATA (pane_name));
-    prev_wv = xmalloc_widget_value ();
-    prev_wv->value = (char *) pane_string;
-    if (keymaps && !NILP (prefix))
-      prev_wv->name++;
-    prev_wv->enabled = 1;
-    prev_wv->name = "message";
-    prev_wv->help = Qnil;
+    prev_wv = make_widget_value ("message", (char *) pane_string, true, Qnil);
     first_wv = prev_wv;
 
     /* Loop over all panes and items, filling in the tree.  */
@@ -1918,15 +1822,13 @@ xdialog_show (struct frame *f,
            return Qnil;
          }
 
-       wv = xmalloc_widget_value ();
+       wv = make_widget_value (button_names[nb_buttons],
+                               SSDATA (item_name),
+                               !NILP (enable), Qnil);
        prev_wv->next = wv;
-       wv->name = (char *) button_names[nb_buttons];
        if (!NILP (descrip))
          wv->key = SSDATA (descrip);
-       wv->value = SSDATA (item_name);
        wv->call_data = aref_addr (menu_items, i);
-       wv->enabled = !NILP (enable);
-       wv->help = Qnil;
        prev_wv = wv;
 
        if (! boundary_seen)
@@ -1941,9 +1843,7 @@ xdialog_show (struct frame *f,
     if (! boundary_seen)
       left_count = nb_buttons - nb_buttons / 2;
 
-    wv = xmalloc_widget_value ();
-    wv->name = dialog_name;
-    wv->help = Qnil;
+    wv = make_widget_value (dialog_name, NULL, false, Qnil);
 
     /*  Frame title: 'Q' = Question, 'I' = Information.
         Can also have 'E' = Error if, one day, we want
@@ -1982,20 +1882,13 @@ xdialog_show (struct frame *f,
      the proper value.  */
   if (menu_item_selection != 0)
     {
-      Lisp_Object prefix;
-
-      prefix = Qnil;
       i = 0;
       while (i < menu_items_used)
        {
          Lisp_Object entry;
 
          if (EQ (AREF (menu_items, i), Qt))
-           {
-             prefix
-               = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
-             i += MENU_ITEMS_PANE_LENGTH;
-           }
+           i += MENU_ITEMS_PANE_LENGTH;
          else if (EQ (AREF (menu_items, i), Qquote))
            {
              /* This is the boundary between left-side elts and
@@ -2007,15 +1900,7 @@ xdialog_show (struct frame *f,
              entry
                = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
              if (menu_item_selection == aref_addr (menu_items, i))
-               {
-                 if (keymaps != 0)
-                   {
-                     entry = list1 (entry);
-                     if (!NILP (prefix))
-                       entry = Fcons (prefix, entry);
-                   }
-                 return entry;
-               }
+               return entry;
              i += MENU_ITEMS_ITEM_LENGTH;
            }
        }
@@ -2052,7 +1937,7 @@ xw_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
 
   /* Display them in a dialog box.  */
   block_input ();
-  selection = xdialog_show (f, 0, title, header, &error_name);
+  selection = x_dialog_show (f, title, header, &error_name);
   unblock_input ();
 
   unbind_to (specpdl_count, Qnil);
@@ -2090,7 +1975,7 @@ menu_help_callback (char const *help_string, int pane, int item)
   if (EQ (first_item[0], Qt))
     pane_name = first_item[MENU_ITEMS_PANE_NAME];
   else if (EQ (first_item[0], Qquote))
-    /* This shouldn't happen, see xmenu_show.  */
+    /* This shouldn't happen, see x_menu_show.  */
     pane_name = empty_unibyte_string;
   else
     pane_name = first_item[MENU_ITEMS_ITEM_NAME];
@@ -2132,8 +2017,8 @@ pop_down_menu (Lisp_Object arg)
 
 
 Lisp_Object
-xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
-           Lisp_Object title, const char **error_name)
+x_menu_show (struct frame *f, int x, int y, int menuflags,
+            Lisp_Object title, const char **error_name)
 {
   Window root;
   XMenu *menu;
@@ -2208,7 +2093,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
          prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
          pane_string = (NILP (pane_name)
                         ? "" : SSDATA (pane_name));
-         if (keymaps && !NILP (prefix))
+         if ((menuflags & MENU_KEYMAPS) && !NILP (prefix))
            pane_string++;
 
          lpane = XMenuAddPane (FRAME_X_DISPLAY (f), menu, pane_string, TRUE);
@@ -2331,7 +2216,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
   if (ulx < 0) x -= ulx;
   if (uly < 0) y -= uly;
 
-  if (! for_click)
+  if (!(menuflags & MENU_FOR_CLICK))
     {
       /* If position was not given by a mouse click, adjust so upper left
          corner of the menu as a whole ends up at given coordinates.  This
@@ -2385,7 +2270,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
                    {
                      entry
                        = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
-                     if (keymaps)
+                     if (menuflags & MENU_KEYMAPS)
                        {
                          entry = list1 (entry);
                          if (!NILP (pane_prefix))
@@ -2407,7 +2292,7 @@ xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
     case XM_NO_SELECT:
       /* Make "Cancel" equivalent to C-g unless FOR_CLICK (which means
         the menu was invoked with a mouse event as POSITION).  */
-      if (! for_click)
+      if (!(menuflags & MENU_FOR_CLICK))
        {
          unblock_input ();
          Fsignal (Qquit, Qnil);
@@ -2446,13 +2331,13 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
 void
 syms_of_xmenu (void)
 {
-  DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
-
 #ifdef USE_X_TOOLKIT
-  widget_id_tick = (1<<16);
+  enum { WIDGET_ID_TICK_START = 1 << 16 };
+  widget_id_tick = WIDGET_ID_TICK_START;
   next_menubar_widget_id = 1;
 #endif
 
+  DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
   defsubr (&Smenu_or_popup_active_p);
 
 #if defined (USE_GTK) || defined (USE_X_TOOLKIT)
index 107a8fca4e1c80ae3c5a1e0ea5158ccbbc67f6db..32ad3c7f01e65caaca4376dcc358565b4d10d684 100644 (file)
@@ -452,6 +452,10 @@ x_load_resources (Display *display, const char *xrm_string,
   XrmPutLineResource (&rdb, line);
   sprintf (line, "%s*verticalScrollBar.troughColor: grey75", myclass);
   XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*horizontalScrollBar.background: grey75", myclass);
+  XrmPutLineResource (&rdb, line);
+  sprintf (line, "%s*horizontalScrollBar.troughColor: grey75", myclass);
+  XrmPutLineResource (&rdb, line);
   sprintf (line, "%s.dialog*.background: grey75", myclass);
   XrmPutLineResource (&rdb, line);
   sprintf (line, "%s*fsb.Text.background: white", myclass);
@@ -499,6 +503,8 @@ x_load_resources (Display *display, const char *xrm_string,
   XrmPutLineResource (&rdb, line);
   sprintf (line, "Emacs*verticalScrollBar.background: grey75");
   XrmPutLineResource (&rdb, line);
+  sprintf (line, "Emacs*horizontalScrollBar.background: grey75");
+  XrmPutLineResource (&rdb, line);
 
 #endif /* not USE_MOTIF */
 
index 28f2d770a7790757e80b0ab5af3350872b29204d..23310b0f86713b5e81bb556fd21546bf0d7136ac 100644 (file)
@@ -53,15 +53,14 @@ static struct prop_location *expect_property_change (Display *, Window,
                                                      Atom, int);
 static void unexpect_property_change (struct prop_location *);
 static void wait_for_property_change (struct prop_location *);
-static Lisp_Object x_get_window_property_as_lisp_data (Display *,
+static Lisp_Object x_get_window_property_as_lisp_data (struct x_display_info *,
                                                        Window, Atom,
                                                        Lisp_Object, Atom);
-static Lisp_Object selection_data_to_lisp_data (Display *,
+static Lisp_Object selection_data_to_lisp_data (struct x_display_info *,
                                                const unsigned char *,
                                                ptrdiff_t, Atom, int);
-static void lisp_data_to_selection_data (Display *, Lisp_Object,
-                                         unsigned char **, Atom *,
-                                        ptrdiff_t *, int *, int *);
+static void lisp_data_to_selection_data (struct x_display_info *, Lisp_Object,
+                                        struct selection_data *);
 
 /* Printing traces to stderr.  */
 
@@ -245,9 +244,8 @@ symbol_to_x_atom (struct x_display_info *dpyinfo, Lisp_Object sym)
    and calls to intern whenever possible.  */
 
 static Lisp_Object
-x_atom_to_symbol (Display *dpy, Atom atom)
+x_atom_to_symbol (struct x_display_info *dpyinfo, Atom atom)
 {
-  struct x_display_info *dpyinfo;
   char *str;
   Lisp_Object val;
 
@@ -268,7 +266,6 @@ x_atom_to_symbol (Display *dpy, Atom atom)
       return QATOM;
     }
 
-  dpyinfo = x_display_info_for_display (dpy);
   if (dpyinfo == NULL)
     return Qnil;
   if (atom == dpyinfo->Xatom_CLIPBOARD)
@@ -295,7 +292,7 @@ x_atom_to_symbol (Display *dpy, Atom atom)
     return QNULL;
 
   block_input ();
-  str = XGetAtomName (dpy, atom);
+  str = XGetAtomName (dpyinfo->display, atom);
   unblock_input ();
   TRACE1 ("XGetAtomName --> %s", str);
   if (! str) return Qnil;
@@ -458,7 +455,7 @@ x_decline_selection_request (struct input_event *event)
      died in the meantime.  Handle that case.  */
   block_input ();
   x_catch_errors (reply->display);
-  XSendEvent (reply->display, reply->requestor, False, 0L, &reply_base);
+  XSendEvent (reply->display, reply->requestor, False, 0, &reply_base);
   XFlush (reply->display);
   x_uncatch_errors ();
   unblock_input ();
@@ -632,7 +629,7 @@ x_reply_selection_request (struct input_event *event,
     }
 
   /* Now issue the SelectionNotify event.  */
-  XSendEvent (display, window, False, 0L, &reply_base);
+  XSendEvent (display, window, False, 0, &reply_base);
   XFlush (display);
 
 #ifdef TRACE_SELECTION
@@ -710,7 +707,7 @@ x_reply_selection_request (struct input_event *event,
           requestor that we're done.  */
        block_input ();
        if (! waiting_for_other_props_on_window (display, window))
-         XSelectInput (display, window, 0L);
+         XSelectInput (display, window, 0);
 
        TRACE1 ("Set %s to a 0-length chunk to indicate EOF",
                XGetAtomName (display, cs->property));
@@ -750,12 +747,11 @@ x_handle_selection_request (struct input_event *event)
   struct gcpro gcpro1, gcpro2;
   Time local_selection_time;
 
-  Display *display = SELECTION_EVENT_DISPLAY (event);
-  struct x_display_info *dpyinfo = x_display_info_for_display (display);
+  struct x_display_info *dpyinfo = SELECTION_EVENT_DPYINFO (event);
   Atom selection = SELECTION_EVENT_SELECTION (event);
-  Lisp_Object selection_symbol = x_atom_to_symbol (display, selection);
+  Lisp_Object selection_symbol = x_atom_to_symbol (dpyinfo, selection);
   Atom target = SELECTION_EVENT_TARGET (event);
-  Lisp_Object target_symbol = x_atom_to_symbol (display, target);
+  Lisp_Object target_symbol = x_atom_to_symbol (dpyinfo, target);
   Atom property = SELECTION_EVENT_PROPERTY (event);
   Lisp_Object local_selection_data;
   int success = 0;
@@ -800,7 +796,7 @@ x_handle_selection_request (struct input_event *event)
 
       if (property == None) goto DONE;
       multprop
-       = x_get_window_property_as_lisp_data (display, requestor, property,
+       = x_get_window_property_as_lisp_data (dpyinfo, requestor, property,
                                              QMULTIPLE, selection);
 
       if (!VECTORP (multprop) || ASIZE (multprop) % 2)
@@ -904,11 +900,7 @@ x_convert_selection (struct input_event *event, Lisp_Object selection_symbol,
   cs->wait_object = NULL;
   cs->next = converted_selections;
   converted_selections = cs;
-  lisp_data_to_selection_data (SELECTION_EVENT_DISPLAY (event),
-                              lisp_selection,
-                              &(cs->data), &(cs->type),
-                              &(cs->size), &(cs->format),
-                              &(cs->nofree));
+  lisp_data_to_selection_data (dpyinfo, lisp_selection, cs);
   UNGCPRO;
   return 1;
 }
@@ -920,20 +912,19 @@ x_convert_selection (struct input_event *event, Lisp_Object selection_symbol,
 static void
 x_handle_selection_clear (struct input_event *event)
 {
-  Display *display = SELECTION_EVENT_DISPLAY (event);
   Atom selection = SELECTION_EVENT_SELECTION (event);
   Time changed_owner_time = SELECTION_EVENT_TIME (event);
 
   Lisp_Object selection_symbol, local_selection_data;
   Time local_selection_time;
-  struct x_display_info *dpyinfo = x_display_info_for_display (display);
+  struct x_display_info *dpyinfo = SELECTION_EVENT_DPYINFO (event);
   Lisp_Object Vselection_alist;
 
   TRACE0 ("x_handle_selection_clear");
 
   if (!dpyinfo) return;
 
-  selection_symbol = x_atom_to_symbol (display, selection);
+  selection_symbol = x_atom_to_symbol (dpyinfo, selection);
   local_selection_data = LOCAL_SELECTION (selection_symbol, dpyinfo);
 
   /* Well, we already believe that we don't own it, so that's just fine.  */
@@ -1070,20 +1061,18 @@ expect_property_change (Display *display, Window window,
 static void
 unexpect_property_change (struct prop_location *location)
 {
-  struct prop_location *prev = 0, *rest = property_change_wait_list;
-  while (rest)
+  struct prop_location *prop, **pprev = &property_change_wait_list;
+
+  for (prop = property_change_wait_list; prop; prop = *pprev)
     {
-      if (rest == location)
+      if (prop == location)
        {
-         if (prev)
-           prev->next = rest->next;
-         else
-           property_change_wait_list = rest->next;
-         xfree (rest);
-         return;
+         *pprev = prop->next;
+         xfree (prop);
+         break;
        }
-      prev = rest;
-      rest = rest->next;
+      else
+       pprev = &prop->next;
     }
 }
 
@@ -1245,7 +1234,7 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type,
 
   /* Otherwise, the selection is waiting for us on the requested property.  */
   return
-    x_get_window_property_as_lisp_data (display, requestor_window,
+    x_get_window_property_as_lisp_data (dpyinfo, requestor_window,
                                        target_property, target_type,
                                        selection_atom);
 }
@@ -1283,7 +1272,7 @@ x_get_window_property (Display *display, Window window, Atom property,
 
   /* First probe the thing to find out how big it is.  */
   result = XGetWindowProperty (display, window, property,
-                              0L, 0L, False, AnyPropertyType,
+                              0, 0, False, AnyPropertyType,
                               actual_type_ret, actual_format_ret,
                               actual_size_ret,
                               &bytes_remaining, &tmp_data);
@@ -1299,9 +1288,7 @@ x_get_window_property (Display *display, Window window, Atom property,
   if (total_size_max < bytes_remaining)
     goto size_overflow;
   total_size = bytes_remaining;
-  data = malloc (total_size + 1);
-  if (! data)
-    goto memory_exhausted;
+  data = xmalloc (total_size + 1);
 
   /* Now read, until we've gotten it all.  */
   while (bytes_remaining)
@@ -1352,9 +1339,7 @@ x_get_window_property (Display *display, Window window, Atom property,
          if (remaining_lim < 0 || remaining_lim < bytes_remaining)
            goto size_overflow;
          total_size = offset + bytes_gotten + bytes_remaining;
-         data1 = realloc (data, total_size + 1);
-         if (! data1)
-           goto memory_exhausted;
+         data1 = xrealloc (data, total_size + 1);
          data = data1;
        }
 
@@ -1386,20 +1371,17 @@ x_get_window_property (Display *display, Window window, Atom property,
   return;
 
  size_overflow:
-  free (data);
+  if (data)
+    xfree (data);
   unblock_input ();
   memory_full (SIZE_MAX);
-
- memory_exhausted:
-  free (data);
-  unblock_input ();
-  memory_full (total_size + 1);
 }
 \f
 /* Use xfree, not XFree, to free the data obtained with this function.  */
 
 static void
-receive_incremental_selection (Display *display, Window window, Atom property,
+receive_incremental_selection (struct x_display_info *dpyinfo,
+                              Window window, Atom property,
                               Lisp_Object target_type,
                               unsigned int min_size_bytes,
                               unsigned char **data_ret,
@@ -1409,6 +1391,8 @@ receive_incremental_selection (Display *display, Window window, Atom property,
 {
   ptrdiff_t offset = 0;
   struct prop_location *wait_object;
+  Display *display = dpyinfo->display;
+
   if (min (PTRDIFF_MAX, SIZE_MAX) < min_size_bytes)
     memory_full (SIZE_MAX);
   *data_ret = xmalloc (min_size_bytes);
@@ -1427,10 +1411,10 @@ receive_incremental_selection (Display *display, Window window, Atom property,
   block_input ();
   XSelectInput (display, window, STANDARD_EVENT_SET | PropertyChangeMask);
   TRACE1 ("  Delete property %s",
-         SDATA (SYMBOL_NAME (x_atom_to_symbol (display, property))));
+         SDATA (SYMBOL_NAME (x_atom_to_symbol (dpyinfo, property))));
   XDeleteProperty (display, window, property);
   TRACE1 ("  Expect new value of property %s",
-         SDATA (SYMBOL_NAME (x_atom_to_symbol (display, property))));
+         SDATA (SYMBOL_NAME (x_atom_to_symbol (dpyinfo, property))));
   wait_object = expect_property_change (display, window, property,
                                        PropertyNewValue);
   XFlush (display);
@@ -1495,8 +1479,8 @@ receive_incremental_selection (Display *display, Window window, Atom property,
    if this fails.  */
 
 static Lisp_Object
-x_get_window_property_as_lisp_data (Display *display, Window window,
-                                   Atom property,
+x_get_window_property_as_lisp_data (struct x_display_info *dpyinfo,
+                                   Window window, Atom property,
                                    Lisp_Object target_type,
                                    Atom selection_atom)
 {
@@ -1506,7 +1490,7 @@ x_get_window_property_as_lisp_data (Display *display, Window window,
   unsigned char *data = 0;
   ptrdiff_t bytes = 0;
   Lisp_Object val;
-  struct x_display_info *dpyinfo = x_display_info_for_display (display);
+  Display *display = dpyinfo->display;
 
   TRACE0 ("Reading selection data");
 
@@ -1523,11 +1507,11 @@ x_get_window_property_as_lisp_data (Display *display, Window window,
        signal_error ("Selection owner couldn't convert",
                      actual_type
                      ? list2 (target_type,
-                              x_atom_to_symbol (display, actual_type))
+                              x_atom_to_symbol (dpyinfo, actual_type))
                      : target_type);
       else
        signal_error ("No selection",
-                     x_atom_to_symbol (display, selection_atom));
+                     x_atom_to_symbol (dpyinfo, selection_atom));
     }
 
   if (actual_type == dpyinfo->Xatom_INCR)
@@ -1540,7 +1524,7 @@ x_get_window_property_as_lisp_data (Display *display, Window window,
         calls xmalloc itself.  */
       xfree (data);
       unblock_input ();
-      receive_incremental_selection (display, window, property, target_type,
+      receive_incremental_selection (dpyinfo, window, property, target_type,
                                     min_size_bytes, &data, &bytes,
                                     &actual_type, &actual_format,
                                     &actual_size);
@@ -1554,7 +1538,7 @@ x_get_window_property_as_lisp_data (Display *display, Window window,
 
   /* It's been read.  Now convert it to a lisp object in some semi-rational
      manner.  */
-  val = selection_data_to_lisp_data (display, data, bytes,
+  val = selection_data_to_lisp_data (dpyinfo, data, bytes,
                                     actual_type, actual_format);
 
   /* Use xfree, not XFree, because x_get_window_property
@@ -1595,11 +1579,10 @@ x_get_window_property_as_lisp_data (Display *display, Window window,
 
 
 static Lisp_Object
-selection_data_to_lisp_data (Display *display, const unsigned char *data,
+selection_data_to_lisp_data (struct x_display_info *dpyinfo,
+                            const unsigned char *data,
                             ptrdiff_t size, Atom type, int format)
 {
-  struct x_display_info *dpyinfo = x_display_info_for_display (display);
-
   if (type == dpyinfo->Xatom_NULL)
     return QNULL;
 
@@ -1637,13 +1620,13 @@ selection_data_to_lisp_data (Display *display, const unsigned char *data,
       int *idata = (int *) data;
 
       if (size == sizeof (int))
-       return x_atom_to_symbol (display, (Atom) idata[0]);
+       return x_atom_to_symbol (dpyinfo, (Atom) idata[0]);
       else
        {
          Lisp_Object v = make_uninit_vector (size / sizeof (int));
 
          for (i = 0; i < size / sizeof (int); i++)
-           ASET (v, i, x_atom_to_symbol (display, (Atom) idata[i]));
+           ASET (v, i, x_atom_to_symbol (dpyinfo, (Atom) idata[i]));
          return v;
        }
     }
@@ -1705,15 +1688,13 @@ cons_to_x_long (Lisp_Object obj)
 /* Use xfree, not XFree, to free the data obtained with this function.  */
 
 static void
-lisp_data_to_selection_data (Display *display, Lisp_Object obj,
-                            unsigned char **data_ret, Atom *type_ret,
-                            ptrdiff_t *size_ret,
-                            int *format_ret, int *nofree_ret)
+lisp_data_to_selection_data (struct x_display_info *dpyinfo,
+                            Lisp_Object obj, struct selection_data *cs)
 {
   Lisp_Object type = Qnil;
-  struct x_display_info *dpyinfo = x_display_info_for_display (display);
 
-  *nofree_ret = 0;
+  eassert (cs != NULL);
+  cs->nofree = 0;
 
   if (CONSP (obj) && SYMBOLP (XCAR (obj)))
     {
@@ -1725,9 +1706,9 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
 
   if (EQ (obj, QNULL) || (EQ (type, QNULL)))
     {                          /* This is not the same as declining */
-      *format_ret = 32;
-      *size_ret = 0;
-      *data_ret = 0;
+      cs->format = 32;
+      cs->size = 0;
+      cs->data = NULL;
       type = QNULL;
     }
   else if (STRINGP (obj))
@@ -1737,19 +1718,19 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
        signal_error ("Non-ASCII string must be encoded in advance", obj);
       if (NILP (type))
        type = QSTRING;
-      *format_ret = 8;
-      *size_ret = SBYTES (obj);
-      *data_ret = SDATA (obj);
-      *nofree_ret = 1;
+      cs->format = 8;
+      cs->size = SBYTES (obj);
+      cs->data = SDATA (obj);
+      cs->nofree = 1;
     }
   else if (SYMBOLP (obj))
     {
       void *data = xmalloc (sizeof (Atom) + 1);
       Atom *x_atom_ptr = data;
-      *data_ret = data;
-      *format_ret = 32;
-      *size_ret = 1;
-      (*data_ret) [sizeof (Atom)] = 0;
+      cs->data = data;
+      cs->format = 32;
+      cs->size = 1;
+      cs->data[sizeof (Atom)] = 0;
       *x_atom_ptr = symbol_to_x_atom (dpyinfo, obj);
       if (NILP (type)) type = QATOM;
     }
@@ -1757,10 +1738,10 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
     {
       void *data = xmalloc (sizeof (short) + 1);
       short *short_ptr = data;
-      *data_ret = data;
-      *format_ret = 16;
-      *size_ret = 1;
-      (*data_ret) [sizeof (short)] = 0;
+      cs->data = data;
+      cs->format = 16;
+      cs->size = 1;
+      cs->data[sizeof (short)] = 0;
       *short_ptr = XINT (obj);
       if (NILP (type)) type = QINTEGER;
     }
@@ -1772,10 +1753,10 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
     {
       void *data = xmalloc (sizeof (unsigned long) + 1);
       unsigned long *x_long_ptr = data;
-      *data_ret = data;
-      *format_ret = 32;
-      *size_ret = 1;
-      (*data_ret) [sizeof (unsigned long)] = 0;
+      cs->data = data;
+      cs->format = 32;
+      cs->size = 1;
+      cs->data[sizeof (unsigned long)] = 0;
       *x_long_ptr = cons_to_x_long (obj);
       if (NILP (type)) type = QINTEGER;
     }
@@ -1798,10 +1779,10 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
            if (!SYMBOLP (AREF (obj, i)))
              signal_error ("All elements of selection vector must have same type", obj);
 
-         *data_ret = data = xnmalloc (size, sizeof *x_atoms);
+         cs->data = data = xnmalloc (size, sizeof *x_atoms);
          x_atoms = data;
-         *format_ret = 32;
-         *size_ret = size;
+         cs->format = 32;
+         cs->size = size;
          for (i = 0; i < size; i++)
            x_atoms[i] = symbol_to_x_atom (dpyinfo, AREF (obj, i));
        }
@@ -1827,11 +1808,11 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
                  break;
                }
            }
-         *data_ret = data = xnmalloc (size, data_size);
+         cs->data = data = xnmalloc (size, data_size);
          x_atoms = data;
          shorts = data;
-         *format_ret = format;
-         *size_ret = size;
+         cs->format = format;
+         cs->size = size;
          for (i = 0; i < size; i++)
            {
              if (format == 32)
@@ -1844,7 +1825,7 @@ lisp_data_to_selection_data (Display *display, Lisp_Object obj,
   else
     signal_error (/* Qselection_error */ "Unrecognized selection data", obj);
 
-  *type_ret = symbol_to_x_atom (dpyinfo, type);
+  cs->type = symbol_to_x_atom (dpyinfo, type);
 }
 
 static Lisp_Object
@@ -2077,7 +2058,7 @@ On MS-DOS, all this does is return non-nil if we own the selection.  */)
      the selection owner to None.  The NCD server does, the MIT Sun4 server
      doesn't.  So we synthesize one; this means we might get two, but
      that's ok, because the second one won't have any effect.  */
-  SELECTION_EVENT_DISPLAY (&event.sie) = dpyinfo->display;
+  SELECTION_EVENT_DPYINFO (&event.sie) = dpyinfo;
   SELECTION_EVENT_SELECTION (&event.sie) = selection_atom;
   SELECTION_EVENT_TIME (&event.sie) = timestamp;
   x_handle_selection_clear (&event.ie);
@@ -2322,7 +2303,7 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)
       else if (STRINGP (o))
         {
           block_input ();
-          val = (long) XInternAtom (dpy, SSDATA (o), False);
+          val = XInternAtom (dpy, SSDATA (o), False);
           unblock_input ();
         }
       else
@@ -2369,45 +2350,8 @@ x_property_data_to_lisp (struct frame *f, const unsigned char *data,
   ptrdiff_t format_bytes = format >> 3;
   if (PTRDIFF_MAX / format_bytes < size)
     memory_full (SIZE_MAX);
-  return selection_data_to_lisp_data (FRAME_X_DISPLAY (f),
-                                     data, size * format_bytes, type, format);
-}
-
-/* Get the mouse position in frame relative coordinates.  */
-
-static void
-mouse_position_for_drop (struct frame *f, int *x, int *y)
-{
-  Window root, dummy_window;
-  int dummy;
-
-  block_input ();
-
-  XQueryPointer (FRAME_X_DISPLAY (f),
-                 DefaultRootWindow (FRAME_X_DISPLAY (f)),
-
-                 /* The root window which contains the pointer.  */
-                 &root,
-
-                 /* Window pointer is on, not used  */
-                 &dummy_window,
-
-                 /* The position on that root window.  */
-                 x, y,
-
-                 /* x/y in dummy_window coordinates, not used.  */
-                 &dummy, &dummy,
-
-                 /* Modifier keys and pointer buttons, about which
-                    we don't care.  */
-                 (unsigned int *) &dummy);
-
-
-  /* Absolute to relative.  */
-  *x -= f->left_pos + FRAME_OUTER_TO_INNER_DIFF_X (f);
-  *y -= f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f);
-
-  unblock_input ();
+  return selection_data_to_lisp_data (FRAME_DISPLAY_INFO (f), data,
+                                     size * format_bytes, type, format);
 }
 
 DEFUN ("x-get-atom-name", Fx_get_atom_name,
@@ -2519,7 +2463,7 @@ x_handle_dnd_message (struct frame *f, const XClientMessageEvent *event,
     }
 
   vec = Fmake_vector (make_number (4), Qnil);
-  ASET (vec, 0, SYMBOL_NAME (x_atom_to_symbol (FRAME_X_DISPLAY (f),
+  ASET (vec, 0, SYMBOL_NAME (x_atom_to_symbol (FRAME_DISPLAY_INFO (f),
                                               event->message_type)));
   ASET (vec, 1, frame);
   ASET (vec, 2, make_number (event->format));
@@ -2529,7 +2473,7 @@ x_handle_dnd_message (struct frame *f, const XClientMessageEvent *event,
                                         event->format,
                                         size));
 
-  mouse_position_for_drop (f, &x, &y);
+  x_relative_mouse_position (f, &x, &y);
   bufp->kind = DRAG_N_DROP_EVENT;
   bufp->frame_or_window = frame;
   bufp->timestamp = CurrentTime;
index 9a31f518f3086eb4fd1ac08561bad50870ee39ed..81b012690f993a80a17ccca0309b9f5c207c764c 100644 (file)
@@ -395,7 +395,7 @@ x_session_initialize (struct x_display_info *dpyinfo)
 {
 #define SM_ERRORSTRING_LEN 512
   char errorstring[SM_ERRORSTRING_LEN];
-  charprevious_id = NULL;
+  char *previous_id = NULL;
   SmcCallbacks callbacks;
   ptrdiff_t name_len = 0;
 
index ed98fb10b898c1107ced99bbf61c3ec34ff49fcc..e35d63c785f5c375ecb6011a597ece1a1e48665f 100644 (file)
@@ -32,6 +32,16 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "xterm.h"
 #include <X11/cursorfont.h>
 
+/* If we have Xfixes extension, use it for pointer blanking.  */
+#ifdef HAVE_XFIXES
+#include <X11/extensions/Xfixes.h>
+#endif
+
+/* Using Xft implies that XRender is available.  */
+#ifdef HAVE_XFT
+#include <X11/extensions/Xrender.h>
+#endif
+
 /* Load sys/types.h if not already loaded.
    In some systems loading it twice is suicidal.  */
 #ifndef makedev
@@ -70,6 +80,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "xsettings.h"
 #include "xgselect.h"
 #include "sysselect.h"
+#include "menu.h"
 
 #ifdef USE_X_TOOLKIT
 #include <X11/Shell.h>
@@ -215,7 +226,6 @@ static void x_lower_frame (struct frame *);
 static const XColor *x_color_cells (Display *, int *);
 static int x_io_error_quitter (Display *);
 static struct terminal *x_create_terminal (struct x_display_info *);
-void x_delete_terminal (struct terminal *);
 static void x_update_end (struct frame *);
 static void XTframe_up_to_date (struct frame *);
 static void x_clear_frame (struct frame *);
@@ -236,11 +246,15 @@ static void x_clip_to_row (struct window *, struct glyph_row *,
 static void x_flush (struct frame *f);
 static void x_update_begin (struct frame *);
 static void x_update_window_begin (struct window *);
-static struct scroll_bar *x_window_to_scroll_bar (Display *, Window);
+static struct scroll_bar *x_window_to_scroll_bar (Display *, Window, int);
 static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *,
                                         enum scroll_bar_part *,
                                         Lisp_Object *, Lisp_Object *,
                                         Time *);
+static void x_horizontal_scroll_bar_report_motion (struct frame **, Lisp_Object *,
+                                                  enum scroll_bar_part *,
+                                                  Lisp_Object *, Lisp_Object *,
+                                                  Time *);
 static int x_handle_net_wm_state (struct frame *, const XPropertyEvent *);
 static void x_check_fullscreen (struct frame *);
 static void x_check_expected_move (struct frame *, int, int);
@@ -258,6 +272,7 @@ static void x_wm_set_window_state (struct frame *, int);
 static void x_wm_set_icon_pixmap (struct frame *, ptrdiff_t);
 static void x_initialize (void);
 
+static int get_current_wm_state (struct frame *, Window, int *, int *);
 
 /* Flush display of frame F.  */
 
@@ -308,7 +323,7 @@ int event_record_index;
 void
 record_event (char *locus, int type)
 {
-  if (event_record_index == sizeof (event_record) / sizeof (struct record))
+  if (event_record_index == ARRAYELTS (event_record))
     event_record_index = 0;
 
   event_record[event_record_index].locus = locus;
@@ -348,8 +363,10 @@ x_find_topmost_parent (struct frame *f)
       unsigned int nchildren;
 
       win = wi;
-      XQueryTree (dpy, win, &root, &wi, &children, &nchildren);
-      XFree (children);
+      if (XQueryTree (dpy, win, &root, &wi, &children, &nchildren))
+       XFree (children);
+      else
+       break;
     }
 
   return win;
@@ -398,7 +415,7 @@ x_set_frame_alpha (struct frame *f)
   if (parent != None)
     XChangeProperty (dpy, parent, dpyinfo->Xatom_net_wm_window_opacity,
                      XA_CARDINAL, 32, PropModeReplace,
-                     (unsigned char *) &opac, 1L);
+                     (unsigned char *) &opac, 1);
 
   /* return unless necessary */
   {
@@ -408,7 +425,7 @@ x_set_frame_alpha (struct frame *f)
     unsigned long n, left;
 
     rc = XGetWindowProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity,
-                            0L, 1L, False, XA_CARDINAL,
+                            0, 1, False, XA_CARDINAL,
                             &actual, &format, &n, &left,
                             &data);
 
@@ -426,23 +443,10 @@ x_set_frame_alpha (struct frame *f)
 
   XChangeProperty (dpy, win, dpyinfo->Xatom_net_wm_window_opacity,
                   XA_CARDINAL, 32, PropModeReplace,
-                  (unsigned char *) &opac, 1L);
+                  (unsigned char *) &opac, 1);
   x_uncatch_errors ();
 }
 
-int
-x_display_pixel_height (struct x_display_info *dpyinfo)
-{
-  return HeightOfScreen (dpyinfo->screen);
-}
-
-int
-x_display_pixel_width (struct x_display_info *dpyinfo)
-{
-  return WidthOfScreen (dpyinfo->screen);
-}
-
-\f
 /***********************************************************************
                    Starting and ending an update
  ***********************************************************************/
@@ -635,10 +639,8 @@ XTframe_up_to_date (struct frame *f)
 }
 
 
-/* Clear under internal border if any for non-toolkit builds. */
-
-
-#if !defined USE_X_TOOLKIT && !defined USE_GTK
+/* Clear under internal border if any (GTK has its own version). */
+#ifndef USE_GTK
 void
 x_clear_under_internal_border (struct frame *f)
 {
@@ -897,7 +899,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
   else
     face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil);
   s->face = FACE_FROM_ID (s->f, face_id);
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   if (s->font == s->face->font)
     s->gc = s->face->gc;
@@ -945,7 +947,7 @@ x_set_mode_line_face_gc (struct glyph_string *s)
 static void
 x_set_glyph_string_gc (struct glyph_string *s)
 {
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   if (s->hl == DRAW_NORMAL_TEXT)
     {
@@ -974,10 +976,7 @@ x_set_glyph_string_gc (struct glyph_string *s)
       s->stippled_p = s->face->stipple != 0;
     }
   else
-    {
-      s->gc = s->face->gc;
-      s->stippled_p = s->face->stipple != 0;
-    }
+    emacs_abort ();
 
   /* GC must have been set.  */
   eassert (s->gc != 0);
@@ -2956,8 +2955,64 @@ x_clear_frame (struct frame *f)
   unblock_input ();
 }
 
+/* RIF: Show hourglass cursor on frame F.  */
+
+static void
+x_show_hourglass (struct frame *f)
+{
+  Display *dpy = FRAME_X_DISPLAY (f);
+
+  if (dpy)
+    {
+      struct x_output *x = FRAME_X_OUTPUT (f);
+#ifdef USE_X_TOOLKIT
+      if (x->widget)
+#else
+      if (FRAME_OUTER_WINDOW (f))
+#endif
+       {
+         x->hourglass_p = 1;
+
+         if (!x->hourglass_window)
+           {
+            unsigned long mask = CWCursor;
+            XSetWindowAttributes attrs;
+#ifdef USE_GTK
+             Window parent = FRAME_X_WINDOW (f);
+#else
+             Window parent = FRAME_OUTER_WINDOW (f);
+#endif
+            attrs.cursor = x->hourglass_cursor;
+
+             x->hourglass_window = XCreateWindow
+               (dpy, parent, 0, 0, 32000, 32000, 0, 0,
+                InputOnly, CopyFromParent, mask, &attrs);
+           }
+
+         XMapRaised (dpy, x->hourglass_window);
+         XFlush (dpy);
+       }
+    }
+}
+
+/* RIF: Cancel hourglass cursor on frame F.  */
+
+static void
+x_hide_hourglass (struct frame *f)
+{
+  struct x_output *x = FRAME_X_OUTPUT (f);
+
+  /* Watch out for newly created frames.  */
+  if (x->hourglass_window)
+    {
+      XUnmapWindow (FRAME_X_DISPLAY (f), x->hourglass_window);
+      /* Sync here because XTread_socket looks at the
+        hourglass_p flag that is reset to zero below.  */
+      XSync (FRAME_X_DISPLAY (f), False);
+      x->hourglass_p = 0;
+    }
+}
 
-\f
 /* Invert the middle quarter of the frame for .15 sec.  */
 
 static void
@@ -3105,16 +3160,7 @@ static void
 XTtoggle_invisible_pointer (struct frame *f, int invisible)
 {
   block_input ();
-  if (invisible)
-    {
-      if (FRAME_DISPLAY_INFO (f)->invisible_cursor != 0)
-        XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                       FRAME_DISPLAY_INFO (f)->invisible_cursor);
-    }
-  else
-    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                   f->output_data.x->current_cursor);
-  f->pointer_invisible = invisible;
+  FRAME_DISPLAY_INFO (f)->toggle_visible_pointer (f, invisible);
   unblock_input ();
 }
 
@@ -3931,7 +3977,14 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
   block_input ();
 
   if (dpyinfo->last_mouse_scroll_bar && insist == 0)
-    x_scroll_bar_report_motion (fp, bar_window, part, x, y, timestamp);
+    {
+      struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar;
+
+      if (bar->horizontal)
+       x_horizontal_scroll_bar_report_motion (fp, bar_window, part, x, y, timestamp);
+      else
+       x_scroll_bar_report_motion (fp, bar_window, part, x, y, timestamp);
+    }
   else
     {
       Window root;
@@ -4075,7 +4128,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
          {
            struct scroll_bar *bar;
 
-            bar = x_window_to_scroll_bar (FRAME_X_DISPLAY (*fp), win);
+            bar = x_window_to_scroll_bar (FRAME_X_DISPLAY (*fp), win, 2);
 
            if (bar)
              {
@@ -4130,7 +4183,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
    bits.  */
 
 static struct scroll_bar *
-x_window_to_scroll_bar (Display *display, Window window_id)
+x_window_to_scroll_bar (Display *display, Window window_id, int type)
 {
   Lisp_Object tail, frame;
 
@@ -4155,8 +4208,11 @@ x_window_to_scroll_bar (Display *display, Window window_id)
                               condemned = Qnil,
                               ! NILP (bar));
           bar = XSCROLL_BAR (bar)->next)
-       if (XSCROLL_BAR (bar)->x_window == window_id &&
-            FRAME_X_DISPLAY (XFRAME (frame)) == display)
+       if (XSCROLL_BAR (bar)->x_window == window_id
+            && FRAME_X_DISPLAY (XFRAME (frame)) == display
+           && (type = 2
+               || (type == 1 && XSCROLL_BAR (bar)->horizontal)
+               || (type == 0 && !XSCROLL_BAR (bar)->horizontal)))
          return XSCROLL_BAR (bar);
     }
 
@@ -4194,7 +4250,7 @@ x_window_to_menu_bar (Window window)
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
 
-static void x_send_scroll_bar_event (Lisp_Object, int, int, int);
+static void x_send_scroll_bar_event (Lisp_Object, int, int, int, bool);
 
 /* Lisp window being scrolled.  Set when starting to interact with
    a toolkit scroll bar, reset to nil when ending the interaction.  */
@@ -4208,6 +4264,7 @@ static Lisp_Object window_being_scrolled;
 /* Id of action hook installed for scroll bars.  */
 
 static XtActionHookId action_hook_id;
+static XtActionHookId horizontal_action_hook_id;
 
 static Boolean xaw3d_arrow_scroll;
 
@@ -4245,7 +4302,7 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name,
       struct scroll_bar *bar;
 
       x_send_scroll_bar_event (window_being_scrolled,
-                              scroll_bar_end_scroll, 0, 0);
+                              scroll_bar_end_scroll, 0, 0, 0);
       w = XWINDOW (window_being_scrolled);
       bar = XSCROLL_BAR (w->vertical_scroll_bar);
 
@@ -4263,6 +4320,49 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name,
       toolkit_scroll_bar_interaction = 0;
     }
 }
+
+
+static void
+xt_horizontal_action_hook (Widget widget, XtPointer client_data, String action_name,
+                          XEvent *event, String *params, Cardinal *num_params)
+{
+  int scroll_bar_p;
+  const char *end_action;
+
+#ifdef USE_MOTIF
+  scroll_bar_p = XmIsScrollBar (widget);
+  end_action = "Release";
+#else /* !USE_MOTIF i.e. use Xaw */
+  scroll_bar_p = XtIsSubclass (widget, scrollbarWidgetClass);
+  end_action = "EndScroll";
+#endif /* USE_MOTIF */
+
+  if (scroll_bar_p
+      && strcmp (action_name, end_action) == 0
+      && WINDOWP (window_being_scrolled))
+    {
+      struct window *w;
+      struct scroll_bar *bar;
+
+      x_send_scroll_bar_event (window_being_scrolled,
+                              scroll_bar_end_scroll, 0, 0, 1);
+      w = XWINDOW (window_being_scrolled);
+      bar = XSCROLL_BAR (w->horizontal_scroll_bar);
+
+      if (bar->dragging != -1)
+       {
+         bar->dragging = -1;
+         /* The thumb size is incorrect while dragging: fix it.  */
+         set_horizontal_scroll_bar (w);
+       }
+      window_being_scrolled = Qnil;
+#if defined (USE_LUCID)
+      bar->last_seen_part = scroll_bar_nowhere;
+#endif
+      /* Xt timeouts no longer needed.  */
+      toolkit_scroll_bar_interaction = 0;
+    }
+}
 #endif /* not USE_GTK */
 
 /* Send a client message with message type Xatom_Scrollbar for a
@@ -4271,7 +4371,7 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name,
    amount to scroll of a whole of WHOLE.  */
 
 static void
-x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
+x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole, bool horizontal)
 {
   XEvent event;
   XClientMessageEvent *ev = &event.xclient;
@@ -4286,7 +4386,9 @@ x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
 
   /* Construct a ClientMessage event to send to the frame.  */
   ev->type = ClientMessage;
-  ev->message_type = FRAME_DISPLAY_INFO (f)->Xatom_Scrollbar;
+  ev->message_type = (horizontal
+                     ? FRAME_DISPLAY_INFO (f)->Xatom_Horizontal_Scrollbar
+                     : FRAME_DISPLAY_INFO (f)->Xatom_Scrollbar);
   ev->display = FRAME_X_DISPLAY (f);
   ev->window = FRAME_X_WINDOW (f);
   ev->format = 32;
@@ -4351,6 +4453,41 @@ x_scroll_bar_to_input_event (const XEvent *event,
   ievent->modifiers = 0;
 }
 
+/* Transform a horizontal scroll bar ClientMessage EVENT to an Emacs
+   input event in *IEVENT.  */
+
+static void
+x_horizontal_scroll_bar_to_input_event (const XEvent *event,
+                                       struct input_event *ievent)
+{
+  const XClientMessageEvent *ev = &event->xclient;
+  Lisp_Object window;
+  struct window *w;
+
+  /* See the comment in the function above.  */
+  intptr_t iw0 = ev->data.l[0];
+  intptr_t iw1 = ev->data.l[1];
+  intptr_t iw = (iw0 << 31 << 1) + (iw1 & 0xffffffffu);
+  w = (struct window *) iw;
+
+  XSETWINDOW (window, w);
+
+  ievent->kind = HORIZONTAL_SCROLL_BAR_CLICK_EVENT;
+  ievent->frame_or_window = window;
+  ievent->arg = Qnil;
+#ifdef USE_GTK
+  ievent->timestamp = CurrentTime;
+#else
+  ievent->timestamp =
+    XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame)));
+#endif
+  ievent->code = 0;
+  ievent->part = ev->data.l[2];
+  ievent->x = make_number (ev->data.l[3]);
+  ievent->y = make_number (ev->data.l[4]);
+  ievent->modifiers = 0;
+}
+
 
 #ifdef USE_MOTIF
 
@@ -4358,7 +4495,6 @@ x_scroll_bar_to_input_event (const XEvent *event,
 
 #define XM_SB_MAX 10000000
 
-
 /* Scroll bar callback for Motif scroll bars.  WIDGET is the scroll
    bar widget.  CLIENT_DATA is a pointer to the scroll_bar structure.
    CALL_DATA is a pointer to a XmScrollBarCallbackStruct.  */
@@ -4369,51 +4505,65 @@ xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
   struct scroll_bar *bar = client_data;
   XmScrollBarCallbackStruct *cs = call_data;
   int part = -1, whole = 0, portion = 0;
+  int horizontal = bar->horizontal;
 
   switch (cs->reason)
     {
     case XmCR_DECREMENT:
       bar->dragging = -1;
-      part = scroll_bar_up_arrow;
+      part = horizontal ? scroll_bar_left_arrow : scroll_bar_up_arrow;
       break;
 
     case XmCR_INCREMENT:
       bar->dragging = -1;
-      part = scroll_bar_down_arrow;
+      part = horizontal ? scroll_bar_right_arrow : scroll_bar_down_arrow;
       break;
 
     case XmCR_PAGE_DECREMENT:
       bar->dragging = -1;
-      part = scroll_bar_above_handle;
+      part = horizontal ? scroll_bar_before_handle : scroll_bar_above_handle;
       break;
 
     case XmCR_PAGE_INCREMENT:
       bar->dragging = -1;
-      part = scroll_bar_below_handle;
+      part = horizontal ? scroll_bar_after_handle : scroll_bar_below_handle;
       break;
 
     case XmCR_TO_TOP:
       bar->dragging = -1;
-      part = scroll_bar_to_top;
+      part = horizontal ? scroll_bar_to_leftmost : scroll_bar_to_top;
       break;
 
     case XmCR_TO_BOTTOM:
       bar->dragging = -1;
-      part = scroll_bar_to_bottom;
+      part = horizontal ? scroll_bar_to_rightmost : scroll_bar_to_bottom;
       break;
 
     case XmCR_DRAG:
       {
        int slider_size;
 
-       /* Get the slider size.  */
        block_input ();
        XtVaGetValues (widget, XmNsliderSize, &slider_size, NULL);
        unblock_input ();
 
-       whole = XM_SB_MAX - slider_size;
-       portion = min (cs->value, whole);
-       part = scroll_bar_handle;
+       if (horizontal)
+         {
+           whole = bar->whole;
+           portion = (((float) cs->value
+                       / (XM_SB_MAX - slider_size))
+                      * (whole
+                         - ((float) slider_size / XM_SB_MAX) * whole));
+           portion = max (0, portion);
+           part = scroll_bar_horizontal_handle;
+         }
+       else
+         {
+           whole = XM_SB_MAX - slider_size;
+           portion = min (cs->value, whole);
+           part = scroll_bar_handle;
+         }
+
        bar->dragging = cs->value;
       }
       break;
@@ -4425,7 +4575,7 @@ xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
   if (part >= 0)
     {
       window_being_scrolled = bar->window;
-      x_send_scroll_bar_event (bar->window, part, portion, whole);
+      x_send_scroll_bar_event (bar->window, part, portion, whole, bar->horizontal);
     }
 }
 
@@ -4454,27 +4604,42 @@ xg_scroll_callback (GtkRange     *range,
       if (FRAME_DISPLAY_INFO (f)->grabbed != 0
           && FRAME_DISPLAY_INFO (f)->grabbed < (1 << 4))
         {
-          part = scroll_bar_handle;
-          whole = gtk_adjustment_get_upper (adj) -
-            gtk_adjustment_get_page_size (adj);
-          portion = min ((int)value, whole);
-          bar->dragging = portion;
-        }
+         if (bar->horizontal)
+           {
+             part = scroll_bar_horizontal_handle;
+             whole = (int)(gtk_adjustment_get_upper (adj) -
+                           gtk_adjustment_get_page_size (adj));
+             portion = min ((int)value, whole);
+             bar->dragging = portion;
+           }
+         else
+           {
+             part = scroll_bar_handle;
+             whole = gtk_adjustment_get_upper (adj) -
+               gtk_adjustment_get_page_size (adj);
+             portion = min ((int)value, whole);
+             bar->dragging = portion;
+           }
+       }
       break;
     case GTK_SCROLL_STEP_BACKWARD:
-      part = scroll_bar_up_arrow;
+      part = (bar->horizontal
+             ? scroll_bar_left_arrow : scroll_bar_up_arrow);
       bar->dragging = -1;
       break;
     case GTK_SCROLL_STEP_FORWARD:
-      part = scroll_bar_down_arrow;
+      part = (bar->horizontal
+             ? scroll_bar_right_arrow : scroll_bar_down_arrow);
       bar->dragging = -1;
       break;
     case GTK_SCROLL_PAGE_BACKWARD:
-      part = scroll_bar_above_handle;
+      part = (bar->horizontal
+             ? scroll_bar_before_handle : scroll_bar_above_handle);
       bar->dragging = -1;
       break;
     case GTK_SCROLL_PAGE_FORWARD:
-      part = scroll_bar_below_handle;
+      part = (bar->horizontal
+             ? scroll_bar_after_handle : scroll_bar_below_handle);
       bar->dragging = -1;
       break;
     }
@@ -4482,7 +4647,7 @@ xg_scroll_callback (GtkRange     *range,
   if (part >= 0)
     {
       window_being_scrolled = bar->window;
-      x_send_scroll_bar_event (bar->window, part, portion, whole);
+      x_send_scroll_bar_event (bar->window, part, portion, whole, bar->horizontal);
     }
 
   return FALSE;
@@ -4500,7 +4665,7 @@ xg_end_scroll_callback (GtkWidget *widget,
   if (WINDOWP (window_being_scrolled))
     {
       x_send_scroll_bar_event (window_being_scrolled,
-                               scroll_bar_end_scroll, 0, 0);
+                               scroll_bar_end_scroll, 0, 0, bar->horizontal);
       window_being_scrolled = Qnil;
     }
 
@@ -4524,29 +4689,27 @@ xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data)
   float shown;
   int whole, portion, height;
   enum scroll_bar_part part;
+  int horizontal = bar->horizontal;
 
   /* Get the size of the thumb, a value between 0 and 1.  */
   block_input ();
   XtVaGetValues (widget, XtNshown, &shown, XtNheight, &height, NULL);
   unblock_input ();
 
-  whole = 10000000;
-  portion = shown < 1 ? top * whole : 0;
-
-  if (shown < 1 && (eabs (top + shown - 1) < 1.0f / height))
-    /* Some derivatives of Xaw refuse to shrink the thumb when you reach
-       the bottom, so we force the scrolling whenever we see that we're
-       too close to the bottom (in x_set_toolkit_scroll_bar_thumb
-       we try to ensure that we always stay two pixels away from the
-       bottom).  */
-    part = scroll_bar_down_arrow;
+  if (horizontal)
+    {
+      whole = bar->whole;
+      portion = (top * (whole - (shown * whole))) / (1 - shown);
+      portion = max (0, portion);
+      part = scroll_bar_horizontal_handle;
+    }
   else
     part = scroll_bar_handle;
 
   window_being_scrolled = bar->window;
   bar->dragging = portion;
   bar->last_seen_part = part;
-  x_send_scroll_bar_event (bar->window, part, portion, whole);
+  x_send_scroll_bar_event (bar->window, part, portion, whole, bar->horizontal);
 }
 
 
@@ -4585,12 +4748,13 @@ xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
   window_being_scrolled = bar->window;
   bar->dragging = -1;
   bar->last_seen_part = part;
-  x_send_scroll_bar_event (bar->window, part, position, height);
+  x_send_scroll_bar_event (bar->window, part, position, height, bar->horizontal);
 }
 
 #endif /* not USE_GTK and not USE_MOTIF */
 
 #define SCROLL_BAR_NAME "verticalScrollBar"
+#define SCROLL_BAR_HORIZONTAL_NAME "horizontalScrollBar"
 
 /* Create the widget for scroll bar BAR on frame F.  Record the widget
    and X window of the scroll bar in BAR.  */
@@ -4608,6 +4772,18 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
   unblock_input ();
 }
 
+static void
+x_create_horizontal_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
+{
+  const char *scroll_bar_name = SCROLL_BAR_HORIZONTAL_NAME;
+
+  block_input ();
+  xg_create_horizontal_scroll_bar (f, bar, G_CALLBACK (xg_scroll_callback),
+                                  G_CALLBACK (xg_end_scroll_callback),
+                                  scroll_bar_name);
+  unblock_input ();
+}
+
 #else /* not USE_GTK */
 
 static void
@@ -4803,86 +4979,294 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
   SET_SCROLL_BAR_X_WIDGET (bar, widget);
   xwindow = XtWindow (widget);
   bar->x_window = xwindow;
+  bar->whole = 1;
+  bar->horizontal = 0;
 
   unblock_input ();
 }
-#endif /* not USE_GTK */
-
-
-/* Set the thumb size and position of scroll bar BAR.  We are currently
-   displaying PORTION out of a whole WHOLE, and our position POSITION.  */
-
-#ifdef USE_GTK
-static void
-x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole)
-{
-  xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
-}
 
-#else /* not USE_GTK */
 static void
-x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position,
-                               int whole)
+x_create_horizontal_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
 {
-  struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
-  Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
-  float top, shown;
+  Window xwindow;
+  Widget widget;
+  Arg av[20];
+  int ac = 0;
+  const char *scroll_bar_name = SCROLL_BAR_HORIZONTAL_NAME;
+  unsigned long pixel;
 
   block_input ();
 
 #ifdef USE_MOTIF
+  /* Set resources.  Create the widget.  */
+  XtSetArg (av[ac], XtNmappedWhenManaged, False); ++ac;
+  XtSetArg (av[ac], XmNminimum, 0); ++ac;
+  XtSetArg (av[ac], XmNmaximum, XM_SB_MAX); ++ac;
+  XtSetArg (av[ac], XmNorientation, XmHORIZONTAL); ++ac;
+  XtSetArg (av[ac], XmNprocessingDirection, XmMAX_ON_RIGHT), ++ac;
+  XtSetArg (av[ac], XmNincrement, 1); ++ac;
+  XtSetArg (av[ac], XmNpageIncrement, 1); ++ac;
 
-  if (scroll_bar_adjust_thumb_portion_p)
+  pixel = f->output_data.x->scroll_bar_foreground_pixel;
+  if (pixel != -1)
     {
-      /* We use an estimate of 30 chars per line rather than the real
-         `portion' value.  This has the disadvantage that the thumb size
-         is not very representative, but it makes our life a lot easier.
-         Otherwise, we have to constantly adjust the thumb size, which
-         we can't always do quickly enough: while dragging, the size of
-         the thumb might prevent the user from dragging the thumb all the
-         way to the end.  but Motif and some versions of Xaw3d don't allow
-         updating the thumb size while dragging.  Also, even if we can update
-         its size, the update will often happen too late.
-         If you don't believe it, check out revision 1.650 of xterm.c to see
-         what hoops we were going through and the still poor behavior we got.  */
-      portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
-      /* When the thumb is at the bottom, position == whole.
-         So we need to increase `whole' to make space for the thumb.  */
-      whole += portion;
+      XtSetArg (av[ac], XmNforeground, pixel);
+      ++ac;
     }
 
-  if (whole <= 0)
-    top = 0, shown = 1;
-  else
+  pixel = f->output_data.x->scroll_bar_background_pixel;
+  if (pixel != -1)
     {
-      top = (float) position / whole;
-      shown = (float) portion / whole;
+      XtSetArg (av[ac], XmNbackground, pixel);
+      ++ac;
     }
 
-  if (bar->dragging == -1)
-    {
-      int size, value;
+  widget = XmCreateScrollBar (f->output_data.x->edit_widget,
+                             (char *) scroll_bar_name, av, ac);
 
-      /* Slider size.  Must be in the range [1 .. MAX - MIN] where MAX
-         is the scroll bar's maximum and MIN is the scroll bar's minimum
-        value.  */
-      size = clip_to_bounds (1, shown * XM_SB_MAX, XM_SB_MAX);
+  /* Add one callback for everything that can happen.  */
+  XtAddCallback (widget, XmNdecrementCallback, xm_scroll_callback,
+                (XtPointer) bar);
+  XtAddCallback (widget, XmNdragCallback, xm_scroll_callback,
+                (XtPointer) bar);
+  XtAddCallback (widget, XmNincrementCallback, xm_scroll_callback,
+                (XtPointer) bar);
+  XtAddCallback (widget, XmNpageDecrementCallback, xm_scroll_callback,
+                (XtPointer) bar);
+  XtAddCallback (widget, XmNpageIncrementCallback, xm_scroll_callback,
+                (XtPointer) bar);
+  XtAddCallback (widget, XmNtoBottomCallback, xm_scroll_callback,
+                (XtPointer) bar);
+  XtAddCallback (widget, XmNtoTopCallback, xm_scroll_callback,
+                (XtPointer) bar);
 
-      /* Position.  Must be in the range [MIN .. MAX - SLIDER_SIZE].  */
-      value = top * XM_SB_MAX;
-      value = min (value, XM_SB_MAX - size);
+  /* Realize the widget.  Only after that is the X window created.  */
+  XtRealizeWidget (widget);
+
+  /* Set the cursor to an arrow.  I didn't find a resource to do that.
+     And I'm wondering why it hasn't an arrow cursor by default.  */
+  XDefineCursor (XtDisplay (widget), XtWindow (widget),
+                 f->output_data.x->nontext_cursor);
 
-      XmScrollBarSetValues (widget, value, size, 0, 0, False);
-    }
 #else /* !USE_MOTIF i.e. use Xaw */
 
-  if (whole == 0)
-    top = 0, shown = 1;
-  else
-    {
-      top = (float) position / whole;
-      shown = (float) portion / whole;
-    }
+  /* Set resources.  Create the widget.  The background of the
+     Xaw3d scroll bar widget is a little bit light for my taste.
+     We don't alter it here to let users change it according
+     to their taste with `emacs*verticalScrollBar.background: xxx'.  */
+  XtSetArg (av[ac], XtNmappedWhenManaged, False); ++ac;
+  XtSetArg (av[ac], XtNorientation, XtorientHorizontal); ++ac;
+  /* For smoother scrolling with Xaw3d   -sm */
+  /* XtSetArg (av[ac], XtNpickTop, True); ++ac; */
+
+  pixel = f->output_data.x->scroll_bar_foreground_pixel;
+  if (pixel != -1)
+    {
+      XtSetArg (av[ac], XtNforeground, pixel);
+      ++ac;
+    }
+
+  pixel = f->output_data.x->scroll_bar_background_pixel;
+  if (pixel != -1)
+    {
+      XtSetArg (av[ac], XtNbackground, pixel);
+      ++ac;
+    }
+
+  /* Top/bottom shadow colors.  */
+
+  /* Allocate them, if necessary.  */
+  if (f->output_data.x->scroll_bar_top_shadow_pixel == -1)
+    {
+      pixel = f->output_data.x->scroll_bar_background_pixel;
+      if (pixel != -1)
+        {
+          if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f),
+                                      FRAME_X_COLORMAP (f),
+                                      &pixel, 1.2, 0x8000))
+            pixel = -1;
+          f->output_data.x->scroll_bar_top_shadow_pixel = pixel;
+        }
+    }
+  if (f->output_data.x->scroll_bar_bottom_shadow_pixel == -1)
+    {
+      pixel = f->output_data.x->scroll_bar_background_pixel;
+      if (pixel != -1)
+        {
+          if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f),
+                                      FRAME_X_COLORMAP (f),
+                                      &pixel, 0.6, 0x4000))
+            pixel = -1;
+          f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel;
+        }
+    }
+
+#ifdef XtNbeNiceToColormap
+  /* Tell the toolkit about them.  */
+  if (f->output_data.x->scroll_bar_top_shadow_pixel == -1
+      || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1)
+    /* We tried to allocate a color for the top/bottom shadow, and
+       failed, so tell Xaw3d to use dithering instead.   */
+    /* But only if we have a small colormap.  Xaw3d can allocate nice
+       colors itself.  */
+    {
+      XtSetArg (av[ac], XtNbeNiceToColormap,
+                DefaultDepthOfScreen (FRAME_X_SCREEN (f)) < 16);
+      ++ac;
+    }
+  else
+    /* Tell what colors Xaw3d should use for the top/bottom shadow, to
+       be more consistent with other emacs 3d colors, and since Xaw3d is
+       not good at dealing with allocation failure.  */
+    {
+      /* This tells Xaw3d to use real colors instead of dithering for
+        the shadows.  */
+      XtSetArg (av[ac], XtNbeNiceToColormap, False);
+      ++ac;
+
+      /* Specify the colors.  */
+      pixel = f->output_data.x->scroll_bar_top_shadow_pixel;
+      if (pixel != -1)
+       {
+         XtSetArg (av[ac], XtNtopShadowPixel, pixel);
+         ++ac;
+       }
+      pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel;
+      if (pixel != -1)
+       {
+         XtSetArg (av[ac], XtNbottomShadowPixel, pixel);
+         ++ac;
+       }
+    }
+#endif
+
+  widget = XtCreateWidget (scroll_bar_name, scrollbarWidgetClass,
+                          f->output_data.x->edit_widget, av, ac);
+
+  {
+    char const *initial = "";
+    char const *val = initial;
+    XtVaGetValues (widget, XtNscrollVCursor, (XtPointer) &val,
+#ifdef XtNarrowScrollbars
+                  XtNarrowScrollbars, (XtPointer) &xaw3d_arrow_scroll,
+#endif
+                  XtNpickTop, (XtPointer) &xaw3d_pick_top, NULL);
+    if (xaw3d_arrow_scroll || val == initial)
+      {        /* ARROW_SCROLL */
+       xaw3d_arrow_scroll = True;
+       /* Isn't that just a personal preference ?   --Stef */
+       XtVaSetValues (widget, XtNcursorName, "top_left_arrow", NULL);
+      }
+  }
+
+  /* Define callbacks.  */
+  XtAddCallback (widget, XtNjumpProc, xaw_jump_callback, (XtPointer) bar);
+  XtAddCallback (widget, XtNscrollProc, xaw_scroll_callback,
+                (XtPointer) bar);
+
+  /* Realize the widget.  Only after that is the X window created.  */
+  XtRealizeWidget (widget);
+
+#endif /* !USE_MOTIF */
+
+  /* Install an action hook that lets us detect when the user
+     finishes interacting with a scroll bar.  */
+  if (horizontal_action_hook_id == 0)
+   horizontal_action_hook_id
+     = XtAppAddActionHook (Xt_app_con, xt_horizontal_action_hook, 0);
+
+  /* Remember X window and widget in the scroll bar vector.  */
+  SET_SCROLL_BAR_X_WIDGET (bar, widget);
+  xwindow = XtWindow (widget);
+  bar->x_window = xwindow;
+  bar->whole = 1;
+  bar->horizontal = 1;
+
+  unblock_input ();
+}
+#endif /* not USE_GTK */
+
+
+/* Set the thumb size and position of scroll bar BAR.  We are currently
+   displaying PORTION out of a whole WHOLE, and our position POSITION.  */
+
+#ifdef USE_GTK
+static void
+x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole)
+{
+  xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
+}
+
+static void
+x_set_toolkit_horizontal_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole)
+{
+  xg_set_toolkit_horizontal_scroll_bar_thumb (bar, portion, position, whole);
+}
+
+#else /* not USE_GTK */
+static void
+x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position,
+                               int whole)
+{
+  struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
+  Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
+  float top, shown;
+
+  block_input ();
+
+#ifdef USE_MOTIF
+
+  if (scroll_bar_adjust_thumb_portion_p)
+    {
+      /* We use an estimate of 30 chars per line rather than the real
+         `portion' value.  This has the disadvantage that the thumb size
+         is not very representative, but it makes our life a lot easier.
+         Otherwise, we have to constantly adjust the thumb size, which
+         we can't always do quickly enough: while dragging, the size of
+         the thumb might prevent the user from dragging the thumb all the
+         way to the end.  but Motif and some versions of Xaw3d don't allow
+         updating the thumb size while dragging.  Also, even if we can update
+         its size, the update will often happen too late.
+         If you don't believe it, check out revision 1.650 of xterm.c to see
+         what hoops we were going through and the still poor behavior we got.  */
+      portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
+      /* When the thumb is at the bottom, position == whole.
+         So we need to increase `whole' to make space for the thumb.  */
+      whole += portion;
+    }
+
+  if (whole <= 0)
+    top = 0, shown = 1;
+  else
+    {
+      top = (float) position / whole;
+      shown = (float) portion / whole;
+    }
+
+  if (bar->dragging == -1)
+    {
+      int size, value;
+
+      /* Slider size.  Must be in the range [1 .. MAX - MIN] where MAX
+         is the scroll bar's maximum and MIN is the scroll bar's minimum
+        value.  */
+      size = clip_to_bounds (1, shown * XM_SB_MAX, XM_SB_MAX);
+
+      /* Position.  Must be in the range [MIN .. MAX - SLIDER_SIZE].  */
+      value = top * XM_SB_MAX;
+      value = min (value, XM_SB_MAX - size);
+
+      XmScrollBarSetValues (widget, value, size, 0, 0, False);
+    }
+#else /* !USE_MOTIF i.e. use Xaw */
+
+  if (whole == 0)
+    top = 0, shown = 1;
+  else
+    {
+      top = (float) position / whole;
+      shown = (float) portion / whole;
+    }
 
   {
     float old_top, old_shown;
@@ -4931,6 +5315,89 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
 
   unblock_input ();
 }
+
+static void
+x_set_toolkit_horizontal_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position,
+                               int whole)
+{
+  struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
+  Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
+  float top, shown;
+
+  block_input ();
+
+#ifdef USE_MOTIF
+  bar->whole = whole;
+  shown = (float) portion / whole;
+  top = (float) position / (whole - portion);
+  {
+    int size = clip_to_bounds (1, shown * XM_SB_MAX, XM_SB_MAX);
+    int value = clip_to_bounds (0, top * (XM_SB_MAX - size), XM_SB_MAX - size);
+
+    XmScrollBarSetValues (widget, value, size, 0, 0, False);
+  }
+#else /* !USE_MOTIF i.e. use Xaw */
+  bar->whole = whole;
+  if (whole == 0)
+    top = 0, shown = 1;
+  else
+    {
+      top = (float) position / whole;
+      shown = (float) portion / whole;
+    }
+
+  {
+    float old_top, old_shown;
+    Dimension height;
+    XtVaGetValues (widget,
+                  XtNtopOfThumb, &old_top,
+                  XtNshown, &old_shown,
+                  XtNheight, &height,
+                  NULL);
+
+#if 0
+    /* Massage the top+shown values.  */
+    if (bar->dragging == -1 || bar->last_seen_part == scroll_bar_down_arrow)
+      top = max (0, min (1, top));
+    else
+      top = old_top;
+#if ! defined (HAVE_XAW3D)
+    /* With Xaw, 'top' values too closer to 1.0 may
+       cause the thumb to disappear.  Fix that.  */
+    top = min (top, 0.99f);
+#endif
+    /* Keep two pixels available for moving the thumb down.  */
+    shown = max (0, min (1 - top - (2.0f / height), shown));
+#if ! defined (HAVE_XAW3D)
+    /* Likewise with too small 'shown'.  */
+    shown = max (shown, 0.01f);
+#endif
+#endif
+
+    /* If the call to XawScrollbarSetThumb below doesn't seem to
+       work, check that 'NARROWPROTO' is defined in src/config.h.
+       If this is not so, most likely you need to fix configure.  */
+    XawScrollbarSetThumb (widget, top, shown);
+#if 0
+    if (top != old_top || shown != old_shown)
+      {
+       if (bar->dragging == -1)
+         XawScrollbarSetThumb (widget, top, shown);
+       else
+         {
+           /* Try to make the scrolling a tad smoother.  */
+           if (!xaw3d_pick_top)
+             shown = min (shown, old_shown);
+
+           XawScrollbarSetThumb (widget, top, shown);
+         }
+      }
+#endif
+  }
+#endif /* !USE_MOTIF */
+
+  unblock_input ();
+}
 #endif /* not USE_GTK */
 
 #endif /* USE_TOOLKIT_SCROLL_BARS */
@@ -4947,7 +5414,7 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
    scroll bar. */
 
 static struct scroll_bar *
-x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
+x_scroll_bar_create (struct window *w, int top, int left, int width, int height, bool horizontal)
 {
   struct frame *f = XFRAME (w->frame);
   struct scroll_bar *bar
@@ -4957,7 +5424,10 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
   block_input ();
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
-  x_create_toolkit_scroll_bar (f, bar);
+  if (horizontal)
+    x_create_horizontal_toolkit_scroll_bar (f, bar);
+  else
+    x_create_toolkit_scroll_bar (f, bar);
 #else /* not USE_TOOLKIT_SCROLL_BARS */
   {
     XSetWindowAttributes a;
@@ -5020,8 +5490,12 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
 #ifdef USE_TOOLKIT_SCROLL_BARS
   {
 #ifdef USE_GTK
-    xg_update_scrollbar_pos (f, bar->x_window, top,
-                            left,width, max (height, 1));
+    if (horizontal)
+      xg_update_horizontal_scrollbar_pos (f, bar->x_window, top,
+                                         left, width, max (height, 1));
+    else
+      xg_update_scrollbar_pos (f, bar->x_window, top,
+                              left, width, max (height, 1));
 #else /* not USE_GTK */
     Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
     XtConfigureWidget (scroll_bar, left, top, width, max (height, 1), 0);
@@ -5105,7 +5579,7 @@ x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end, int rebuild
 
     /* Draw the empty space above the handle.  Note that we can't clear
        zero-height areas; that means "clear to end of window."  */
-    if (start > 0)
+    if ((inside_width > 0) && (start > 0))
       x_clear_area (FRAME_X_DISPLAY (f), w,
                    VERTICAL_SCROLL_BAR_LEFT_BORDER,
                    VERTICAL_SCROLL_BAR_TOP_BORDER,
@@ -5130,7 +5604,7 @@ x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end, int rebuild
 
     /* Draw the empty space below the handle.  Note that we can't
        clear zero-height areas; that means "clear to end of window." */
-    if (end < inside_height)
+    if ((inside_width > 0) && (end < inside_height))
       x_clear_area (FRAME_X_DISPLAY (f), w,
                    VERTICAL_SCROLL_BAR_LEFT_BORDER,
                    VERTICAL_SCROLL_BAR_TOP_BORDER + end,
@@ -5162,7 +5636,10 @@ x_scroll_bar_remove (struct scroll_bar *bar)
 #endif
 
   /* Dissociate this scroll bar from its window.  */
-  wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil);
+  if (bar->horizontal)
+    wset_horizontal_scroll_bar (XWINDOW (bar->window), Qnil);
+  else
+    wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil);
 
   unblock_input ();
 }
@@ -5186,30 +5663,148 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
   window_box (w, ANY_AREA, 0, &window_y, 0, &window_height);
   top = window_y;
   height = window_height;
-
-  /* Compute the left edge and the width of the scroll bar area.  */
   left = WINDOW_SCROLL_BAR_AREA_X (w);
   width = WINDOW_SCROLL_BAR_AREA_WIDTH (w);
 
   /* Does the scroll bar exist yet?  */
-  if (NILP (w->vertical_scroll_bar))
+  if (NILP (w->vertical_scroll_bar))
+    {
+      if (width > 0 && height > 0)
+       {
+         block_input ();
+         x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                       left, top, width, height);
+         unblock_input ();
+       }
+
+      bar = x_scroll_bar_create (w, top, left, width, max (height, 1), 0);
+    }
+  else
+    {
+      /* It may just need to be moved and resized.  */
+      unsigned int mask = 0;
+
+      bar = XSCROLL_BAR (w->vertical_scroll_bar);
+
+      block_input ();
+
+      if (left != bar->left)
+       mask |= CWX;
+      if (top != bar->top)
+       mask |= CWY;
+      if (width != bar->width)
+       mask |= CWWidth;
+      if (height != bar->height)
+       mask |= CWHeight;
+
+#ifdef USE_TOOLKIT_SCROLL_BARS
+
+      /* Move/size the scroll bar widget.  */
+      if (mask)
+       {
+         /* Since toolkit scroll bars are smaller than the space reserved
+            for them on the frame, we have to clear "under" them.  */
+         if (width > 0 && height > 0)
+           x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                         left, top, width, height);
+#ifdef USE_GTK
+          xg_update_scrollbar_pos (f, bar->x_window, top,
+                                  left, width, max (height, 1));
+#else /* not USE_GTK */
+          XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
+                             left, top, width, max (height, 1), 0);
+#endif /* not USE_GTK */
+       }
+#else /* not USE_TOOLKIT_SCROLL_BARS */
+
+      /* Move/size the scroll bar window.  */
+      if (mask)
+       {
+         XWindowChanges wc;
+
+         wc.x = left;
+         wc.y = top;
+         wc.width = width;
+         wc.height = height;
+         XConfigureWindow (FRAME_X_DISPLAY (f), bar->x_window,
+                           mask, &wc);
+       }
+
+#endif /* not USE_TOOLKIT_SCROLL_BARS */
+
+      /* Remember new settings.  */
+      bar->left = left;
+      bar->top = top;
+      bar->width = width;
+      bar->height = height;
+
+      unblock_input ();
+    }
+
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
+#else /* not USE_TOOLKIT_SCROLL_BARS */
+  /* Set the scroll bar's current state, unless we're currently being
+     dragged.  */
+  if (bar->dragging == -1)
+    {
+      int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height);
+
+      if (whole == 0)
+       x_scroll_bar_set_handle (bar, 0, top_range, 0);
+      else
+       {
+         int start = ((double) position * top_range) / whole;
+         int end = ((double) (position + portion) * top_range) / whole;
+         x_scroll_bar_set_handle (bar, start, end, 0);
+       }
+    }
+#endif /* not USE_TOOLKIT_SCROLL_BARS */
+
+  XSETVECTOR (barobj, bar);
+  wset_vertical_scroll_bar (w, barobj);
+}
+
+
+static void
+XTset_horizontal_scroll_bar (struct window *w, int portion, int whole, int position)
+{
+  struct frame *f = XFRAME (w->frame);
+  Lisp_Object barobj;
+  struct scroll_bar *bar;
+  int top, height, left, width;
+  int window_x, window_width;
+  int pixel_width = WINDOW_PIXEL_WIDTH (w);
+
+  /* Get window dimensions.  */
+  window_box (w, ANY_AREA, &window_x, 0, &window_width, 0);
+  left = window_x;
+  width = window_width;
+  top = WINDOW_SCROLL_BAR_AREA_Y (w);
+  height = WINDOW_SCROLL_BAR_AREA_HEIGHT (w);
+
+  /* Does the scroll bar exist yet?  */
+  if (NILP (w->horizontal_scroll_bar))
     {
       if (width > 0 && height > 0)
        {
          block_input ();
+
+         /* Clear also part between window_width and
+            WINDOW_PIXEL_WIDTH.  */
          x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                       left, top, width, height);
+                       left, top, pixel_width, height);
          unblock_input ();
        }
 
-      bar = x_scroll_bar_create (w, top, left, width, max (height, 1));
+      bar = x_scroll_bar_create (w, top, left, width, height, 1);
     }
   else
     {
       /* It may just need to be moved and resized.  */
       unsigned int mask = 0;
 
-      bar = XSCROLL_BAR (w->vertical_scroll_bar);
+      bar = XSCROLL_BAR (w->horizontal_scroll_bar);
 
       block_input ();
 
@@ -5223,7 +5818,6 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
        mask |= CWHeight;
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
-
       /* Move/size the scroll bar widget.  */
       if (mask)
        {
@@ -5231,17 +5825,30 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
             for them on the frame, we have to clear "under" them.  */
          if (width > 0 && height > 0)
            x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                         left, top, width, height);
+                         WINDOW_LEFT_EDGE_X (w), top,
+                         pixel_width - WINDOW_RIGHT_DIVIDER_WIDTH (w), height);
 #ifdef USE_GTK
-          xg_update_scrollbar_pos (f, bar->x_window, top,
-                                  left, width, max (height, 1));
+          xg_update_horizontal_scrollbar_pos (f, bar->x_window, top, left,
+                                             width, height);
 #else /* not USE_GTK */
           XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
-                             left, top, width, max (height, 1), 0);
+                             left, top, width, height, 0);
 #endif /* not USE_GTK */
        }
 #else /* not USE_TOOLKIT_SCROLL_BARS */
 
+      /* Clear areas not covered by the scroll bar because it's not as
+        wide as the area reserved for it.  This makes sure a
+        previous mode line display is cleared after C-x 2 C-x 1, for
+        example.  */
+      {
+       int area_height = WINDOW_CONFIG_SCROLL_BAR_HEIGHT (w);
+       int rest = area_height - height;
+       if (rest > 0 && width > 0)
+         x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                       left, top, width, rest);
+      }
+
       /* Move/size the scroll bar window.  */
       if (mask)
        {
@@ -5267,27 +5874,27 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
     }
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
-  x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
+  x_set_toolkit_horizontal_scroll_bar_thumb (bar, portion, position, whole);
 #else /* not USE_TOOLKIT_SCROLL_BARS */
   /* Set the scroll bar's current state, unless we're currently being
      dragged.  */
   if (bar->dragging == -1)
     {
-      int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height);
+      int left_range = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, width);
 
       if (whole == 0)
-       x_scroll_bar_set_handle (bar, 0, top_range, 0);
+       x_scroll_bar_set_handle (bar, 0, left_range, 0);
       else
        {
-         int start = ((double) position * top_range) / whole;
-         int end = ((double) (position + portion) * top_range) / whole;
+         int start = ((double) position * left_range) / whole;
+         int end = ((double) (position + portion) * left_range) / whole;
          x_scroll_bar_set_handle (bar, start, end, 0);
        }
     }
 #endif /* not USE_TOOLKIT_SCROLL_BARS */
 
   XSETVECTOR (barobj, bar);
-  wset_vertical_scroll_bar (w, barobj);
+  wset_horizontal_scroll_bar (w, barobj);
 }
 
 
@@ -5306,17 +5913,22 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
 static void
 XTcondemn_scroll_bars (struct frame *frame)
 {
-  /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS.  */
-  while (! NILP (FRAME_SCROLL_BARS (frame)))
+  if (!NILP (FRAME_SCROLL_BARS (frame)))
     {
-      Lisp_Object bar;
-      bar = FRAME_SCROLL_BARS (frame);
-      fset_scroll_bars (frame, XSCROLL_BAR (bar)->next);
-      XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame);
-      XSCROLL_BAR (bar)->prev = Qnil;
-      if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame)))
-       XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar;
-      fset_condemned_scroll_bars (frame, bar);
+      if (!NILP (FRAME_CONDEMNED_SCROLL_BARS (frame)))
+       {
+         /* Prepend scrollbars to already condemned ones.  */
+         Lisp_Object last = FRAME_SCROLL_BARS (frame);
+
+         while (!NILP (XSCROLL_BAR (last)->next))
+           last = XSCROLL_BAR (last)->next;
+
+         XSCROLL_BAR (last)->next = FRAME_CONDEMNED_SCROLL_BARS (frame);
+         XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = last;
+       }
+
+      fset_condemned_scroll_bars (frame, FRAME_SCROLL_BARS (frame));
+      fset_scroll_bars (frame, Qnil);
     }
 }
 
@@ -5325,47 +5937,84 @@ XTcondemn_scroll_bars (struct frame *frame)
    Note that WINDOW isn't necessarily condemned at all.  */
 
 static void
-XTredeem_scroll_bar (struct window *window)
+XTredeem_scroll_bar (struct window *w)
 {
   struct scroll_bar *bar;
-  struct frame *f;
   Lisp_Object barobj;
+  struct frame *f;
 
   /* We can't redeem this window's scroll bar if it doesn't have one.  */
-  if (NILP (window->vertical_scroll_bar))
+  if (NILP (w->vertical_scroll_bar) && NILP (w->horizontal_scroll_bar))
     emacs_abort ();
 
-  bar = XSCROLL_BAR (window->vertical_scroll_bar);
-
-  /* Unlink it from the condemned list.  */
-  f = XFRAME (WINDOW_FRAME (window));
-  if (NILP (bar->prev))
+  if (!NILP (w->vertical_scroll_bar) && WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
     {
-      /* If the prev pointer is nil, it must be the first in one of
-        the lists.  */
-      if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
-       /* It's not condemned.  Everything's fine.  */
-       return;
-      else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
-                  window->vertical_scroll_bar))
-       fset_condemned_scroll_bars (f, bar->next);
+      bar = XSCROLL_BAR (w->vertical_scroll_bar);
+      /* Unlink it from the condemned list.  */
+      f = XFRAME (WINDOW_FRAME (w));
+      if (NILP (bar->prev))
+       {
+         /* If the prev pointer is nil, it must be the first in one of
+            the lists.  */
+         if (EQ (FRAME_SCROLL_BARS (f), w->vertical_scroll_bar))
+           /* It's not condemned.  Everything's fine.  */
+           goto horizontal;
+         else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
+                      w->vertical_scroll_bar))
+           fset_condemned_scroll_bars (f, bar->next);
+         else
+           /* If its prev pointer is nil, it must be at the front of
+              one or the other!  */
+           emacs_abort ();
+       }
       else
-       /* If its prev pointer is nil, it must be at the front of
-          one or the other!  */
-       emacs_abort ();
+       XSCROLL_BAR (bar->prev)->next = bar->next;
+
+      if (! NILP (bar->next))
+       XSCROLL_BAR (bar->next)->prev = bar->prev;
+
+      bar->next = FRAME_SCROLL_BARS (f);
+      bar->prev = Qnil;
+      XSETVECTOR (barobj, bar);
+      fset_scroll_bars (f, barobj);
+      if (! NILP (bar->next))
+       XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
     }
-  else
-    XSCROLL_BAR (bar->prev)->next = bar->next;
 
-  if (! NILP (bar->next))
-    XSCROLL_BAR (bar->next)->prev = bar->prev;
+ horizontal:
+  if (!NILP (w->horizontal_scroll_bar) && WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w))
+    {
+      bar = XSCROLL_BAR (w->horizontal_scroll_bar);
+      /* Unlink it from the condemned list.  */
+      f = XFRAME (WINDOW_FRAME (w));
+      if (NILP (bar->prev))
+       {
+         /* If the prev pointer is nil, it must be the first in one of
+            the lists.  */
+         if (EQ (FRAME_SCROLL_BARS (f), w->horizontal_scroll_bar))
+           /* It's not condemned.  Everything's fine.  */
+           return;
+         else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
+                      w->horizontal_scroll_bar))
+           fset_condemned_scroll_bars (f, bar->next);
+         else
+           /* If its prev pointer is nil, it must be at the front of
+              one or the other!  */
+           emacs_abort ();
+       }
+      else
+       XSCROLL_BAR (bar->prev)->next = bar->next;
+
+      if (! NILP (bar->next))
+       XSCROLL_BAR (bar->next)->prev = bar->prev;
 
-  bar->next = FRAME_SCROLL_BARS (f);
-  bar->prev = Qnil;
-  XSETVECTOR (barobj, bar);
-  fset_scroll_bars (f, barobj);
-  if (! NILP (bar->next))
-    XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
+      bar->next = FRAME_SCROLL_BARS (f);
+      bar->prev = Qnil;
+      XSETVECTOR (barobj, bar);
+      fset_scroll_bars (f, barobj);
+      if (! NILP (bar->next))
+       XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
+    }
 }
 
 /* Remove all scroll bars on FRAME that haven't been saved since the
@@ -5450,7 +6099,9 @@ x_scroll_bar_handle_click (struct scroll_bar *bar,
   if (! WINDOWP (bar->window))
     emacs_abort ();
 
-  emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
+  emacs_event->kind = (bar->horizontal
+                      ? HORIZONTAL_SCROLL_BAR_CLICK_EVENT
+                      : SCROLL_BAR_CLICK_EVENT);
   emacs_event->code = event->xbutton.button - Button1;
   emacs_event->modifiers
     = (x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO
@@ -5462,36 +6113,68 @@ x_scroll_bar_handle_click (struct scroll_bar *bar,
   emacs_event->frame_or_window = bar->window;
   emacs_event->arg = Qnil;
   emacs_event->timestamp = event->xbutton.time;
-  {
-    int top_range
-      = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height);
-    int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER;
+  if (bar->horizontal)
+    {
+      int left_range
+       = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width);
+      int x = event->xbutton.x - HORIZONTAL_SCROLL_BAR_LEFT_BORDER;
 
-    if (y < 0) y = 0;
-    if (y > top_range) y = top_range;
+      if (x < 0) x = 0;
+      if (x > left_range) x = left_range;
 
-    if (y < bar->start)
-      emacs_event->part = scroll_bar_above_handle;
-    else if (y < bar->end + VERTICAL_SCROLL_BAR_MIN_HANDLE)
-      emacs_event->part = scroll_bar_handle;
-    else
-      emacs_event->part = scroll_bar_below_handle;
+      if (x < bar->start)
+       emacs_event->part = scroll_bar_before_handle;
+      else if (x < bar->end + HORIZONTAL_SCROLL_BAR_MIN_HANDLE)
+       emacs_event->part = scroll_bar_horizontal_handle;
+      else
+       emacs_event->part = scroll_bar_after_handle;
 
 #ifndef USE_TOOLKIT_SCROLL_BARS
-    /* If the user has released the handle, set it to its final position.  */
-    if (event->type == ButtonRelease && bar->dragging != -1)
-      {
-       int new_start = y - bar->dragging;
-       int new_end = new_start + bar->end - bar->start;
+      /* If the user has released the handle, set it to its final position.  */
+      if (event->type == ButtonRelease && bar->dragging != -1)
+       {
+         int new_start =  - bar->dragging;
+         int new_end = new_start + bar->end - bar->start;
 
-       x_scroll_bar_set_handle (bar, new_start, new_end, 0);
-       bar->dragging = -1;
-      }
+         x_scroll_bar_set_handle (bar, new_start, new_end, 0);
+         bar->dragging = -1;
+       }
 #endif
 
-    XSETINT (emacs_event->x, y);
-    XSETINT (emacs_event->y, top_range);
-  }
+      XSETINT (emacs_event->x, left_range);
+      XSETINT (emacs_event->y, x);
+    }
+  else
+    {
+      int top_range
+       = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height);
+      int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER;
+
+      if (y < 0) y = 0;
+      if (y > top_range) y = top_range;
+
+      if (y < bar->start)
+       emacs_event->part = scroll_bar_above_handle;
+      else if (y < bar->end + VERTICAL_SCROLL_BAR_MIN_HANDLE)
+       emacs_event->part = scroll_bar_handle;
+      else
+       emacs_event->part = scroll_bar_below_handle;
+
+#ifndef USE_TOOLKIT_SCROLL_BARS
+      /* If the user has released the handle, set it to its final position.  */
+      if (event->type == ButtonRelease && bar->dragging != -1)
+       {
+         int new_start = y - bar->dragging;
+         int new_end = new_start + bar->end - bar->start;
+
+         x_scroll_bar_set_handle (bar, new_start, new_end, 0);
+         bar->dragging = -1;
+       }
+#endif
+
+      XSETINT (emacs_event->x, y);
+      XSETINT (emacs_event->y, top_range);
+    }
 }
 
 #ifndef USE_TOOLKIT_SCROLL_BARS
@@ -5598,6 +6281,75 @@ x_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
 }
 
 
+/* Return information to the user about the current position of the mouse
+   on the scroll bar.  */
+
+static void
+x_horizontal_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window,
+                                      enum scroll_bar_part *part, Lisp_Object *x,
+                                      Lisp_Object *y, Time *timestamp)
+{
+  struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (*fp);
+  struct scroll_bar *bar = dpyinfo->last_mouse_scroll_bar;
+  Window w = bar->x_window;
+  struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
+  int win_x, win_y;
+  Window dummy_window;
+  int dummy_coord;
+  unsigned int dummy_mask;
+
+  block_input ();
+
+  /* Get the mouse's position relative to the scroll bar window, and
+     report that.  */
+  if (XQueryPointer (FRAME_X_DISPLAY (f), w,
+
+                    /* Root, child, root x and root y.  */
+                    &dummy_window, &dummy_window,
+                    &dummy_coord, &dummy_coord,
+
+                    /* Position relative to scroll bar.  */
+                    &win_x, &win_y,
+
+                    /* Mouse buttons and modifier keys.  */
+                    &dummy_mask))
+    {
+      int left_range = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width);
+
+      win_x -= HORIZONTAL_SCROLL_BAR_LEFT_BORDER;
+
+      if (bar->dragging != -1)
+       win_x -= bar->dragging;
+
+      if (win_x < 0)
+       win_x = 0;
+      if (win_x > left_range)
+       win_x = left_range;
+
+      *fp = f;
+      *bar_window = bar->window;
+
+      if (bar->dragging != -1)
+       *part = scroll_bar_horizontal_handle;
+      else if (win_x < bar->start)
+       *part = scroll_bar_before_handle;
+      else if (win_x < bar->end + HORIZONTAL_SCROLL_BAR_MIN_HANDLE)
+       *part = scroll_bar_handle;
+      else
+       *part = scroll_bar_after_handle;
+
+      XSETINT (*y, win_x);
+      XSETINT (*x, left_range);
+
+      f->mouse_moved = 0;
+      dpyinfo->last_mouse_scroll_bar = NULL;
+      *timestamp = dpyinfo->last_mouse_movement_time;
+    }
+
+  unblock_input ();
+}
+
+
 /* The screen has been cleared so we may have changed foreground or
    background colors, and the scroll bars may need to be redrawn.
    Clear out the scroll bars, and ask for expose events, so we can
@@ -5630,7 +6382,7 @@ static int temp_index;
 static short temp_buffer[100];
 
 #define STORE_KEYSYM_FOR_DEBUG(keysym)                         \
-  if (temp_index == sizeof temp_buffer / sizeof (short))       \
+  if (temp_index == ARRAYELTS (temp_buffer))                   \
     temp_index = 0;                                            \
   temp_buffer[temp_index++] = (keysym)
 
@@ -5740,6 +6492,35 @@ static void xembed_send_message (struct frame *f, Time,
                                  enum xembed_message,
                                  long detail, long data1, long data2);
 
+static void
+x_net_wm_state (struct frame *f, Window window)
+{
+  int value = FULLSCREEN_NONE;
+  Lisp_Object lval = Qnil;
+  int sticky = 0;
+
+  (void)get_current_wm_state (f, window, &value, &sticky);
+
+  switch (value)
+    {
+    case FULLSCREEN_WIDTH:
+      lval = Qfullwidth;
+      break;
+    case FULLSCREEN_HEIGHT:
+      lval = Qfullheight;
+      break;
+    case FULLSCREEN_BOTH:
+      lval = Qfullboth;
+      break;
+    case FULLSCREEN_MAXIMIZED:
+      lval = Qmaximized;
+      break;
+    }
+
+  store_frame_param (f, Qfullscreen, lval);
+/**   store_frame_param (f, Qsticky, sticky ? Qt : Qnil); **/
+}
+
 /* Handles the XEvent EVENT on display DPYINFO.
 
    *FINISH is X_EVENT_GOTO_OUT if caller should stop reading events.
@@ -5937,6 +6718,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
            *finish = X_EVENT_GOTO_OUT;
             goto done;
           }
+        else if (event->xclient.message_type == dpyinfo->Xatom_Horizontal_Scrollbar)
+          {
+            x_horizontal_scroll_bar_to_input_event (event, &inev.ie);
+           *finish = X_EVENT_GOTO_OUT;
+            goto done;
+          }
 #endif /* USE_TOOLKIT_SCROLL_BARS */
 
        /* XEmbed messages from the embedder (if any).  */
@@ -5979,7 +6766,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
         const XSelectionClearEvent *eventp = &event->xselectionclear;
 
         inev.ie.kind = SELECTION_CLEAR_EVENT;
-        SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
+        SELECTION_EVENT_DPYINFO (&inev.sie) = dpyinfo;
         SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
         SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
       }
@@ -5995,7 +6782,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
        const XSelectionRequestEvent *eventp = &event->xselectionrequest;
 
        inev.ie.kind = SELECTION_REQUEST_EVENT;
-       SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
+       SELECTION_EVENT_DPYINFO (&inev.sie) = dpyinfo;
        SELECTION_EVENT_REQUESTOR (&inev.sie) = eventp->requestor;
        SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
        SELECTION_EVENT_TARGET (&inev.sie) = eventp->target;
@@ -6088,7 +6875,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           goto OTHER;
 #else /* not USE_TOOLKIT_SCROLL_BARS */
           bar = x_window_to_scroll_bar (event->xexpose.display,
-                                        event->xexpose.window);
+                                        event->xexpose.window, 2);
 
           if (bar)
             x_scroll_bar_expose (bar, event);
@@ -6460,7 +7247,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
            for (i = 0, nchars = 0; i < nbytes; i++)
              {
-               if (ASCII_BYTE_P (copy_bufptr[i]))
+               if (ASCII_CHAR_P (copy_bufptr[i]))
                  nchars++;
                STORE_KEYSYM_FOR_DEBUG (copy_bufptr[i]);
              }
@@ -6652,7 +7439,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #ifndef USE_TOOLKIT_SCROLL_BARS
             struct scroll_bar *bar
               = x_window_to_scroll_bar (event->xmotion.display,
-                                        event->xmotion.window);
+                                        event->xmotion.window, 2);
 
             if (bar)
               x_scroll_bar_note_movement (bar, &event->xmotion);
@@ -6685,6 +7472,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #endif
       if (f)
         {
+         x_net_wm_state (f, event->xconfigure.window);
+
 #ifndef USE_X_TOOLKIT
 #ifndef USE_GTK
           int width = FRAME_PIXEL_TO_TEXT_WIDTH (f, event->xconfigure.width);
@@ -6795,7 +7584,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           {
             struct scroll_bar *bar
               = x_window_to_scroll_bar (event->xbutton.display,
-                                        event->xbutton.window);
+                                        event->xbutton.window, 2);
 
 #ifdef USE_TOOLKIT_SCROLL_BARS
             /* Make the "Ctrl-Mouse-2 splits window" work for toolkit
@@ -6815,9 +7604,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
           {
             dpyinfo->grabbed |= (1 << event->xbutton.button);
             dpyinfo->last_mouse_frame = f;
-
-            if (!tool_bar_p)
-              last_tool_bar_item = -1;
+#if ! defined (USE_GTK)
+            if (f && !tool_bar_p)
+              f->last_tool_bar_item = -1;
+#endif /* not USE_GTK */
           }
         else
           dpyinfo->grabbed &= ~(1 << event->xbutton.button);
@@ -6846,7 +7636,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
             && event->xbutton.x >= 0
             && event->xbutton.x < FRAME_PIXEL_WIDTH (f)
             && event->xbutton.y >= 0
-            && event->xbutton.y < f->output_data.x->menubar_height
+            && event->xbutton.y < FRAME_MENUBAR_HEIGHT (f)
             && event->xbutton.same_screen)
           {
            if (!f->output_data.x->saved_menu_event)
@@ -7360,9 +8150,13 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
 
 #ifdef USE_GTK
 
-         if (xg_set_icon (f, xg_default_icon_file)
-             || xg_set_icon_from_xpm_data (f, gnu_xpm_bits))
-           return 0;
+         if (FRAME_DISPLAY_INFO (f)->icon_bitmap_id == -2
+              || xg_set_icon (f, xg_default_icon_file)
+              || xg_set_icon_from_xpm_data (f, gnu_xpm_bits))
+            {
+              FRAME_DISPLAY_INFO (f)->icon_bitmap_id = -2;
+              return 0;
+            }
 
 #elif defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)
 
@@ -7776,10 +8570,10 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
   FRAME_COLUMN_WIDTH (f) = font->average_width;
   FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (font);
 
-  FRAME_TOOL_BAR_HEIGHT (f) = FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
+#ifndef USE_X_TOOLKIT                                                  \
+/**   FRAME_TOOL_BAR_HEIGHT (f) = FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); **/
   FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
-
-  compute_fringe_widths (f, 1);
+#endif
 
   /* Compute character columns occupied by scrollbar.
 
@@ -7855,11 +8649,6 @@ xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data)
 
 #endif /* HAVE_X11R6 */
 
-#ifdef HAVE_X11R6
-/* This isn't prototyped in OSF 5.0 or 5.1a.  */
-extern char *XSetIMValues (XIM, ...);
-#endif
-
 /* Open the connection to the XIM server on display DPYINFO.
    RESOURCE_NAME is the resource name Emacs uses.  */
 
@@ -8094,7 +8883,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
   x_calc_absolute_position (f);
 
   block_input ();
-  x_wm_set_size_hint (f, (long) 0, 0);
+  x_wm_set_size_hint (f, 0, 0);
 
   modified_left = f->left_pos;
   modified_top = f->top_pos;
@@ -8562,7 +9351,7 @@ x_sync_with_move (struct frame *f, int left, int top, int fuzzy)
           if (eabs (current_left - left) <= 10
              && eabs (current_top - top) <= 40)
             return;
-  }
+       }
       else if (current_left == left && current_top == top)
         return;
     }
@@ -8570,7 +9359,7 @@ x_sync_with_move (struct frame *f, int left, int top, int fuzzy)
   /* As a last resort, just wait 0.5 seconds and hope that XGetGeometry
      will then return up-to-date position info. */
 
-  wait_reading_process_output (0, 500000, 0, 0, Qnil, NULL, 0);
+  wait_reading_process_output (0, 500000000, 0, 0, Qnil, NULL, 0);
 }
 
 
@@ -8615,7 +9404,7 @@ x_wait_for_event (struct frame *f, int eventtype)
 }
 
 
-/* Change the size of frame F's X window to COLS/ROWS in the case F
+/* Change the size of frame F's X window to WIDTH/HEIGHT in the case F
    doesn't have a widget.  If CHANGE_GRAVITY is 1, we change to
    top-left-corner window gravity for this size change and subsequent
    size changes.  Otherwise we leave the window gravity unchanged.  */
@@ -8625,23 +9414,39 @@ x_set_window_size_1 (struct frame *f, int change_gravity, int width, int height,
 {
   int pixelwidth, pixelheight;
 
-  check_frame_size (f, &width, &height, pixelwise);
-
-  compute_fringe_widths (f, 0);
-
-  pixelwidth = ((pixelwise
-                ? FRAME_TEXT_TO_PIXEL_WIDTH (f, width)
-                : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width))
-               + FRAME_TOOLBAR_WIDTH (f));
+/**   if (pixelwise) **/
+/**     { **/
+/**       pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); **/
+/**       pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); **/
+/**     } **/
+/**   else **/
+/**     { **/
+/**       pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); **/
+/**       pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); **/
+/**     } **/
+
+/**   FRAME_TOOL_BAR_HEIGHT (f) = FRAME_TOOLBAR_HEIGHT (f); **/
+  pixelwidth = (pixelwise
+               ? FRAME_TEXT_TO_PIXEL_WIDTH (f, width)
+               : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width));
   pixelheight = ((pixelwise
                  ? FRAME_TEXT_TO_PIXEL_HEIGHT (f, height)
-                 : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height))
-                + FRAME_MENUBAR_HEIGHT (f)
-                + FRAME_TOOLBAR_HEIGHT (f));
+                 : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height)));
+
+/**   pixelwidth = ((pixelwise ? width : (width * FRAME_COLUMN_WIDTH (f))) **/
+/**            + FRAME_SCROLL_BAR_AREA_WIDTH (f) **/
+/**            + FRAME_TOTAL_FRINGE_WIDTH (f) **/
+/**            + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/
+
+/**   pixelheight = ((pixelwise ? height : (height * FRAME_LINE_HEIGHT (f))) **/
+/**             + FRAME_TOOLBAR_HEIGHT (f) **/
+/**             + FRAME_SCROLL_BAR_AREA_HEIGHT (f) **/
+/**             + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); **/
+
   if (change_gravity) f->win_gravity = NorthWestGravity;
-  x_wm_set_size_hint (f, (long) 0, 0);
+  x_wm_set_size_hint (f, 0, 0);
   XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
-                pixelwidth, pixelheight);
+                pixelwidth, pixelheight + FRAME_MENUBAR_HEIGHT (f));
 
 
   /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
@@ -8671,7 +9476,7 @@ x_set_window_size_1 (struct frame *f, int change_gravity, int width, int height,
     x_wait_for_event (f, ConfigureNotify);
   else
     {
-      change_frame_size (f, width, height, 0, 1, 0, 1);
+      change_frame_size (f, pixelwidth, pixelheight, 0, 1, 0, 1);
       x_sync (f);
     }
 }
@@ -8687,8 +9492,9 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
 {
   block_input ();
 
-  check_frame_size (f, &width, &height, pixelwise);
-
+  /* The following breaks our calculations.  If it's really needed,
+     think of something else.  */
+#if 0
   if (NILP (tip_frame) || XFRAME (tip_frame) != f)
     {
       int text_width, text_height;
@@ -8711,6 +9517,7 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
 
       change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
     }
+#endif
 
 #ifdef USE_GTK
   if (FRAME_GTK_WIDGET (f))
@@ -8724,9 +9531,7 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
 #else /* not USE_GTK */
 
   x_set_window_size_1 (f, change_gravity, width, height, pixelwise);
-#if !defined USE_X_TOOLKIT
   x_clear_under_internal_border (f);
-#endif
 
 #endif /* not USE_GTK */
 
@@ -8740,35 +9545,14 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
   cancel_mouse_face (f);
 
   unblock_input ();
-}
-\f
-/* Mouse warping.  */
-
-void
-x_set_mouse_position (struct frame *f, int x, int y)
-{
-  int pix_x, pix_y;
-
-  pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2;
-  pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2;
-
-  if (pix_x < 0) pix_x = 0;
-  if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f);
 
-  if (pix_y < 0) pix_y = 0;
-  if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
-
-  block_input ();
-
-  XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f),
-               0, 0, 0, 0, pix_x, pix_y);
-  unblock_input ();
+  do_pending_window_change (0);
 }
 
 /* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F.  */
 
 void
-x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
+frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
 {
   block_input ();
 
@@ -9069,7 +9853,7 @@ x_make_frame_invisible (struct frame *f)
      program-specified, so that when the window is mapped again, it will be
      placed at the same location, without forcing the user to position it
      by hand again (they have already done that once for this window.)  */
-  x_wm_set_size_hint (f, (long) 0, 1);
+  x_wm_set_size_hint (f, 0, 1);
 
 #ifdef USE_GTK
   if (FRAME_GTK_OUTER_WIDGET (f))
@@ -9239,6 +10023,11 @@ x_free_frame_resources (struct frame *f)
      commands to the X server.  */
   if (dpyinfo->display)
     {
+      /* Always exit with visible pointer to avoid weird issue
+        with Xfixes (Bug#17609).  */
+      if (f->pointer_invisible)
+       FRAME_DISPLAY_INFO (f)->toggle_visible_pointer (f, 0);
+
       /* We must free faces before destroying windows because some
         font-driver (e.g. xft) access a window while finishing a
         face.  */
@@ -9276,6 +10065,9 @@ x_free_frame_resources (struct frame *f)
        XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
 
       free_frame_menubar (f);
+
+      if (f->shell_position)
+       xfree (f->shell_position);
 #else  /* !USE_X_TOOLKIT */
 
 #ifdef USE_GTK
@@ -9297,13 +10089,13 @@ x_free_frame_resources (struct frame *f)
        unload_color (f, f->output_data.x->scroll_bar_background_pixel);
       if (f->output_data.x->scroll_bar_foreground_pixel != -1)
        unload_color (f, f->output_data.x->scroll_bar_foreground_pixel);
-#ifdef USE_TOOLKIT_SCROLL_BARS
+#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS)
       /* Scrollbar shadow colors.  */
       if (f->output_data.x->scroll_bar_top_shadow_pixel != -1)
        unload_color (f, f->output_data.x->scroll_bar_top_shadow_pixel);
       if (f->output_data.x->scroll_bar_bottom_shadow_pixel != -1)
        unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel);
-#endif /* USE_TOOLKIT_SCROLL_BARS */
+#endif /* USE_LUCID && USE_TOOLKIT_SCROLL_BARS */
       if (f->output_data.x->white_relief.pixel != -1)
        unload_color (f, f->output_data.x->white_relief.pixel);
       if (f->output_data.x->black_relief.pixel != -1)
@@ -9391,6 +10183,9 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
   XSizeHints size_hints;
   Window window = FRAME_OUTER_WINDOW (f);
 
+  if (!window)
+    return;
+
 #ifdef USE_X_TOOLKIT
   if (f->output_data.x->widget)
     {
@@ -9424,8 +10219,6 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
     base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
     base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
 
-    check_frame_size (f, &min_cols, &min_rows, 0);
-
     if (frame_resize_pixelwise)
       /* Needed to prevent a bad protocol error crash when making the
         frame size very small.  */
@@ -9722,6 +10515,96 @@ my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
 }
 #endif
 
+/* Create invisible cursor on X display referred by DPYINFO.  */
+
+static Cursor
+make_invisible_cursor (struct x_display_info *dpyinfo)
+{
+  Display *dpy = dpyinfo->display;
+  static char const no_data[] = { 0 };
+  Pixmap pix;
+  XColor col;
+  Cursor c = 0;
+
+  x_catch_errors (dpy);
+  pix = XCreateBitmapFromData (dpy, dpyinfo->root_window, no_data, 1, 1);
+  if (! x_had_errors_p (dpy) && pix != None)
+    {
+      Cursor pixc;
+      col.pixel = 0;
+      col.red = col.green = col.blue = 0;
+      col.flags = DoRed | DoGreen | DoBlue;
+      pixc = XCreatePixmapCursor (dpy, pix, pix, &col, &col, 0, 0);
+      if (! x_had_errors_p (dpy) && pixc != None)
+        c = pixc;
+      XFreePixmap (dpy, pix);
+    }
+
+  x_uncatch_errors ();
+
+  return c;
+}
+
+/* True if DPY supports Xfixes extension >= 4.  */
+
+static bool
+x_probe_xfixes_extension (Display *dpy)
+{
+#ifdef HAVE_XFIXES
+  int major, minor;
+  return XFixesQueryVersion (dpy, &major, &minor) && major >= 4;
+#else
+  return false;
+#endif /* HAVE_XFIXES */
+}
+
+/* Toggle mouse pointer visibility on frame F by using Xfixes functions.  */
+
+static void
+xfixes_toggle_visible_pointer (struct frame *f, bool invisible)
+{
+#ifdef HAVE_XFIXES
+  if (invisible)
+    XFixesHideCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
+  else
+    XFixesShowCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
+  f->pointer_invisible = invisible;
+#else
+  emacs_abort ();
+#endif /* HAVE_XFIXES */
+}
+
+/* Toggle mouse pointer visibility on frame F by using invisible cursor.  */
+
+static void
+x_toggle_visible_pointer (struct frame *f, bool invisible)
+{
+  eassert (FRAME_DISPLAY_INFO (f)->invisible_cursor != 0);
+  if (invisible)
+    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                  FRAME_DISPLAY_INFO (f)->invisible_cursor);
+  else
+    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                  f->output_data.x->current_cursor);
+  f->pointer_invisible = invisible;
+}
+
+/* Setup pointer blanking, prefer Xfixes if available.  */
+
+static void
+x_setup_pointer_blanking (struct x_display_info *dpyinfo)
+{
+  /* FIXME: the brave tester should set EMACS_XFIXES because we're suspecting
+     X server bug, see http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17609.  */
+  if (egetenv ("EMACS_XFIXES") && x_probe_xfixes_extension (dpyinfo->display))
+    dpyinfo->toggle_visible_pointer = xfixes_toggle_visible_pointer;
+  else
+    {
+      dpyinfo->toggle_visible_pointer = x_toggle_visible_pointer;
+      dpyinfo->invisible_cursor = make_invisible_cursor (dpyinfo);
+    }
+}
+
 /* Current X display connection identifier.  Incremented for each next
    connection established.  */
 static unsigned x_display_id;
@@ -9961,6 +10844,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
   dpyinfo->vertical_scroll_bar_cursor
     = XCreateFontCursor (dpyinfo->display, XC_sb_v_double_arrow);
 
+  dpyinfo->horizontal_scroll_bar_cursor
+    = XCreateFontCursor (dpyinfo->display, XC_sb_h_double_arrow);
+
   xrdb = x_load_resources (dpyinfo->display, xrm_option,
                           resource_name, EMACS_CLASS);
 #ifdef HAVE_XRMSETDATABASE
@@ -10015,14 +10901,27 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
 
 #ifdef HAVE_XFT
   {
-    /* If we are using Xft, check dpi value in X resources.
-       It is better we use it as well, since Xft will use it, as will all
-       Gnome applications.  If our real DPI is smaller or larger than the
-       one Xft uses, our font will look smaller or larger than other
-       for other applications, even if it is the same font name (monospace-10
-       for example).  */
-    char *v = XGetDefault (dpyinfo->display, "Xft", "dpi");
+    /* If we are using Xft, the following precautions should be made:
+
+       1. Make sure that the Xrender extension is added before the Xft one.
+       Otherwise, the close-display hook set by Xft is called after the one
+       for Xrender, and the former tries to re-add the latter.  This results
+       in inconsistency of internal states and leads to X protocol error when
+       one reconnects to the same X server (Bug#1696).
+
+       2. Check dpi value in X resources.  It is better we use it as well,
+       since Xft will use it, as will all Gnome applications.  If our real DPI
+       is smaller or larger than the one Xft uses, our font will look smaller
+       or larger than other for other applications, even if it is the same
+       font name (monospace-10 for example).  */
+
+    int event_base, error_base;
+    char *v;
     double d;
+
+    XRenderQueryExtension (dpyinfo->display, &event_base, &error_base);
+
+    v = XGetDefault (dpyinfo->display, "Xft", "dpi");
     if (v != NULL && sscanf (v, "%lf", &d) == 1)
       dpyinfo->resy = dpyinfo->resx = d;
   }
@@ -10083,6 +10982,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
       ATOM_REFS_INIT ("DONE", Xatom_DONE)
       ATOM_REFS_INIT ("PAGE", Xatom_PAGE)
       ATOM_REFS_INIT ("SCROLLBAR", Xatom_Scrollbar)
+      ATOM_REFS_INIT ("HORIZONTAL_SCROLLBAR", Xatom_Horizontal_Scrollbar)
       ATOM_REFS_INIT ("_XEMBED", Xatom_XEMBED)
       /* EWMH */
       ATOM_REFS_INIT ("_NET_WM_STATE", Xatom_net_wm_state)
@@ -10112,7 +11012,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
     };
 
     int i;
-    const int atom_count = sizeof (atom_refs) / sizeof (atom_refs[0]);
+    const int atom_count = ARRAYELTS (atom_refs);
     /* 1 for _XSETTINGS_SN  */
     const int total_atom_count = 1 + atom_count;
     Atom *atoms_return = xmalloc (total_atom_count * sizeof *atoms_return);
@@ -10150,6 +11050,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
                                   gray_bits, gray_width, gray_height,
                                   1, 0, 1);
 
+  x_setup_pointer_blanking (dpyinfo);
+
 #ifdef HAVE_X_I18N
   xim_initialize (dpyinfo, resource_name);
 #endif
@@ -10171,6 +11073,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
 
 #ifdef USE_LUCID
   {
+    XFontStruct *xfont = NULL;
     XrmValue d, fr, to;
     Font font;
 
@@ -10184,8 +11087,10 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
     x_catch_errors (dpy);
     if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL))
       emacs_abort ();
-    if (x_had_errors_p (dpy) || !XQueryFont (dpy, font))
+    if (x_had_errors_p (dpy) || !((xfont = XQueryFont (dpy, font))))
       XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15");
+    if (xfont)
+      XFreeFont (dpy, xfont);
     x_uncatch_errors ();
   }
 #endif
@@ -10351,7 +11256,9 @@ static struct redisplay_interface x_redisplay_interface =
     x_draw_window_cursor,
     x_draw_vertical_window_border,
     x_draw_window_divider,
-    x_shift_glyphs_for_insert
+    x_shift_glyphs_for_insert,
+    x_show_hourglass,
+    x_hide_hourglass
   };
 
 
@@ -10439,9 +11346,8 @@ x_create_terminal (struct x_display_info *dpyinfo)
 {
   struct terminal *terminal;
 
-  terminal = create_terminal ();
+  terminal = create_terminal (output_x_window, &x_redisplay_interface);
 
-  terminal->type = output_x_window;
   terminal->display_info.x = dpyinfo;
   dpyinfo->terminal = terminal;
 
@@ -10452,37 +11358,36 @@ x_create_terminal (struct x_display_info *dpyinfo)
   terminal->delete_glyphs_hook = x_delete_glyphs;
   terminal->ring_bell_hook = XTring_bell;
   terminal->toggle_invisible_pointer_hook = XTtoggle_invisible_pointer;
-  terminal->reset_terminal_modes_hook = NULL;
-  terminal->set_terminal_modes_hook = NULL;
   terminal->update_begin_hook = x_update_begin;
   terminal->update_end_hook = x_update_end;
-  terminal->set_terminal_window_hook = NULL;
   terminal->read_socket_hook = XTread_socket;
   terminal->frame_up_to_date_hook = XTframe_up_to_date;
   terminal->mouse_position_hook = XTmouse_position;
   terminal->frame_rehighlight_hook = XTframe_rehighlight;
   terminal->frame_raise_lower_hook = XTframe_raise_lower;
   terminal->fullscreen_hook = XTfullscreen_hook;
+  terminal->menu_show_hook = x_menu_show;
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
+  terminal->popup_dialog_hook = xw_popup_dialog;
+#endif
   terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
+  terminal->set_horizontal_scroll_bar_hook = XTset_horizontal_scroll_bar;
   terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
   terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
   terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
-
   terminal->delete_frame_hook = x_destroy_window;
   terminal->delete_terminal_hook = x_delete_terminal;
-
-  terminal->rif = &x_redisplay_interface;
+  /* Other hooks are NULL by default.  */
 
   return terminal;
 }
 
-void
+static void
 x_initialize (void)
 {
   baud_rate = 19200;
 
   x_noop_count = 0;
-  last_tool_bar_item = -1;
   any_help_event_p = 0;
   ignore_next_mouse_click_timeout = 0;
 
index 50df88cb592e044699a03c342ce398394d829676..3e92ebd231793d8861cfc26e334918390376b674 100644 (file)
@@ -47,7 +47,6 @@ typedef Widget xt_or_gtk_widget;
 
 /* Some definitions to reduce conditionals.  */
 typedef GtkWidget *xt_or_gtk_widget;
-#define XtParent(x) (gtk_widget_get_parent (x))
 #undef XSync
 #define XSync(d, b) do { gdk_window_process_all_updates (); \
                          XSync (d, b);  } while (false)
@@ -78,6 +77,8 @@ typedef GtkWidget *xt_or_gtk_widget;
 #include "dispextern.h"
 #include "termhooks.h"
 
+INLINE_HEADER_BEGIN
+
 /* Black and white pixel values for the screen which frame F is on.  */
 #define BLACK_PIX_DEFAULT(f)                                   \
   BlackPixel (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))
@@ -174,9 +175,16 @@ struct x_display_info
   /* The cursor to use for vertical scroll bars.  */
   Cursor vertical_scroll_bar_cursor;
 
-  /* The invisible cursor used for pointer blanking.  */
+  /* The cursor to use for horizontal scroll bars.  */
+  Cursor horizontal_scroll_bar_cursor;
+
+  /* The invisible cursor used for pointer blanking.
+     Unused if this display supports Xfixes extension.  */
   Cursor invisible_cursor;
 
+  /* Function used to toggle pointer visibility on this display.  */
+  void (*toggle_visible_pointer) (struct frame *, bool);
+
 #ifdef USE_GTK
   /* The GDK cursor for scroll bars and popup menus.  */
   GdkCursor *xg_cursor;
@@ -274,8 +282,8 @@ struct x_display_info
   /* More atoms for Ghostscript support.  */
   Atom Xatom_DONE, Xatom_PAGE;
 
-  /* Atom used in toolkit scroll bar client messages.  */
-  Atom Xatom_Scrollbar;
+  /* Atoms used in toolkit scroll bar client messages.  */
+  Atom Xatom_Scrollbar, Xatom_Horizontal_Scrollbar;
 
   /* Atom used in XEmbed client messages.  */
   Atom Xatom_XEMBED, Xatom_XEMBED_INFO;
@@ -423,11 +431,11 @@ extern void select_visual (struct x_display_info *);
 
 struct x_output
 {
-  /* Height of menu bar widget, in pixels.
-     Zero if not using the X toolkit.
-     When using the toolkit, this value is not meaningful
-     if the menubar is turned off.  */
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK)  
+  /* Height of menu bar widget, in pixels.  This value
+     is not meaningful if the menubar is turned off.  */
   int menubar_height;
+#endif
 
   /* Height of tool bar widget, in pixels.  top_height is used if tool bar
      at top, bottom_height if tool bar is at the bottom.
@@ -536,10 +544,12 @@ struct x_output
      bars).  */
   unsigned long scroll_bar_background_pixel;
 
-  /* Top and bottom shadow colors for 3d toolkit scrollbars.  -1 means
-     let the scroll compute them itself.  */
+#if defined (USE_LUCID) && defined (USE_TOOLKIT_SCROLL_BARS)
+  /* Top and bottom shadow colors for 3D Lucid scrollbars.
+     -1 means let the scroll compute them itself.  */
   unsigned long scroll_bar_top_shadow_pixel;
   unsigned long scroll_bar_bottom_shadow_pixel;
+#endif
 
   /* Descriptor for the cursor in use for this window.  */
   Cursor text_cursor;
@@ -709,10 +719,14 @@ enum
 #endif /* !USE_GTK */
 #endif
 
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
+#define FRAME_MENUBAR_HEIGHT(f) ((f)->output_data.x->menubar_height)
+#else
+#define FRAME_MENUBAR_HEIGHT(f) ((void) f, 0)
+#endif /* USE_X_TOOLKIT || USE_GTK */
 
 #define FRAME_FONT(f) ((f)->output_data.x->font)
 #define FRAME_FONTSET(f) ((f)->output_data.x->fontset)
-#define FRAME_MENUBAR_HEIGHT(f) ((f)->output_data.x->menubar_height)
 #define FRAME_TOOLBAR_TOP_HEIGHT(f) ((f)->output_data.x->toolbar_top_height)
 #define FRAME_TOOLBAR_BOTTOM_HEIGHT(f) \
   ((f)->output_data.x->toolbar_bottom_height)
@@ -811,6 +825,14 @@ struct scroll_bar
   /* Last scroll bar part seen in xaw_jump_callback and xaw_scroll_callback.  */
   enum scroll_bar_part last_seen_part;
 #endif
+
+#if defined (USE_TOOLKIT_SCROLL_BARS) && !defined (USE_GTK)
+  /* Last value of whole for horizontal scrollbars.  */
+  int whole;
+#endif
+
+  /* 1 if the scroll bar is horizontal.  */
+  bool horizontal;
 };
 
 /* Turning a lisp vector value into a pointer to a struct scroll_bar.  */
@@ -857,6 +879,28 @@ struct scroll_bar
 #define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(f, height) \
   ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER)
 
+/* Return the inside height of a horizontal scroll bar, given the outside
+   height.  */
+#define HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT(f, height) \
+  ((height) \
+   - HORIZONTAL_SCROLL_BAR_TOP_BORDER \
+   - HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
+
+/* Return the length of the rectangle within which the left part of the
+   handle must stay.  This isn't equivalent to the inside width, because
+   the scroll bar handle has a minimum width.
+
+   This is the real range of motion for the scroll bar, so when we're
+   scaling buffer positions to scroll bar positions, we use this, not
+   HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH.  */
+#define HORIZONTAL_SCROLL_BAR_LEFT_RANGE(f, width) \
+  (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH (f, width) - HORIZONTAL_SCROLL_BAR_MIN_HANDLE)
+
+/* Return the inside width of horizontal scroll bar, given the outside
+   width.  See HORIZONTAL_SCROLL_BAR_LEFT_RANGE too.  */
+#define HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH(f, width) \
+  ((width) - HORIZONTAL_SCROLL_BAR_LEFT_BORDER - HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
+
 
 /* Border widths for scroll bars.
 
@@ -874,8 +918,14 @@ struct scroll_bar
 #define VERTICAL_SCROLL_BAR_TOP_BORDER (2)
 #define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (2)
 
+#define HORIZONTAL_SCROLL_BAR_LEFT_BORDER (2)
+#define HORIZONTAL_SCROLL_BAR_RIGHT_BORDER (2)
+#define HORIZONTAL_SCROLL_BAR_TOP_BORDER (2)
+#define HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER (2)
+
 /* Minimum lengths for scroll bar handles, in pixels.  */
 #define VERTICAL_SCROLL_BAR_MIN_HANDLE (5)
+#define HORIZONTAL_SCROLL_BAR_MIN_HANDLE (5)
 
 /* If a struct input_event has a kind which is SELECTION_REQUEST_EVENT
    or SELECTION_CLEAR_EVENT, then its contents are really described
@@ -887,15 +937,21 @@ struct scroll_bar
 struct selection_input_event
 {
   int kind;
-  Display *display;
+  struct x_display_info *dpyinfo;
   /* We spell it with an "o" here because X does.  */
   Window requestor;
   Atom selection, target, property;
   Time time;
 };
 
-#define SELECTION_EVENT_DISPLAY(eventp)        \
-  (((struct selection_input_event *) (eventp))->display)
+/* Unlike macros below, this can't be used as an lvalue.  */
+INLINE Display *
+SELECTION_EVENT_DISPLAY (struct input_event *ev)
+{
+  return ((struct selection_input_event *) ev)->dpyinfo->display;
+}
+#define SELECTION_EVENT_DPYINFO(eventp) \
+  (((struct selection_input_event *) (eventp))->dpyinfo)
 /* We spell it with an "o" here because X does.  */
 #define SELECTION_EVENT_REQUESTOR(eventp)      \
   (((struct selection_input_event *) (eventp))->requestor)
@@ -911,6 +967,7 @@ struct selection_input_event
 /* From xfns.c.  */
 
 extern void x_free_gcs (struct frame *);
+extern void x_relative_mouse_position (struct frame *, int *, int *);
 
 /* From xrdb.c.  */
 
@@ -926,9 +983,6 @@ extern void x_check_errors (Display *, const char *)
 extern bool x_had_errors_p (Display *);
 extern void x_uncatch_errors (void);
 extern void x_clear_errors (Display *);
-extern void x_set_window_size (struct frame *, int, int, int, bool);
-extern void x_set_mouse_position (struct frame *, int, int);
-extern void x_set_mouse_pixel_position (struct frame *, int, int);
 extern void xembed_request_focus (struct frame *);
 extern void x_ewmh_activate_frame (struct frame *);
 extern void x_delete_terminal (struct terminal *terminal);
@@ -943,7 +997,6 @@ extern bool x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
                                              double, int);
 #endif
 extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
-extern void x_query_color (struct frame *f, XColor *);
 extern void x_clear_area (Display *, Window, int, int, int, int);
 #if !defined USE_X_TOOLKIT && !defined USE_GTK
 extern void x_mouse_leave (struct x_display_info *);
@@ -953,11 +1006,22 @@ extern void x_mouse_leave (struct x_display_info *);
 extern int x_dispatch_event (XEvent *, Display *);
 #endif
 extern int x_x_to_emacs_modifiers (struct x_display_info *, int);
-extern int x_display_pixel_height (struct x_display_info *);
-extern int x_display_pixel_width (struct x_display_info *);
+
+INLINE int
+x_display_pixel_height (struct x_display_info *dpyinfo)
+{
+  return HeightOfScreen (dpyinfo->screen);
+}
+
+INLINE int
+x_display_pixel_width (struct x_display_info *dpyinfo)
+{
+  return WidthOfScreen (dpyinfo->screen);
+}
 
 extern void x_set_sticky (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_wait_for_event (struct frame *, int);
+extern void x_clear_under_internal_border (struct frame *f);
 
 /* Defined in xselect.c.  */
 
@@ -990,16 +1054,11 @@ extern Lisp_Object x_property_data_to_lisp (struct frame *,
 extern void x_clipboard_manager_save_frame (Lisp_Object);
 extern void x_clipboard_manager_save_all (void);
 
-/* Defined in xfns.c */
-
-extern Lisp_Object x_get_focus_frame (struct frame *);
-
 #ifdef USE_GTK
 extern int xg_set_icon (struct frame *, Lisp_Object);
-extern int xg_set_icon_from_xpm_data (struct frame *, const char**);
+extern int xg_set_icon_from_xpm_data (struct frame *, const char **);
 #endif /* USE_GTK */
 
-extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
 extern void xic_free_xfontset (struct frame *);
 extern void create_frame_xic (struct frame *);
 extern void destroy_frame_xic (struct frame *);
@@ -1030,18 +1089,9 @@ extern Lisp_Object xw_popup_dialog (struct frame *, Lisp_Object, Lisp_Object);
 #if defined USE_GTK || defined USE_MOTIF
 extern void x_menu_set_in_use (int);
 #endif
-#ifdef USE_MOTIF
 extern void x_menu_wait_for_event (void *data);
-#endif
-extern int popup_activated (void);
 extern void initialize_frame_menubar (struct frame *);
 
-/* Defined in widget.c */
-
-#ifdef USE_X_TOOLKIT
-extern void widget_store_internal_border (Widget);
-#endif
-
 /* Defined in xsmfns.c */
 #ifdef HAVE_X_SM
 extern void x_session_initialize (struct x_display_info *dpyinfo);
@@ -1053,10 +1103,6 @@ extern void x_session_close (void);
 
 extern Lisp_Object Qx_gtk_map_stock;
 
-#if !defined USE_X_TOOLKIT && !defined USE_GTK
-extern void x_clear_under_internal_border (struct frame *f);
-#endif
-
 /* Is the frame embedded into another application? */
 
 #define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0)
@@ -1076,4 +1122,6 @@ extern void x_clear_under_internal_border (struct frame *f);
    (nr).width = (rwidth),                              \
    (nr).height = (rheight))
 
+INLINE_HEADER_END
+
 #endif /* XTERM_H */
index 451fa91548f42328fbdf3091e3237f8d0f4c2f1f..4e47f95b066c41ab984851c4f1da7a05b6877a8a 100644 (file)
@@ -1,10 +1,22 @@
-2014-07-20  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+2014-07-30  Ulf Jasper  <ulf.jasper@web.de>
+
+       * automated/icalendar-tests.el (icalendar--decode-isodatetime): New test.
+
+2014-07-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * automated/timer-tests.el (timer-tests-debug-timer-check): New test.
+
+2014-07-26  Ulf Jasper  <ulf.jasper@web.de>
+
+       * automated/icalendar-tests.el (icalendar-tests--do-test-import):
+       Work around the failures in icalendar-tests which occasionally occur on
+       hydra.nixos.org.
+
+2014-07-21  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        * automated/python-tests.el:
        (python-util-clone-local-variables-1): Fix test.
 
-2014-07-17  Fabián Ezequiel Gallina  <fgallina@gnu.org>
-
        * automated/python-tests.el (python-shell-make-comint-1):
        (python-shell-make-comint-2): Fix indentation.
        (python-shell-make-comint-3)
        (python-shell-prompt-set-calculated-regexps-6)
        (python-util-valid-regexp-p-1): New tests.
 
-2014-07-09  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+2014-07-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * automated/python-tests.el
-       (python-indent-block-enders-1)
+       * automated/advice-tests.el (advice-test-call-interactively): Make sure
+       the function's definition is fully restored at the end.
+
+2014-07-12  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * automated/python-tests.el (python-indent-block-enders-1)
        (python-indent-block-enders-2): Fix tests.
-       (python-indent-block-enders-3)
-       (python-indent-block-enders-4)
-       (python-indent-block-enders-5)
-       (python-indent-dedenters-1)
+       (python-indent-block-enders-3, python-indent-block-enders-4)
+       (python-indent-block-enders-5, python-indent-dedenters-1)
        (python-indent-dedenters-2): Remove tests.
-       (python-indent-dedenters-1)
-       (python-indent-dedenters-2)
-       (python-indent-dedenters-3)
-       (python-indent-dedenters-4)
-       (python-indent-dedenters-5)
-       (python-indent-dedenters-6)
+       (python-indent-dedenters-1, python-indent-dedenters-2)
+       (python-indent-dedenters-3, python-indent-dedenters-4)
+       (python-indent-dedenters-5, python-indent-dedenters-6)
        (python-indent-dedenters-7)
        (python-info-dedenter-opening-block-position-1)
        (python-info-dedenter-opening-block-position-2)
        (python-info-dedenter-statement-p-4)
        (python-info-dedenter-statement-p-5): New tests.
 
-2014-07-01  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+2014-07-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-       * automated/python-tests.el
-       (python-tests-self-insert): New function.
+       * indent/perl.perl: Add indentation pattern for hash-table entries.
+
+2014-07-04  Michael Albinus  <michael.albinus@gmx.de>
+
+       * automated/dbus-tests.el (dbus-test02-register-service-session)
+       (dbus-test02-register-service-system): Fix docstring.
+       (dbus-test02-register-service-own-bus)
+       (dbus-test03-peer-interface): New tests.
+
+2014-07-03  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * automated/python-tests.el (python-tests-self-insert): New function.
        (python-triple-quote-pairing): Use it.
        (python-parens-electric-indent-1): New test. (Bug#17658)
 
+2014-06-30  Fabián Ezequiel Gallina  <fgallina@gnu.org>
+
+       * automated/subr-x-tests.el: New file.
+
+2014-06-29  Michael Albinus  <michael.albinus@gmx.de>
+
+       * automated/tramp-tests.el (tramp--instrument-test-case):
+       Print debug buffer in any case.
+
 2014-06-28  Leo Liu  <sdl.web@gmail.com>
 
        * automated/calc-tests.el: New file and add tests for math-bignum.
        (Bug#17556)
 
-2014-06-27  Michael Albinus  <michael.albinus@gmx.de>
+2014-06-28  Michael Albinus  <michael.albinus@gmx.de>
 
        * automated/dbus-tests.el (dbus--test-register-service)
        (dbus-test02-register-service-session): Replace `dbus-ping' calls
        by `dbus-list-known-names'.  (Bug#17858)
 
-2014-06-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+2014-06-28  Glenn Morris  <rgm@gnu.org>
+
+       * automated/Makefile.in (GDB): New variable.
+       (emacs): Use $GDB.  (Bug#15991)
+
+       * automated/Makefile.in (WRITE_LOG): New variable.
+       (%.log): Use WRITE_LOG.
+       (test_template): Disable logging.
+
+       * automated/Makefile.in (TESTS): New list of short PHONY aliases.
+       (test_template): New definition.  Apply to TESTS.
+
+2014-06-27  Glenn Morris  <rgm@gnu.org>
+
+       * automated/Makefile.in (check-maybe): Rename from check.
+       (check): Re-run all the tests, every time.
+       (clean, mostlyclean): Also delete *.log~.
+
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * automated/package-x-test.el: Do not mess with load-path.
+
+       * automated/Makefile.in (%.log): If error, dump log to stdout.
+
+2014-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * automated/package-test.el (package-test-update-listing)
        (package-test-update-archives, package-test-describe-package):
        Adjust tests according to new package-list-unsigned.
 
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * automated/ert-tests.el (no-byte-compile): Set it.  (Bug#17851)
+
+       * automated/eieio-tests.el (no-byte-compile): Set it.  (Bug#17852)
+
+       * automated/Makefile.in: Simplify and parallelize.  (Bug#15991)
+       (XARGS_LIMIT, BYTE_COMPILE_EXTRA_FLAGS)
+       (setwins, compile-targets, compile-main, compile-clean): Remove.
+       (GREP_OPTIONS): Unexport.
+       (.el.elc): Replace with pattern rule.
+       (%.elc, %.log): New pattern rules.
+       (ELFILES, LOGFILES): New variables.
+       (check): Depend on LOGFILES.  Call ert-summarize-tests-batch-and-exit.
+       (clean, mostlyclean): New rules.
+       (bootstrap-clean): Simplify.
+       (bootstrap-clean, distclean): Depend on clean.
+
+2014-06-25  Glenn Morris  <rgm@gnu.org>
+
+       * automated/flymake-tests.el (flymake-tests--current-face):
+       Sleep for longer.  Avoid querying.
+
+2014-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * automated/fns-tests.el (fns-tests-compare-string): New test.
+
+2014-06-24  Michael Albinus  <michael.albinus@gmx.de>
+
+       * automated/tramp-tests.el (tramp-test26-process-file): Extend test
+       according to Bug#17815.
+
 2014-06-21  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        * automated/python-tests.el (python-util-strip-string-1): New test.
 
+2014-06-15  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.2.10.
+
+       * automated/tramp-tests.el (tramp--test-enabled): Ignore errors.
+       (tramp--instrument-test-case): Extend docstring.
+       (tramp-test15-copy-directory): Skip for tramp-smb.el.
+       (tramp-test21-file-links): Use `file-truename' for directories.
+       (tramp-test27-start-file-process, tramp-test28-shell-command):
+       Retrieve process output more robustly.
+       (tramp--test-check-files): Extend test.
+       (tramp-test30-special-characters): Skip for tramp-adb.el,
+       tramp-gvfs.el and tramp-smb.el.  Add further file names.
+
+2014-06-13  Glenn Morris  <rgm@gnu.org>
+
+       * automated/Makefile.in (compile-main):
+       GNU make automatically passes command-line arguments to sub-makes.
+
+2014-06-05  Michal Nazarewicz  <mina86@mina86.com>
+
+       * automated/tildify-tests.el (tildify-test--test): Optimise the test
+       slightly by reusing the same temporary buffer across multiple test
+       cases.
+
+       * automated/tildify-tests.el (tildify-test-find-env-end-re-bug)
+       (tildify-test-find-env-group-index-bug): Update to support new
+       signature of the `tildify-foreach-region-outside-env' function.
+       Namely, it now takes pairs as an argument instead of looking it up in
+       `tildify-ignored-environments-alist'.
+
+       * automated/tildify-tests.el (tildify-test--example-html): Add support
+       for generating XML code, so that…
+       (tildify-test-xml) …test can be added to check handling of XML
+       documents.
+
+       * automated/tildify-tests.el (tildify-test-find-env-group-index-bug):
+       New test checking end-regex building when multiple environment pairs
+       use integers to refer to capture groups.
+
+       * automated/tildify-tests.el (tildify-test-find-env-end-re-bug): New
+       test checking end-regex building in `tildify-find-env' function when
+       integers (denoting capture groups) and strings are mixed together.
+
+2014-06-02  Michael Albinus  <michael.albinus@gmx.de>
+
+       * automated/tramp-tests.el (tramp-remote-process-environment): Declare.
+       (tramp-test29-vc-registered): Set $BZR_HOME.  Remove instrumentation.
+
+2014-06-01  Michael Albinus  <michael.albinus@gmx.de>
+
+       * automated/tramp-tests.el (tramp-test29-vc-registered):
+       Instrument failed test case.
+
+2014-05-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure.
+       (ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
+
+2014-05-21  Michal Nazarewicz  <mina86@mina86.com>
+
+       * automated/tildify-tests.el: New file.
+
+2014-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * indent/ruby.rb: Add one more test.
+
+       * indent/ps-mode.ps: New file.
+
+       * indent/octave.m: Add a few more tests.
+
+       * automated/core-elisp-tests.el
+       (core-elisp-test-window-configurations): New test.
+
+2014-05-26  Glenn Morris  <rgm@gnu.org>
+
+       * automated/package-test.el (package-test-install-single):
+       Update for changed output.
+
+2014-05-22  Glenn Morris  <rgm@gnu.org>
+
+       * automated/bytecomp-tests.el (test-byte-comp-compile-and-load):
+       Fix handling of temporary elc files.
+
+       * automated/fns-tests.el (fns-tests-nreverse):
+       Update for changed string behavior.
+
+2014-05-15  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * automated/fns-tests.el: New file.
+       * automated/fns-tests.el (fns-tests-nreverse)
+       (fns-tests-nreverse-bool-vector): New tests.
+
 2014-05-08  Glenn Morris  <rgm@gnu.org>
 
        * automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781)
        (vc-bzr-test-faulty-bzr-autoloads):
        Give bzr a temporary home-directory, in case the real one is missing.
 
-2014-05-05  Dmitry Gutov  <dgutov@yandex.ru>
+2014-05-08  Dmitry Gutov  <dgutov@yandex.ru>
 
-       * automated/ruby-mode-tests.el
-       (ruby-interpolation-after-dollar-sign): New test.
+       * automated/ruby-mode-tests.el (ruby-interpolation-after-dollar-sign):
+       New test.
 
-2014-05-05  Glenn Morris  <rgm@gnu.org>
+2014-05-08  Glenn Morris  <rgm@gnu.org>
 
        * automated/help-fns.el: New file.
 
+2014-05-01  Barry O'Reilly  <gundaetiapo@gmail.com>
+
+       * automated/undo-tests.el (undo-test-region-deletion): New test to
+       demonstrate bug#17235.
+       (undo-test-region-example): New test to verify example given in
+       comments for undo-make-selective-list.
+
 2014-04-25  Michael Albinus  <michael.albinus@gmx.de>
 
        * automated/tramp-tests.el (top):
        passwords in batch mode.
        (password-cache-expiry): Set to nil.
 
-2014-04-24  Michael Albinus  <michael.albinus@gmx.de>
-
        * automated/file-notify-tests.el
        (file-notify-test-remote-temporary-file-directory):
        * automated/tramp-tests.el (tramp-test-temporary-file-directory):
        only if there is a usable timestamp.
        (tramp--test-check-files): Do not use `copy-sequence'.
 
+2014-04-22  Daniel Colascione  <dancol@dancol.org>
+
+       * automated/bytecomp-tests.el (test-byte-comp-compile-and-load):
+       Add compile flag.
+       (test-byte-comp-macro-expansion)
+       (test-byte-comp-macro-expansion-eval-and-compile)
+       (test-byte-comp-macro-expansion-eval-when-compile)
+       (test-byte-comp-macro-expand-lexical-override): Use it.
+       (test-eager-load-macro-expansion)
+       (test-eager-load-macro-expansion-eval-and-compile)
+       (test-eager-load-macro-expansion-eval-when-compile)
+       (test-eager-load-macro-expand-lexical-override): New tests.
+
+       * automated/cl-lib.el (cl-lib-struct-accessors): Fix test to
+       account for removal of `cl-struct-set-slot-value'. Also, move
+       the defstruct to top level.
+
+2014-04-21  Daniel Colascione  <dancol@dancol.org>
+
+       * automated/bytecomp-tests.el (test-byte-comp-compile-and-load):
+       New function.
+       (test-byte-comp-macro-expansion)
+       (test-byte-comp-macro-expansion-eval-and-compile)
+       (test-byte-comp-macro-expansion-eval-when-compile)
+       (test-byte-comp-macro-expand-lexical-override): New tests.
+
+       * automated/cl-lib.el (cl-loop-destructuring-with): New test.
+       (cl-the): Fix cl-the test.
+
+2014-04-20  Daniel Colascione  <dancol@dancol.org>
+
+       * automated/cl-lib.el (cl-lib-struct-accessors,cl-the): New tests.
+
 2014-04-19  Michael Albinus  <michael.albinus@gmx.de>
 
        * automated/tramp-tests.el (tramp--test-check-files): Extend test.
        (tramp-test34-unload): New tests.
        (tramp-test31-utf8, tramp-test32-asynchronous-requests):  Rename.
 
-2014-04-10  Paul Eggert  <eggert@cs.ucla.edu>
+2014-04-11  Glenn Morris  <rgm@gnu.org>
+
+       * automated/Makefile.in (EMACSDATA, EMACSDOC, EMACSPATH): Unexport.
+
+2014-04-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        * automated/electric-tests.el: Fix spelling error in test name.
        (whitespace-skipping-for-quotes-not-outside):
        Rename from whitespace-skipping-for-quotes-not-ouside.
 
+2014-04-09  Daniel Colascione  <dancol@dancol.org>
+
+       * automated/syntax-tests.el: New file.
+
 2014-04-09  Glenn Morris  <rgm@gnu.org>
 
        * automated/python-tests.el (python-triple-quote-pairing):
 
 2014-04-07  João Távora  <joaotavora@gmail.com>
 
-       * automated/electric-tests.el (define-electric-pair-test):
-       Don't overtest.
-       (inhibit-in-mismatched-string-inside-ruby-comments): New test.
-       (inhibit-in-mismatched-string-inside-c-comments): New test.
-
-       * automated/electric-tests.el (inhibit-if-strings-mismatched):
-       New test, change from `inhibit-only-of-next-is-mismatched'.
-
-2014-04-06  João Távora  <joaotavora@gmail.com>
-
        * automated/python-tests.el (python-triple-quote-pairing): New test.
        (python-syntax-after-python-backspace): New test.
 
        (whitespace-skipping-for-quotes-only-inside)
        (whitespace-skipping-quotes-not-without-proper-syntax): New tests.
 
-2014-03-24  Barry O'Reilly  <gundaetiapo@gmail.com>
+2014-04-04  João Távora  <joaotavora@gmail.com>
+
+       * automated/electric-tests.el (define-electric-pair-test):
+       Don't overtest.
+       (inhibit-in-mismatched-string-inside-ruby-comments): New test.
+       (inhibit-in-mismatched-string-inside-c-comments): New test.
+
+2014-04-02  João Távora  <joaotavora@gmail.com>
+
+       * automated/electric-tests.el (inhibit-if-strings-mismatched):
+       New test, change from `inhibit-only-of-next-is-mismatched'.
+
+2014-03-26  Barry O'Reilly  <gundaetiapo@gmail.com>
 
        * automated/undo-tests.el (undo-test-marker-adjustment-nominal):
        (undo-test-region-t-marker): New tests of marker adjustments.
        (undo-test-region-mark-adjustment): New tests to demonstrate
        bug#16818, which fail without the fix.
 
-2014-03-23  Daniel Colascione  <dancol@dancol.org>
-
-       * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New
-       test: correct parsing of keyword arguments.
-
 2014-03-23  Dmitry Gutov  <dgutov@yandex.ru>
 
        * automated/package-test.el (package-test-describe-package):
        Fix test failure in non-graphical mode.
 
+2014-03-23  Daniel Colascione  <dancol@dancol.org>
+
+       * automated/subword-tests.el (subword-tests2): More subword tests.
+
+       * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New
+       test: correct parsing of keyword arguments.
+
 2014-03-22  Dmitry Gutov  <dgutov@yandex.ru>
 
        * automated/package-test.el (package-test-describe-package):
index 764b80ece93136c8d0e0c055896d44b6c333d185..e0eaffa4c2c09284cb5c926956e761be5e8db55e 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
+### Commentary:
+
+## Some targets:
+## check: re-run all tests, writing to .log files.
+## check-maybe: run all tests whose .log file needs updating
+## filename.log: run tests from filename.el(c) if .log file needs updating
+## filename: re-run tests from filename.el(c), with no logging
+
+### Code:
+
 SHELL = @SHELL@
 
 srcdir = @srcdir@
@@ -24,10 +34,6 @@ VPATH = $(srcdir)
 
 SEPCHAR = @SEPCHAR@
 
-# Empty for all systems except MinGW, where xargs needs an explicit
-# limitation.
-XARGS_LIMIT = @XARGS_LIMIT@
-
 # We never change directory before running Emacs, so a relative file
 # name is fine, and makes life easier.  If we need to change
 # directory, we can use emacs --chdir.
@@ -38,84 +44,94 @@ EMACS = ../../src/emacs
 # but we might as well be explicit.
 EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)"
 
-# Extra flags to pass to the byte compiler.
-BYTE_COMPILE_EXTRA_FLAGS =
+# Prevent any settings in the user environment causing problems.
+unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
+
+## To run tests under a debugger, set this to eg: "gdb --args".
+GDB =
 
 # The actual Emacs command run in the targets below.
 # Prevent any setting of EMACSLOADPATH in user environment causing problems.
-emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
-
-# Common command to find subdirectories
-setwins=for file in `find $(srcdir) -type d -print`; do \
-          case $$file in $(srcdir)*/data* | $(srcdir)*/flymake* ) ;; \
-               *) wins="$$wins$${wins:+ }$$file" ;; \
-          esac; \
-        done
+emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) $(GDB) "$(EMACS)" $(EMACSOPT)
 
 .PHONY: all check
 
 all: check
 
-# The compilation stuff is copied from lisp/Makefile - see comments there.
-
-.SUFFIXES: .elc .el
-
-.el.elc:
+%.elc: %.el
        @echo Compiling $<
-       @$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
-
-
-.PHONY: compile-targets compile-main compile-clean
-
-# TARGETS is set dynamically in the recursive call from `compile-main'.
-compile-targets: $(TARGETS)
-
-# Compile all the Elisp files that need it.  Beware: it approximates
-# `no-byte-compile', so watch out for false-positives!
-compile-main: compile-clean
-       @$(setwins); \
-       els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
-       for el in $$els; do \
-         test -f $$el || continue; \
-         test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
-         echo "$${el}c"; \
-       done | xargs $(XARGS_LIMIT) echo | \
-       while read chunk; do \
-         $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
-       done
-
-# Erase left-over .elc files that do not have a corresponding .el file.
-compile-clean:
-       @$(setwins); \
-       elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \
-       for el in $$(echo $$elcs | sed -e 's/\.elc/\.el/g'); do \
-         if test -f "$$el" -o \! -f "$${el}c"; then :; else \
-           echo rm "$${el}c"; \
-           rm "$${el}c"; \
-         fi \
-       done
-
-
-.PHONY: bootstrap-clean distclean maintainer-clean
-
-bootstrap-clean:
-       -cd $(srcdir) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
-
-distclean:
+       @$(emacs) -f batch-byte-compile $<
+
+## Ignore any test errors so we can continue to test other files.
+## But compilation errors are always fatal.
+WRITE_LOG = >& $@ || { stat=ERROR; cat $@; }; echo $$stat: $@
+
+## I'd prefer to use -emacs -f ert-run-tests-batch-and-exit rather
+## than || true, since the former makes problems more obvious.
+## I'd also prefer to @-hide the grep part and not the
+## ert-run-tests-batch-and-exit part.
+##
+## We need to use $loadfile because:
+## i) -L :$srcdir -l basename does not work, because we have files whose
+## basename duplicates a file in lisp/ (eg eshell.el).
+## ii) Although -l basename will automatically load .el or .elc,
+## -l ./basename treats basename as a literal file (it would be nice
+## to change this; bug#17848 - if that gets done, this can be simplified).
+##
+## Beware: it approximates `no-byte-compile', so watch out for false-positives!
+%.log: ${srcdir}/%.el
+       @if grep '^;.*no-byte-compile: t' $< > /dev/null; then \
+         loadfile=$<; \
+       else \
+         loadfile=$<c; \
+         ${MAKE} $$loadfile; \
+       fi; \
+       echo Testing $$loadfile; \
+       stat=OK ; \
+       $(emacs) -l ert -l $$loadfile \
+         -f ert-run-tests-batch-and-exit ${WRITE_LOG}
+
+ELFILES = $(wildcard ${srcdir}/*.el)
+LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
+TESTS = ${LOGFILES:.log=}
+
+## If we have to interrupt a hanging test, preserve the log so we can
+## see what the problem was.
+.PRECIOUS: %.log
+
+.PHONY: ${TESTS}
+
+## The short aliases that always re-run the tests, with no logging.
+define test_template
+$(1):
+       @test ! -f $(1).log || mv $(1).log $(1).log~
+       @${MAKE} $(1).log WRITE_LOG=
+endef
+
+$(foreach test,${TESTS},$(eval $(call test_template,${test})))
+
+
+## Re-run all the tests every time.
+check:
+       -@for f in *.log; do test ! -f $$f || mv $$f $$f~; done
+       @${MAKE} check-maybe
+
+## Only re-run tests whose .log is older than the test.
+.PHONY: check-maybe
+check-maybe: ${LOGFILES}
+       $(emacs) -l ert -f ert-summarize-tests-batch-and-exit $^
+
+.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
+
+clean mostlyclean:
+       -rm -f *.log *.log~
+
+bootstrap-clean: clean
+       -rm -f ${srcdir}/*.elc
+
+distclean: clean
        rm -f Makefile
 
 maintainer-clean: distclean bootstrap-clean
 
-
-check: compile-main
-       @$(setwins); \
-       pattern=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
-       for el in $$pattern; do \
-         test -f $$el || continue; \
-         args="$$args -l $$el"; \
-         els="$$els $$el"; \
-       done; \
-       echo Testing $$els; \
-       $(emacs) $$args -f ert-run-tests-batch-and-exit
-
 # Makefile ends here.
index a87d979f919ab819390d53fa63f1de01c973da0f..bbb4adda9fd665e3dcb03c74f36795556096fc22 100644 (file)
@@ -160,7 +160,8 @@ function being an around advice."
           (advice-add 'call-interactively :before #'ignore)
           (should (equal (sm-test7.4) '(1 . nil)))
           (should (equal (call-interactively 'sm-test7.4) '(1 . t))))
-      (fset 'call-interactively old))))
+      (advice-remove 'call-interactively #'ignore)
+      (should (eq (symbol-function 'call-interactively) old)))))
 
 (ert-deftest advice-test-interactive ()
   "Check handling of interactive spec."
index 0a9a301dd0d883caaaf96c3eb40135fa48e448b4..1d96f1cdfcecaa7bef48c7bbdef1d8ebf767963a 100644 (file)
@@ -305,6 +305,95 @@ Subtests signal errors if something goes wrong."
                            'face fail-face)))
       (insert "\n"))))
 
+(defun test-byte-comp-compile-and-load (compile &rest forms)
+  (let ((elfile nil)
+        (elcfile nil))
+    (unwind-protect
+         (progn
+           (setf elfile (make-temp-file "test-bytecomp" nil ".el"))
+           (when compile
+             (setf elcfile (make-temp-file "test-bytecomp" nil ".elc")))
+           (with-temp-buffer
+             (dolist (form forms)
+               (print form (current-buffer)))
+             (write-region (point-min) (point-max) elfile))
+           (if compile
+               (let ((byte-compile-dest-file-function
+                      (lambda (e) elcfile)))
+                 (byte-compile-file elfile t))
+             (load elfile)))
+      (when elfile (delete-file elfile))
+      (when elcfile (delete-file elcfile)))))
+(put 'test-byte-comp-compile-and-load 'lisp-indent-function 1)
+
+(ert-deftest test-byte-comp-macro-expansion ()
+  (test-byte-comp-compile-and-load t
+    '(progn (defmacro abc (arg) 1) (defun def () (abc 2))))
+  (should (equal (funcall 'def) 1)))
+
+(ert-deftest test-byte-comp-macro-expansion-eval-and-compile ()
+  (test-byte-comp-compile-and-load t
+    '(eval-and-compile (defmacro abc (arg) -1) (defun def () (abc 2))))
+  (should (equal (funcall 'def) -1)))
+
+(ert-deftest test-byte-comp-macro-expansion-eval-when-compile ()
+  ;; Make sure we interpret eval-when-compile forms properly.  CLISP
+  ;; and SBCL interpreter eval-when-compile (well, the CL equivalent)
+  ;; in the same way.
+  (test-byte-comp-compile-and-load t
+    '(eval-when-compile
+      (defmacro abc (arg) -10)
+      (defun abc-1 () (abc 2)))
+    '(defmacro abc-2 () (abc-1))
+    '(defun def () (abc-2)))
+  (should (equal (funcall 'def) -10)))
+
+(ert-deftest test-byte-comp-macro-expand-lexical-override ()
+  ;; Intuitively, one might expect the defmacro to override the
+  ;; macrolet since macrolet's is explicitly called out as being
+  ;; equivalent to toplevel, but CLISP and SBCL both evaluate the form
+  ;; this way, so we should too.
+  (test-byte-comp-compile-and-load t
+    '(require 'cl-lib)
+    '(cl-macrolet ((m () 4))
+      (defmacro m () 5)
+      (defun def () (m))))
+  (should (equal (funcall 'def) 4)))
+
+(ert-deftest test-eager-load-macro-expansion ()
+  (test-byte-comp-compile-and-load nil
+    '(progn (defmacro abc (arg) 1) (defun def () (abc 2))))
+  (should (equal (funcall 'def) 1)))
+
+(ert-deftest test-eager-load-macro-expansion-eval-and-compile ()
+  (test-byte-comp-compile-and-load nil
+    '(eval-and-compile (defmacro abc (arg) -1) (defun def () (abc 2))))
+  (should (equal (funcall 'def) -1)))
+
+(ert-deftest test-eager-load-macro-expansion-eval-when-compile ()
+  ;; Make sure we interpret eval-when-compile forms properly.  CLISP
+  ;; and SBCL interpreter eval-when-compile (well, the CL equivalent)
+  ;; in the same way.
+  (test-byte-comp-compile-and-load nil
+    '(eval-when-compile
+      (defmacro abc (arg) -10)
+      (defun abc-1 () (abc 2)))
+    '(defmacro abc-2 () (abc-1))
+    '(defun def () (abc-2)))
+  (should (equal (funcall 'def) -10)))
+
+(ert-deftest test-eager-load-macro-expand-lexical-override ()
+  ;; Intuitively, one might expect the defmacro to override the
+  ;; macrolet since macrolet's is explicitly called out as being
+  ;; equivalent to toplevel, but CLISP and SBCL both evaluate the form
+  ;; this way, so we should too.
+  (test-byte-comp-compile-and-load nil
+    '(require 'cl-lib)
+    '(cl-macrolet ((m () 4))
+      (defmacro m () 5)
+      (defun def () (m))))
+  (should (equal (funcall 'def) 4)))
+
 
 ;; Local Variables:
 ;; no-byte-compile: t
index 0587bf92b7ca0c0ee2dd53e6157c173498f09282..6bbd9a5e81dc05837d82bbcb0db722e6b56926e5 100644 (file)
                     :b :a :a 42)
            '(42 :a))))
 
+(cl-defstruct mystruct (abc :readonly t) def)
+(ert-deftest cl-lib-struct-accessors ()
+  (let ((x (make-mystruct :abc 1 :def 2)))
+    (should (eql (cl-struct-slot-value 'mystruct 'abc x) 1))
+    (should (eql (cl-struct-slot-value 'mystruct 'def x) 2))
+    (setf (cl-struct-slot-value 'mystruct 'def x) -1)
+    (should (eql (cl-struct-slot-value 'mystruct 'def x) -1))
+    (should (eql (cl-struct-slot-offset 'mystruct 'abc) 1))
+    (should-error (cl-struct-slot-offset 'mystruct 'marypoppins))
+    (should (equal (cl-struct-slot-info 'mystruct)
+                   '((cl-tag-slot) (abc :readonly t) (def))))))
+
+(ert-deftest cl-the ()
+  (should (eql (cl-the integer 42) 42))
+  (should-error (cl-the integer "abc"))
+  (let ((side-effect 0))
+    (should (= (cl-the integer (cl-incf side-effect)) 1))
+    (should (= side-effect 1))))
+
+(ert-deftest cl-loop-destructuring-with ()
+  (should (equal (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6)))
+
 ;;; cl-lib.el ends here
index 1abaa4d7dec77153e31b6b883b9d02d60043eebb..67ed6b659622590d40d628a45ed647b041f8790c 100644 (file)
                          c-e-x)
                    '(1 2)))))
 
+(ert-deftest core-elisp-test-window-configurations ()
+  "Test properties of window-configurations."
+  (let ((wc (current-window-configuration)))
+    (with-current-buffer (window-buffer (frame-selected-window))
+      (push-mark)
+      (activate-mark))
+    (set-window-configuration wc)
+    (should (or (not mark-active) (mark)))))
+
 (provide 'core-elisp-tests)
 ;;; core-elisp-tests.el ends here
index 1af5c77de5373cbbc855193168be80f47bf90410..b157a365a4c128810feff58a0c9efcbc26c810c3 100644 (file)
   (should-error (dbus-unregister-service bus dbus-service-dbus)))
 
 (ert-deftest dbus-test02-register-service-session ()
-  "Check service registration at `:session'."
+  "Check service registration at `:session' bus."
   (skip-unless (and dbus--test-enabled-session-bus
                    (dbus-register-service :session dbus-service-emacs)))
   (dbus--test-register-service :session)
       (should (eq (dbus-unregister-service :session service) :not-owner)))))
 
 (ert-deftest dbus-test02-register-service-system ()
-  "Check service registration at `:system'."
+  "Check service registration at `:system' bus."
   (skip-unless (and dbus--test-enabled-system-bus
                    (dbus-register-service :system dbus-service-emacs)))
   (dbus--test-register-service :system))
 
+(ert-deftest dbus-test02-register-service-own-bus ()
+  "Check service registration with an own bus.
+This includes initialization and closing the bus."
+  ;; Start bus.
+  (let ((output
+        (ignore-errors
+          (shell-command-to-string "dbus-launch --sh-syntax")))
+       bus pid)
+    (skip-unless (stringp output))
+    (when (string-match "DBUS_SESSION_BUS_ADDRESS='\\(.+\\)';" output)
+      (setq bus (match-string 1 output)))
+    (when (string-match "DBUS_SESSION_BUS_PID=\\([[:digit:]]+\\);" output)
+      (setq pid (match-string 1 output)))
+    (unwind-protect
+       (progn
+         (skip-unless
+          (dbus-ignore-errors
+            (and bus pid
+                 (featurep 'dbusbind)
+                 (dbus-init-bus bus)
+                 (dbus-get-unique-name bus)
+                 (dbus-register-service bus dbus-service-emacs))))
+         ;; Run the test.
+         (dbus--test-register-service bus))
+
+      ;; Save exit.
+      (when pid (call-process "kill" nil nil nil pid)))))
+
+(ert-deftest dbus-test03-peer-interface ()
+  "Check `dbus-interface-peer' methods."
+  (skip-unless
+   (and dbus--test-enabled-session-bus
+       (dbus-register-service :session dbus-service-emacs)
+       ;; "GetMachineId" is not implemented (yet).  When it returns a
+       ;; value, another D-Bus client like dbus-monitor is reacting
+       ;; on `dbus-interface-peer'.  We cannot test then.
+       (not
+        (dbus-ignore-errors
+          (dbus-call-method
+           :session dbus-service-emacs dbus-path-dbus
+           dbus-interface-peer "GetMachineId" :timeout 100)))))
+
+  (should (dbus-ping :session dbus-service-emacs 100))
+  (dbus-unregister-service :session dbus-service-emacs)
+  (should-not (dbus-ping :session dbus-service-emacs 100)))
+
 (defun dbus-test-all (&optional interactive)
   "Run all tests for \\[dbus]."
   (interactive "p")
index 77ea75ddce20cc510b1650ddef6ec17900dc2c27..9a8886231d1d07db7465c09807dfa4d77237e9c0 100644 (file)
@@ -1,7 +1,6 @@
 ;;; eieio-tests.el -- eieio tests routines
 
-;; Copyright (C) 1999-2003, 2005-2010, 2012-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1999-2003, 2005-2010, 2012-2014 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -888,3 +887,7 @@ Subclasses to override slot attributes.")
 (provide 'eieio-tests)
 
 ;;; eieio-tests.el ends here
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
index 53cbd1f1f88d328c50e93ca1367520e04fff6d70..45440e060c2610c4786e49d990eefc3ff6f712e4 100644 (file)
@@ -831,3 +831,7 @@ This macro is used to test if macroexpansion in `should' works."
 (provide 'ert-tests)
 
 ;;; ert-tests.el ends here
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
index c9761050f738b1490a48caa6bf542f906da03615..e5f444e262b40da51d3191656c44ae7c57268a3a 100644 (file)
 ;; Warning predicate
 (defun flymake-tests--current-face (file predicate)
   (let ((buffer (find-file-noselect
-                 (expand-file-name file flymake-tests-data-directory))))
+                 (expand-file-name file flymake-tests-data-directory)))
+        (i 0))
     (unwind-protect
         (with-current-buffer buffer
           (setq-local flymake-warning-predicate predicate)
           (goto-char (point-min))
           (flymake-mode 1)
-          ;; XXX: is this reliable enough?
-          (sleep-for (+ 0.5 flymake-no-changes-timeout))
+          ;; Weirdness here...  http://debbugs.gnu.org/17647#25
+          (while (and flymake-is-running (< (setq i (1+ i)) 10))
+            (sleep-for (+ 0.5 flymake-no-changes-timeout)))
           (flymake-goto-next-error)
           (face-at-point))
-      (and buffer (kill-buffer buffer)))))
+      (and buffer (let (kill-buffer-query-functions) (kill-buffer buffer))))))
 
 (ert-deftest warning-predicate-rx-gcc ()
   "Test GCC warning via regexp predicate."
diff --git a/test/automated/fns-tests.el b/test/automated/fns-tests.el
new file mode 100644 (file)
index 0000000..461995b
--- /dev/null
@@ -0,0 +1,102 @@
+;;; fns-tests.el --- tests for src/fns.c
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; This program is free software: you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation, either version 3 of the
+;; License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see `http://www.gnu.org/licenses/'.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'cl-lib)
+(eval-when-compile (require 'cl))
+
+(ert-deftest fns-tests-reverse ()
+  (should-error (reverse))
+  (should-error (reverse 1))
+  (should-error (reverse (make-char-table 'foo)))
+  (should (equal [] (reverse [])))
+  (should (equal [0] (reverse [0])))
+  (should (equal [1 2 3 4] (reverse (reverse [1 2 3 4]))))
+  (should (equal '(a b c d) (reverse (reverse '(a b c d)))))
+  (should (equal "xyzzy" (reverse (reverse "xyzzy"))))
+  (should (equal "こんにちは / コンニチハ" (reverse (reverse "こんにちは / コンニチハ")))))
+
+(ert-deftest fns-tests-nreverse ()
+  (should-error (nreverse))
+  (should-error (nreverse 1))
+  (should-error (nreverse (make-char-table 'foo)))
+  (should (equal (nreverse "xyzzy") "yzzyx"))
+  (let ((A []))
+    (nreverse A)
+    (should (equal A [])))
+  (let ((A [0]))
+    (nreverse A)
+    (should (equal A [0])))
+  (let ((A [1 2 3 4]))
+    (nreverse A)
+    (should (equal A [4 3 2 1])))
+  (let ((A [1 2 3 4]))
+    (nreverse A)
+    (nreverse A)
+    (should (equal A [1 2 3 4])))
+  (let* ((A [1 2 3 4])
+        (B (nreverse (nreverse A))))
+    (should (equal A B))))
+
+(ert-deftest fns-tests-reverse-bool-vector ()
+  (let ((A (make-bool-vector 10 nil)))
+    (dotimes (i 5) (aset A i t))
+    (should (equal [nil nil nil nil nil t t t t t] (vconcat (reverse A))))
+    (should (equal A (reverse (reverse A))))))
+
+(ert-deftest fns-tests-nreverse-bool-vector ()
+  (let ((A (make-bool-vector 10 nil)))
+    (dotimes (i 5) (aset A i t))
+    (nreverse A)
+    (should (equal [nil nil nil nil nil t t t t t] (vconcat A)))
+    (should (equal [t t t t t nil nil nil nil nil] (vconcat (nreverse A))))))
+
+(ert-deftest fns-tests-compare-strings ()
+  (should-error (compare-strings))
+  (should-error (compare-strings "xyzzy" "xyzzy"))
+  (should-error (compare-strings "xyzzy" 0 10 "zyxxy" 0 5))
+  (should-error (compare-strings "xyzzy" 0 5 "zyxxy" -1 2))
+  (should-error (compare-strings "xyzzy" 'foo nil "zyxxy" 0 1))
+  (should-error (compare-strings "xyzzy" 0 'foo "zyxxy" 2 3))
+  (should-error (compare-strings "xyzzy" 0 2 "zyxxy" 'foo 3))
+  (should-error (compare-strings "xyzzy" nil 3 "zyxxy" 4 'foo))
+  (should (compare-strings "" nil nil "" nil nil))
+  (should (compare-strings "" 0 0 "" 0 0))
+  (should (compare-strings "test" nil nil "test" nil nil))
+  (should (compare-strings "test" nil nil "test" nil nil t))
+  (should (compare-strings "test" nil nil "test" nil nil nil))
+  (should (compare-strings "Test" nil nil "test" nil nil t))
+  (should (= (compare-strings "Test" nil nil "test" nil nil) -1))
+  (should (= (compare-strings "Test" nil nil "test" nil nil) -1))
+  (should (= (compare-strings "test" nil nil "Test" nil nil) 1))
+  (should (= (compare-strings "foobaz" nil nil "barbaz" nil nil) 1))
+  (should (= (compare-strings "barbaz" nil nil "foobar" nil nil) -1))
+  (should (= (compare-strings "foobaz" nil nil "farbaz" nil nil) 2))
+  (should (= (compare-strings "farbaz" nil nil "foobar" nil nil) -2))
+  (should (compare-strings "abcxyz" 0 2 "abcprq" 0 2))
+  (should (compare-strings "abcxyz" 0 -3 "abcprq" 0 -3))
+  (should (= (compare-strings "abcxyz" 0 6 "abcprq" 0 6) 4))
+  (should (= (compare-strings "abcprq" 0 6 "abcxyz" 0 6) -4))
+  (should (compare-strings "xyzzy" -3 4 "azza" -3 3))
+  (should (compare-strings "こんにちはコンニチハ" nil nil "こんにちはコンニチハ" nil nil))
+  (should (= (compare-strings "んにちはコンニチハこ" nil nil "こんにちはコンニチハ" nil nil) 1))
+  (should (= (compare-strings "こんにちはコンニチハ" nil nil "んにちはコンニチハこ" nil nil) -1)))
index b921853c4aa06bf40a3a7f7dec281bcb703f868f..2ffa3911ee316558b3333b6a5b81ec8024d0645d 100644 (file)
@@ -414,6 +414,38 @@ END:VEVENT
     (should (not result))
     ))
 
+(ert-deftest icalendar--decode-isodatetime ()
+  "Test `icalendar--decode-isodatetime'."
+  (let ((tz (getenv "TZ"))
+       result)
+    (unwind-protect
+       (progn
+         ;; Use Eastern European Time (UTC+1, UTC+2 daylight saving)
+         (setenv "TZ" "EET")
+
+          (message "%s" (current-time-zone (encode-time 0 0 10 1 1 2013 0)))
+          (message "%s" (current-time-zone (encode-time 0 0 10 1 8 2013 0)))
+
+          ;; testcase: no time zone in input -> keep time as is
+          ;; 1 Jan 2013 10:00
+          (should (equal '(0 0 10 1 1 2013 2 nil 7200)
+                         (icalendar--decode-isodatetime "20130101T100000")))
+          ;; 1 Aug 2013 10:00 (DST)
+          (should (equal '(0 0 10 1 8 2013 4 t 10800)
+                         (icalendar--decode-isodatetime "20130801T100000")))
+
+          ;; testcase: UTC time zone specifier in input -> convert to local time
+          ;; 31 Dec 2013 23:00 UTC -> 1 Jan 2013 01:00 EET
+          (should (equal '(0 0 1 1 1 2014 3 nil 7200)
+                         (icalendar--decode-isodatetime "20131231T230000Z")))
+          ;; 1 Aug 2013 10:00 UTC -> 1 Aug 2013 13:00 EEST
+          (should (equal '(0 0 13 1 8 2013 4 t 10800)
+                         (icalendar--decode-isodatetime "20130801T100000Z")))
+
+          )
+      ;; restore time-zone even if something went terribly wrong
+      (setenv "TZ" tz)))  )
+
 ;; ======================================================================
 ;; Export tests
 ;; ======================================================================
@@ -718,11 +750,34 @@ Argument EXPECTED-AMERICAN expected american style diary string."
 Argument INPUT input icalendar string.
 Argument EXPECTED-OUTPUT expected diary string."
   (let ((temp-file (make-temp-file "icalendar-test-diary")))
+    ;; Test the Catch-the-mysterious-coding-header logic below.
+    ;; Ruby-mode adds an after-save-hook which inserts the header!
+    ;; (save-excursion
+    ;;   (find-file temp-file)
+    ;;   (ruby-mode))
     (icalendar-import-buffer temp-file t t)
     (save-excursion
       (find-file temp-file)
+      ;; Check for the mysterious "# coding: ..." header, remove it
+      ;; and give a shout
+      (goto-char (point-min))
+      (when (re-search-forward "# coding: .*?\n" nil t)
+        (message (concat "%s\n"
+                         "Found mysterious \"# coding ...\" header!  Removing it.\n"
+                         "Current Modes: %s, %s\n"
+                         "Current test: %s\n"
+                         "%s")
+                 (make-string 70 ?*)
+                 major-mode
+                 minor-mode-list
+                 (ert-running-test)
+                 (make-string 70 ?*))
+        (buffer-disable-undo)
+        (replace-match "")
+        (set-buffer-modified-p nil))
+
       (let ((result (buffer-substring-no-properties (point-min) (point-max))))
-       (should (string= expected-output result)))
+        (should (string= expected-output result)))
       (kill-buffer (find-buffer-visiting temp-file))
       (delete-file temp-file))))
 
index 65e13438ea14edab72e23021a3817e103f48814d..b970cd7c9f80064ebc8f61bd68cbeaa0616bc2a8 100644 (file)
@@ -186,7 +186,8 @@ Must called from within a `tar-mode' buffer."
         (insert-file-contents (expand-file-name "simple-single-pkg.el"
                                                 simple-pkg-dir))
         (should (string= (buffer-string)
-                         (concat "(define-package \"simple-single\" \"1.3\" "
+                         (concat ";;; -*- no-byte-compile: t -*-\n"
+                                 "(define-package \"simple-single\" \"1.3\" "
                                  "\"A single-file package "
                                  "with no dependencies\" 'nil "
                                  ":url \"http://doodles.au\""
index cce51b63561331850ed2528a9baae9d4648eee0a..d58915e7c7b78bd7282fe0ec3de81b6c5636de48 100644 (file)
 
 ;;; Commentary:
 
-;; You may want to run this from a separate Emacs instance from your
-;; main one, because a bug in the code below could mess with your
-;; installed packages.
-
-;; Run this in a clean Emacs session using:
-;;
-;;     $ emacs -Q --batch -L . -l package-x-test.el -f ert-run-tests-batch-and-exit
-
 ;;; Code:
 
 (require 'package-x)
 (require 'ert)
 (require 'cl-lib)
-(eval-when-compile (require 'package-test))
-
-;; package-test is not normally in `load-path', so temporarily set
-;; `load-path' to contain the current directory.
-(let ((load-path (append (list (file-name-directory (or load-file-name
-                                                        buffer-file-name)))
-                         load-path)))
-  (require 'package-test))
+(require 'package-test)
 
 (defvar package-x-test--single-archive-entry-1-3
   (cons 'simple-single
index 0ad5650cd7719dffc93a269b780622ef91d9c2de..1c14a0c4696f025b3f898c58e9b15902e498220d 100644 (file)
@@ -61,7 +61,7 @@ VALUES-PLIST is a list with alternating index and value elements."
 
 (defun ruby-assert-face (content pos face)
   (ruby-with-temp-buffer content
-    (font-lock-fontify-buffer)
+    (font-lock-ensure nil nil)
     (should (eq face (get-text-property pos 'face)))))
 
 (ert-deftest ruby-indent-after-symbol-made-from-string-interpolation ()
@@ -420,7 +420,7 @@ VALUES-PLIST is a list with alternating index and value elements."
     (ruby-with-temp-buffer s
       (goto-char (point-min))
       (ruby-mode)
-      (font-lock-fontify-buffer)
+      (syntax-propertize (point-max))
       (search-forward "tee")
       (should (string= (thing-at-point 'symbol) "tee")))))
 
diff --git a/test/automated/subr-x-tests.el b/test/automated/subr-x-tests.el
new file mode 100644 (file)
index 0000000..df84126
--- /dev/null
@@ -0,0 +1,526 @@
+;;; subr-x-tests.el --- Testing the extended lisp routines
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Fabián E. Gallina <fgallina@gnu.org>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(require 'ert)
+(require 'subr-x)
+
+\f
+;; if-let tests
+
+(ert-deftest subr-x-test-if-let-single-binding-expansion ()
+  "Test single bindings are expanded properly."
+  (should (equal
+           (macroexpand
+            '(if-let (a 1)
+                 (- a)
+               "no"))
+           '(let* ((a (and t 1)))
+              (if a
+                  (- a)
+                "no"))))
+  (should (equal
+           (macroexpand
+            '(if-let (a)
+                 (- a)
+               "no"))
+           '(let* ((a (and t nil)))
+              (if a
+                  (- a)
+                "no")))))
+
+(ert-deftest subr-x-test-if-let-single-symbol-expansion ()
+  "Test single symbol bindings are expanded properly."
+  (should (equal
+           (macroexpand
+            '(if-let (a)
+                 (- a)
+               "no"))
+           '(let* ((a (and t nil)))
+              (if a
+                  (- a)
+                "no"))))
+  (should (equal
+           (macroexpand
+            '(if-let (a b c)
+                 (- a)
+               "no"))
+           '(let* ((a (and t nil))
+                   (b (and a nil))
+                   (c (and b nil)))
+              (if c
+                  (- a)
+                "no"))))
+  (should (equal
+           (macroexpand
+            '(if-let (a (b 2) c)
+                 (- a)
+               "no"))
+           '(let* ((a (and t nil))
+                   (b (and a 2))
+                   (c (and b nil)))
+              (if c
+                  (- a)
+                "no")))))
+
+(ert-deftest subr-x-test-if-let-nil-related-expansion ()
+  "Test nil is processed properly."
+  (should (equal
+           (macroexpand
+            '(if-let (nil)
+                 (- a)
+               "no"))
+           '(let* ((nil (and t nil)))
+              (if nil
+                  (- a)
+                "no"))))
+  (should (equal
+           (macroexpand
+            '(if-let ((nil))
+                 (- a)
+               "no"))
+           '(let* ((nil (and t nil)))
+              (if nil
+                  (- a)
+                "no"))))
+  (should (equal
+           (macroexpand
+            '(if-let ((a 1) (nil) (b 2))
+                 (- a)
+               "no"))
+           '(let* ((a (and t 1))
+                   (nil (and a nil))
+                   (b (and nil 2)))
+              (if b
+                  (- a)
+                "no"))))
+  (should (equal
+           (macroexpand
+            '(if-let ((a 1) nil (b 2))
+                 (- a)
+               "no"))
+           '(let* ((a (and t 1))
+                   (nil (and a nil))
+                   (b (and nil 2)))
+              (if b
+                  (- a)
+                "no")))))
+
+(ert-deftest subr-x-test-if-let-malformed-binding ()
+  "Test malformed bindings trigger errors."
+  (should-error (macroexpand
+                 '(if-let (_ (a 1 1) (b 2) (c 3) d)
+                      (- a)
+                    "no"))
+                :type 'error)
+  (should-error (macroexpand
+                 '(if-let (_ (a 1) (b 2 2) (c 3) d)
+                      (- a)
+                    "no"))
+                :type 'error)
+  (should-error (macroexpand
+                 '(if-let (_ (a 1) (b 2) (c 3 3) d)
+                      (- a)
+                    "no"))
+                :type 'error)
+  (should-error (macroexpand
+                 '(if-let ((a 1 1))
+                      (- a)
+                    "no"))
+                :type 'error))
+
+(ert-deftest subr-x-test-if-let-true ()
+  "Test `if-let' with truthy bindings."
+  (should (equal
+           (if-let (a 1)
+               a
+             "no")
+           1))
+  (should (equal
+           (if-let ((a 1) (b 2) (c 3))
+               (list a b c)
+             "no")
+           (list 1 2 3))))
+
+(ert-deftest subr-x-test-if-let-false ()
+  "Test `if-let' with falsey bindings."
+  (should (equal
+           (if-let (a nil)
+               (list a b c)
+             "no")
+           "no"))
+  (should (equal
+           (if-let ((a nil) (b 2) (c 3))
+               (list a b c)
+             "no")
+           "no"))
+  (should (equal
+           (if-let ((a 1) (b nil) (c 3))
+               (list a b c)
+             "no")
+           "no"))
+  (should (equal
+           (if-let ((a 1) (b 2) (c nil))
+               (list a b c)
+             "no")
+           "no"))
+  (should (equal
+           (if-let (z (a 1) (b 2) (c 3))
+               (list a b c)
+             "no")
+           "no"))
+  (should (equal
+           (if-let ((a 1) (b 2) (c 3) d)
+               (list a b c)
+             "no")
+           "no")))
+
+(ert-deftest subr-x-test-if-let-bound-references ()
+  "Test `if-let' bindings can refer to already bound symbols."
+  (should (equal
+           (if-let ((a (1+ 0)) (b (1+ a)) (c (1+ b)))
+               (list a b c)
+             "no")
+           (list 1 2 3))))
+
+(ert-deftest subr-x-test-if-let-and-lazyness-is-preserved ()
+  "Test `if-let' respects `and' lazyness."
+  (let (a-called b-called c-called)
+    (should (equal
+             (if-let ((a nil)
+                      (b (setq b-called t))
+                      (c (setq c-called t)))
+                 "yes"
+               (list a-called b-called c-called))
+             (list nil nil nil))))
+  (let (a-called b-called c-called)
+    (should (equal
+             (if-let ((a (setq a-called t))
+                      (b nil)
+                      (c (setq c-called t)))
+                 "yes"
+               (list a-called b-called c-called))
+             (list t nil nil))))
+  (let (a-called b-called c-called)
+    (should (equal
+             (if-let ((a (setq a-called t))
+                      (b (setq b-called t))
+                      (c nil)
+                      (d (setq c-called t)))
+                 "yes"
+               (list a-called b-called c-called))
+             (list t t nil)))))
+
+\f
+;; when-let tests
+
+(ert-deftest subr-x-test-when-let-body-expansion ()
+  "Test body allows for multiple sexps wrapping with progn."
+  (should (equal
+           (macroexpand
+            '(when-let (a 1)
+               (message "opposite")
+               (- a)))
+           '(let* ((a (and t 1)))
+              (if a
+                  (progn
+                    (message "opposite")
+                    (- a)))))))
+
+(ert-deftest subr-x-test-when-let-single-binding-expansion ()
+  "Test single bindings are expanded properly."
+  (should (equal
+           (macroexpand
+            '(when-let (a 1)
+               (- a)))
+           '(let* ((a (and t 1)))
+              (if a
+                  (- a)))))
+  (should (equal
+           (macroexpand
+            '(when-let (a)
+               (- a)))
+           '(let* ((a (and t nil)))
+              (if a
+                  (- a))))))
+
+(ert-deftest subr-x-test-when-let-single-symbol-expansion ()
+  "Test single symbol bindings are expanded properly."
+  (should (equal
+           (macroexpand
+            '(when-let (a)
+               (- a)))
+           '(let* ((a (and t nil)))
+              (if a
+                  (- a)))))
+  (should (equal
+           (macroexpand
+            '(when-let (a b c)
+               (- a)))
+           '(let* ((a (and t nil))
+                   (b (and a nil))
+                   (c (and b nil)))
+              (if c
+                  (- a)))))
+  (should (equal
+           (macroexpand
+            '(when-let (a (b 2) c)
+               (- a)))
+           '(let* ((a (and t nil))
+                   (b (and a 2))
+                   (c (and b nil)))
+              (if c
+                  (- a))))))
+
+(ert-deftest subr-x-test-when-let-nil-related-expansion ()
+  "Test nil is processed properly."
+  (should (equal
+           (macroexpand
+            '(when-let (nil)
+               (- a)))
+           '(let* ((nil (and t nil)))
+              (if nil
+                  (- a)))))
+  (should (equal
+           (macroexpand
+            '(when-let ((nil))
+               (- a)))
+           '(let* ((nil (and t nil)))
+              (if nil
+                  (- a)))))
+  (should (equal
+           (macroexpand
+            '(when-let ((a 1) (nil) (b 2))
+               (- a)))
+           '(let* ((a (and t 1))
+                   (nil (and a nil))
+                   (b (and nil 2)))
+              (if b
+                  (- a)))))
+  (should (equal
+           (macroexpand
+            '(when-let ((a 1) nil (b 2))
+               (- a)))
+           '(let* ((a (and t 1))
+                   (nil (and a nil))
+                   (b (and nil 2)))
+              (if b
+                  (- a))))))
+
+(ert-deftest subr-x-test-when-let-malformed-binding ()
+  "Test malformed bindings trigger errors."
+  (should-error (macroexpand
+                 '(when-let (_ (a 1 1) (b 2) (c 3) d)
+                    (- a)))
+                :type 'error)
+  (should-error (macroexpand
+                 '(when-let (_ (a 1) (b 2 2) (c 3) d)
+                    (- a)))
+                :type 'error)
+  (should-error (macroexpand
+                 '(when-let (_ (a 1) (b 2) (c 3 3) d)
+                    (- a)))
+                :type 'error)
+  (should-error (macroexpand
+                 '(when-let ((a 1 1))
+                    (- a)))
+                :type 'error))
+
+(ert-deftest subr-x-test-when-let-true ()
+  "Test `when-let' with truthy bindings."
+  (should (equal
+           (when-let (a 1)
+             a)
+           1))
+  (should (equal
+           (when-let ((a 1) (b 2) (c 3))
+             (list a b c))
+           (list 1 2 3))))
+
+(ert-deftest subr-x-test-when-let-false ()
+  "Test `when-let' with falsey bindings."
+  (should (equal
+           (when-let (a nil)
+             (list a b c)
+             "no")
+           nil))
+  (should (equal
+           (when-let ((a nil) (b 2) (c 3))
+             (list a b c)
+             "no")
+           nil))
+  (should (equal
+           (when-let ((a 1) (b nil) (c 3))
+             (list a b c)
+             "no")
+           nil))
+  (should (equal
+           (when-let ((a 1) (b 2) (c nil))
+             (list a b c)
+             "no")
+           nil))
+  (should (equal
+           (when-let (z (a 1) (b 2) (c 3))
+             (list a b c)
+             "no")
+           nil))
+  (should (equal
+           (when-let ((a 1) (b 2) (c 3) d)
+             (list a b c)
+             "no")
+           nil)))
+
+(ert-deftest subr-x-test-when-let-bound-references ()
+  "Test `when-let' bindings can refer to already bound symbols."
+  (should (equal
+           (when-let ((a (1+ 0)) (b (1+ a)) (c (1+ b)))
+             (list a b c))
+           (list 1 2 3))))
+
+(ert-deftest subr-x-test-when-let-and-lazyness-is-preserved ()
+  "Test `when-let' respects `and' lazyness."
+  (let (a-called b-called c-called)
+    (should (equal
+             (progn
+               (when-let ((a nil)
+                          (b (setq b-called t))
+                          (c (setq c-called t)))
+                 "yes")
+               (list a-called b-called c-called))
+             (list nil nil nil))))
+  (let (a-called b-called c-called)
+    (should (equal
+             (progn
+               (when-let ((a (setq a-called t))
+                          (b nil)
+                          (c (setq c-called t)))
+                 "yes")
+               (list a-called b-called c-called))
+             (list t nil nil))))
+  (let (a-called b-called c-called)
+    (should (equal
+             (progn
+               (when-let ((a (setq a-called t))
+                          (b (setq b-called t))
+                          (c nil)
+                          (d (setq c-called t)))
+                 "yes")
+               (list a-called b-called c-called))
+             (list t t nil)))))
+
+\f
+;; Thread first tests
+
+(ert-deftest subr-x-test-thread-first-no-forms ()
+  "Test `thread-first' with no forms expands to the first form."
+  (should (equal (macroexpand '(thread-first 5)) 5))
+  (should (equal (macroexpand '(thread-first (+ 1 2))) '(+ 1 2))))
+
+(ert-deftest subr-x-test-thread-first-function-names-are-threaded ()
+  "Test `thread-first' wraps single function names."
+  (should (equal (macroexpand
+                  '(thread-first 5
+                     -))
+                 '(- 5)))
+  (should (equal (macroexpand
+                  '(thread-first (+ 1 2)
+                     -))
+                 '(- (+ 1 2)))))
+
+(ert-deftest subr-x-test-thread-first-expansion ()
+  "Test `thread-first' expands correctly."
+  (should (equal
+           (macroexpand '(thread-first
+                             5
+                           (+ 20)
+                           (/ 25)
+                           -
+                           (+ 40)))
+           '(+ (- (/ (+ 5 20) 25)) 40))))
+
+(ert-deftest subr-x-test-thread-first-examples ()
+  "Test several `thread-first' examples."
+  (should (equal (thread-first (+ 40 2)) 42))
+  (should (equal (thread-first
+                     5
+                   (+ 20)
+                   (/ 25)
+                   -
+                   (+ 40)) 39))
+  (should (equal (thread-first
+                     "this-is-a-string"
+                   (split-string "-")
+                   (nbutlast 2)
+                   (append (list "good")))
+                 (list "this" "is" "good"))))
+\f
+;; Thread last tests
+
+(ert-deftest subr-x-test-thread-last-no-forms ()
+  "Test `thread-last' with no forms expands to the first form."
+  (should (equal (macroexpand '(thread-last 5)) 5))
+  (should (equal (macroexpand '(thread-last (+ 1 2))) '(+ 1 2))))
+
+(ert-deftest subr-x-test-thread-last-function-names-are-threaded ()
+  "Test `thread-last' wraps single function names."
+  (should (equal (macroexpand
+                  '(thread-last 5
+                     -))
+                 '(- 5)))
+  (should (equal (macroexpand
+                  '(thread-last (+ 1 2)
+                     -))
+                 '(- (+ 1 2)))))
+
+(ert-deftest subr-x-test-thread-last-expansion ()
+  "Test `thread-last' expands correctly."
+  (should (equal
+           (macroexpand '(thread-last
+                             5
+                           (+ 20)
+                           (/ 25)
+                           -
+                           (+ 40)))
+           '(+ 40 (- (/ 25 (+ 20 5)))))))
+
+(ert-deftest subr-x-test-thread-last-examples ()
+  "Test several `thread-last' examples."
+  (should (equal (thread-last (+ 40 2)) 42))
+  (should (equal (thread-last
+                     5
+                   (+ 20)
+                   (/ 25)
+                   -
+                   (+ 40)) 39))
+  (should (equal (thread-last
+                     (list 1 -2 3 -4 5)
+                   (mapcar #'abs)
+                   (cl-reduce #'+)
+                   (format "abs sum is: %s"))
+                 "abs sum is: 15")))
+
+
+(provide 'subr-x-tests)
+;;; subr-x-tests.el ends here
index 3b37bc84886a26c5646bc6c5737d1c8e5ae2cfd7..7c6c77d4cc9ad46c213c052d0ca893b836eacb95 100644 (file)
         (insert "^"))
       (should (equal (buffer-string) str)))))
 
+(ert-deftest subword-tests2 ()
+  "Test that motion in subword-mode stops at the right places."
+
+  (let* ((line "fooBarBAZ quXD g_TESTThingAbc word BLAH test")
+         (fwrd "*  *  *  *  * * *    *    *  *    *    *    *")
+         (bkwd "*  *  *   * *  * *   *    *   *    *    *   *"))
+
+    (with-temp-buffer
+      (subword-mode 1)
+      (insert line)
+
+      ;; Test forward motion.
+      
+      (goto-char (point-min))
+      (let ((stops (make-string (length fwrd) ?\ )))
+        (while (progn
+                 (aset stops (1- (point)) ?\*)
+                 (not (eobp)))          
+          (forward-word))
+        (should (equal stops fwrd)))
+
+      ;; Test backward motion.
+
+      (goto-char (point-max))
+      (let ((stops (make-string (length bkwd) ?\ )))
+        (while (progn
+                 (aset stops (1- (point)) ?\*)
+                 (not (bobp)))          
+          (backward-word))
+        (should (equal stops bkwd))))))
+
 (provide 'subword-tests)
 ;;; subword-tests.el ends here
diff --git a/test/automated/syntax-tests.el b/test/automated/syntax-tests.el
new file mode 100644 (file)
index 0000000..9b97001
--- /dev/null
@@ -0,0 +1,97 @@
+;;; syntax-tests.el --- Testing syntax rules and basic movement -*- lexical-binding: t -*-
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Daniel Colascione <dancol@dancol.org>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+(require 'ert)
+(require 'cl-lib)
+
+(defun run-up-list-test (fn data start instructions)
+  (cl-labels ((posof (thing)
+                (and (symbolp thing)
+                     (= (length (symbol-name thing)) 1)
+                     (- (aref (symbol-name thing) 0) ?a -1))))
+    (with-temp-buffer
+      (set-syntax-table (make-syntax-table))
+      ;; Use a syntax table in which single quote is a string
+      ;; character so that we can embed the test data in a lisp string
+      ;; literal.
+      (modify-syntax-entry ?\' "\"")
+      (insert data)
+      (goto-char (posof start))
+      (dolist (instruction instructions)
+        (cond ((posof instruction)
+               (funcall fn)
+               (should (eql (point) (posof instruction))))
+              ((symbolp instruction)
+               (should-error (funcall fn)
+                             :type instruction))
+              (t (cl-assert nil nil "unknown ins")))))))
+
+(defmacro define-up-list-test (name fn data start &rest expected)
+  `(ert-deftest ,name ()
+     (run-up-list-test ,fn ,data ',start ',expected)))
+
+(define-up-list-test up-list-basic
+  (lambda () (up-list))
+  (or "(1 1 (1 1) 1 (1 1) 1)")
+  ;;   abcdefghijklmnopqrstuv
+  i k v scan-error)
+
+(define-up-list-test up-list-with-forward-sexp-function
+  (lambda ()
+    (let ((forward-sexp-function
+           (lambda (&optional arg)
+             (let ((forward-sexp-function nil))
+               (forward-sexp arg)))))
+      (up-list)))
+  (or "(1 1 (1 1) 1 (1 1) 1)")
+  ;;   abcdefghijklmnopqrstuv
+  i k v scan-error)
+
+(define-up-list-test up-list-out-of-string
+  (lambda () (up-list 1 t))
+  (or "1 (1 '2 2 (2 2 2' 1) 1")
+  ;;   abcdefghijklmnopqrstuvwxy
+  o r u scan-error)
+
+(define-up-list-test up-list-cross-string
+  (lambda () (up-list 1 t))
+  (or "(1 '2 ( 2' 1 '2 ) 2' 1)")
+  ;;   abcdefghijklmnopqrstuvwxy
+  i r u x scan-error)
+
+(define-up-list-test up-list-no-cross-string
+  (lambda () (up-list 1 t t))
+  (or "(1 '2 ( 2' 1 '2 ) 2' 1)")
+  ;;   abcdefghijklmnopqrstuvwxy
+  i k x scan-error)
+
+(define-up-list-test backward-up-list-basic
+  (lambda () (backward-up-list))
+  (or "(1 1 (1 1) 1 (1 1) 1)")
+  ;;   abcdefghijklmnopqrstuv
+  i f a scan-error)
+
+(provide 'syntax-tests)
+;;; syntax-tests.el ends here
diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el
new file mode 100644 (file)
index 0000000..86c83d7
--- /dev/null
@@ -0,0 +1,137 @@
+;;; tildify-test.el --- ERT tests for teldify.el
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author:     Michal Nazarewicz <mina86@mina86.com>
+;; Version:    4.5
+;; Keywords:   text, TeX, SGML, wp
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This package defines regression tests for the tildify package.
+
+;;; Code:
+
+(require 'ert)
+(require 'tildify)
+
+(defun tildify-test--example-sentence (space)
+  "Return an example sentence with SPACE where hard space is required."
+  (concat "Lorem ipsum v" space "dolor sit amet, a" space
+          "consectetur adipiscing elit."))
+
+
+(defun tildify-test--example-html (sentence &optional with-nbsp is-xml)
+  "Return an example HTML code.
+SENTENCE is placed where spaces should not be replaced with hard spaces, and
+WITH-NBSP is placed where spaces should be replaced with hard spaces.  If the
+latter is missing, SENTENCE will be used in all placeholder positions.
+If IS-XML is non-nil, <pre> tag is not treated specially."
+  (let ((with-nbsp (or with-nbsp sentence)))
+    (concat "<p>" with-nbsp "</p>\n"
+            "<pre>" (if is-xml with-nbsp sentence) "</pre>\n"
+            "<! -- " sentence " -- >\n"
+            "<p>" with-nbsp "</p>\n"
+            "<" sentence ">\n")))
+
+
+(defun tildify-test--test (modes input expected)
+  "Test tildify running in MODES.
+INPUT is the initial content of the buffer and EXPECTED is expected result
+after `tildify-buffer' is run."
+  (with-temp-buffer
+    (dolist (mode modes)
+      (erase-buffer)
+      (funcall mode)
+      (let ((header (concat "Testing `tildify-buffer' in "
+                            (symbol-name mode) "\n")))
+        (insert header input)
+        (tildify-buffer t)
+        (should (string-equal (concat header expected) (buffer-string))))
+      (erase-buffer)
+      (let ((header (concat "Testing `tildify-region' in "
+                            (symbol-name mode) "\n")))
+        (insert header input)
+        (tildify-region (point-min) (point-max) t)
+        (should (string-equal (concat header expected) (buffer-string)))))))
+
+(ert-deftest tildify-test-html ()
+  "Tests tildification in an HTML document"
+  (let* ((sentence (tildify-test--example-sentence " "))
+         (with-nbsp (tildify-test--example-sentence "&nbsp;")))
+    (tildify-test--test '(html-mode sgml-mode)
+                        (tildify-test--example-html sentence sentence)
+                        (tildify-test--example-html sentence with-nbsp))))
+
+(ert-deftest tildify-test-xml ()
+  "Tests tildification in an XML document"
+  (let* ((sentence (tildify-test--example-sentence " "))
+         (with-nbsp (tildify-test--example-sentence "&#160;")))
+    (tildify-test--test '(nxml-mode)
+                        (tildify-test--example-html sentence sentence t)
+                        (tildify-test--example-html sentence with-nbsp t))))
+
+
+(defun tildify-test--example-tex (sentence &optional with-nbsp)
+  "Return an example (La)Tex code.
+SENTENCE is placed where spaces should not be replaced with hard spaces, and
+WITH-NBSP is placed where spaces should be replaced with hard spaces.  If the
+latter is missing, SENTENCE will be used in all placeholder positions."
+  (let ((with-nbsp (or with-nbsp sentence)))
+    (concat with-nbsp "\n"
+            "\\begin{verbatim}\n" sentence "\n\\end{verbatim}\n"
+            "\\verb#" sentence "#\n"
+            "$$" sentence "$$\n"
+            "$" sentence "$\n"
+            "\\[" sentence "\\]\n"
+            "\\v A % " sentence "\n"
+            with-nbsp "\n")))
+
+(ert-deftest tildify-test-tex ()
+  "Tests tildification in a (La)TeX document"
+  (let* ((sentence (tildify-test--example-sentence " "))
+         (with-nbsp (tildify-test--example-sentence "~")))
+    (tildify-test--test '(tex-mode latex-mode plain-tex-mode)
+                        (tildify-test--example-tex sentence sentence)
+                        (tildify-test--example-tex sentence with-nbsp))))
+
+
+(ert-deftest tildify-test-find-env-end-re-bug ()
+    "Tests generation of end-regex using mix of indexes and strings"
+  (with-temp-buffer
+    (insert "foo whatever end-foo")
+    (goto-char (point-min))
+    (should (string-equal "end-foo"
+                          (tildify-find-env "foo\\|bar"
+                                            '(("foo\\|bar" . ("end-" 0))))))))
+
+
+(ert-deftest tildify-test-find-env-group-index-bug ()
+    "Tests generation of match-string indexes"
+  (with-temp-buffer
+    (let ((pairs '(("start-\\(foo\\|bar\\)" . ("end-" 1))
+                   ("open-\\(foo\\|bar\\)" . ("close-" 1))))
+          (beg-re "start-\\(foo\\|bar\\)\\|open-\\(foo\\|bar\\)"))
+      (insert "open-foo whatever close-foo")
+      (goto-char (point-min))
+      (should (string-equal "close-foo" (tildify-find-env beg-re pairs))))))
+
+
+(provide 'tildify-tests)
+
+;;; tildify-tests.el ends here
index bc95df5e773688278fae269ab1b51aa7d85c468f..f8e8414f8d72ca7b358849ee8e3be2ff01714d5d 100644 (file)
@@ -34,5 +34,9 @@
     (sit-for 0 t)
     (should timer-ran)))
 
-;;; timer-tests.el ends here
+(ert-deftest timer-tests-debug-timer-check ()
+  ;; This function exists only if --enable-checking.
+  (if (fboundp 'debug-timer-check)
+      (should (debug-timer-check)) t))
 
+;;; timer-tests.el ends here
index 2640ee9cef5b287240aa6e533eeb14abd8484c8c..864a43d638f9bb3bf45f7acf310014681ed3525c 100644 (file)
@@ -47,6 +47,7 @@
 (declare-function tramp-find-executable "tramp-sh")
 (declare-function tramp-get-remote-path "tramp-sh")
 (defvar tramp-copy-size-limit)
+(defvar tramp-remote-process-environment)
 
 ;; There is no default value on w32 systems, which could work out of the box.
 (defconst tramp-test-temporary-file-directory
@@ -92,9 +93,10 @@ being the result.")
 
   (when (cdr tramp--test-enabled-checked)
     ;; Cleanup connection.
-    (tramp-cleanup-connection
-     (tramp-dissect-file-name tramp-test-temporary-file-directory)
-     nil 'keep-password))
+    (ignore-errors
+      (tramp-cleanup-connection
+       (tramp-dissect-file-name tramp-test-temporary-file-directory)
+       nil 'keep-password)))
 
   ;; Return result.
   (cdr tramp--test-enabled-checked))
@@ -108,27 +110,21 @@ being the result.")
 (defmacro tramp--instrument-test-case (verbose &rest body)
   "Run BODY with `tramp-verbose' equal VERBOSE.
 Print the the content of the Tramp debug buffer, if BODY does not
-eval properly in `should', `should-not' or `should-error'."
+eval properly in `should', `should-not' or `should-error'.  BODY
+shall not contain a timeout."
   (declare (indent 1) (debug (natnump body)))
   `(let ((tramp-verbose ,verbose)
         (tramp-message-show-message t)
         (tramp-debug-on-error t))
-     (condition-case err
-        ;; In general, we cannot use a timeout here: this would
-        ;; prevent traces when the test runs into an error.
-;       (with-timeout (10 (ert-fail "`tramp--instrument-test-case' timed out"))
-        (progn
-          ,@body)
-       (ert-test-skipped
-       (signal (car err) (cdr err)))
-       ((error quit)
-       (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
-         (with-current-buffer (tramp-get-connection-buffer v)
-           (message "%s" (buffer-string)))
-         (with-current-buffer (tramp-get-debug-buffer v)
-           (message "%s" (buffer-string))))
-       (message "%s" err)
-       (signal (car err) (cdr err))))))
+     (unwind-protect
+        (progn ,@body)
+       (when (> tramp-verbose 3)
+        (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
+          (with-current-buffer (tramp-get-connection-buffer v)
+            (message "%s" (buffer-string)))
+          (with-current-buffer
+              (tramp-get-debug-buffer v)
+            (message "%s" (buffer-string))))))))
 
 (ert-deftest tramp-test00-availability ()
   "Test availability of Tramp functions."
@@ -867,6 +863,11 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
 (ert-deftest tramp-test15-copy-directory ()
   "Check `copy-directory'."
   (skip-unless (tramp--test-enabled))
+  (skip-unless
+   (not
+    (eq
+     (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
+     'tramp-smb-file-name-handler)))
 
   (let* ((tmp-name1 (tramp--test-make-temp-name))
         (tmp-name2 (tramp--test-make-temp-name))
@@ -1073,9 +1074,14 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
 This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
   (skip-unless (tramp--test-enabled))
 
-  (let ((tmp-name1 (tramp--test-make-temp-name))
-       (tmp-name2 (tramp--test-make-temp-name))
-       (tmp-name3 (tramp--test-make-temp-name 'local)))
+  ;; We must use `file-truename' for the temporary directory, because
+  ;; it could be located on a symlinked directory.  This would let the
+  ;; test fail.
+  (let* ((tramp-test-temporary-file-directory
+         (file-truename tramp-test-temporary-file-directory))
+        (tmp-name1 (tramp--test-make-temp-name))
+        (tmp-name2 (tramp--test-make-temp-name))
+        (tmp-name3 (tramp--test-make-temp-name 'local)))
     (unwind-protect
        (progn
          (write-region "foo" nil tmp-name1)
@@ -1237,9 +1243,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
      (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
      '(tramp-gvfs-file-name-handler tramp-smb-file-name-handler))))
 
-  (let ((tmp-name (tramp--test-make-temp-name))
-       (default-directory tramp-test-temporary-file-directory)
-       kill-buffer-query-functions)
+  (let* ((tmp-name (tramp--test-make-temp-name))
+        (fnnd (file-name-nondirectory tmp-name))
+        (default-directory tramp-test-temporary-file-directory)
+        kill-buffer-query-functions)
     (unwind-protect
        (progn
          ;; We cannot use "/bin/true" and "/bin/false"; those paths
@@ -1250,17 +1257,25 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
          (with-temp-buffer
            (write-region "foo" nil tmp-name)
            (should (file-exists-p tmp-name))
-           (should
-            (zerop
-             (process-file "ls" nil t nil (file-name-nondirectory tmp-name))))
+           (should (zerop (process-file "ls" nil t nil fnnd)))
+           ;; `ls' could produce colorized output.
+           (goto-char (point-min))
+           (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+             (replace-match "" nil nil))
+           (should (string-equal (format "%s\n" fnnd) (buffer-string)))
+           (should-not (get-buffer-window (current-buffer) t))
+
+           ;; Second run. The output must be appended.
+           (should (zerop (process-file "ls" nil t t fnnd)))
            ;; `ls' could produce colorized output.
            (goto-char (point-min))
            (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
              (replace-match "" nil nil))
            (should
-            (string-equal
-             (format "%s\n" (file-name-nondirectory tmp-name))
-             (buffer-string)))))
+            (string-equal (format "%s\n%s\n" fnnd fnnd) (buffer-string)))
+           ;; A non-nil DISPLAY must not raise the buffer.
+           (should-not (get-buffer-window (current-buffer) t))))
+
       (ignore-errors (delete-file tmp-name)))))
 
 (ert-deftest tramp-test27-start-file-process ()
@@ -1284,7 +1299,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
          (should (equal (process-status proc) 'run))
          (process-send-string proc "foo")
          (process-send-eof proc)
-         (accept-process-output proc 1)
+         ;; Read output.
+         (with-timeout (10 (ert-fail "`start-file-process' timed out"))
+           (while (< (- (point-max) (point-min)) (length "foo"))
+             (accept-process-output proc 1)))
          (should (string-equal (buffer-string) "foo")))
       (ignore-errors (delete-process proc)))
 
@@ -1297,22 +1315,30 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
                 "test2" (current-buffer)
                 "cat" (file-name-nondirectory tmp-name)))
          (should (processp proc))
-         (accept-process-output proc 1)
+         ;; Read output.
+         (with-timeout (10 (ert-fail "`start-file-process' timed out"))
+           (while (< (- (point-max) (point-min)) (length "foo"))
+             (accept-process-output proc 1)))
          (should (string-equal (buffer-string) "foo")))
       (ignore-errors
        (delete-process proc)
        (delete-file tmp-name)))
 
     (unwind-protect
-       (progn
-         (setq proc (start-file-process "test3" nil "cat"))
+       (with-temp-buffer
+         (setq proc (start-file-process "test3" (current-buffer) "cat"))
          (should (processp proc))
          (should (equal (process-status proc) 'run))
          (set-process-filter
-          proc (lambda (_p s) (should (string-equal s "foo"))))
+          proc
+          (lambda (p s) (with-current-buffer (process-buffer p) (insert s))))
          (process-send-string proc "foo")
          (process-send-eof proc)
-         (accept-process-output proc 1))
+         ;; Read output.
+         (with-timeout (10 (ert-fail "`start-file-process' timed out"))
+           (while (< (- (point-max) (point-min)) (length "foo"))
+             (accept-process-output proc 1)))
+         (should (string-equal (buffer-string) "foo")))
       (ignore-errors (delete-process proc)))))
 
 (ert-deftest tramp-test28-shell-command ()
@@ -1350,17 +1376,20 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
          (should (file-exists-p tmp-name))
           (async-shell-command
           (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer))
-         (accept-process-output (get-buffer-process (current-buffer)) 1)
+         (set-process-sentinel (get-buffer-process (current-buffer)) nil)
+         ;; Read output.
          (with-timeout (10 (ert-fail "`async-shell-command' timed out"))
-           (while
-               (ignore-errors
-                 (memq (process-status (get-buffer-process (current-buffer)))
-                       '(run open)))
+           (while (< (- (point-max) (point-min))
+                     (1+ (length (file-name-nondirectory tmp-name))))
              (accept-process-output (get-buffer-process (current-buffer)) 1)))
          ;; `ls' could produce colorized output.
          (goto-char (point-min))
          (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
            (replace-match "" nil nil))
+         ;; There might be a nasty "Process *Async Shell* finished" message.
+         (goto-char (point-min))
+         (forward-line)
+         (narrow-to-region (point-min) (point))
          (should
           (string-equal
            (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
@@ -1371,16 +1400,23 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
           (write-region "foo" nil tmp-name)
          (should (file-exists-p tmp-name))
          (async-shell-command "read line; ls $line" (current-buffer))
+         (set-process-sentinel (get-buffer-process (current-buffer)) nil)
          (process-send-string
           (get-buffer-process (current-buffer))
           (format "%s\n" (file-name-nondirectory tmp-name)))
-         (accept-process-output (get-buffer-process (current-buffer)) 1)
+         ;; Read output.
          (with-timeout (10 (ert-fail "`async-shell-command' timed out"))
-           (while
-               (ignore-errors
-                 (memq (process-status (get-buffer-process (current-buffer)))
-                       '(run open)))
+           (while (< (- (point-max) (point-min))
+                     (1+ (length (file-name-nondirectory tmp-name))))
              (accept-process-output (get-buffer-process (current-buffer)) 1)))
+         ;; `ls' could produce colorized output.
+         (goto-char (point-min))
+         (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+           (replace-match "" nil nil))
+         ;; There might be a nasty "Process *Async Shell* finished" message.
+         (goto-char (point-min))
+         (forward-line)
+         (narrow-to-region (point-min) (point))
          (should
           (string-equal
            (format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
@@ -1397,10 +1433,19 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
   (let* ((default-directory tramp-test-temporary-file-directory)
         (tmp-name1 (tramp--test-make-temp-name))
         (tmp-name2 (expand-file-name "foo" tmp-name1))
+        (tramp-remote-process-environment tramp-remote-process-environment)
         (vc-handled-backends
          (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
            (cond
             ((tramp-find-executable v vc-bzr-program (tramp-get-remote-path v))
+             (setq tramp-remote-process-environment
+                   (cons (format "BZR_HOME=%s"
+                                 (file-remote-p tmp-name1 'localname))
+                         tramp-remote-process-environment))
+             ;; We must force a reconnect, in order to activate $BZR_HOME.
+             (tramp-cleanup-connection
+              (tramp-dissect-file-name tramp-test-temporary-file-directory)
+              nil 'keep-password)
              '(Bzr))
             ((tramp-find-executable v vc-git-program (tramp-get-remote-path v))
              '(Git))
@@ -1455,13 +1500,34 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
              (should-not (file-exists-p file1))
              (copy-file file2 tmp-name1)
              (should (file-exists-p file1))))
+
          ;; Check file names.
          (should (equal (directory-files
                          tmp-name1 nil directory-files-no-dot-files-regexp)
                         (sort (copy-sequence files) 'string-lessp)))
          (should (equal (directory-files
                          tmp-name2 nil directory-files-no-dot-files-regexp)
-                        (sort files 'string-lessp))))
+                        (sort (copy-sequence files) 'string-lessp)))
+
+         ;; `substitute-in-file-name' could return different values.
+         ;; For `adb', there could be strange file permissions
+         ;; preventing overwriting a file.  We don't care in this
+         ;; testcase.
+         (dolist (elt files)
+           (let ((file1
+                  (substitute-in-file-name (expand-file-name elt tmp-name1)))
+                 (file2
+                  (substitute-in-file-name (expand-file-name elt tmp-name2))))
+             (ignore-errors (write-region elt nil file1))
+             (should (file-exists-p file1))
+             (ignore-errors (write-region elt nil file2 nil 'nomessage))
+             (should (file-exists-p file2))))
+
+         (should (equal (directory-files
+                         tmp-name1 nil directory-files-no-dot-files-regexp)
+                        (directory-files
+                         tmp-name2 nil directory-files-no-dot-files-regexp))))
+
       (ignore-errors (delete-directory tmp-name1 'recursive))
       (ignore-errors (delete-directory tmp-name2 'recursive)))))
 
@@ -1469,6 +1535,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
 (ert-deftest tramp-test30-special-characters ()
   "Check special characters in file names."
   (skip-unless (tramp--test-enabled))
+  (skip-unless
+   (not
+    (memq
+     (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
+     '(tramp-adb-file-name-handler
+       tramp-gvfs-file-name-handler
+       tramp-smb-file-name-handler))))
 
   ;; Newlines, slashes and backslashes in file names are not supported.
   ;; So we don't test.
@@ -1481,11 +1554,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
    "?foo?bar?baz?"
    "*foo*bar*baz*"
    "'foo\"bar'baz\""
-   "#foo#bar#baz#"
+   "#foo~bar#baz~"
    "!foo|bar!baz|"
    ":foo;bar:baz;"
    "<foo>bar<baz>"
-   "(foo)bar(baz)"))
+   "(foo)bar(baz)"
+   "[foo]bar[baz]"
+   "{foo}bar{baz}"))
 
 (ert-deftest tramp-test31-utf8 ()
   "Check UTF8 encoding in file names and file contents."
@@ -1657,8 +1732,13 @@ Since it unloads Tramp, it shall be the last test to run."
 ;; * set-file-acl
 ;; * set-file-selinux-context
 
-;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?).
+;; * Work on skipped tests.  Make a comment, when it is impossible.
+;; * Fix `tramp-test15-copy-directory' for `smb'.  Using tar in a pipe
+;;   doesn't work well when an interactive password must be provided.
+;; * Fix `tramp-test27-start-file-process' for `nc' and on MS
+;;   Windows (`process-send-eof'?).
 ;; * Fix `tramp-test28-shell-command' on MS Windows (nasty plink message).
+;; * Fix `tramp-test30-special-characters' for `adb', `nc' and `smb'.
 ;; * Fix `tramp-test31-utf8' for MS Windows and `nc'/`telnet' (when
 ;;   target is a dumb busybox).  Seems to be in `directory-files'.
 ;; * Fix Bug#16928.  Set expected error of `tramp-test32-asynchronous-requests'.
index 6ecac36b6b3544f3777019b0c5a6affed08e578f..178eaf194d88ca2f3567a04a0c8aa87eb0a14ab7 100644 (file)
             (should-not (buffer-modified-p))))
       (delete-file tempfile))))
 
-(ert-deftest undo-test-in-region-not-most-recent ()
+(ert-deftest undo-test-region-not-most-recent ()
   "Test undo in region of an edit not the most recent."
   (with-temp-buffer
     (buffer-enable-undo)
     (should (string= (buffer-string)
                      "11131"))))
 
-(ert-deftest undo-test-in-region-eob ()
+(ert-deftest undo-test-region-deletion ()
+  "Test undoing a deletion to demonstrate bug 17235."
+  (with-temp-buffer
+    (buffer-enable-undo)
+    (transient-mark-mode 1)
+    (insert "12345")
+    (search-backward "4")
+    (undo-boundary)
+    (delete-forward-char 1)
+    (search-backward "1")
+    (undo-boundary)
+    (insert "xxxx")
+    (undo-boundary)
+    (insert "yy")
+    (search-forward "35")
+    (undo-boundary)
+    ;; Select "35"
+    (push-mark (point) t t)
+    (setq mark-active t)
+    (forward-char -2)
+    (undo) ; Expect "4" to come back
+    (should (string= (buffer-string)
+                     "xxxxyy12345"))))
+
+(ert-deftest undo-test-region-example ()
+  "The same example test case described in comments for
+undo-make-selective-list."
+  ;; buf pos:
+  ;; 123456789 buffer-undo-list  undo-deltas
+  ;; --------- ----------------  -----------
+  ;; aaa       (1 . 4)           (1 . -3)
+  ;; aaba      (3 . 4)           N/A (in region)
+  ;; ccaaba    (1 . 3)           (1 . -2)
+  ;; ccaabaddd (7 . 10)          (7 . -3)
+  ;; ccaabdd   ("ad" . 6)        (6 . 2)
+  ;; ccaabaddd (6 . 8)           (6 . -2)
+  ;;  |   |<-- region: "caab", from 2 to 6
+  (with-temp-buffer
+    (buffer-enable-undo)
+    (transient-mark-mode 1)
+    (insert "aaa")
+    (goto-char 3)
+    (undo-boundary)
+    (insert "b")
+    (goto-char 1)
+    (undo-boundary)
+    (insert "cc")
+    (goto-char 7)
+    (undo-boundary)
+    (insert "ddd")
+    (search-backward "ad")
+    (undo-boundary)
+    (delete-forward-char 2)
+    (undo-boundary)
+    ;; Select "dd"
+    (push-mark (point) t t)
+    (setq mark-active t)
+    (goto-char (point-max))
+    (undo)
+    (undo-boundary)
+    (should (string= (buffer-string)
+                     "ccaabaddd"))
+    ;; Select "caab"
+    (push-mark 2 t t)
+    (setq mark-active t)
+    (goto-char 6)
+    (undo)
+    (undo-boundary)
+    (should (string= (buffer-string)
+                     "ccaaaddd"))))
+
+(ert-deftest undo-test-region-eob ()
   "Test undo in region of a deletion at EOB, demonstrating bug 16411."
   (with-temp-buffer
     (buffer-enable-undo)
index e5bae8505897134a631974b822658c557ee706a2..8aab5ec03ed1e5efda52791221d2ae664fde007d 100644 (file)
@@ -14,7 +14,15 @@ function res = tcomp (fn)
   y = 'hello';
   z = y';
 
+  ## Bug#14399.
+  vec = [...
+          one;...
+          two;...
+          three];
+
   cnty = repmat(x(:,1)(:), 10, 1);
+  x = ...
+  12
 
   pop = x(:,1:10)(:);
     ## Here and below, we test if the indentation aligns with a previous
index aca478a1375285bd7acaa1db2c07c1553330dce3..6b05a5f1d07285ed5990f53bf04e2e7c9b6afcbf 100755 (executable)
@@ -14,12 +14,23 @@ my $b=3;
 print $str;
 if ($c && /====/){xyz;}
 
-print << "EOF1" . s/he"llo/th'ere/;
+print "a" . <<EOF . s/he"llo/th'ere/;
+It's a surprise!
+EOF
+
+print <<\EOF1 . s/he"llo/th'ere/;
 foo
 EOF2
 bar
 EOF1
 
+$config = {
+    b  =>
+        [
+         "123",
+        ],
+    c => "123",
+};
 
 print <<"EOF1" . <<\EOF2 . s/he"llo/th'ere/;
 foo
diff --git a/test/indent/ps-mode.ps b/test/indent/ps-mode.ps
new file mode 100644 (file)
index 0000000..4b4ee0f
--- /dev/null
@@ -0,0 +1,14 @@
+%!PS-2.0
+
+<< 23 45 >>                     %dictionary
+< 23 >                          %hex string
+<~a>a%a~>                       %base85 string
+(%)s
+(sf\(g>a)sdg)
+
+/foo {
+    <<
+       hello 2
+       3
+    >>
+} def
index 7e7787989965ee5191562ead8960d89aef26ce05..82cc63f916839a82f3a91f57100f0177b94f3f82 100644 (file)
@@ -6,6 +6,10 @@ if something_wrong?             # ruby-move-to-block-skips-heredoc
   foo
 end
 
+def foo
+  %^bar^
+end
+
 # Percent literals.
 b = %Q{This is a "string"}
 c = %w!foo